Cyfrin / solidity-by-example.github.io

Solidity By Example
https://solidity-by-example.org/
MIT License
614 stars 201 forks source link

triggering `fallback()` via `call()` #211

Closed skaunov closed 2 years ago

skaunov commented 2 years ago

Correct me if I got the idea of this example wrong, pls. If we want to trigger Receiver.fallback(), then we should declare testCallDoesNotExist() as payable. And without passing msg.value the fallback() will be triggered with zero value.

skaunov commented 2 years ago

On the second thought I came to conclusion that this difference in calls were on purpose, so let me close the PR. Though I would say it will be helpful to have an additional line of comment to emphasize this difference for a reader.