From 490d371defbfb55aa3a8548f09e80c9568f95529 Mon Sep 17 00:00:00 2001 From: ezra4 <43926721+ezra4@users.noreply.github.com> Date: Tue, 12 Dec 2023 12:25:57 +0200 Subject: [PATCH 1/2] Update testnet.snippets.sh Deleted --verbose argument out of mxpy commands, as it is indeed a good way of seeing what's happening behind the commands, but it is also filling the variables with logger information that is destructing the flow of the deployment. example: --verbose on mxpy contract call is filling ${ADDRESS} with a logger.warning() message before filling it with the actual address. --- contracts/adder/interaction/testnet.snippets.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/adder/interaction/testnet.snippets.sh b/contracts/adder/interaction/testnet.snippets.sh index 06bb13e3..67446fa8 100644 --- a/contracts/adder/interaction/testnet.snippets.sh +++ b/contracts/adder/interaction/testnet.snippets.sh @@ -4,7 +4,7 @@ DEPLOY_TRANSACTION=$(mxpy data load --key=deployTransaction-testnet) PROXY=https://testnet-api.multiversx.com deploy() { - mxpy --verbose contract deploy --project=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return + mxpy contract deploy --project=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return TRANSACTION=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data['emittedTransactionHash']") ADDRESS=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data['contractAddress']") @@ -18,9 +18,9 @@ deploy() { add() { read -p "Enter number: " NUMBER - mxpy --verbose contract call ${ADDRESS} --recall-nonce --pem=${ALICE} --gas-limit=5000000 --function="add" --arguments ${NUMBER} --send --proxy=${PROXY} --chain=T + mxpy contract call ${ADDRESS} --recall-nonce --pem=${ALICE} --gas-limit=5000000 --function="add" --arguments ${NUMBER} --send --proxy=${PROXY} --chain=T } getSum() { - mxpy --verbose contract query ${ADDRESS} --function="getSum" --proxy=${PROXY} + mxpy contract query ${ADDRESS} --function="getSum" --proxy=${PROXY} } From 28ea0878e21214aa1b0d1056fcebf08bfd3f0406 Mon Sep 17 00:00:00 2001 From: ezra4 <43926721+ezra4@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:10:49 +0200 Subject: [PATCH 2/2] Update testnet.snippets.sh v2 Arguement of mxpy contract deploy "--project" might be deprecated and it's not working with the current version of mxpy installed. Substituted with "--bytecode" instead, which works. --- contracts/adder/interaction/testnet.snippets.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/adder/interaction/testnet.snippets.sh b/contracts/adder/interaction/testnet.snippets.sh index 67446fa8..944c0ed1 100644 --- a/contracts/adder/interaction/testnet.snippets.sh +++ b/contracts/adder/interaction/testnet.snippets.sh @@ -4,7 +4,7 @@ DEPLOY_TRANSACTION=$(mxpy data load --key=deployTransaction-testnet) PROXY=https://testnet-api.multiversx.com deploy() { - mxpy contract deploy --project=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return + mxpy contract deploy --bytecode=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return TRANSACTION=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data['emittedTransactionHash']") ADDRESS=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data['contractAddress']")