Fallback | Solidity 0.8

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 42

  • @ndabenhlemhlongo7231
    @ndabenhlemhlongo7231 2 года назад +3

    You have a mania or a gift 🙇🏽 of making complicated and complex things seems so simple, easy to understand, with succinct explanation and examples.

  • @tetuaoro
    @tetuaoro 2 года назад +7

    The best profesor for blockchain ever. Thanks a lot for this video.

  • @Bruhne
    @Bruhne Год назад

    Got it! I just purchased the physical book Solidity Programming Essentials; and so where ever I am with you, I go into the book to learn more on said subject. I dive into your material very early in the mornings, and I delve into the book later in the days.

  • @sumimudgil2019
    @sumimudgil2019 2 года назад +4

    Hi! Just wanted to say that this is the most helpful solidity youtube series so far - thanks for making these!

  • @langchen1300
    @langchen1300 2 года назад +3

    The best explaination I could find, thanks a lot!

  • @Hi_Chew
    @Hi_Chew 2 года назад +4

    Great explanation!!! The most efficient 5 minutes I've spent.

  • @sdfsfsfd437
    @sdfsfsfd437 2 года назад +4

    great explanation, I learn with your videos! many thanks!

  • @gilbertoconde8760
    @gilbertoconde8760 2 года назад +1

    Apparently the fallback function is very useful for the upgradeable contracts pattern as well. Btw, many thanks to this video, is very helpful indeed.

  • @alekhyadiwakar
    @alekhyadiwakar 2 года назад

    Best example for fallback function and gave clear difference for fallback and receive

  • @jacob_dmn
    @jacob_dmn 2 года назад

    Obviously, a genius is behind all that simplicity

  • @karich21
    @karich21 2 года назад

    best solidity tutorials on youtube! Thanks!

  • @orophile05
    @orophile05 2 года назад +3

    Perfect video

  • @radubutucelea
    @radubutucelea 2 года назад +1

    Hello there! Thank you very much for putting together this video series, it is indeed super helpful.
    I am a beginner in the Solidity world and was wondering if you can share a use case example where one would use both "receive" and "fallback" rather than just "fallback"?! From what I understood, "fallback" is enough the handle any use case where value is being sent to the smart contract..
    Cheers!

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 года назад

      expresses the intent of your code
      receive means this contract can receive ETH but there is no default function to fallback to

  • @crypto_peng
    @crypto_peng 2 года назад

    Man, I'm happy that I notice this channel.
    But feel guilty that I didn't know as early as possible!

    • @Ts2pc
      @Ts2pc 2 года назад

      比特彭您好, 請問您是台灣的彭彭老師(Javascript及Python)嗎? 您來自台灣或大陸? 我來自台灣.

  • @tuanquangsangnguyen2385
    @tuanquangsangnguyen2385 2 года назад

    thank you so much ... i learn more knowledge from your channel

  • @MrCoreyTexas
    @MrCoreyTexas 4 месяца назад

    I wonder why fallback(), receive(), and constructor() don't have "function" preceding them.

  • @engenglish610
    @engenglish610 Год назад +1

    Useful content 🎉

  • @Ts2pc
    @Ts2pc 2 года назад

    In solidity 0.5 payable video, there is no fallback function inside the contract Wallet but it can receive ETH, so is the deposit function (#18) of the contract Wallet also a kind of fallback function?

  • @meka4996
    @meka4996 Год назад

    Excellent! Thanks

  • @Ts2pc
    @Ts2pc 2 года назад

    Excellent Video! When you say"receive ETH directly", is the way you make a demo here to use low level code interaction? And the code and demo in solidity 0.5 fallback is also a kind of "receive ETH directly"? Please advise, Thanks!

  • @realbotix
    @realbotix 2 года назад +1

    Great tutorial. Thank you.

  • @NikhilKumar-mm4to
    @NikhilKumar-mm4to 2 года назад

    I cant believe only 6k views, quality is not being valued!

  • @tuntunewala
    @tuntunewala 2 года назад

    hey sir i have a question why can't we send ethers directly when we deploy our smart contract using value section i have tried it and this shows execution runtime error , but i am not sure why it can't recieve the ethers even when we decalred receive aswell as fallback and why we use low level interaction?

  • @crypto_peng
    @crypto_peng 2 года назад

    1:38 receive() executed when the data that sent is empty

  • @Ts2pc
    @Ts2pc 2 года назад

    If there is a payable function like last lesson(#37), still need to have a payable fallback function or payable receive function?

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 года назад

      if your contract is going to receive ETH directly, then yes

    • @Ts2pc
      @Ts2pc 2 года назад

      @@smartcontractprogrammerThanks for your teaching. But I still confuse the difference between "receive ETH directly" and "receive ETH indirectly "? Is to receive ETH directly very risky , otherwise why Fallback payable ?

  • @viktorcortez5706
    @viktorcortez5706 2 года назад

    Thanks for your video. I undesrstand what fallback is, but could you explain this? Why is it necessary to use a fallback with flashloan? "A fallback function is called whenever a smart contract iscalled and the selector doesn’t match any of the existing function selectors. It’s basically a catch all.
    Now you can receive generalized flashloans simply by putting all the flashloan logic in the fallback
    function. Be warned there are serious security vulnerabilities that will need to be patched to make
    this function safe to expose."

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 года назад +1

      it's not required to have fallback for flashloans

    • @viktorcortez5706
      @viktorcortez5706 2 года назад

      @@smartcontractprogrammer yes, but I read one of the manuals from mev searches. So they advise using a fallback when you have several flash loan providers and you simply need to receive funds from them on contract.

  • @natnaelberhane3141
    @natnaelberhane3141 2 года назад

    Why the need for the fallback function when we can just create a function that is payable?

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 года назад

      fallback is default function and a payable fallback can receive direct transfer of ETH

  • @cryptoknight7256
    @cryptoknight7256 2 года назад

    Say that I code a wallet with both fallback() & receive(). If I send native coins to that contract wallet, receive() will listen and emit. But what if I send a token instead? receive() won't get it but will fallback() listen to it? Thanks!

  • @edwassermann8368
    @edwassermann8368 2 года назад

    cool. didn't know. is it common practice to implement both functions in one contract, or is this more of an academic discussion?

  • @chankanhei
    @chankanhei 2 года назад

    Someone needs to send ether to his payable ...

  • @mertcankose5079
    @mertcankose5079 Год назад

    okey but why there are two methods? fallback does the two jobs already

  • @mrin0
    @mrin0 7 месяцев назад +1

    !