Add auction start functionality to vault#4
Add auction start functionality to vault#4cmontecoding wants to merge 43 commits intofeature/mintfrom
Conversation
Flocqst
left a comment
There was a problem hiding this comment.
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.
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.
_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.
You can remove this and make function internal as the check will be performed in the modifier.
No description provided.