Skip to content

Commit

Permalink
fix(script): Fix testnet script not bumps to latest version (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 authored May 21, 2024
2 parents 909a9eb + d73155e commit 07f8c65
Show file tree
Hide file tree
Showing 55 changed files with 12,987 additions and 10,957 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ docs/
node_modules/
yarn-error.log
.yarn
.yarnrc.yml
.yarnrc.yml
script/data/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
[submodule "lib/foundry-deployment-kit"]
path = lib/foundry-deployment-kit
url = https://github.com/axieinfinity/foundry-deployment-kit
[submodule "lib/contract-libs"]
path = lib/contract-libs
url = https://github.com/axieinfinity/contract-libs
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=v0.3.4 - SHA: e8f3eed9674a015330280fb9f829678b455e1324
VERSION=v0.3.4 - SHA: 31f2c28744fa8628b707591dd30496a7bc63f6bb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ loadConfig() {
ERC721_BATCH_TRANSFER=0x2368dfed532842db89b470fde9fd584d48d4f644

if [ "$MODE" == "broadcast" ]; then
PK=$TESTNET_PK
PK=$MAINNET_PK
fi
else
RPC=$TESTNET_URL
Expand All @@ -37,18 +37,20 @@ loadConfig() {
ERC721_BATCH_TRANSFER=0x2e889348bd37f192063bfec8ff39bd3635949e20

if [ "$MODE" == "broadcast" ]; then
PK=$MAINNET_PK
PK=$TESTNET_PK
fi
fi

if [ "$MODE" == "broadcast" ]; then
CURRENT_NONCE=$(cast nonce --rpc-url $RPC $FROM)
CURRENT_GAS_PRICE=$(cast gas-price --rpc-url $RPC)

if [[ "$PK" == op://* ]]; then
PK=$(op read "$PK")
fi
fi

CURRENT_NONCE=$(cast nonce --rpc-url $RPC $FROM)
echo "Current nonce: $CURRENT_NONCE"
}

# Function to load address from deployment file
Expand Down
40 changes: 1 addition & 39 deletions debug.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
# Source (or "dot") the .env file to load environment variables
if [ -f .env ]; then
source .debug.env
else
echo "Error: .debug.env file not found."
fi

verify_arg=""
extra_argument=""
op_command=""

for arg in "$@"; do
case $arg in
--trezor)
op_command=""
extra_argument+=trezor@
;;
--broadcast)
op_command="op run --env-file="./.env" --"
;;
--log)
set -- "${@/#--log/}"
extra_argument+=log@
;;
*) ;;
esac
done

# Remove the @ character from the end of extra_argument
extra_argument="${extra_argument%%@}"

echo Debug Tx...
echo From: ${FROM}
echo To: ${TO}
echo Value: ${VALUE}
echo Calldata:
cast pretty-calldata ${CALLDATA}
calldata=$(cast calldata 'debug(uint256,address,address,uint256,bytes)' ${BLOCK} ${FROM} ${TO} ${VALUE} ${CALLDATA})
${op_command} forge script ${verify_arg} --legacy ${@} script/Debug.s.sol --sig 'run(bytes,string)' ${calldata} "${extra_argument}"
source lib/foundry-deployment-kit/debug.sh
Loading

0 comments on commit 07f8c65

Please sign in to comment.