diff --git a/deployments/.keep b/deployments/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/deployments/base.json b/deployments/base.json new file mode 100644 index 0000000..5d7db1f --- /dev/null +++ b/deployments/base.json @@ -0,0 +1,3 @@ +{ + "Schnaps": "0xA92D665c4814c8E1681AaB292BA6d2278D01DEE0" +} \ No newline at end of file diff --git a/deployments/goerli.json b/deployments/goerli.json deleted file mode 100644 index 2c46f98..0000000 --- a/deployments/goerli.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Schnaps": "0x117303a2f3a195C94BBC0bB4979449454b38038D" -} \ No newline at end of file diff --git a/deployments/sepolia.json b/deployments/sepolia.json index 2c46f98..5d7db1f 100644 --- a/deployments/sepolia.json +++ b/deployments/sepolia.json @@ -1,3 +1,3 @@ { - "Schnaps": "0x117303a2f3a195C94BBC0bB4979449454b38038D" + "Schnaps": "0xA92D665c4814c8E1681AaB292BA6d2278D01DEE0" } \ No newline at end of file diff --git a/script/Deployer.s.sol b/script/Deployer.s.sol index 49e95f0..83eab27 100644 --- a/script/Deployer.s.sol +++ b/script/Deployer.s.sol @@ -6,7 +6,7 @@ import "forge-std/Script.sol"; import "../src/Schnaps.sol"; interface ICREATE3Factory { - function deploy(bytes32 salt, bytes memory bytecode) external returns (address deployedAddress); + function deploy(bytes32 salt, bytes memory bytecode) external payable returns (address deployedAddress); } contract Deployer is Script { @@ -20,13 +20,17 @@ contract Deployer is Script { string memory network = vm.envString("NETWORK"); address owner = vm.envAddress("OWNER"); + // We use the latest commit hash as the salt for CREATE3 deployment + // Prepended with `00` to remove any solc warning. + uint256 LATEST_COMMIT = 0x00b382240c00c8d079fcfd2837de873b60ecf062d6; + deploymentsPath = string.concat(string.concat("./deployments/", network), ".json"); vm.startBroadcast(deployerPrivateKey); // Using the CREATE3 factory maintained by lififinance: https://github.com/lifinance/create3-factory address deployed = ICREATE3Factory(0x93FEC2C00BfE902F733B57c5a6CeeD7CD1384AE1).deploy( - bytes32(uint256(0)), abi.encodePacked(type(Schnaps).creationCode, abi.encode(owner)) + bytes32(LATEST_COMMIT), abi.encodePacked(type(Schnaps).creationCode, abi.encode(owner)) ); deployments = deployments.serialize("Schnaps", deployed);