tokamak-network / crossTrade

Cross Trade is a new core service for optimistic rollups that complements standard withdrawals and fast withdrawals. It is trustless and do not require extensive backend.
4 stars 1 forks source link

J_6. use unchecked [optimization] #8

Closed usgeeus closed 5 months ago

usgeeus commented 6 months ago

Configuration

Lines of Code

https://github.com/tokamak-network/L2-FastWithdraw/blob/aefc050fdaf7c81e1cef3f4a1a5eeea70351b762/contracts/L2/L2FastWithdraw.sol#L73

Description

unchecked keyword saves gas and allows you to restart from 0 when the count is 2^256.

Recommendation

unchecked {    
        ++ saleCount;    
    }
zzooppii commented 5 months ago

https://github.com/tokamak-network/crossTrade/commit/3da835e288680cbc6507cd3af1dea72ee87b200a

usgeeus commented 5 months ago

Solved, closing this issue.