Has anyone figure out under what circumstances a failing tx ends up eating its entire gas limit, even though all the gas required to reach the failure is well below the gas limit?
Jun 4, 2022, 7:03 PM
I think assert have that behaviour
https://stackoverflow.com/questions/48847407/assert-vs-require-within-solidity#48847724
Yup
Yup
Jun 4, 2022, 8:12 PM
Thanks, that helped a lot
I've read the comments but i still don't understand why i would choose assert over require. Can't see an advantage
Even if the check will never fail, i don't see a reason for burning an arbitrary amount of gas
A revert message saying 'oh shit' and no additional gas burned would be much more helpful
Jun 4, 2022, 8:24 PM
Can't see any advantage. Other than
assert(a == b, "a should be equal to b idiot, now all your gas is mine"); xD
assert(a == b, "a should be equal to b idiot, now all your gas is mine"); xD
Jun 4, 2022, 8:48 PM