Block time refers to the time separating blocks. The average block time in Ethereum is 12 seconds, but this value is different on different chains on Polygon and in Arbitrum chains.
Proof of Concept
Consider a Principal Token (PT) with a maturity date set based on block.timestamp.
On Ethereum, this might work predictably, but on Arbitrum and on Polygon chain, the PT could reach maturity earlier or later than expected due to how these other networks handles timestamps. This discrepancy could mislead token holders regarding the maturity of their investments, potentially leading to confusion or loss if tokens appear to mature at unexpected times.
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/YieldToken.sol#L124 https://github.com/code-423n4/2024-02-spectra/blob/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/PrincipalToken.sol#L86
Vulnerability details
Impact
Block time refers to the time separating blocks. The average block time in Ethereum is 12 seconds, but this value is different on different chains on Polygon and in Arbitrum chains.
Proof of Concept
Consider a Principal Token (PT) with a maturity date set based on block.timestamp.
On Ethereum, this might work predictably, but on Arbitrum and on Polygon chain, the PT could reach maturity earlier or later than expected due to how these other networks handles timestamps. This discrepancy could mislead token holders regarding the maturity of their investments, potentially leading to confusion or loss if tokens appear to mature at unexpected times.
Tools Used
Manual Review
Recommended Mitigation Steps
Implement a more flexible maturity calculation and other operations involving
block.timestamp
whilst using theblock.timestamp
values.Assessed type
Invalid Validation