Skip to content
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

fix: hook getter #40

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script/DeployAuctionFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract DeployAuctionFactory is Script {
// Pick an unique salt
bytes32 salt = keccak256("Auction Factory");

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

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

Expand All @@ -29,7 +29,7 @@ contract DeployAuctionFactory is Script {
interface Deployer {
event ContractCreation(address indexed newContract, bytes32 indexed salt);

function deployCreate2(
function deployCreate3(
bytes32 salt,
bytes memory initCode
) external payable returns (address newContract);
Expand Down
2 changes: 1 addition & 1 deletion src/Auctions/Auction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
/// @notice Array of all the enabled auction for this contract.
bytes32[] public enabledAuctions;

constructor() Governance(msg.sender) {}

Check warning on line 115 in src/Auctions/Auction.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

/**
* @notice Initializes the Auction contract with initial parameters.
Expand Down Expand Up @@ -198,7 +198,7 @@
virtual
returns (bool, bool, bool, bool)
{
Hook memory _hook;
Hook memory _hook = hook_;
return (_hook.kickable, _hook.kick, _hook.preTake, _hook.postTake);
}

Expand Down Expand Up @@ -631,7 +631,7 @@
}

/// @dev Implements the take of the auction.
function _take(

Check warning on line 634 in src/Auctions/Auction.sol

View workflow job for this annotation

GitHub Actions / solidity

Function body contains 73 lines but allowed no more than 50 lines
bytes32 _auctionId,
uint256 _maxAmount,
address _receiver,
Expand Down
2 changes: 1 addition & 1 deletion src/swappers/AuctionSwapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract AuctionSwapper {

/// @notice The pre-deployed Auction factory for cloning.
address public constant auctionFactory =
0x4A14145C4977E18c719BB70E6FcBF8fBFF6F62d2;
0xE6aB098E8582178A76DC80d55ca304d1Dec11AD8;

/// @notice Address of the specific Auction this strategy uses.
address public auction;
Expand Down
7 changes: 7 additions & 0 deletions src/test/AuctionSwapper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ contract AuctionSwapperTest is Setup {
assertEq(_to, address(asset));
assertEq(_kicked, 0);
assertEq(_available, 0);
assertEq(auction.hook(), address(swapper));
(bool hook1, bool hook2, bool hook3, bool hook4) = auction
.getHookFlags();
assertTrue(hook1);
assertTrue(hook2);
assertTrue(hook3);
assertTrue(hook4);

// Kicking it reverts
vm.expectRevert("nothing to kick");
Expand Down
Loading