code-423n4 / 2022-04-phuture-findings

0 stars 0 forks source link

Gas Optimizations #13

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

gas ompimization in indexLayout.sol uint lastTransferTime : should become a uint96 to save gas because its at the it should be at the same slot as the address before bec the address above is 20 bytes which is 160 bits and every slot holds 256 bits.there are 96 bits left over to use So the thrid address varible is at 3 slot and can be packed together with uint96 to get 256 bits in that slot saving 1 slot of gas which is a sstore 50,000 gas.