code-423n4 / 2021-10-ambire-findings

0 stars 0 forks source link

Cache storage access #62

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

scheduled[hash] in functions cancel and execScheduled is accessed 2 times. It would be a bit cheaper to extract this value to a variable and re-use it. Same situation in function setAddrPrivilege where privileges[addr] is accessed 2 times when checking the state.

Recommended Mitigation Steps

Cache and re-use state values to reduce gas costs.

Ivshti commented 3 years ago

duplicate of #30

GalloDaSballo commented 3 years ago

Duplicate of #30