Open c4-bot-4 opened 11 months ago
0xleastwood marked the issue as selected for report
0xleastwood marked the issue as grade-a
What a nice trick to learn for G1, thanks!
Re G4, so we should modify it into the following, right?
struct Info {
uint40 tokenId;
uint128 liquidity;
uint24 token0PremiumPortion;
uint24 token1PremiumPortion;
uint32 startTime;
bool zeroForOne;
uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
}
Also, I thought bool is 1 bit (enough to encode), why is it 8 bits?
wukong-particle (sponsor) confirmed
struct Info { uint40 tokenId; uint128 liquidity; uint24 token0PremiumPortion; uint24 token1PremiumPortion; uint32 startTime; bool zeroForOne; uint256 feeGrowthInside0LastX128; uint256 feeGrowthInside1LastX128; }
yes, that's correct. Even if a bool takes a single bit, these are always encoded as 1 byte.
See the markdown file with the details of this report here.