I read this stackexchange post and understood the difference between 'assert' and 'require'.

But it got me thinking, what even is the point of 'assert'? I mean it has same the behaviour as 'require' except gas won't get refunded.

Can't we just use 'require' all the time, since it has the added possibility of gas being refunded?

If this isn't the case, then can somebody please give an example of a scenario where we should use 'assert' and explain why we need to specifically use it instead of 'require'.




Browse other questions tagged or ask your own question.