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

feat: mutable unlockers controller and factory #9

Merged
merged 15 commits into from
May 20, 2024
Merged

Conversation

mrice32
Copy link
Member

@mrice32 mrice32 commented May 15, 2024

This PR includes:

  • The "standard" oval instantiations for Chainlink, Chronicle, and Pyth.
  • Factories for each.
  • A PermissionProxy contract that delegates permissions to other addresses.
  • A controller with mutable unlockers, but everything else immutable. We think this will be the standard controller that integrations use.

mrice32 added 2 commits May 15, 2024 03:04
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
mrice32 pushed a commit that referenced this pull request May 16, 2024
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
@@ -14,7 +14,7 @@ contract TestImmutableController is ImmutableController, MockSourceAdapter, Base
{}
}

contract OvalUnlockLatestValue is CommonTest {
contract ImmutableControllerTest is CommonTest {
Copy link
Member

Choose a reason for hiding this comment

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

I fixed this. the naming was wrong and we had silly tests in here that dont make sence.

mrice32 added 4 commits May 18, 2024 13:38
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
@mrice32 mrice32 changed the title [DRAFT] feat: mutable unlockers controller and factory feat: mutable unlockers controller and factory May 18, 2024
@mrice32 mrice32 requested a review from chrismaree May 18, 2024 18:34
@mrice32 mrice32 marked this pull request as ready for review May 18, 2024 18:35
@mrice32 mrice32 requested review from Reinis-FRP and md0x May 18, 2024 18:35
mrice32 added 4 commits May 18, 2024 19:37
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
mrice32 and others added 2 commits May 20, 2024 03:56
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com>
Co-authored-by: Pablo Maldonado <pablo@umaproject.org>
@mrice32 mrice32 requested review from md0x and Reinis-FRP May 20, 2024 07:58
revert SenderNotApproved(msg.sender);
}

(bool success, bytes memory returnData) = target.call{value: value}(callData);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need generic execute with low level call? If this is intended only to extend unlocker permission, why not simplify it here to only forward the unlockLatestValue call to target oval instance?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just figured it would be better to make it more general in case we wanted to use this functionality elsewhere.

For instance, if there were a redstone feed that only Oval was allowed to push prices to, this might be useful there as well.

@mrice32 mrice32 requested a review from Reinis-FRP May 20, 2024 08:12
Copy link
Collaborator

@md0x md0x left a comment

Choose a reason for hiding this comment

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

Looks good.
I just left some questions about the customization of the Oval instances if this is something we want to allow or could need in the future.

);

constructor(uint256 maxTraversal, address[] memory _defaultUnlockers) {
MAX_TRAVERSAL = maxTraversal;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we call it defaultMaxTraversal and have a setter for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really see max traversal changing that often for a particular oracle type. If it were to change, I think it would be acceptable to just move to a new factory.

src/factories/StandardChainlinkFactory.sol Outdated Show resolved Hide resolved
* for the Oval auction to be run and, thus, the maximum time that prices will be delayed.
* @return oval deployed oval address.
*/
function create(IAggregatorV3Source source, uint256 lockWindow) external returns (address oval) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think there could be cases where someone wants to create an Oval instance with a different list of unlockers than the defaultUnlockers or max traversal?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we want official Oval deployments to have the same unlocker setup, whereby default unlockers managed by Risk Labs are used.

I don't think these factories are intended for nonstandard deployments, but you can always do a custom deployment if you want that!

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
@mrice32 mrice32 merged commit e52f84a into master May 20, 2024
3 checks passed
@mrice32 mrice32 deleted the mutable_unlockers branch May 20, 2024 08:37
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