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

0 stars 0 forks source link

State variable that can be decalred as constant #52

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

JMukesh

Vulnerability details

Impact

State variable that can be decalred as constant to save gas

bytes32 private TXNS_TYPEHASH bytes32 private BUNDLE_TYPEHASH

since these value will not be changed as mentioned in comment , it can be declared as constant

Proof of Concept

https://github.com/code-423n4/2021-10-ambire/blob/bc01af4df3f70d1629c4e22a72c19e6a814db70d/contracts/wallet/QuickAccManager.sol#L153

https://github.com/code-423n4/2021-10-ambire/blob/bc01af4df3f70d1629c4e22a72c19e6a814db70d/contracts/wallet/QuickAccManager.sol#L154

Tools Used

manual review

Recommended Mitigation Steps

Ivshti commented 2 years ago

fixed in https://github.com/AmbireTech/adex-protocol-eth/commit/687a027d27693f18a5d547fc95f0af358a1de12e

Ivshti commented 2 years ago

duplicate of #31

GalloDaSballo commented 2 years ago

Duplicate of #31