shitdao icon indicating copy to clipboard operation
shitdao copied to clipboard

Replace require with assert

Open nanexcool opened this issue 4 years ago • 5 comments

Require has very descriptive error messages, plus returns extra gas... too nice and not shitty enough :)

nanexcool avatar Aug 28 '21 15:08 nanexcool

ok I love it but what if you kept require (I know not as bad on gas) but you used the error messages to make fun of the user? Or just be totally unhelpful

JesseAbram avatar Aug 29 '21 00:08 JesseAbram

I like mocking the user with an error message, but also like taking their gas!

Bit more complicated but could have a loop before the require that consumes most of the gas, then trigger the error lol

On Sat, Aug 28, 2021 at 7:03 PM JesseAbram @.***> wrote:

ok I love it but what if you kept require (I know not as bad on gas) but you used the error messages to make fun of the user? Or just be totally unhelpful

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smartcontracts/shitdao/pull/12#issuecomment-907705337, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAM2HQMX7QCAQ7KGUOHLJTT7F2NRANCNFSM5C7HM3BQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

nanexcool avatar Aug 29 '21 00:08 nanexcool

I was literally thinking the same thing!

JesseAbram avatar Aug 29 '21 00:08 JesseAbram

I propose we override require to do a loop to burn the gas

smartcontracts avatar Sep 05 '21 09:09 smartcontracts

I'm not sure, but it can be done with if revert. Or does it return extra gas?

grGred avatar Jul 18 '22 13:07 grGred