-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: dutch auction and factory (#36)
* build: auction swapper * build: auction factory * fix: transfer to specific address * chore: comments * build: factory fixes * chore: auction tweaks * test: auction * chore: add reentrancy gaurd * fix: uni swapper * build: callback * feat: add callback * test: swapper * fix: small fixes * fix: remove extra check Co-authored-by: FP <[email protected]> * feat: fp reviewssssszz * feat: pack it up * build: add hook flags * test: hook flags * chore: comments * feat: track enabled auctions * feat: check decimals and optional index * chore: deploy * fix: interface --------- Co-authored-by: FP <[email protected]>
- Loading branch information
1 parent
ae73e78
commit d4c3961
Showing
13 changed files
with
2,389 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import "forge-std/Script.sol"; | ||
|
||
// Deploy a contract to a deterministic address with create2 | ||
contract DeployAuctionFactory is Script { | ||
|
||
Deployer public deployer = Deployer(0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed); | ||
|
||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// Get the bytecode | ||
bytes memory bytecode = abi.encodePacked(vm.getCode("AuctionFactory.sol:AuctionFactory")); | ||
|
||
// Pick an unique salt | ||
bytes32 salt = keccak256("Auction Factory"); | ||
|
||
address contractAddress = deployer.deployCreate2(salt, bytecode); | ||
|
||
console.log("Address is ", contractAddress); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} | ||
|
||
interface Deployer { | ||
event ContractCreation(address indexed newContract, bytes32 indexed salt); | ||
|
||
function deployCreate2( | ||
bytes32 salt, | ||
bytes memory initCode | ||
) external payable returns (address newContract); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.