ERC4626 Vault Smart Contract tutorial | DeFi Vault tutorial

Поділитися
Вставка
  • Опубліковано 25 вер 2023
  • In this DeFi vault smart contract tutorial we build a tokenized vault smart contract using the ERC4626 standard. Learn how to build a custom vault that inherits from ERC4626, add vault fees and hook up your yield strategy code. Follow along and learn this important DeFi protocol pattern.
    Useful links:
    Remix editor:
    remix.ethereum.org/
    Metamask wallet:
    metamask.io/
    Ethereum unit converter:
    eth-converter.com/
    Sepolia faucets:
    sepoliafaucet.com/
    www.infura.io/faucet/sepolia
    ERC4626 info:
    eips.ethereum.org/EIPS/eip-4626
    ethereum.org/en/developers/do...
    docs.openzeppelin.com/contrac...
    implementations:
    github.com/transmissions11/so...
    github.com/OpenZeppelin/openz...
    ERC4626 Tutorial GitHub repo:
    github.com/jspruance/erc4626-...
    Imports for remix:
    Vault.sol
    import "github.com/OpenZeppelin/openz...";
    import "github.com/jspruance/erc4626-...";
    OceanToken.sol
    import "github.com/OpenZeppelin/openz...";
  • Наука та технологія

КОМЕНТАРІ • 36

  • @jrsantos1737
    @jrsantos1737 7 місяців тому +2

    nice bro, welcome back haha. Hope you continue making videos about defi

  • @marklin9308
    @marklin9308 4 місяці тому

    very clear explained . it's my first time seeing people using remix to trying these contracts. lovely !

  • @shishgeor
    @shishgeor 7 місяців тому

    Great tutorial! Looking forward to seeing more of this!

  • @blockmaxi
    @blockmaxi 6 місяців тому +1

    Well explained 👏
    Would love to see more videos on defi integration!

  • @hasfocus
    @hasfocus 8 місяців тому

    Thrilled to see a new video!

  • @superfunsurf
    @superfunsurf 3 місяці тому

    thanks much. love your work. so glad you still making defi vids. thanks again.

  • @bhok5228
    @bhok5228 4 місяці тому

    Great video, waiting for more!

  • @Cryptopunkstar
    @Cryptopunkstar 4 місяці тому

    Woow great thank you I understand a vault manage.

  • @sayf3446
    @sayf3446 7 місяців тому

    Excellent video! May I ask a bit behind the math why the 1% of 100 ended up being less than 1% sent to the wallet? Is there a resource I can look up to understand it a bit better, please?

  • @sigmamale7914
    @sigmamale7914 8 місяців тому

    after a long time

  • @safoantouil2660
    @safoantouil2660 4 місяці тому

    fantastic thanks for the video

  • @user-es8lh1vd9q
    @user-es8lh1vd9q 5 місяців тому

    Great tutorial! What's the difference between redeem and withdraw?

  • @nabuza8639
    @nabuza8639 6 місяців тому

    Very well done!!
    How could we apply different value of fee in function of sender? For exemple 1% for the first address, 1,5% for the second and 2% for the third? Can we pass something as parameter of deposit function?

  • @EverythingFootball331
    @EverythingFootball331 5 місяців тому

    Good day. Please I need you insight into a couple of things(erc-20 swap and smart contracts related).
    1. Why can’t a higher number of certain tokens be swapped in the uniswap wallet? eg. you can swap only 10 or less.
    2. Will using a smart contract for the swap allow you to swap higher amounts of your choice even if the token creator has placed limits on the number of tokens to be swapped I.e. does using a smart contract make the transaction independent of the token contract?

  • @Sianae
    @Sianae 7 місяців тому

    I watched your video on Flashloan Arbitrage and it was best explanation ever on executing a flashloan in UA-cam by the way did you recieved 110 usdc in your metamask wallet end of it ???😅 Please reply I'm eagerly waiting for you reply 😊

  • @gaba903
    @gaba903 6 місяців тому

    I1m sorry if my question is meaningless, but i can change the contract so that shares can be erc-1155?
    I intend to participate im my first hackathon and it's about tokeenization of trasury bonds, I thought of something along those lines...

  • @pc5798
    @pc5798 Місяць тому

    Can you do a video of how to exit a smart contract and bring coins back to your account if for example Uniswap Labs gets shut down?

  • @stephensimeon1.
    @stephensimeon1. 8 місяців тому

    Thank you Block Explorer, you are a seasoned tutor. I really need your personal mentorship.

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому

      Thanks my friend, appreciate it!

    • @EverythingFootball331
      @EverythingFootball331 5 місяців тому

      @@BlockExplorerMedia Good day. Please I need you insight into a couple of things(erc-20 swap and smart contracts related).
      1. Why can’t a higher number of certain tokens be swapped in the uniswap wallet? eg. you can swap only 10 or less.
      2. Will using a smart contract for the swap allow you to swap higher amounts of your choice even if the token creator has placed limits on the number of tokens to be swapped I.e. does using a smart contract make the transaction independent of the token contract?

  • @Notepad123
    @Notepad123 7 місяців тому +1

    I’ll buy your course if you make one

  • @kevin123497
    @kevin123497 8 місяців тому +1

    Hey what's up! Long time no see! You should do a foundry tutorial! Or a vyper tutorial!

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому +1

      Hey how's it going? Great ideas - they're both on my list. Thinking about a Solidity one as well. Thanks!

    • @EverythingFootball331
      @EverythingFootball331 5 місяців тому

      @@BlockExplorerMedia Good day. Please I need you insight into a couple of things(erc-20 swap and smart contracts related).
      1. Why can’t a higher number of certain tokens be swapped in the uniswap wallet? eg. you can swap only 10 or less.
      2. Will using a smart contract for the swap allow you to swap higher amounts of your choice even if the token creator has placed limits on the number of tokens to be swapped I.e. does using a smart contract make the transaction independent of the token contract?

  • @_VANADAIN_
    @_VANADAIN_ 8 місяців тому

    I see interest is hardcoded, but how interest logic handled in real-world scenarios? Could you recommend some strategies to check maybe?

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому +1

      In a real production vault the interest would be added to the underlying vault funds whenever vault tokens are withdrawn from various other DeFi protocols as part of strategy execution. The vault participants' shares inherently represent their claim on the underlying funds and interest, so nothing more is needed to claim their share of the interest - this is already baked into ERC4626 and is reflected on withdraw / redeem.

    • @EverythingFootball331
      @EverythingFootball331 5 місяців тому

      @@BlockExplorerMedia Good day. Please I need you insight into a couple of things(erc-20 swap and smart contracts related).
      1. Why can’t a higher number of certain tokens be swapped in the uniswap wallet? eg. you can swap only 10 or less.
      2. Will using a smart contract for the swap allow you to swap higher amounts of your choice even if the token creator has placed limits on the number of tokens to be swapped I.e. does using a smart contract make the transaction independent of the token contract?

  • @MrSkatebox09
    @MrSkatebox09 8 місяців тому +1

    could you do a contract on Loans and how I could give someone a loan for 6 months and they pay me back monthly with interest

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому +1

      That's a good idea and would tie into this nicely as loans are one of the common vault strategies.

  • @CryptoWork99
    @CryptoWork99 8 місяців тому

    Why you do allowance with another account ?

    • @BlockExplorerMedia
      @BlockExplorerMedia  8 місяців тому

      The vault deposit function does a 'transferFrom' so the depositor must first give the vault approval to use the funds.

    • @EverythingFootball331
      @EverythingFootball331 5 місяців тому

      @@BlockExplorerMedia Good day. Please I need you insight into a couple of things(erc-20 swap and smart contracts related).
      1. Why can’t a higher number of certain tokens be swapped in the uniswap wallet? eg. you can swap only 10 or less.
      2. Will using a smart contract for the swap allow you to swap higher amounts of your choice even if the token creator has placed limits on the number of tokens to be swapped I.e. does using a smart contract make the transaction independent of the token contract?

  • @CryptoWork99
    @CryptoWork99 8 місяців тому

    Because if you use the allowance they Stolen token and the vault Is not automatically

  • @NK-xk7me
    @NK-xk7me 4 місяці тому

    Hey Jonathan, I subscribed to your Patreon. I do need your help with one university project. The remix erc20 code is working perfect, MetaMask is connected, just the JavaScript with one function into the the frontend does not work. The transaction always fails. Is there a possibility u could help me? How can I contact you? your help would mean the world to me.
    Kind regard N

  • @sankaudaya341
    @sankaudaya341 8 днів тому

    Hi sir, I'm in a big trouble. can u help me.. I loss my ethereum using remix site. How can I withdraw my eth to my metamas wallet.. pls help.. How can I contact u.. Pls help..