Platform: Code4rena
Start Date: 04/01/2022
Pot Size: $75,000 USDC
Total HM: 17
Participants: 33
Period: 7 days
Judge: 0xean
Total Solo HM: 14
Id: 74
League: ETH
Rank: 20/33
Findings: 1
Award: $215.74
🌟 Selected for report: 2
🚀 Solo Findings: 0
🌟 Selected for report: rfa
93.0809 USDC - $93.08
rfa
more expensive gas
instead of caching state on memory. just read it directly from the storage. State memory state = pools[maturity].state;
self research on: https://remix.ethereum.org/
State storage state = pools[maturity].state;
#0 - Mathepreneur
2022-01-18T10:51:29Z
rfa
more expensive gas usage
since uint variable type cannot < 0. use != to replace < or >
https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L149-L150 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L153 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L170 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L200 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L203
and more
replace with '!='
#0 - amateur-dev
2022-01-14T11:08:24Z
Similar issue reported over here #172; hence closing this.
25.1318 USDC - $25.13
rfa
expensive gas
if we change locked data type to boolean . it can save gas.
bool private locked = true;
modifier lock() { require(locked, 'E211'); locked = false; _; locked = true; }
#0 - amateur-dev
2022-01-15T03:59:02Z
Similar issue reported over here #87; hence closing this
🌟 Selected for report: rfa
93.0809 USDC - $93.08
rfa
more expensive gas usage
instead of using operator && on single require check. using additional require check can save more gas:
https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L151-L152 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L201-L202 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L234-L235 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L272-L273 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L309-L310 https://github.com/code-423n4/2022-01-timeswap/blob/main/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L351
example: require(liquidityTo != address(0), 'E201' ); require(dueTo != address(0), 'E201');
#0 - Mathepreneur
2022-01-17T16:52:40Z