Contracts will not working correctly after February 2106. Migration takes costs and is risky. You shouldn't pass on this work to future programmers. You should fix it in the first place. In case anything went wrong during migration, a big fund loss will occur.
Vesting will be locked forever if withdrawn after February 2106. Moreover, there isn't any migration logic, so this should be high risk as funds may be lost forever.
Proof of Concept
function tokensAvailableForWithdrawal(uint256 auctionId, uint128 baseAmount)
public
view
returns (uint128 tokensAvailable)
{
Auction storage a = idToAuction[auctionId];
return CommonTokenMath.tokensAvailableAtTime(
a.timings.vestingStartTimestamp,
a.timings.vestingEndTimestamp,
uint32(block.timestamp),
a.timings.cliffPercent,
baseAmount
);
}
block.timestamp is converted to uint32 which has a max value of 4294967295. 4294967295 is February 7, 2106. After February 7, 2106, uint32(block.timestamp) will be overflowed. Once it is overflowed, the logic of the contract will be broken.
Here, vesting will be locked forever if withdrawn after February 2106. Since tokensAvailableForWithdrawal round block.timestamp to a very small number.
Lines of code
https://github.com/code-423n4/2022-11-size/blob/79aa9c01987e57a760521acecfe81b28eab3b313/src/SizeSealed.sol#L460 https://github.com/code-423n4/2022-11-size/blob/79aa9c01987e57a760521acecfe81b28eab3b313/src/SizeSealed.sol#L405 https://github.com/code-423n4/2022-11-size/blob/79aa9c01987e57a760521acecfe81b28eab3b313/src/util/CommonTokenMath.sol#L47-L69 https://github.com/code-423n4/2022-11-size/blob/79aa9c01987e57a760521acecfe81b28eab3b313/src/SizeSealed.sol#L358-L387
Vulnerability details
Impact
Contracts will not working correctly after February 2106. Migration takes costs and is risky. You shouldn't pass on this work to future programmers. You should fix it in the first place. In case anything went wrong during migration, a big fund loss will occur.
Vesting will be locked forever if withdrawn after February 2106. Moreover, there isn't any migration logic, so this should be high risk as funds may be lost forever.
Proof of Concept
block.timestamp is converted to uint32 which has a max value of 4294967295. 4294967295 is February 7, 2106. After February 7, 2106, uint32(block.timestamp) will be overflowed. Once it is overflowed, the logic of the contract will be broken.
Here, vesting will be locked forever if withdrawn after February 2106. Since tokensAvailableForWithdrawal round block.timestamp to a very small number.
Recommended Mitigation Steps
Use larger unit such as uint40 instead of uint32