-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add mETH as collateral to USDT market on Mainnet #918
base: main
Are you sure you want to change the base?
Add mETH as collateral to USDT market on Mainnet #918
Conversation
constructor(address mETHRateProvider, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = mETHRateProvider; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 mETHRateProviderDecimals = 18; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = mETHRateProviderDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - mETHRateProviderDecimals)) | ||
: signed256(10 ** (mETHRateProviderDecimals - decimals_)) | ||
); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks
constructor(address mETHRateProvider, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = mETHRateProvider; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 mETHRateProviderDecimals = 18; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = mETHRateProviderDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - mETHRateProviderDecimals)) | ||
: signed256(10 ** (mETHRateProviderDecimals - decimals_)) | ||
); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks
constructor(address mETHRateProvider, uint8 decimals_, string memory description_) { | ||
underlyingPriceFeed = mETHRateProvider; | ||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
|
||
uint8 mETHRateProviderDecimals = 18; | ||
// Note: Solidity does not allow setting immutables in if/else statements | ||
shouldUpscale = mETHRateProviderDecimals < decimals_ ? true : false; | ||
rescaleFactor = (shouldUpscale | ||
? signed256(10 ** (decimals_ - mETHRateProviderDecimals)) | ||
: signed256(10 ** (mETHRateProviderDecimals - decimals_)) | ||
); | ||
} |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.non-payable-constructor
…of-software/comet into woof-software/add-meth-to-mainnet-usdt
…are/add-meth-to-mainnet-usdt
…are/comet into woof-software/add-meth-to-mainnet-usdt
…are/comet into woof-software/add-meth-to-mainnet-usdt
…are/comet into woof-software/add-meth-to-mainnet-usdt
…ub.com/woof-software/comet into woof-software/add-meth-to-mainnet-usdt
No description provided.