Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

hansfriese - Wrong constants for time delay #231

Open
github-actions bot opened this issue Dec 11, 2022 · 2 comments
Open

hansfriese - Wrong constants for time delay #231

github-actions bot opened this issue Dec 11, 2022 · 2 comments

Comments

@github-actions
Copy link

hansfriese

medium

Wrong constants for time delay

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.

    uint256 constant ISOUSD_TIME_DELAY = 3; // days;

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

    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.

@kree-dotcom
Copy link

kree-dotcom commented Dec 12, 2022

Fixed kree-dotcom/isomorph@4fc80e6 , corrected missing semicolon here kree-dotcom/isomorph@9bad274

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

@IAm0x52
Copy link
Collaborator

IAm0x52 commented Jan 7, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants