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

Add auction start functionality to vault #4

Open
wants to merge 43 commits into
base: feature/mint
Choose a base branch
from

Conversation

cmontecoding
Copy link

No description provided.

@cmontecoding cmontecoding marked this pull request as draft October 17, 2024 19:27
@cmontecoding cmontecoding requested a review from Flocqst October 18, 2024 14:14
@cmontecoding cmontecoding marked this pull request as ready for review October 18, 2024 14:15
@cmontecoding cmontecoding marked this pull request as draft October 25, 2024 02:07
@cmontecoding cmontecoding marked this pull request as ready for review October 28, 2024 16:15
Copy link
Collaborator

@Flocqst Flocqst left a comment

Choose a reason for hiding this comment

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

Nice work, starting logic is good but it is still missing small adjustment for starting the auction automatically on vault operations.

Tests will have to be adapted slightly once new logic is in.

src/KSXVault.sol Outdated

/// @notice Starts the auction with the USDC balance of the vault
/// @param _startingBid The starting bid for the auction
function createAuction(uint256 _startingBid) public {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be performed on vault operations (deposit/redeem) when possible so that no one has to call the auction manually.

What you should be doing instead is having a modifier, something like that for instance :

modifier checkAuction() {
    if (isAuctionReady()) {
        createAuction();
    }
    _;
}

and add it to the deposit/redeem functions.

test/KSXVault.t.sol Show resolved Hide resolved
src/KSXVault.sol Outdated
Comment on lines 141 to 142
/// @notice Starts the auction with the USDC balance of the vault
/// @param _startingBid The starting bid for the auction
Copy link
Collaborator

Choose a reason for hiding this comment

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

_startingBid logic should be handled directly in the auction factory, KSX vault should only have "vault logic" and the logic to start auction. (same as bidBuffer).

src/KSXVault.sol Outdated
Comment on lines 144 to 146
if (!isAuctionReady()) {
revert AuctionNotReady();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can remove this and make function internal as the check will be performed in the modifier.

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.

2 participants