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.
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!
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?
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!
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?
@@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 ?
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 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.
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!
You have a mania or a gift 🙇🏽 of making complicated and complex things seems so simple, easy to understand, with succinct explanation and examples.
The best profesor for blockchain ever. Thanks a lot for this video.
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.
Hi! Just wanted to say that this is the most helpful solidity youtube series so far - thanks for making these!
The best explaination I could find, thanks a lot!
Great explanation!!! The most efficient 5 minutes I've spent.
great explanation, I learn with your videos! many thanks!
Apparently the fallback function is very useful for the upgradeable contracts pattern as well. Btw, many thanks to this video, is very helpful indeed.
Best example for fallback function and gave clear difference for fallback and receive
Obviously, a genius is behind all that simplicity
best solidity tutorials on youtube! Thanks!
Perfect video
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!
expresses the intent of your code
receive means this contract can receive ETH but there is no default function to fallback to
Man, I'm happy that I notice this channel.
But feel guilty that I didn't know as early as possible!
比特彭您好, 請問您是台灣的彭彭老師(Javascript及Python)嗎? 您來自台灣或大陸? 我來自台灣.
thank you so much ... i learn more knowledge from your channel
I wonder why fallback(), receive(), and constructor() don't have "function" preceding them.
Useful content 🎉
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?
Excellent! Thanks
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!
Great tutorial. Thank you.
I cant believe only 6k views, quality is not being valued!
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?
1:38 receive() executed when the data that sent is empty
If there is a payable function like last lesson(#37), still need to have a payable fallback function or payable receive function?
if your contract is going to receive ETH directly, then yes
@@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 ?
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."
it's not required to have fallback for flashloans
@@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.
Why the need for the fallback function when we can just create a function that is payable?
fallback is default function and a payable fallback can receive direct transfer of ETH
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!
both won't be called when a token is sent
cool. didn't know. is it common practice to implement both functions in one contract, or is this more of an academic discussion?
depends on the code
Someone needs to send ether to his payable ...
okey but why there are two methods? fallback does the two jobs already
I agree.
!