-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: feature/mint
Are you sure you want to change the base?
Conversation
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.
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 { |
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 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.
src/KSXVault.sol
Outdated
/// @notice Starts the auction with the USDC balance of the vault | ||
/// @param _startingBid The starting bid for the auction |
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.
_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
if (!isAuctionReady()) { | ||
revert AuctionNotReady(); | ||
} |
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.
You can remove this and make function internal
as the check will be performed in the modifier.
No description provided.