Zilliqa / ZRC

Zilliqa Reference Contracts
MIT License
40 stars 57 forks source link

Fix: optimise zrc6 `RequireNotPaused` calls #125

Closed gb3h closed 2 years ago

gb3h commented 2 years ago

By having the guard clause RequireNotPaused in procedures, batch operations result in multiple (wasted) calls to RequireNotPaused. When operations occur in large batches, this is a waste of gas fees and network efficiency.

Fixes issue #124

Old procedures with RequireNotPaused:

New transitions with RequireNotPaused:

bb111189 commented 2 years ago

Gas saving in this case will not be a lot. RequireNotPaused will throw an exception and contract execution will halt immediately.

However, there will still be some gas savings as there is no need to access the list