Skip to content

Commit

Permalink
immutable deployer deploys and writes output
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDeadCe11 committed Sep 6, 2024
1 parent 9a1b2ab commit 1946bc2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
57 changes: 28 additions & 29 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
test = 'test'
cache_path = 'cache'
fs_permissions = [
{ access = "read-write", path = "./deployments" },
{ access = "read", path = "./" },
]
optimizer = true
optimizer-runs = 200
evm_version = "cancun"
solc_version = "0.8.24"
prompt_timeout = 120
src = "src"
out = "out"
libs = ["lib"]
test = 'test'
cache_path = 'cache'
fs_permissions = [
{ access = "read-write", path = "./script/output" },
{ access = "read", path = "./" },
]
optimizer = true
optimizer-runs = 200
evm_version = "cancun"
solc_version = "0.8.24"
prompt_timeout = 120

[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"
base = "${BASE_RPC_URL}"
fraxtal = "${FRAXTAL_RPC_URL}"
holesky = "${HOLESKY_RPC_URL}"
fraxtal_testnet = "${FRAXTAL_TESTNET_RPC_URL}"
mainnet = "${MAINNET_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"
base = "${BASE_RPC_URL}"
fraxtal = "${FRAXTAL_RPC_URL}"
holesky = "${HOLESKY_RPC_URL}"
fraxtal_testnet = "${FRAXTAL_TESTNET_RPC_URL}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}" }
optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" }
base = { key = "${BASESCAN_API_KEY}", url = "https://api.basescan.org/api/" }
holesky = { key = "${ETHERSCAN_API_KEY}" }
fraxtal = { key = "${FRAXSCAN_API_KEY}", url = "https://api.fraxscan.io/api/" }
fraxtal_testnet = { key = "${FRAXSCAN_API_KEY}", url = "https://api-holesky.fraxscan.io/api/" }

mainnet = { key = "${ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}" }
optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" }
base = { key = "${BASESCAN_API_KEY}", url = "https://api.basescan.org/api/" }
holesky = { key = "${ETHERSCAN_API_KEY}" }
fraxtal = { key = "${FRAXSCAN_API_KEY}", url = "https://api.fraxscan.io/api/" }
fraxtal_testnet = { key = "${FRAXSCAN_API_KEY}", url = "https://api-holesky.fraxscan.io/api/" }
5 changes: 5 additions & 0 deletions script/BaseScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ contract BaseScript is BaseData {
string memory root = vm.projectRoot();
return string.concat(root, "/script/output/", _deploymentType, "-", vm.toString(block.chainid), ".json");
}

function _writeOutput(string memory deploymentType, string memory json) internal {
string memory path = _getOutputPath("ImmutableMultiChainDeployer");
vm.writeFile(path, json);
}
}
7 changes: 5 additions & 2 deletions script/DeployImmutableMultiChainDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity ^0.8.13;
import {BaseScript} from "./BaseScript.s.sol";
import {ImmutableMultiChainDeployer} from "@factory/ImmutableMultiChainDeployer.sol";
import "forge-std/console.sol";
//forge script script/DeployImmutableMultiChainDeployer.s.sol:DeployImmutableMultiChainDeployer --rpc-url ${rpc} --sig "run(string memory)" ${path} --account ${deployerAccountName} --sender ${deployer} --broadcast --etherscan-api-key ${api} --verify

//forge script script/DeployImmutableMultiChainDeployer.s.sol:DeployImmutableMultiChainDeployer --rpc-url ${rpc} --sig "run(bytes32)" ${salt} --account ${deployerAccountName} --sender ${deployer} --broadcast --etherscan-api-key ${api} --verify

contract DeployImmutableMultiChainDeployer is BaseScript {
address public multiChainDeployerAddress;
Expand All @@ -19,6 +20,8 @@ contract DeployImmutableMultiChainDeployer is BaseScript {

function _serializeOutputs(string memory objectKey) internal override {
vm.serializeString(objectKey, "chainid", vm.toString(block.chainid));
vm.serializeAddress(objectKey, "ImmutableMultiChainDeployerAddress", address(multiChainDeployerAddress));
string memory finalJson =
vm.serializeAddress(objectKey, "ImmutableMultiChainDeployerAddress", address(multiChainDeployerAddress));
_writeOutput("ImmutableMultiChainDeployer", finalJson);
}
}

0 comments on commit 1946bc2

Please sign in to comment.