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

Global optimistic auction rebalance extension #154

Merged

Conversation

snake-poison
Copy link
Contributor

@snake-poison snake-poison commented Oct 31, 2023

@coveralls
Copy link

coveralls commented Oct 31, 2023

Coverage Status

coverage: 46.877% (-30.4%) from 77.323%
when pulling 0635ef6 on snakepoison/GlobalOptimisticAuctionRebalanceExtension
into ec7ce83 on master.

Copy link
Contributor Author

@snake-poison snake-poison left a comment

Choose a reason for hiding this comment

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

Should add some internal functions that would DRY the contract a bit

Should also add some events.

require(assertionId != bytes32(0), "Proposal hash does not exist");

delete assertionIds[proposalHash];
delete proposalHashes[assertionId];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

missed removing the assertedProducts here. probably a good idea to make an internal function that unsets these..

Copy link
Contributor

Choose a reason for hiding this comment

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

bump to resolve @snake-poison

if (msg.sender == address(settings.optimisticParams.optimisticOracleV3)) {
// Delete the disputed proposal and associated assertionId.
delete assertionIds[proposalHash];
delete proposalHashes[assertionId];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

missed removing the assertedProducts here. probably a good idea to make an internal function that unsets these..

/* ============ External Functions ============ */

/**
* @dev OPERATOR ONLY: sets product settings for a given quote asset
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @dev OPERATOR ONLY: sets product settings for a given quote asset
* @dev OPERATOR ONLY: sets product settings for a given set token

Comment on lines 176 to 183



uint256 minimumBond = settings.optimisticParams.optimisticOracleV3.getMinimumBond(address(settings.optimisticParams.collateral));
uint256 totalBond = minimumBond > settings.optimisticParams.bondAmount ? minimumBond : settings.optimisticParams.bondAmount;

settings.optimisticParams.collateral.safeTransferFrom(msg.sender, address(this), totalBond);
settings.optimisticParams.collateral.safeIncreaseAllowance(address(settings.optimisticParams.optimisticOracleV3), totalBond);
Copy link
Contributor

Choose a reason for hiding this comment

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

lets clean this up with some internal functions

Copy link
Collaborator

@ckoopmann ckoopmann left a comment

Choose a reason for hiding this comment

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

Good stuff.
Mostly added questions for my own understanding.
Also might be worth to review all the docstrings at the end to make sure they align with the function implementations.

@snake-poison snake-poison force-pushed the snakepoison/GlobalOptimisticAuctionRebalanceExtension branch from 07cb344 to c633ed5 Compare November 22, 2023 00:31
@snake-poison snake-poison force-pushed the snakepoison/GlobalOptimisticAuctionRebalanceExtension branch from 08cdb1b to 0472543 Compare November 22, 2023 00:47
@snake-poison snake-poison marked this pull request as ready for review November 22, 2023 03:24
Copy link
Collaborator

@ckoopmann ckoopmann left a comment

Choose a reason for hiding this comment

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

LGTM! Great Work 🚀

@ckoopmann ckoopmann merged commit d5ab030 into master Nov 23, 2023
2 checks passed
@ckoopmann ckoopmann deleted the snakepoison/GlobalOptimisticAuctionRebalanceExtension branch November 23, 2023 03:47
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