Skip to content

Commit bc7e97d

Browse files
Copy 2024-02-21-setup-smart-escrow, update start and end times (#156)
1 parent ad0644b commit bc7e97d

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
OPTIMISM_RPC_URL=https://mainnet.optimism.io
2+
OPTIMISM_CHAIN_ID=10
3+
4+
OP_COMMIT=4a157b4b0aad8eef2ea19320d5ed1a1d50a9807e
5+
BASE_CONTRACTS_COMMIT=b2682e85953a48cf64659a24ae7121f39f327867
6+
7+
OP_TOKEN=0x4200000000000000000000000000000000000042
8+
9+
DEPLOYER=0xbebe472f467888b197b90693b8852ad12a50b261
10+
BENEFACTOR=0x2501c477d0a35545a387aa4a3eee4292a9a8b3f0
11+
BENEFICIARY=0x635Fb974F09B269Bc750bF96338c29cF41430125
12+
BENEFACTOR_OWNER=0x2501c477D0A35545a387Aa4A3EEe4292A9a8B3F0
13+
BENEFICIARY_OWNER=0x6e1DFd5C1E22A4677663A81D24C6BA03561ef0f6
14+
NESTED_SAFE=0x0a7361e734cf3f0394B0FC4a45C74E7a4Ec70940
15+
START=1724976000
16+
END=1882764000
17+
VESTING_PERIOD_SECONDS=7889400
18+
INITIAL_TOKENS=17895697000000000000000000
19+
VESTING_EVENT_TOKENS=4473924000000000000000000
20+
21+
DEPLOYED_CONTRACT=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include ../../Makefile
2+
include ../.env
3+
include .env
4+
5+
.PHONY: deploy-new-implementation
6+
deploy-new-implementation:
7+
forge script --rpc-url $(OPTIMISM_RPC_URL) DeploySmartEscrow
8+
9+
10+
.PHONY: verify-implementation
11+
verify-implementation:
12+
forge verify-contract ${DEPLOYED_CONTRACT} SmartEscrow \
13+
--constructor-args $(shell cast abi-encode "constructor(address,address,address,address,address,uint256,uint256,uint256,uint256,uint256)" ${BENEFACTOR} ${BENEFICIARY} ${BENEFACTOR_OWNER} ${BENEFICIARY_OWNER} ${NESTED_SAFE} ${START} ${END} ${VESTING_PERIOD_SECONDS} ${INITIAL_TOKENS} ${VESTING_EVENT_TOKENS}) \
14+
--watch --chain-id $(OPTIMISM_CHAIN_ID) \
15+
--compiler-version v0.8.15+commit.e14f2714 --num-of-optimizations=99999 --retries=1 \
16+
--verifier-url https://api-optimistic.etherscan.io/api
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[profile.default]
2+
src = 'src'
3+
out = 'out'
4+
libs = ['lib']
5+
broadcast = 'records'
6+
fs_permissions = [ {access = "read-write", path = "./"} ]
7+
optimizer = true
8+
optimizer_runs = 999999
9+
solc_version = "0.8.15"
10+
via-ir = true
11+
remappings = [
12+
'@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/',
13+
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts',
14+
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts',
15+
'@rari-capital/solmate/=lib/solmate/',
16+
'@base-contracts/=lib/base-contracts'
17+
]
18+
19+
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity 0.8.15;
3+
4+
import "forge-std/Script.sol";
5+
import "@base-contracts/src/smart-escrow/SmartEscrow.sol";
6+
7+
contract DeploySmartEscrow is Script {
8+
address internal DEPLOYER = vm.envAddress("DEPLOYER");
9+
address internal BENEFACTOR = vm.envAddress("BENEFACTOR");
10+
address internal BENEFICIARY = vm.envAddress("BENEFICIARY");
11+
address internal BENEFACTOR_OWNER = vm.envAddress("BENEFACTOR_OWNER");
12+
address internal BENEFICIARY_OWNER = vm.envAddress("BENEFICIARY_OWNER");
13+
address internal ESCROW_OWNER = vm.envAddress("NESTED_SAFE");
14+
uint256 internal START = vm.envUint("START");
15+
uint256 internal END = vm.envUint("END");
16+
uint256 internal VESTING_PERIOD_SECONDS = vm.envUint("VESTING_PERIOD_SECONDS");
17+
uint256 internal INITIAL_TOKENS = vm.envUint("INITIAL_TOKENS");
18+
uint256 internal VESTING_EVENT_TOKENS = vm.envUint("VESTING_EVENT_TOKENS");
19+
20+
function run() public {
21+
vm.broadcast(DEPLOYER);
22+
SmartEscrow smartEscrow = new SmartEscrow(
23+
BENEFACTOR,
24+
BENEFICIARY,
25+
BENEFACTOR_OWNER,
26+
BENEFICIARY_OWNER,
27+
ESCROW_OWNER,
28+
START,
29+
END,
30+
VESTING_PERIOD_SECONDS,
31+
INITIAL_TOKENS,
32+
VESTING_EVENT_TOKENS
33+
);
34+
require(smartEscrow.start() == START, "DeploySmartEscrow: start time not set correctly");
35+
require(smartEscrow.end() == END, "DeploySmartEscrow: end time not set correctly");
36+
require(smartEscrow.vestingPeriod() == VESTING_PERIOD_SECONDS, "DeploySmartEscrow: vesting period incorrect");
37+
require(smartEscrow.initialTokens() == INITIAL_TOKENS, "DeploySmartEscrow: number of initial tokens incorrect");
38+
require(smartEscrow.vestingEventTokens() == VESTING_EVENT_TOKENS, "DeploySmartEscrow: number of vesting event tokens incorrect");
39+
require(smartEscrow.benefactor() == BENEFACTOR, "DeploySmartEscrow: benefactor incorrect");
40+
require(smartEscrow.beneficiary() == BENEFICIARY, "DeploySmartEscrow: beneficiary incorrect");
41+
require(smartEscrow.released() == 0, "DeploySmartEscrow: initial released value must bex zero");
42+
require(smartEscrow.contractTerminated() == false, "DeploySmartEscrow: contract cannot initially be terminated");
43+
}
44+
}

0 commit comments

Comments
 (0)