diff --git a/src/AuctionFactory.sol b/src/AuctionFactory.sol index e55a7ca..1df0729 100644 --- a/src/AuctionFactory.sol +++ b/src/AuctionFactory.sol @@ -7,6 +7,7 @@ import "@openzeppelin/contracts/proxy/Clones.sol"; /// @title Auction Factory Contract for USDC-KWENTA Auctions /// @author Flocqst (florian@kwenta.io) contract AuctionFactory { + /// @notice Kwenta owned/operated multisig address that /// can authorize upgrades /// @dev making immutable because the pDAO address @@ -48,9 +49,11 @@ contract AuctionFactory { _; } - /// @notice Constructs the AuctionFactory with the address of the auction implementation contract + /// @notice Constructs the AuctionFactory with the address of the auction + /// implementation contract /// @param _pDAO Kwenta owned/operated multisig address - /// @param _auctionImplementation The address of the auction implementation contract + /// @param _auctionImplementation The address of the auction implementation + /// contract constructor(address _pDAO, address _auctionImplementation) { pDAO = _pDAO; auctionImplementation = _auctionImplementation; @@ -63,13 +66,17 @@ contract AuctionFactory { /// @param _kwenta The address for the KWENTA ERC20 token /// @param _startingBid The starting bid amount /// @return newAuction The newly created auction contract - /// @dev The newly created auction contract is initialized and added to the auctions array and returned + /// @dev The newly created auction contract is initialized and added to the + /// auctions array and returned function createAuction( address _owner, address _usdc, address _kwenta, uint256 _startingBid - ) external returns (Auction newAuction) { + ) + external + returns (Auction newAuction) + { address clone = Clones.clone(auctionImplementation); Auction(clone).initialize( _owner, _usdc, _kwenta, _startingBid, bidBuffer diff --git a/test/KSXVault.t.sol b/test/KSXVault.t.sol index 327dcfd..d89865f 100644 --- a/test/KSXVault.t.sol +++ b/test/KSXVault.t.sol @@ -22,8 +22,10 @@ contract KSXVaultTest is Bootstrap { depositToken = new MockERC20("Deposit Token", "DT"); mockUSDC = new MockERC20("USDC", "USDC"); stakingRewards = new MockStakingRewards(address(depositToken)); - auctionImplementation = new Auction(address(this), address(0), address(0), 100, 100); - auctionFactory = new AuctionFactory(PDAOADDR, address(auctionImplementation)); + auctionImplementation = + new Auction(address(this), address(0), address(0), 100, 100); + auctionFactory = + new AuctionFactory(PDAOADDR, address(auctionImplementation)); vm.prank(address(PDAOADDR)); auctionFactory.updateBidBuffer(BID_BUFFER); initializeLocal( @@ -44,9 +46,11 @@ contract KSXVaultTest is Bootstrap { vm.prank(address(ksxVault)); depositToken.approve(address(stakingRewards), type(uint256).max); } + } contract KSXVaultDepositMintTest is KSXVaultTest { + // Asserts decimals offset is correctly set to 3 function test_vault_decimalsOffset() public { assertEq(ksxVault.decimalOffset(), 3); @@ -120,6 +124,7 @@ contract KSXVaultDepositMintTest is KSXVaultTest { // assertEq(depositToken.balanceOf(alice), 10 ether); vm.stopPrank(); } + } contract KSXVaultAuctionTest is KSXVaultTest { @@ -127,7 +132,7 @@ contract KSXVaultAuctionTest is KSXVaultTest { function test_isAuctionReady() public { vm.warp(DEFAULT_START_TIME); assertEq(ksxVault.isAuctionReady(), false); - + vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION - 1); assertEq(ksxVault.isAuctionReady(), false); vm.warp(block.timestamp + 1); @@ -171,7 +176,8 @@ contract KSXVaultAuctionTest is KSXVaultTest { function test_isAuctionReady_before_start_fuzz(uint128 time) public { /// @dev using lastAuctionStartTime to get the startTime because /// startTime is private - uint256 timeBeforeInitialStart = ksxVault.lastAuctionStartTime() - block.timestamp; + uint256 timeBeforeInitialStart = + ksxVault.lastAuctionStartTime() - block.timestamp; assertEq(timeBeforeInitialStart, DEFAULT_START_TIME - 1); vm.assume(time < timeBeforeInitialStart);