Open code423n4 opened 3 years ago
shw
In the PoolStorage library, declaring the POOL_STORAGE_PREFIX constant with type bytes32, and change abi.encode ti abi.encodePacked at line 87 can save gas.
PoolStorage
POOL_STORAGE_PREFIX
bytes32
abi.encode
abi.encodePacked
Referenced code: PoolStorage.sol#L14 PoolStorage.sol#L87
Related links: Change string to byteX if possible Solidity-Encode-Gas-Comparison
string
byteX
See above
Handle
shw
Vulnerability details
Impact
In the
PoolStorage
library, declaring thePOOL_STORAGE_PREFIX
constant with typebytes32
, and changeabi.encode
tiabi.encodePacked
at line 87 can save gas.Proof of Concept
Referenced code: PoolStorage.sol#L14 PoolStorage.sol#L87
Related links: Change
string
tobyteX
if possible Solidity-Encode-Gas-ComparisonRecommended Mitigation Steps
See above