Skip to content

Commit

Permalink
fix: hook getter (#40)
Browse files Browse the repository at this point in the history
* fix: hook getter

* chore: deploy new factory

* fix: remove flat
  • Loading branch information
Schlagonia authored Mar 22, 2024
1 parent 20b8885 commit 3986b04
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
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 @@ -198,7 +198,7 @@ contract Auction is Governance, ReentrancyGuard {
virtual
returns (bool, bool, bool, bool)
{
Hook memory _hook;
Hook memory _hook = hook_;
return (_hook.kickable, _hook.kick, _hook.preTake, _hook.postTake);
}

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

0 comments on commit 3986b04

Please sign in to comment.