Skip to content

Commit

Permalink
✨ fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Oct 25, 2024
1 parent f30567c commit 08303a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
15 changes: 11 additions & 4 deletions src/AuctionFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "@openzeppelin/contracts/proxy/Clones.sol";
/// @title Auction Factory Contract for USDC-KWENTA Auctions
/// @author Flocqst ([email protected])
contract AuctionFactory {

/// @notice Kwenta owned/operated multisig address that
/// can authorize upgrades
/// @dev making immutable because the pDAO address
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions test/KSXVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down Expand Up @@ -120,14 +124,15 @@ contract KSXVaultDepositMintTest is KSXVaultTest {
// assertEq(depositToken.balanceOf(alice), 10 ether);
vm.stopPrank();
}

}

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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 08303a3

Please sign in to comment.