code-423n4 / 2021-07-sherlock-findings

0 stars 0 forks source link

Gas optimization on calculating the storage slot of a token #148

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

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.

Proof of Concept

Referenced code: PoolStorage.sol#L14 PoolStorage.sol#L87

Related links: Change string to byteX if possible Solidity-Encode-Gas-Comparison

Recommended Mitigation Steps

See above