Automate Smart Contract Returns Using Chainlink Keepers - Solange Gueiros
Ethereum Denver·Sun, Oct 9, 2022, 12:00 AM
Speaker
Transcript
yes hello everyone i'm so happy to be here it's the third time that i came into it denver in the and the first that i'm talking in the stage so i'm so happy and i need to confess that i choose a difficult topic to talk with you but prepare your computer because we will do a interesting uh challenger in 20 minutes let's go so this is me my name is solenjigeros i am developer advocate at changing clubs and this is our agenda but let's go faster to jesus so go to this link in your computer and i will go out to my presentation to do this with you so here we are you can see here and are you at the requirements over there because no oh oh wait thank you okay you are seeing now okay so this is our pet our link pad dot rise up dot net slash p slash keepers i will come back in a minute because i'm re adding the requirements so it's it's easy you only need to have metamask uh to have some a there's an coven we are doing this on coven i have some link on coven i put the default set for you if you need coven at eaters or link and i asked something for you so as it is information for me here like i am so i'm from brazil you can put your name over there one line for each person and let's go forward because now you are installed if you need something and you are putting our name here and i will come back to the presentation okay and yes no oh i can choose the beginning okay no problem here we are and why we need keepers what's the problem with the smart contracts these smart contacts are passive autonomous agents it means that they can't trigger or they can't initiate their own functions at any time or under some conditions and how we can do a change a state change in a smart context so we need to have a transaction and this is this transaction must be sent by a external account or an another account can be external account can be a user it can be a oracle and because of this we have chain link keepers to solve this chain link keepers it's a decentralized network of nodes these nodes are incentivized to prefer registered jobs we call them upkeeps in this means that they can be used to check some conditions and then to run functions in your smart contracts so this is the the main uh goal of the main idea uh the the keeper is doing this off-chain is doing a simulation and then if this simulation returns true it will send your transaction to your is much context to execute something that you will define i did a very fast explanation at the end i will put some links to you to understand better and more because i'd like to you understand this in prezi so we now will create as much context using remix and this is much context you give to you some tokens on coven but it is the chain link it danger token and we will prepare a keeper to give this talking to us every minute for example so we can have a lot of talkings so let's go wow we have a lot of persons here and i know that some of them are online others are here this is amazing oh again okay okay okay every time that i go out to presentation this happen perfect so we are using remix now okay we are creating our smart content then amy it will be keeper minter and the iu copy and paste here the source code and you can copy and paste in your computer be careful to not cut this much content you need to copy it not good so this is much concrete it's so big here it is better so i put the beginning the end copy inside the beginning and the end and are you explaining what this is doing now so my smart contract i'm using the last version of solid not the last one but the 0.8 and i am importing a interface from keepers we need to use this interface but i can import this directly from the the the chain link but i copy it here only to be fast for us okay and then this is our token i have it is open here only to you understand what's this so i created this token uh today my morning and when this is uh ahor uh because uh i sent some tokens to the uh the job to the upkeeper and then this is my address and for some minutes like 106 minutes i received tokens so i have a lot of tokens i can see here in my metamask that i have uh chain link it in your tokens and you got this too so i need to mint the tokens i need to have an interface connected to that token i created this interface here for you and this is the main contract the keep minter it's using the keeper compatible interface and i have a counter only to know how many times i'm doing this and uh how many uh how is the interval to get the tokens like i like to do these in 30 seconds or in one minute something like that and to do this i need to control uh how was the last block the last time stamp that i did this in the constructor what i'm doing setting the interval like i will do here with 30 seconds setting the last time stamp initialization the counter and the interface to that token that i show you before remember that i said that we have two functions one is the check upkeep and this is this is used by the job uh to verify if there is something to do using my smart content and then i have the perform upkeep this will execute what i'd like to do and what i'd like to do i would like to increase the counter and mint tokens for me probably you don't like to mention tokens for me would you like to make tokens for you so change here in this line put your address here and my token has only two decimal places so here it means that i'm doing one token i'm meeting minting when talking okay so going back here oh someone i said to you don't cut only copy so you need to change in the remix the line 40 okay so is this you will update your address here in remix in this line to mint the talk is not for my account but for your account and if you you'd like more tokens you can do it no problem it's yours and let's publish this i think you are right to do this so i'm going to deploy and run transactions uh connecting to my injected web tree this is my metamask here i am in coven here just now and you can check that i have some eaters and i have some link over there i can do this it's perfect here very important select our contract go to the keeper minter and i need to define the interval it will be 30 seconds it's good deploy it in a few seconds i you have my content deployed on coven here we are and are you asked to do something with me just now like put your name over there and the address of your is much content mine is i can copy here at the end and here is mine perfect we have more persons doing it it's amazing okay next step i'm going now to the keeper app to register my smart concrete and in this way the keepers nodes can monitor my smart content and execute this for me so go to the keepers app register a new upkeep and i copy and paste over there the information well we don't need my email and i changed these much concrete so is this let's do this now this is the address of my smart content i can copy from remix again you can see that that mean address it's my address but i can use another smart content or another wallet to administrate this the gas limit we have some tests that this is a good limit to use and we are funding the the keepers the job with some link because every time that this is executed it is consuming the link token i can pass some parameters for this but i'm not using this now and the hashester upkeep i'm sending a transaction again you need to wait a bit well we have some persons oh sorry alex about your laptop and oh it's done perfect view upkeep this is my upkeep now and you can see that uh wow it's so fast in the first time that i added it already did the performer so probably i forgot to to show you how many tokens i have before no we did this remember that i have 106 now i have 107 and you i mean winning more tokens i have more tokens in 30 seconds i have one more token like i can refresh here to see that it was performed again and then let's go through the metamask to see it and yes one more and this is i'm you i i automated my smart content because i have an external agent like this is a job that it's running a function with my smart content for me and we can use this for uh for many applications i will come back to my presentation because i have some links for you uh how how much time i have i don't remember the time two minutes okay it's perfect so come back here oh not in the beginning okay where we are here so you can understand more about the keepers you can first take a look at the introduction the introduction have only they counter that i'm using here but i put a bit more because of the talking winter and these utility contracts are so useful because you can learn how to send eaters to another country you can have useful functions that you can use like this kind of jobs and i'd like to invite you especially the beginners for our smart country developer bootcamp it will be happen on 70 from 9 8 to 5 p.m and you can register over there it will be streamed too so you can go in any place okay i know that we are copying so fast go go go and this is uh you can learn more in all of these channels about chain link so is this i know that i don't have time to question just now but you can find me over there and it will be my pleasure to talk with you thank you guys [Applause]
Automatic transcript — names and jargon may be misspelled.
