Skip to content
Business logic Audit finding Beginner

Wrong constants for time delay

Two time-delay constants in the smart contracts were set to values far shorter than intended (3 seconds instead of 3 days, and 200 seconds instead of 2 days). This meant admin settings could be changed with almost no delay, giving users little time to react.

wagmi Follow with jonatascm, 0x4non and 4 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-11-isomorph-judging/issues/231

Found by

wagmi, jonatascm, 0x4non, hansfriese, GimelSec, rvierdiiev, neumo

Summary

This protocol uses several constants for time dealy and some of them are incorrect.

Vulnerability Detail

In isoUSDToken.sol, ISOUSD_TIME_DELAY should be 3 days instead of 3 seconds.

Solidity
    uint256 constant ISOUSD_TIME_DELAY = 3; // days;

In CollateralBook.sol, CHANGE_COLLATERAL_DELAY should be 2 days instead of 200 seconds.

Solidity
    uint256 public constant CHANGE_COLLATERAL_DELAY = 200; //2 days

Impact

Admin settings would be updated within a short period of delay so that users wouldn't react properly.

Code Snippet

https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Isomorph/contracts/isoUSDToken.sol#L10 https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Isomorph/contracts/CollateralBook.sol#L23

Tool used

Manual Review

Recommendation

2 constants should be modified as mentioned above.

Discussion

kree-dotcom

Fixed https://github.com/kree-dotcom/isomorph/commit/4fc80e6178204691a365f656908c278d5faf4f88 , corrected missing semicolon here https://github.com/kree-dotcom/isomorph/commit/9bad2748dd3f3e7905dc8013383aef0cf98b1bea

isoToken was not altered in this commit but is correct. A copying error was made when setting up the audit repo originally.

https://github.com/kree-dotcom/isomorph/blob/4fc80e6178204691a365f656908c278d5faf4f88/contracts/isoUSDToken.sol#L10

0x00052

Fixes look good. Delay is now 2 days instead of 200 seconds

The original report as published on Sherlock, by wagmi. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a copying or configuration error when setting up the audit repository, where the constants were given values in seconds rather than the intended days.

Impact

Admin settings could be updated with only a very short delay, so users would not have enough time to react properly.

What the attacker needed

None

The fix

The constants were fixed to use the intended delays (2 days instead of 200 seconds), and the isoUSD token constant was confirmed correct in the actual code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Smart contracts often have a waiting period before certain admin changes take effect, so users have time to notice and react. Here, two of those waiting periods were set to a few seconds instead of days, making the protection almost useless.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by wagmi

View all

2 more disclosed reports, best first.

More from Isomorph

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.