Skip to content

Commit

Permalink
fix(scripts): missing 'ModuleKeeper' input and Makefile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielstoica committed Jul 30, 2024
1 parent bd4c08a commit abcbdc7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 31 deletions.
71 changes: 42 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,52 @@ clean :; forge clean
# See https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/coverage.sh
tests-coverage :; ./coverage.sh

# Deploy the {InvoiceModule} contracts deterministically on Base Sepolia
# See Sablier V2 deployments on Base Sepolia: https://docs.sablier.com/contracts/v2/deployments#base-sepolia
# Update the {PRIVATE_KEY} .env variable with the deployer private key
deploy-deterministic-base-sepolia-invoice-module:
forge script script/DeployDeterministicInvoiceModule.s.sol:DeployDeterministicInvoiceModule $(CREATE2SALT) \
0xFE7fc0Bbde84C239C0aB89111D617dC7cc58049f 0xb8c724df3eC8f2Bf8fA808dF2cB5dbab22f3E68c 0x85E094B259718Be1AF0D8CbBD41dd7409c2200aa \
--sig "run(string,address,address,address)" --rpc-url base_sepolia --private-key $(PRIVATE_KEY) --etherscan-api-key $(BASESCAN_API_KEY)
--broadcast --verify

# Deploy the {InvoiceModule} contracts deterministically on Base
# See Sablier V2 deployments on Base Sepolia: https://docs.sablier.com/contracts/v2/deployments#base
# Update the {PRIVATE_KEY} .env variable with the deployer private key
deploy-deterministic-base-invoice-module:
forge script script/DeployDeterministicInvoiceModule.s.sol:DeployDeterministicInvoiceModule $(CREATE2SALT) \
0x4CB16D4153123A74Bc724d161050959754f378D8 0xf4937657Ed8B3f3cB379Eed47b8818eE947BEb1e 0x85E094B259718Be1AF0D8CbBD41dd7409c2200aa \
--sig "run(string,address,address,address)" --rpc-url base_sepolia --private-key $(PRIVATE_KEY) --etherscan-api-key $(BASESCAN_API_KEY)
# Deploy the {InvoiceModule} contract deterministically
# See Sablier V2 deployments: https://docs.sablier.com/contracts/v2/deployments
#
# Update the following configs before running the script:
# - {SABLIER_LOCKUP_LINEAR} with the according {SablierV2LockupLinear} deployment address
# - {SABLIER_LOCKUP_TRANCHED} with the according {SablierV2LockupTranched} deployment address
# - {BROKER_ADMIN} with the address of the account managing the Sablier V2 integration fee
# - {RPC_URL} with the network RPC used for deployment
deploy-deterministic-invoice-module:
forge script script/DeployDeterministicInvoiceModule.s.sol:DeployDeterministicInvoiceModule \
$(CREATE2SALT) {SABLIER_LOCKUP_LINEAR} {SABLIER_LOCKUP_TRANCHED} {BROKER_ADMIN} \
--sig "run(string,address,address,address)" --rpc-url {RPC_URL} --private-key $(PRIVATE_KEY) --etherscan-api-key $(ETHERSCAN_API_KEY)
--broadcast --verify


# Deploy a {Container} contract deterministically on Base
# Update the {PRIVATE_KEY} .env variable with the deployer private key
deploy-deterministic-base-container:
# Deploy a {Container} contract deterministically
# Update the following configs before running the script:
# - {INITIAL_OWNER} with the address of the initial owner
# - {MODULE_KEEPER_ADDRESS} with the address of the {ModuleKeeper} deployment
# - {RPC_URL} with the network RPC used for deployment
deploy-deterministic-container:
forge script script/DeployDeterministicContainer.s.sol:DeployDeterministicContainer \
$(CREATE2SALT) 0x85E094B259718Be1AF0D8CbBD41dd7409c2200aa [] \
--sig "run(string,address,address[])" --rpc-url base_sepolia \
--private-key $(PRIVATE_KEY) --etherscan-api-key $(BASESCAN_API_KEY) \
$(CREATE2SALT) {INITIAL_OWNER} {MODULE_KEEPER_ADDRESS} [] \
--sig "run(string,address,address,address[])" --rpc-url {RPC_URL} \
--private-key $(PRIVATE_KEY) --etherscan-api-key $(ETHERSCAN_API_KEY) \
--broadcast --verify

