Code With No Effects
Last updated
Last updated
In Solidity, it's possible to write code that does not produce the intended effects.
Let's see an example:
The line
has an error which is very unpleasant. Instead the right way is to assign the amount to the balance of the msg.sender, like this:
Another bad example is this code snippet:
As you can see, here we are not checking the return value of the call on this line:
And the fix is the following: