Chainlink Workshop | Solange Gueiros | Connecting Smart Contracts to the Real World | ETHDam 2023
CryptoCanal·Sat, Oct 7, 2023, 12:00 AM
Speaker
Solange Gueiros is a Developer Advocate at Chainlink Labs. https://twitter.com/solangegueiros Chainlink Labs https://chainlinklabs.com/ ETHDam is a Hackathon & Conference that gathered over 500 DeFi and Privacy builders on the 20th and 21st of May 2023 in Amsterdam. Privacy is normal. Following the arrest of Alex Pertsev, a Tornado Cash developer in the Netherlands, ETHDam 2023 is determined to counter the chilling effects of the lawsuit and bridge worlds to discuss the future of privacy and encourage to build on the shoulders of cypherpunk giants. ETHDam is powered by CryptoCanal, - a blockchain education and events platform growing in Amsterdam, spreading its roots to Rotterdam and Zurich. ETHDam 2024 is on the map already! Keep up with us to see updates: CryptoCanal https://www.cryptocanal.org/ CryptoCanal Twitter https://twitter.com/CryptoCanal Join CryptoCanal Community https://t.me/CryptoCanalCommunity We would like to thank our partners and sponsors that made this event possible. 🌷 Our BFF 1inch https://1inch.io/ Our Frens: Sismo https://www.sismo.io/ Aleph Zero https://alephzero.org/ Scroll https://scroll.io/ RAILGUN https://railgun.org/#/ And our Sisters: oasis.app https://oasis.app/#earn Maven11 https://www.maven11.com/ bitvavo https://bitvavo.com/en Lido https://lido.fi/ Spankchain https://spankchain.com/ API3 https://api3.org/ Gelato https://www.gelato.network/ VanEck https://www.vaneck.com/nl/en/crypto-etn Marlin Protocol https://www.marlin.org/ Silent Protocol https://www.silentprotocol.org/ Cyber Capital https://cyber.capital/ … and Proto https://twitter.com/protolambda 🍍
Transcript
foreign [Music] and yes I know that I did like a generic title for my workshop like how to connect is smart context to the real world but in fact I decided to put a specific topic related to how to build a dynamic asset monitoring nft like to get your computer you can do with me if not are you the demonstration so this is me my name is Solange the people who call me so like the sun I am a developer advocator training collapse and this is how my networks I am from Brazil in my website you can see my last talk is in English Spanish Portuguese that I love a lot of content over there the talking about smart contacts and how to connect to the real world first I need to talk about limitations in smart contents and we can say that to connect to get some information from the off chain word is not so easy because if you try to use an API an API and each validator must use the same API to get the information they can get different informations so this is not a deterministic and the audio blockchain word is deterministic so this can be a challenge because of this we have the oracles the concept of Oracle it's any data source or external resources that you can use inside your smart content but they came from of chain word and they will be saved on chain to you using other smart contents like I have here for example information related to the weather to sports to the steps that you are doing and my watches monitoring for me or any Financial assets but when we talk about oracles you talk about centralized articles this can be a problem because um when we talk about blockchain we are talking about decentralization and if you have a centralized Oracle this can be a point of failure because this can be manipulated as well so uh the best is to have a centralized Oracle and the chain link is one of these um I have a disco code related to basic Stuffy from education but if you don't get it now is not a problem at the end I use shell the care code for all the presentation and you can get the others so talking about chaining chaining key has some products or Services especially when talk about D5 wins of our goals here and we have like the market in data feeds exactly to get information especially quotes on information related to assets and using your smart contents other interesting selfie that training has is the proof of Reserve is that you can get some information like including for a bank or for another chain and they use inside your conflicts one example bitgo is the is the issued for the WBC the rapid Bitcoin on a Channel network so they must have Bitcoin in the Bitcoin network with the proof of a result we can check the amount of Bitcoins that they have in their wallets and for example check if the the mission of WBC is greater than this because if they have been more wbcs than Bitcoins this is a problem it's under collateralization so this can be checked by your system by your app in your response context for example and the other services related to connection with the real world um for example smart contents cannot be self-executed they must have another agent calling them uh and this can be you calling as much content can be another smart content calling so but this is another as much content must be colored as well or can be um like a bot calling the contract uh but you can have this kind of bot in a decentralized way this is the automation it's a selfie with a network of nodes that are checking the conditions inside your smart contracts your business rules and then um provide uh ways to cause some functions that you do like it and automatizate the smart contents and also we have the vrf to Generate random numbers outside the blockchain in a network and then bring these numbers to your smart contracts and let's try to see this is so new uh in February we launched the change link functions this is the uh for me it's a great potential because it's the first time that you don't need to like depend of run and achieving in order to run something directly related to chaining you can have your own JavaScript code and your code will be inside there is much content when you call a function with your JavaScript code this will be executed by different nodes in the functions Network there you get the result get the consensus and bring it back to your smart content so in this way you can call any API okay you must trust understandable API but we have different nodes calling and getting the same result too using other smart conflict and this can be so powerful and this is you can check this later and you shut these lights with you exactly here so this is the interesting slide for you if you'd like to check out of this ladies and the K yes now it's time into the demo part if you you was doing with me we we could use a collaborative Pad but I'm alone here so no okay and this is the basic that we need like to to create our Dynamic nft to have a wallet are you do this on Mumbai and so I need to have Matic and I'm doing on remix so easy talking about about dynamic nfts um nfts represents something can be a ticket uh real estate an apartment a post a badge a trading card uh whatever um but even today most part of the nfts are static but the goal is that they are becoming more Dynamic for example this over there it's a nft from lamelo and it's been aging he's his old song basketball this is real I used to say that I am a dynamic nft because I am Munich I have my own DNA but I mean growing I mean being old day by day I hope to be not fast not fat but my body can change so I understand and each of you are a dynamic nft as well and we have a different rules and conditions to update your nft can be the timing my nft today you'll be updated by timing only but we can use scores like I told you related to lamelo Highlights or your experience or even the weather talking oh talking about um specifically the dynamic nft I mean using them the data feed and automation if you'd like to get the code later you have the link and I will do this now so where am I going this is um this is good for you I think yes you can see well so this is my nft to understand what I'm having what I have here I'm using the base key openings Zeppelin library to create an nft and are you manipulate this using strings because I generate The Meta data from infg inside the smart contage this is the great part of this and I'm using the chaining aggregator the price of the the it go up this is my emoji I'm happy if the price went down okay I'm sad or if nothing happened nothing happened is this so this is the the emojis that I'm using in my nft and to be sure that for every time that I call the function again something change if even if the price didn't change because I am on testnet and I don't have the real update of assets so let me change the the background color so something will change and is this this is all the information that I need to use this on Mumbai the aggregator and this is the uh interesting function used to update my sfg that I'm generating the image live inside the smart content and I use this like I mean doing the encode with the build SVG where I'm using the background of some of the colors and then I could use vrf to change the color randomly key but I choose to only go to another color to be fast and here I have the the image here here I uh I'm calling comparing the price and get the new image in order to get this I need to compare the current price that is saved in my content with the price again that you get the result from the data feed with this function only to get the result and this is these two functions are important to only to compatibility with remix and solidity so I may ready to publish this let's see if I'm here I am in the right Network yes I am so let's connect my environment with my wallet okay I'm connected this is my balance this is my wallet and you deploy this so it's conformed I have orders that I did before but after this you check my Nifty on openc because Audi Json that I generated is compatible with this let's see yes I have it here this is my nfg let's see if you can see I already got it not yet maybe I need to wait a bit more because sometimes uh it needs more time to get it let's try not yet okay I go for it if I go here I Can See For example what is the indicator now the first time that I'm running this because in the constructured I'm already updating the first time it means that the first time that I called this it will be happy because it is going from zero to something so the first hour is to be happy this is the idea and if I come back here and I check the it indicator it's a bit small here but can you see that it's happy over there okay so I'm happy to let's see if openc makes me happier no oh come on obesity don't complicate my life ah yes yes and it's happy great now we need to you can do this like if I can call this um manually but remember that I choose automated this so I'm using automation from chaining now and I have this conflict let's get to the address again and because I will do a tiny based I can automate any smart content that I'd like to have and let's check the function that I'd like to use it's the update SVG so in the automation are you registered a new app keep it's a job that to be colored by the the chain link Network checking the conditions here we are I need to connect my wallet come on I don't have a lot of time let's see if I need to do something because here it's saying that time is apolia no now I'm on Mumbai so this is Tiny basic only timing okay the contract address and let's do something about it I need to get the ABI from my contract let's go to the first button and solidage compiler and I have the API here next okay which function I'd like to call from time to time I'd like to cover the update SVG is this next and this is a column expression for example I you get every 15 minutes but I change this for every minute okay and this is the schedule causes next the name me is uh 8080 USD price can be this and because like to get the information from the chain link data feed I'm not paying nothing I'm yelling using the gas for my transaction but because this is like a public good everyone can coward and it has the interesting from the community to have this information but when I'm creating an automation it's my interesting this is my business so I need to pay for this so I put here like him and two links stuff like that I put five but two is enough and is this I I need to put some link I'm paying on link to this and the link will be converted to pay the gas fees by the network and I don't need nothing more so confirming and we will need to wait to this here let's see yes no not yet yes yes it's good okay if I come back here I can see how my app keeps come on show my upkeeps yes it's a bit and you can see like the flower was the next I I did a lot of flowers past week the flower it is another Dynamic nft that is a flower grown but what I did now this flower I don't like the flower now oh maybe no I think it work what's happened here let's hear I have a transaction over there oh I didn't confirm it oh okay yes I miss hanging the the link now let's wait this to be confirmed and then I have my uh job here besides that let's see if I have something that I can talk with you not yet let's come back and see if I can update it again yes probably yes yes now it's here and you can see that it was already colored twice wow so if I come back let's see first on remix come back here and check the indicator now this may can be good but I need to be sure that it was updated uh so if I came here I prefer when this changes are you refresh the the data again and I need to refresh one minute but the idea is that this you change probably at least the background you change remember that is changing our timing let's see yes it is still happy but now we change the color so is this if I come back here in one minute it will be updated again and again because it's monitoring the price of the it just now and when this this will stop for example I can simply pause this or if I don't have more money over there if you not execute anymore and one interesting thing related to this kind of upkeep first this is uh you'll be executed like in a simulation mode and the only the real transaction will be sent to the network if it's right if it's good so you are not losing money if you did something wrong and a lot of times I I did using my testing and workshops and let's see again if something changed it and you show you the next the last slides let's see yes okay and now the price is the same my my face is not so happy the background change it and this is changing and automatically okay come back to the slides to finish this um we adding a hackathon here I hope that you are hackers I hope that you are building amazing projects um and you can maybe continue your project doing different stuff in your project in the chain link hackathon that you happen for three more weeks so it's online you can do like in a slow mode and maybe add more features to your project and also in October we will be here in Europe again but in Barcelona because we have the conference from chain link past year was in New York now we'll be in Barcelona and the weekend before I be running a hacker house exactly to heavy hackles together with a lot of workshops like a boot camp only for beginners workshops for advanced people different protocols so I'm inviting you personally and this is my discount code as well in fact the hacker house will be free and this is what the conference and this is me again I think it's this let's see let's time if it's changed probably you'll be the same face or no but I hope that the color change again yes change it is still working I'm so happy do you have any questions who is calling the transaction is one of the nodes they have a network of notes and each time it's a different node that's scaling your transaction right right okay and this network is open permissionless uh for the people at home please yes yes and I need to stay here okay okay in fact you need to have uh like a chain link check the nodes and approve them for now but this is in the way to be have more and more decentralized yeah more questions yes I'm a pain I'm paying every time that you it was executed so every time you hear that you can see the execution I'm a pain because it's executed if it didn't pass if I put for example one hour I will pay every hour one per hour okay no no not and not Depends off on this and I can say that if uh if it is checking every block but only when the condition is true in our case every minute or every one hour it will be colored and we will pay link for this okay one over there and yes I awaited the mic so who's paying for the guest fees to update the data you uh you when you registered the depkip you are paying for this and you paying link and this is converted by the the network the operator in the network to pay the gas fee okay clear okay I think we are good and I will be around today and tomorrow if you need any help not only related to changing I am entering the hackathon so it'd be my pleasure to help you thank you [Applause]
Automatic transcript — names and jargon may be misspelled.