# Deploy a {Container} contract on Base
# Update the {PRIVATE_KEY} .env variable with the deployer private key
deploy-base-container:
# Deploy a {Container} contract
# Update the following configs before running the script:
# - {INITIAL_OWNER} with the address of the initial owner
# - {MODULE_KEEPER_ADDRESS} with the address of the {ModuleKeeper} deployment
# - {RPC_URL} with the network RPC used for deployment
deploy-container:
forge script script/DeployContainer.s.sol:DeployContainer \
0x85E094B259718Be1AF0D8CbBD41dd7409c2200aa [] \
--sig "run(address,address[])" --rpc-url base_sepolia \
--private-key $(PRIVATE_KEY) --etherscan-api-key $(BASESCAN_API_KEY) \
--broadcast --verify
{INITIAL_OWNER} {MODULE_KEEPER_ADDRESS} [] \
--sig "run(address,address,address[])" --rpc-url {RPC_URL} \
--private-key $(PRIVATE_KEY) --etherscan-api-key $(ETHERSCAN_API_KEY) \
--broadcast --verify

# Deploy the {ModuleKeeper} contract deterministically
# Update the following configs before running the script:
# - {INITIAL_OWNER} with the address of the initial owner
# - {RPC_URL} with the network RPC used for deployment
deploy-deterministic-module-keeper:
forge script script/DeployDeterministicModuleKeeper.s.sol:DeployDeterministicModuleKeeper \
$(CREATE2SALT) {INITIAL_OWNER} \
--sig "run(string,address)" --rpc-url {RPC_URL} \
--private-key $(PRIVATE_KEY) --etherscan-api-key $(ETHERSCAN_API_KEY) \
--broadcast --verify
4 changes: 3 additions & 1 deletion script/DeployContainer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ pragma solidity ^0.8.26;

import { BaseScript } from "./Base.s.sol";
import { Container } from "../src/Container.sol";
import { ModuleKeeper } from "./../src/ModuleKeeper.sol";

/// @notice Deploys an instance of {Container} and enables initial module(s)
contract DeployContainer is BaseScript {
function run(
address initialOwner,
ModuleKeeper moduleKeeper,
address[] memory initialModules
) public virtual broadcast returns (Container container) {
// Ddeploy the {InvoiceModule} contracts
container = new Container(initialOwner, initialModules);
container = new Container(initialOwner, moduleKeeper, initialModules);
}
}
4 changes: 3 additions & 1 deletion script/DeployDeterministicContainer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.26;

import { BaseScript } from "./Base.s.sol";
import { Container } from "../src/Container.sol";
import { ModuleKeeper } from "./../src/ModuleKeeper.sol";

/// @notice Deploys at deterministic addresses across chains an instance of {Container} and enables initial module(s)
/// @dev Reverts if any contract has already been deployed
Expand All @@ -12,11 +13,12 @@ contract DeployDeterministicContainer is BaseScript {
function run(
string memory create2Salt,
address initialOwner,
ModuleKeeper moduleKeeper,
address[] memory initialModules
) public virtual broadcast returns (Container container) {
bytes32 salt = bytes32(abi.encodePacked(create2Salt));

// Deterministically deploy a {Container} contract
container = new Container{ salt: salt }(initialOwner, initialModules);
container = new Container{ salt: salt }(initialOwner, moduleKeeper, initialModules);
}
}

0 comments on commit abcbdc7

Please sign in to comment.