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

juancito - ethOracle is not defined in StableOracleDAI making getPriceUSD always revert #93

Closed
sherlock-admin opened this issue May 23, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented May 23, 2023

juancito

medium

ethOracle is not defined in StableOracleDAI making getPriceUSD always revert

Summary

ethOracle is not defined in StableOracleDAI making getPriceUSD always revert, preventing minting tokens with DAI as collateral.

Vulnerability Detail

The ethOracle is not defined:

    ethOracle = IStableOracle(0x0000000000000000000000000000000000000000); // TODO: WETH oracle price

Link to code

It tries to use it when calculating the usd price, so it will always revert:

    uint256 wethPriceUSD = ethOracle.getPriceUSD();

Link to code

The price is used when trying to mint USSD tokens on the USSD contract. So, it is impossible to use this oracle for that purpose.

Impact

StableOracleDAI::getPriceUSD() will always revert.

It will not be possible to mint USSD tokens with DAI as collateral, due to the getPriceUSD function reverting when trying to do it.

Code Snippet

Tool used

Manual Review

Recommendation

Allow the constructor to receive the address of the expected oracle, like it is implemented in StableOracleWBGL.sol:

-   constructor() {
+   constructor(address _WETHoracle) {
+       ethOracle = IStableOracle(_WETHoracle);

Duplicate of #817

@github-actions github-actions bot closed this as completed Jun 5, 2023
@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 5, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant