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

[SC-885] OraclePrices library #75

Merged
merged 13 commits into from
Aug 10, 2023
Merged

[SC-885] OraclePrices library #75

merged 13 commits into from
Aug 10, 2023

Conversation

zZoMROT
Copy link
Contributor

@zZoMROT zZoMROT commented Aug 4, 2023

Expand thresholdFilter logic to separate library and add it to Oracles

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2023

Codecov Report

Patch coverage: 88.48% and project coverage change: -0.49% ⚠️

Comparison is base (5148935) 78.31% compared to head (ceed420) 77.83%.
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
- Coverage   78.31%   77.83%   -0.49%     
==========================================
  Files          26       26              
  Lines         738      731       -7     
  Branches      167      156      -11     
==========================================
- Hits          578      569       -9     
- Misses        160      162       +2     
Files Changed Coverage Δ
contracts/MultiWrapper.sol 72.34% <ø> (+1.22%) ⬆️
contracts/oracles/SolidlyOracle.sol 0.00% <0.00%> (ø)
contracts/oracles/SolidlyOracleNoCreate2.sol 0.00% <0.00%> (ø)
contracts/oracles/UniswapV3LikeOracle.sol 96.42% <90.00%> (ø)
contracts/OffchainOracle.sol 74.15% <100.00%> (-6.51%) ⬇️
contracts/libraries/OraclePrices.sol 100.00% <100.00%> (ø)
contracts/oracles/ChainlinkOracle.sol 100.00% <100.00%> (ø)
contracts/oracles/CurveOracle.sol 74.28% <100.00%> (ø)
contracts/oracles/DodoOracle.sol 100.00% <100.00%> (ø)
contracts/oracles/DodoV2Oracle.sol 97.29% <100.00%> (-0.08%) ⬇️
... and 4 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 50 to 56
OraclePrice[] memory oraclePrices;
assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
oraclePrices := mload(0x40)
mstore(0x40, add(oraclePrices, add(0x20, mul(maxArrLength, 0x40))))
mstore(oraclePrices, maxArrLength)
}
data = Data(0, 0, oraclePrices);
Copy link
Member

@ZumZoom ZumZoom Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OraclePrice[] memory oraclePrices;
assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
oraclePrices := mload(0x40)
mstore(0x40, add(oraclePrices, add(0x20, mul(maxArrLength, 0x40))))
mstore(oraclePrices, maxArrLength)
}
data = Data(0, 0, oraclePrices);
assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
data := mload(0x40)
mstore(0x40, add(data, add(0x80, mul(maxArrLength, 0x40))))
mstore(add(data, 0x00), 0)
mstore(add(data, 0x20), 0)
mstore(add(data, 0x40), add(data, 0x60))
mstore(add(data, 0x60), maxArrLength)
}

@zZoMROT zZoMROT merged commit e836f73 into master Aug 10, 2023
@zZoMROT zZoMROT deleted the feature/oracles-threshold branch August 10, 2023 13:50
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.

4 participants