-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathjustfile
51 lines (45 loc) · 1.93 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export rpcUrl := env_var_or_default('ETH_RPC_URL', 'https://ethereum.publicnode.com')
export etherscanApiKey := env_var_or_default('ETHERSCAN_API_KEY', '')
install: install-contracts install-eip712sign
# install dependencies
# for any tasks run in production, a specific commit should be used for each dep.
install-contracts:
#!/usr/bin/env bash
forge install
install-eip712sign:
#!/usr/bin/env bash
REPO_ROOT=`git rev-parse --show-toplevel`
PATH="$REPO_ROOT/bin:$PATH"
cd $REPO_ROOT
mkdir -p bin || true
GOBIN="$REPO_ROOT/bin" go install github.com/base-org/[email protected]
# Bundle path should be provided including the .json file extension.
add-transaction bundlePath to sig *params:
#!/usr/bin/env bash
bundleBaseName=$(echo {{bundlePath}} | xargs -I{} basename {} .json)
dirname=$(echo {{bundlePath}} | xargs -I{} dirname {})
# bundleBasePath is the path to the bundle without the .json extension
bundleBasePath=${dirname}/${bundleBaseName}
newBundlePath=${bundleBasePath}-new.json
backupBundlePath=${bundleBasePath}-$(date -u '+%Y-%m-%d_%H-%M-%S').json
DATA=$(cast calldata '{{sig}}' {{params}})
echo DATA: $DATA
echo bundlePath: {{bundlePath}}
echo newBundlePath: $newBundlePath
jq --arg to {{to}} --arg data ${DATA} '.transactions += [{"to": $to, "data": $data}]' {{bundlePath}} > ${newBundlePath}
mv {{bundlePath}} ${backupBundlePath}
mv ${newBundlePath} {{bundlePath}}
echo "Old bundle backed up to ${backupBundlePath}."
clean:
forge clean
# Deploy the Multicall3Delegatecall contract to 0x95b259eae68ba96edB128eF853fFbDffe47D2Db0, as is
# the case on Mainnet and Sepolia.
# Will fail if the contract is already deployed.
# ARGS must include --private-key or --keystore in order to deploy successfully.
deploy-multicall3-delegatecall *ARGS:
forge script DeployMulticall3Delegatecall \
--rpc-url {{rpcUrl}} \
--verify \
--verifier-api-key {{etherscanApiKey}} \
--broadcast \
{{ARGS}}