|
| 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