@@ -62,6 +62,11 @@ deploy_graph_contracts() {
62
62
# Hardhat requires an older version of node
63
63
nvm install 16.0.0
64
64
nvm use 16.0.0
65
+ # Install yarn if not available
66
+ if ! command -v yarn & > /dev/null; then
67
+ echo " Installing yarn for Node 16.0.0..."
68
+ npm install -g yarn
69
+ fi
65
70
yarn
66
71
yes | yarn deploy-localhost --auto-mine
67
72
export GRAPH_NODE_ADDRESS=" $( jq ' .["1337"].GraphToken.address' addresses.json | tr -d ' "' || error_exit " Error obtaining Graph Node address" ) "
@@ -74,22 +79,33 @@ deploy_graph_contracts() {
74
79
deploy_tap_contracts () {
75
80
cd " $tap_contracts "
76
81
echo " Starting deploy for TAP contracts located in $PWD "
82
+ # Switch back to a newer Node version for TAP contracts
83
+ nvm install 18
84
+ nvm use 18
85
+ # Install yarn if not available in Node 18
86
+ if ! command -v yarn & > /dev/null; then
87
+ echo " Installing yarn for Node 18..."
88
+ npm install -g yarn
89
+ fi
90
+
77
91
export WITHDRAW_ESCROW_FREEZE_PERIOD=800
78
92
export REVOKE_SIGNER_FREEZE_PERIOD=800
93
+ # Set dummy ETHERSCAN_API_KEY to avoid verification errors
94
+ export ETHERSCAN_API_KEY=" dummy_key_for_local_testing"
79
95
yarn
80
96
export ALLOCATION_TRACKER_ADDRESS=$( forge create \
81
97
--unlocked --from $DEPLOYER \
82
- --rpc-url localhost:8545 src/AllocationIDTracker.sol:AllocationIDTracker --json \
98
+ --rpc-url localhost:8545 src/AllocationIDTracker.sol:AllocationIDTracker --json --broadcast \
83
99
| jq -Rr ' fromjson? | .deployedTo' )
84
100
export TAP_VERIFIER_ADDRESS=$( forge create \
85
101
--unlocked --from $DEPLOYER \
86
102
--rpc-url localhost:8545 src/TAPVerifier.sol:TAPVerifier \
87
- --constructor-args ' tapVerifier' ' 1.0' --json \
103
+ --constructor-args ' tapVerifier' ' 1.0' --json --broadcast \
88
104
| jq -Rr ' fromjson? | .deployedTo' )
89
105
export ESCROW_ADDRESS=$( forge create \
90
106
--unlocked --from $DEPLOYER \
91
107
--rpc-url localhost:8545 src/Escrow.sol:Escrow \
92
- --constructor-args $GRAPH_NODE_ADDRESS $STAKING_ADDRESS $TAP_VERIFIER_ADDRESS $ALLOCATION_TRACKER_ADDRESS $WITHDRAW_ESCROW_FREEZE_PERIOD $REVOKE_SIGNER_FREEZE_PERIOD --json \
108
+ --constructor-args $GRAPH_NODE_ADDRESS $STAKING_ADDRESS $TAP_VERIFIER_ADDRESS $ALLOCATION_TRACKER_ADDRESS $WITHDRAW_ESCROW_FREEZE_PERIOD $REVOKE_SIGNER_FREEZE_PERIOD --json --broadcast \
93
109
| jq -Rr ' fromjson? | .deployedTo' )
94
110
echo " TAP contracts deployed"
95
111
cd -
@@ -105,6 +121,8 @@ main() {
105
121
106
122
if $RUN_INTEGRATION_TESTS ; then
107
123
echo " Running integration tests..."
124
+ # Set ETHERSCAN_API_KEY for testing to avoid verification errors
125
+ export ETHERSCAN_API_KEY=" dummy_key_for_local_testing"
108
126
# run integration tests...
109
127
forge test --match-contract EscrowContractTest --rpc-url localhost:8545
110
128
else
0 commit comments