Skip to content

Commit

Permalink
test: dumper auction
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 24, 2024
1 parent 48dde2b commit adf804e
Show file tree
Hide file tree
Showing 3 changed files with 465 additions and 4 deletions.
23 changes: 23 additions & 0 deletions script/DeployAuction.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.18;

import "./BaseScript.s.sol";

// Deploy a contract to a deterministic address with create2
contract DeployAprOracle is BaseScript {

function run() external {
vm.startBroadcast();

// Get the bytecode
bytes memory bytecode = vm.getCode("DumperAuctionFactory.sol:DumperAuctionFactory");

bytes32 salt;

address contractAddress = deployer.deployCreate2(salt, bytecode);

console.log("Address is ", contractAddress);

vm.stopBroadcast();
}
}
13 changes: 9 additions & 4 deletions src/Auctions/DumperAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ contract DumperAuction is Governance2Step, ReentrancyGuard {

function available(address _from) external view virtual returns (uint256) {
if (auctions[_from].kicked + auctionLength > block.timestamp) {
return auctions[_from].initialAvailable;
return auctions[_from].currentAvailable;
}
return 0;
}
Expand All @@ -141,10 +141,15 @@ contract DumperAuction is Governance2Step, ReentrancyGuard {
}

/**
* @notice Get the length of the enabled auctions array.
* @notice Get all the enabled auctions.
*/
function numberOfEnabledAuctions() external view virtual returns (uint256) {
return enabledAuctions.length;
function getAllEnabledAuctions()
external
view
virtual
returns (address[] memory)
{
return enabledAuctions;
}

/**
Expand Down
Loading

0 comments on commit adf804e

Please sign in to comment.