-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[VRF-567] Mercury price feed registry #10348
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
Go solidity wrappers are out-of-date, regenerate them via the |
2 similar comments
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
1374829
to
71e87f8
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
| Key Contracts: | | ||
| - `MercuryRegistry.sol` - stores price feed data and implements core logic. | | ||
| - `MercuryRegistryBatchUpkeep.sol` - enables batching for the registry. | | ||
| - `MercuryRegistry.t.soll` - contains foundry tests to demonstrate various flows. | |
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.
typo soll
| off-chain feed data. | | ||
| - Fetch batches of price data. All price feed data is held on the same contract, so a contract that needs | | ||
| multiple sets of feed data can fetch them while paying for only one external call. | | ||
| - Scalabiliy. Feeds can be added or removed from the contract with a single contract call, and the number of | |
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.
typo scalability
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.
this lib is great for arb!
(bytes[] memory values /* bytes memory lookupData */, ) = abi.decode(performData, (bytes[], bytes)); | ||
for (uint256 i = 0; i < values.length; i++) { | ||
// Verify and decode report. | ||
i_verifier.verify(values[i]); |
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.
can we use the response from verify function
// Helper function to reconcile a difference in formatting: | ||
// - Automation passes feedId into their off-chain lookup function as a string. | ||
// - Mercury stores feedId in their reports as a bytes32. | ||
function bytes32ToHextString(bytes memory buffer) internal pure returns (string memory) { |
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.
typo Hext
contracts/src/v0.8/dev/automation/upkeeps/MercuryRegistryBatchUpkeep.sol
Outdated
Show resolved
Hide resolved
a6d3ddd
to
c8a56ca
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
2 similar comments
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
485520f
to
c132210
Compare
b7063d1
to
60f51e0
Compare
Go solidity wrappers are out-of-date, regenerate them via the |
| TODO: | | ||
| - Optimize gas consumption. | | ||
-+---------------------------------------------------------------------------------------------------------------------*/ | ||
contract MercuryRegistry is ConfirmedOwner, AutomationCompatibleInterface, StreamsLookupCompatibleInterface { |
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.
can we add a comment somewhere to indicate that this only works with mercury v0.2?
for mercury v0.3, certain feeds still have the same report schema but some are different (timestamp feeds)
and verify function will take different params..
SonarQube Quality Gate |
This implementation allows for an on-chain registry of price feed data to be maintained and updated by Automation nodes.
The upkeep provides the following advantages:
off-chain feed data.
multiple sets of feed data can fetch them while paying for only one external call.
feeds that the registry can store is unbounded.
Key Contracts:
MercuryRegistry.sol
- stores price feed data and implements core logic.MercuryRegistryBatchUpkeep.sol
- enables batching for the registry.MercuryRegistry.t.sol
- contains foundry tests to demonstrate various flows.Example deployment to Arbitrum Goerli: https://goerli.arbiscan.io/address/0xf3219b8b80f3cce2b900abe0a88330fccd785f4b