ethereum: update script to test setting rate limits

This commit is contained in:
Nikhil Suri 2024-06-26 08:47:17 -07:00
parent 91c5a12ad3
commit 2b063a85bf
1 changed files with 23 additions and 0 deletions

View File

@ -99,30 +99,35 @@ GOV_CONTRACT=""
NTT_CONTRACT=""
UNSIGNED_PAUSE_VAA=""
UNSIGNED_UNPAUSE_VAA=""
UNSIGNED_INBOUND_LIMIT_VAA=""
case "$chain_name" in
ethereum)
GOV_CONTRACT=0x23Fea5514DFC9821479fBE18BA1D7e1A61f6FfCf
NTT_CONTRACT=0xc072B1AEf336eDde59A049699Ef4e8Fa9D594A48
UNSIGNED_PAUSE_VAA=0100000004000000000076fc210a00010000000000000000000000000000000000000000000000000000000000000004f6ca212aede81c0a20000000000000000047656e6572616c507572706f7365476f7665726e616e636501000223fea5514dfc9821479fbe18ba1d7e1a61f6ffcfc072b1aef336edde59a049699ef4e8fa9d594a4800048456cb59
UNSIGNED_UNPAUSE_VAA=010000000400000000002d25e93f000100000000000000000000000000000000000000000000000000000000000000044af9d5923779bdf520000000000000000047656e6572616c507572706f7365476f7665726e616e636501000223fea5514dfc9821479fbe18ba1d7e1a61f6ffcfc072b1aef336edde59a049699ef4e8fa9d594a4800043f4ba83a
UNSIGNED_INBOUND_LIMIT_VAA=010000000400000000008a42db5c00010000000000000000000000000000000000000000000000000000000000000004b47038e2b5f0803220000000000000000047656e6572616c507572706f7365476f7665726e616e636501000223fea5514dfc9821479fbe18ba1d7e1a61f6ffcfc072b1aef336edde59a049699ef4e8fa9d594a480044186ce61200000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000000000000000000000000001
;;
arbitrum)
GOV_CONTRACT=0x36CF4c88FA548c6Ad9fcDc696e1c27Bb3306163F
NTT_CONTRACT=0x5333d0AcA64a450Add6FeF76D6D1375F726CB484
UNSIGNED_PAUSE_VAA=01000000040000000000a97c5ba800010000000000000000000000000000000000000000000000000000000000000004efd07b35d2dd420a20000000000000000047656e6572616c507572706f7365476f7665726e616e636501001736cf4c88fa548c6ad9fcdc696e1c27bb3306163f5333d0aca64a450add6fef76d6d1375f726cb48400048456cb59
UNSIGNED_UNPAUSE_VAA=0100000004000000000092654e5000010000000000000000000000000000000000000000000000000000000000000004529039baf463475220000000000000000047656e6572616c507572706f7365476f7665726e616e636501001736cf4c88fa548c6ad9fcdc696e1c27bb3306163f5333d0aca64a450add6fef76d6d1375f726cb48400043f4ba83a
UNSIGNED_INBOUND_LIMIT_VAA=0100000004000000000090fd11c300010000000000000000000000000000000000000000000000000000000000000004804d844f7737a30d20000000000000000047656e6572616c507572706f7365476f7665726e616e636501001736cf4c88fa548c6ad9fcdc696e1c27bb3306163f5333d0aca64a450add6fef76d6d1375f726cb4840044186ce61200000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000000000000000000000000001
;;
optimism)
GOV_CONTRACT=0x0E09a3081837ff23D2e59B179E0Bc48A349Afbd8
NTT_CONTRACT=0x1a4F1a790f23Ffb9772966cB6F36dCd658033e13
UNSIGNED_PAUSE_VAA=01000000040000000000952b3208000100000000000000000000000000000000000000000000000000000000000000042a5d763e56b1709d20000000000000000047656e6572616c507572706f7365476f7665726e616e63650100180e09a3081837ff23d2e59b179e0bc48a349afbd81a4f1a790f23ffb9772966cb6f36dcd658033e1300048456cb59
UNSIGNED_UNPAUSE_VAA=01000000040000000000fe7d99ea00010000000000000000000000000000000000000000000000000000000000000004a3d4945c1212065020000000000000000047656e6572616c507572706f7365476f7665726e616e63650100180e09a3081837ff23d2e59b179e0bc48a349afbd81a4f1a790f23ffb9772966cb6f36dcd658033e1300043f4ba83a
UNSIGNED_INBOUND_LIMIT_VAA=01000000040000000000061174730001000000000000000000000000000000000000000000000000000000000000000494778c0814c711a720000000000000000047656e6572616c507572706f7365476f7665726e616e63650100180e09a3081837ff23d2e59b179e0bc48a349afbd81a4f1a790f23ffb9772966cb6f36dcd658033e130044186ce61200000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000000000000000000000000001
;;
base)
GOV_CONTRACT=0x838a95B6a3E06B6f11C437e22f3C7561a6ec40F1
NTT_CONTRACT=0x5333d0AcA64a450Add6FeF76D6D1375F726CB484
UNSIGNED_PAUSE_VAA=010000000400000000008f3da7570001000000000000000000000000000000000000000000000000000000000000000458191dc4234221d420000000000000000047656e6572616c507572706f7365476f7665726e616e636501001e838a95b6a3e06b6f11c437e22f3c7561a6ec40f15333d0aca64a450add6fef76d6d1375f726cb48400048456cb59
UNSIGNED_UNPAUSE_VAA=010000000400000000000498f2cd00010000000000000000000000000000000000000000000000000000000000000004a1cc2db10977351720000000000000000047656e6572616c507572706f7365476f7665726e616e636501001e838a95b6a3e06b6f11c437e22f3c7561a6ec40f15333d0aca64a450add6fef76d6d1375f726cb48400043f4ba83a
UNSIGNED_INBOUND_LIMIT_VAA=01000000040000000000d8f0816000010000000000000000000000000000000000000000000000000000000000000004d7e164ff6be60c8220000000000000000047656e6572616c507572706f7365476f7665726e616e636501001e838a95b6a3e06b6f11c437e22f3c7561a6ec40f15333d0aca64a450add6fef76d6d1375f726cb4840044186ce61200000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000000000000000000000000001
;;
*) echo "unknown module $module" >&2
usage
@ -147,6 +152,7 @@ printf "Done\n\n"
# Step 0.75) Resign the pause and unpause VAAs with the devnet guardian secret
pauseVaa=$(worm edit-vaa --network devnet --gs $GUARDIAN_SECRET --vaa $UNSIGNED_PAUSE_VAA)
unpauseVaa=$(worm edit-vaa --network devnet --gs $GUARDIAN_SECRET --vaa $UNSIGNED_UNPAUSE_VAA)
inboundLimitVaa=$(worm edit-vaa --network devnet --gs $GUARDIAN_SECRET --vaa $UNSIGNED_INBOUND_LIMIT_VAA)
# Step 1) Query owner and pauser for the current NTT Manager contract (should not be the governance contract)
echo "STEP 1:"
@ -224,6 +230,23 @@ else
printf "Verified contract is not paused\n\n"
fi
# Step 9) Set Inbound Limit from Solana on NTT Manager
echo "STEP 9:"
echo "Submitting Inbound Rate Limit Adjustment from Solana VAA to Governance contract..."
cast send --private-key "$USER_PK" "$GOV_CONTRACT" "performGovernance(bytes)" "$inboundLimitVaa"
printf "Done\n\n"
# Step 10) Check Inbound Limit from Solana is 100 million
echo "STEP 10:"
echo "Getting inbound limit from Solana on NTT Manager... (should be 100 million)"
inboundLimit=$(cast call "$NTT_CONTRACT" "getCurrentInboundCapacity(uint16)" 1)
if [[ $inboundLimit != "0x00000000000000000000000000000000000000000052b7d2dcc80cd2e4000000" ]]; then
echo "ERROR! Inbound Limit from Solana not correct. Exiting..."
clean_up
else
printf "Inbound limit from Solana is set to 100 million correctly\n\n"
fi
echo "Congratulations! You've verified that the Governance contract works in a mainnet fork test."
# Anvil can be kept alive by setting the -k flag. This is useful for interacting