Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Mantle USDe market #85

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

MishaShWoof
Copy link
Collaborator

No description provided.

error InvalidInt256();

/// @notice Version of the price feed
uint public constant override version = 1;

Check warning

Code scanning / Semgrep OSS

A constant name is not in UPPER_CASE like other constant variables. Warning

A constant name is not in UPPER_CASE like other constant variables.
Comment on lines +39 to +51
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) {
underlyingPriceFeed = underlyingPriceFeed_;
decimals = decimals_;
description = description_;

uint8 underlyingPriceFeedDecimals = AggregatorV3Interface(underlyingPriceFeed_).decimals();
// Note: Solidity does not allow setting immutables in if/else statements
shouldUpscale = underlyingPriceFeedDecimals < decimals_ ? true : false;
rescaleFactor = (shouldUpscale
? signed256(10 ** (decimals_ - underlyingPriceFeedDecimals))
: signed256(10 ** (underlyingPriceFeedDecimals - decimals_))
);
}

Check warning

Code scanning / Semgrep OSS

There're no sanity checks for the constructor argument decimals_. Warning

There're no sanity checks for the constructor argument decimals_.
Comment on lines +39 to +51
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) {
underlyingPriceFeed = underlyingPriceFeed_;
decimals = decimals_;
description = description_;

uint8 underlyingPriceFeedDecimals = AggregatorV3Interface(underlyingPriceFeed_).decimals();
// Note: Solidity does not allow setting immutables in if/else statements
shouldUpscale = underlyingPriceFeedDecimals < decimals_ ? true : false;
rescaleFactor = (shouldUpscale
? signed256(10 ** (decimals_ - underlyingPriceFeedDecimals))
: signed256(10 ** (underlyingPriceFeedDecimals - decimals_))
);
}

Check warning

Code scanning / Semgrep OSS

There're no sanity checks for the constructor argument description_. Warning

There're no sanity checks for the constructor argument description_.
Comment on lines +39 to +51
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) {
underlyingPriceFeed = underlyingPriceFeed_;
decimals = decimals_;
description = description_;

uint8 underlyingPriceFeedDecimals = AggregatorV3Interface(underlyingPriceFeed_).decimals();
// Note: Solidity does not allow setting immutables in if/else statements
shouldUpscale = underlyingPriceFeedDecimals < decimals_ ? true : false;
rescaleFactor = (shouldUpscale
? signed256(10 ** (decimals_ - underlyingPriceFeedDecimals))
: signed256(10 ** (underlyingPriceFeedDecimals - decimals_))
);
}

Check warning

Code scanning / Semgrep OSS

There're no sanity checks for the constructor argument underlyingPriceFeed_. Warning

There're no sanity checks for the constructor argument underlyingPriceFeed_.
Comment on lines +39 to +51
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) {
underlyingPriceFeed = underlyingPriceFeed_;
decimals = decimals_;
description = description_;

uint8 underlyingPriceFeedDecimals = AggregatorV3Interface(underlyingPriceFeed_).decimals();
// Note: Solidity does not allow setting immutables in if/else statements
shouldUpscale = underlyingPriceFeedDecimals < decimals_ ? true : false;
rescaleFactor = (shouldUpscale
? signed256(10 ** (decimals_ - underlyingPriceFeedDecimals))
: signed256(10 ** (underlyingPriceFeedDecimals - decimals_))
);
}

Check warning

Code scanning / Semgrep OSS

Consider making costructor payable to save gas. Warning

Consider making costructor payable to save gas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants