Skip to content

Conversation

@totomanov
Copy link
Contributor

@totomanov totomanov commented Mar 28, 2024

This PR implements the following:

  • FeedRegistry.sol, a Governable contract that holds a mapping (base,quote) -> FeedIdentifier.
  • FeedIdentifier.sol, a library that wraps address/bytes32 in the same data type. This is necessary because the registry for Chainlink and Chronicle stores addresses, while the registry for Pyth and Redstone stores bytes32s.
  • `OracleFactory.sol, a common interface for oracle factories.
  • BaseAdapterFactory.sol, an abstract base contract for oracle factories.
  • 4 adapter factories for Chainlink, Chronicle, Pyth and Redstone
  • OracleMultiFactory.sol, a Governable meta-factory. It maintains a mapping of enabled factories and records all deployed oracles.
  • Tests for all of the above. Some improvements (mostly refactoring) to existing tests

IOracleFactory

interface IOracleFactory {
    struct DeploymentInfo {
        address deployer;
        uint48 deployedAt;
    }
    function deploy(address base, address quote, bytes calldata extraData) external returns (address);
    function deployments(address oracle) external view returns (address, uint48);
}
  • extraData contains abi-encoded extra deployment parameters e.g. maxStaleness.

OracleMultiFactory

  • governor can enable and disabled an IOracleFactory
  • governor can set a singleton oracle e.g. LidoOracle to the deployments
  • user/product line can deploy an oracle through the allowed factories
  • user/product line can verify that an oracle is deployed by one of the enabled factories

@totomanov totomanov self-assigned this Mar 28, 2024
@totomanov
Copy link
Contributor Author

Closing for now. Factories are out of scope for this repo.

@totomanov totomanov closed this Apr 5, 2024
@totomanov totomanov deleted the review-factories branch May 17, 2024 10:07
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.

3 participants