-
Notifications
You must be signed in to change notification settings - Fork 151
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
Update pricefeeds for rsETH and weETH on Mainnet WETH market #878
Update pricefeeds for rsETH and weETH on Mainnet WETH market #878
Conversation
… need to update them to new ones
…w to pass all the scenarios to not waiting till ezETH PR merging into main branch
To merge after conflicts resolve |
…are/update-pricefeeds-for-rseth-and-weeth-on-mainnet-weth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
constructor(address underlyingPriceFeed_, uint8 decimals_, uint8 underlyingDecimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 priceFeedDecimals = underlyingDecimals_; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = priceFeedDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - priceFeedDecimals)) | ||
: signed256(10 ** (priceFeedDecimals - decimals_)) | ||
); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
constructor(address underlyingPriceFeed_, uint8 decimals_, uint8 underlyingDecimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 priceFeedDecimals = underlyingDecimals_; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = priceFeedDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - priceFeedDecimals)) | ||
: signed256(10 ** (priceFeedDecimals - decimals_)) | ||
); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
constructor(address underlyingPriceFeed_, uint8 decimals_, uint8 underlyingDecimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 priceFeedDecimals = underlyingDecimals_; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = priceFeedDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - priceFeedDecimals)) | ||
: signed256(10 ** (priceFeedDecimals - decimals_)) | ||
); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
constructor(address underlyingPriceFeed_, uint8 decimals_, uint8 underlyingDecimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 priceFeedDecimals = underlyingDecimals_; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = priceFeedDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - priceFeedDecimals)) | ||
: signed256(10 ** (priceFeedDecimals - decimals_)) | ||
); | ||
} |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.non-payable-constructor Note
uint256 updatedAt, | ||
uint80 answeredInRound | ||
) { | ||
uint256 rate = IRateProvider(underlyingPriceFeed).getRate(); |
Check failure
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.security.balancer-readonly-reentrancy-getrate Error
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 underlyingPriceFeedDecimals = 18; | ||
// 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
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 underlyingPriceFeedDecimals = 18; | ||
// 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
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
constructor(address underlyingPriceFeed_, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = underlyingPriceFeed_; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 underlyingPriceFeedDecimals = 18; | ||
// 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 notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.non-payable-constructor Note
No description provided.