Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic deploys #175

Merged
merged 6 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Chain-specific
RPC_URL="XYZ"
GOERLI_RPC_URL="XYZ"
SEPOLIA_RPC_URL="XYZ"
PRIVATE_KEY="XYZ"
ETHERSCAN_API_KEY="XYZ"
# RPC Nodes
MAINNET_RPC_URL=""
GOERLI_RPC_URL=""
ARBITRUM_RPC_URL=""
ARBITRUM_GOERLI_RPC_URL=""

# Project
FEE_TO="XYZ"
# FeeTo Address
FEE_TO=""

# Credentials
PRIVATE_KEY=""
ETHERSCAN_API_KEY=""
ARBISCAN_API_KEY=""

# Salts
SALT_GENERATOR=""
SALT_ENGINE=""
30 changes: 30 additions & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: BUSL 1.1
pragma solidity 0.8.16;

import "forge-std/Script.sol";

import "../src/TokenURIGenerator.sol";
import "../src/OptionSettlementEngine.sol";

contract DeployScript is Script {
// Command to deploy Core
// forge script script/Deploy.s.sol --rpc-url=<RPC_URL> --broadcast --slow

function run() public {
// Get environment variables
address feeTo = vm.envAddress("FEE_TO");
uint256 privateKey = vm.envUint("PRIVATE_KEY");
bytes32 saltGenerator = keccak256(bytes(vm.envString("SALT_GENERATOR")));
bytes32 saltEngine = keccak256(bytes(vm.envString("SALT_ENGINE")));

// Deploy TokenURIGenerator
vm.startBroadcast(privateKey);
TokenURIGenerator generator = new TokenURIGenerator{salt: saltGenerator}();
vm.stopBroadcast();

// Deploy OptionSettlementEngine
vm.startBroadcast(privateKey);
new OptionSettlementEngine{salt: saltEngine}(feeTo, address(generator));
vm.stopBroadcast();
}
}
25 changes: 0 additions & 25 deletions script/ValoremDeploy.s.sol

This file was deleted.