-
Notifications
You must be signed in to change notification settings - Fork 0
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
Сomet with extended asset list #53
base: main
Are you sure you want to change the base?
Conversation
contracts/AssetList.sol
Outdated
constructor(CometConfiguration.AssetConfig[] memory assetConfigs) { | ||
uint8 _numAssets = uint8(assetConfigs.length); | ||
numAssets = _numAssets; | ||
for (uint i = 0; i < _numAssets; i++) { | ||
(uint256 asset_a, uint256 asset_b) = getPackedAssetInternal(assetConfigs, i); | ||
assets_a.push(asset_a); | ||
assets_b.push(asset_b); | ||
} | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning
contracts/AssetList.sol
Outdated
constructor(CometConfiguration.AssetConfig[] memory assetConfigs) { | ||
uint8 _numAssets = uint8(assetConfigs.length); | ||
numAssets = _numAssets; | ||
for (uint i = 0; i < _numAssets; i++) { | ||
(uint256 asset_a, uint256 asset_b) = getPackedAssetInternal(assetConfigs, i); | ||
assets_a.push(asset_a); | ||
assets_b.push(asset_b); | ||
} | ||
} |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.non-payable-constructor Note
…are/collateral-extension
…tware/comet into woof-software/collateral-extension
…xtension-audit-fix Audit fixes to collateral extension
|
||
uint startGas = gasleft(); | ||
accrueInternal(); | ||
for (uint i = 0; i < accounts.length; ) { |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.array-length-outside-loop Note
accrueInternal(); | ||
for (uint i = 0; i < accounts.length; ) { | ||
absorbInternal(absorber, accounts[i]); | ||
unchecked { i++; } |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note
The prefix increment expression is cheaper in terms of gas.
// Using gas price instead of base fee would more accurately reflect spend, | ||
// but is also subject to abuse if refunds were to be given automatically. | ||
LiquidatorPoints memory points = liquidatorPoints[absorber]; | ||
points.numAbsorbs++; |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note
The prefix increment expression is cheaper in terms of gas.
uint8 _reserved = accountUser._reserved; | ||
|
||
uint256 basePrice = getPrice(baseTokenPriceFeed); | ||
uint256 deltaValue = 0; |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.init-variables-with-default-value Note
Explicitly initializing a variable with its default value costs unnecessary gas.
|
||
emit AbsorbCollateral(absorber, account, asset, seizeAmount, value); | ||
} | ||
unchecked { i++; } |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note
The prefix increment expression is cheaper in terms of gas.
if (isBuyPaused()) revert Paused(); | ||
|
||
int reserves = getReserves(); | ||
if (reserves >= 0 && uint(reserves) >= targetReserves) revert NotForSale(); |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-nested-if Note
There are more advantages, such as easier to read code and better coverage reports.
|
||
const { timelock } = await deploymentManager.getContracts(); | ||
// impersonate the timelock | ||
await deploymentManager.hre.network.provider.request({ |
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.
remove
No description provided.