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

Deploy WETH market on Optimism #33

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

Conversation

MishaShWoof
Copy link
Collaborator

No description provided.

Comment on lines +49 to +61
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) {
priceFeedA = priceFeedA_;
priceFeedB = priceFeedB_;
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals();
uint8 priceFeedBDecimals = AggregatorV3Interface(priceFeedB_).decimals();
priceFeedAScale = signed256(10 ** (priceFeedADecimals));
priceFeedBScale = signed256(10 ** (priceFeedBDecimals));

if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;
priceFeedScale = int256(10 ** decimals);
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument description_.
Comment on lines +49 to +61
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) {
priceFeedA = priceFeedA_;
priceFeedB = priceFeedB_;
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals();
uint8 priceFeedBDecimals = AggregatorV3Interface(priceFeedB_).decimals();
priceFeedAScale = signed256(10 ** (priceFeedADecimals));
priceFeedBScale = signed256(10 ** (priceFeedBDecimals));

if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;
priceFeedScale = int256(10 ** decimals);
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument priceFeedA_.
Comment on lines +49 to +61
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) {
priceFeedA = priceFeedA_;
priceFeedB = priceFeedB_;
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals();
uint8 priceFeedBDecimals = AggregatorV3Interface(priceFeedB_).decimals();
priceFeedAScale = signed256(10 ** (priceFeedADecimals));
priceFeedBScale = signed256(10 ** (priceFeedBDecimals));

if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;
priceFeedScale = int256(10 ** decimals);
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument priceFeedB_.
Comment on lines +49 to +61
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) {
priceFeedA = priceFeedA_;
priceFeedB = priceFeedB_;
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals();
uint8 priceFeedBDecimals = AggregatorV3Interface(priceFeedB_).decimals();
priceFeedAScale = signed256(10 ** (priceFeedADecimals));
priceFeedBScale = signed256(10 ** (priceFeedBDecimals));

if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;
priceFeedScale = int256(10 ** decimals);
}

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.non-payable-constructor Note

Consider making costructor payable to save gas.
Comment on lines +40 to +53
constructor(address ezETHRateProvider, uint8 decimals_, string memory description_) {
underlyingPriceFeed = ezETHRateProvider;
if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;

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

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument description_.
Comment on lines +40 to +53
constructor(address ezETHRateProvider, uint8 decimals_, string memory description_) {
underlyingPriceFeed = ezETHRateProvider;
if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;

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

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument ezETHRateProvider.
Comment on lines +40 to +53
constructor(address ezETHRateProvider, uint8 decimals_, string memory description_) {
underlyingPriceFeed = ezETHRateProvider;
if (decimals_ > 18) revert BadDecimals();
decimals = decimals_;
description = description_;

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

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.non-payable-constructor Note

Consider making costructor payable to save gas.
uint256 updatedAt,
uint80 answeredInRound
) {
uint256 rate = IBalancerRateProvider(underlyingPriceFeed).getRate();

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.security.balancer-readonly-reentrancy-getrate Error

IBalancerRateProvider(underlyingPriceFeed).getRate() call on a Balancer pool is not protected from the read-only reentrancy.
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