deployCustomConsistencyLevel.sh 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. #
  3. # This script deploys the CustomConsistencyLevel contract.
  4. # Usage: RPC_URL= MNEMONIC= EVM_CHAIN_ID= ./sh/deployCustomConsistencyLevel.sh
  5. # tilt: ./sh/deployCustomConsistencyLevel.sh
  6. # anvil: EVM_CHAIN_ID=31337 MNEMONIC=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 ./sh/deployCustomConsistencyLevel.sh
  7. if [ "${RPC_URL}X" == "X" ]; then
  8. RPC_URL=http://localhost:8545
  9. fi
  10. if [ "${MNEMONIC}X" == "X" ]; then
  11. MNEMONIC=0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
  12. fi
  13. if [ "${EVM_CHAIN_ID}X" == "X" ]; then
  14. EVM_CHAIN_ID=1337
  15. fi
  16. forge script ./forge-scripts/DeployCustomConsistencyLevel.s.sol:DeployCustomConsistencyLevel \
  17. --sig "run()" \
  18. --rpc-url "$RPC_URL" \
  19. --private-key "$MNEMONIC" \
  20. --broadcast ${FORGE_ARGS}
  21. returnInfo=$(cat ./broadcast/DeployCustomConsistencyLevel.s.sol/$EVM_CHAIN_ID/run-latest.json)
  22. DEPLOYED_ADDRESS=$(jq -r '.returns.deployedAddress.value' <<< "$returnInfo")
  23. echo "Deployed custom consistency level to address: $DEPLOYED_ADDRESS"