Skip to content

Commit

Permalink
Merge pull request #6 from Hats-Protocol/deploy/v0.3.0
Browse files Browse the repository at this point in the history
Deploy/v0.3.0
  • Loading branch information
spengrah authored Sep 11, 2024
2 parents a7553f2 + 3c46110 commit f80b45d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ GNOSISSCAN_KEY=
POLYGONSCAN_KEY=
OPTIMISM_KEY=
ARBISCAN_KEY=
BASESCAN_KEY=
FOUNDRY_PROFILE=
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ wrap_comments = true

[rpc_endpoints]
arbitrum = "https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}"
base = "https://base-mainnet.infura.io/v3/${INFURA_KEY}"
celo = "${CELO_RPC}"
gnosis = "${GC_RPC}"
local = "http://localhost:8545"
Expand All @@ -62,6 +63,7 @@ sepolia = "https://sepolia.infura.io/v3/${INFURA_KEY}"

[etherscan]
arbitrum = { key = "${ARBISCAN_KEY}", url = "https://api.arbiscan.io/api" }
base = { key = "${BASESCAN_KEY}", url = "https://api.basescan.org/api" }
celo = { key = "${CELOSCAN_KEY}", url = "https://api.celoscan.com/api" }
gnosis = { key = "${GNOSISSCAN_KEY}", url = "https://api.gnosisscan.io/api" }
mainnet = { key = "${ETHERSCAN_KEY}", url = "https://api.etherscan.io/api" }
Expand Down
27 changes: 4 additions & 23 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract Deploy is Script {

// default values
bool internal _verbose = true;
string internal _version = "0.2.0"; // increment this with each new deployment
string internal _version = "0.3.0"; // increment this with each new deployment

/// @dev Override default values, if desired
function prepare(bool verbose, string memory version) public {
Expand Down Expand Up @@ -50,24 +50,6 @@ contract Deploy is Script {
}
}

/// @dev Deploy pre-compiled ir-optimized bytecode to a non-deterministic address
contract DeployPrecompiled is Deploy {
/// @dev Update SALT and default values in Deploy contract

function run() public override {
vm.startBroadcast(deployer());

bytes memory args = abi.encode( /* insert constructor args here */ );

/// @dev Load and deploy pre-compiled ir-optimized bytecode.
implementation = AllowlistEligibility(deployCode("optimized-out/Module.sol/Module.json", args));

vm.stopBroadcast();

_log("Precompiled ");
}
}

/* FORGE CLI COMMANDS
## A. Simulate the deployment locally
Expand All @@ -77,10 +59,9 @@ forge script script/Deploy.s.sol -f mainnet
forge script script/Deploy.s.sol -f mainnet --broadcast --verify
## C. Fix verification issues (replace values in curly braces with the actual values)
forge verify-contract --chain-id 1 --num-of-optimizations 1000000 --watch --constructor-args $(cast abi-encode \
"constructor({args})" "{arg1}" "{arg2}" "{argN}" ) \
--compiler-version v0.8.19 {deploymentAddress} \
src/{Counter}.sol:{Counter} --etherscan-api-key $ETHERSCAN_KEY
forge verify-contract --chain-id 11155111 --num-of-optimizations 1000000 --watch --constructor-args $(cast abi-encode \
"constructor(string)" "0.3.0" ) --compiler-version v0.8.19 0x80336fb7b6B653686eBe71d2c3ee685b70108B8f \
src/AllowlistEligibility.sol:AllowlistEligibility --etherscan-api-key $ETHERSCAN_KEY
## D. To verify ir-optimized contracts on etherscan...
1. Run (C) with the following additional flag: `--show-standard-json-input > etherscan.json`
Expand Down

0 comments on commit f80b45d

Please sign in to comment.