chore: Remove test token address and minting procedures (#170)

This commit is contained in:
Tanya S 2025-08-01 15:13:36 +02:00 committed by GitHub
parent 8e4a33b0a0
commit 1bbf42a1e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 26 deletions

View File

@ -6,7 +6,7 @@
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
TOKEN_CONTRACT_ADDRESS=<TEST_STABLE_TOKEN_CONTRACT_ADDRESS_HERE>
# Private key of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
# Note: make sure you don't use the '0x' prefix.

View File

@ -17,7 +17,7 @@ if test -n "${ETH_CLIENT_ADDRESS}"; then
exit 1
fi
# Ensure Foundry (cast & foundryup) is available for token mint/approve calls
# Ensure Foundry (cast & foundryup) is available for token approve calls
if ! command -v cast >/dev/null 2>&1; then
echo "Foundry toolkit (cast) not found. Installing Foundry..."
curl -L https://foundry.paradigm.xyz | bash
@ -26,42 +26,30 @@ if ! command -v cast >/dev/null 2>&1; then
foundryup
fi
# default: do mint/approve
NEED_MINTING=1
# default: do approve
NEED_APPROVAL=1
for arg in "$@"; do
case "$arg" in
--no-mint) NEED_MINTING=0 ;;
--mint) NEED_MINTING=1 ;;
--no-approve) NEED_APPROVAL=0 ;;
--approve) NEED_APPROVAL=1 ;;
esac
done
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
TTT_AMOUNT_WEI=5000000000000000000
TST_AMOUNT_WEI=5000000000000000000
# Mint
if [ "$NEED_MINTING" = "1" ]; then
echo "\nMinting test token"
if ! cast send "$TOKEN_CONTRACT_ADDRESS" "mint(address,uint256)" \
"$ETH_TESTNET_ACCOUNT" "$TTT_AMOUNT_WEI" \
# Approve
if [ "$NEED_APPROVAL" = "1" ]; then
echo "Approve to spend TestStableToken"
if ! cast send "$TOKEN_CONTRACT_ADDRESS" "approve(address,uint256)" \
"$RLN_CONTRACT_ADDRESS" "$TST_AMOUNT_WEI" \
--private-key "$ETH_TESTNET_KEY" \
--rpc-url "$RLN_RELAY_ETH_CLIENT_ADDRESS"
then
echo " Mint transaction failed."
echo "Approve transaction failed."
exit 1
fi
fi
# Approve
echo "\nApprove to spend the test tokens"
if ! cast send "$TOKEN_CONTRACT_ADDRESS" "approve(address,uint256)" \
"$RLN_CONTRACT_ADDRESS" "$TTT_AMOUNT_WEI" \
--private-key "$ETH_TESTNET_KEY" \
--rpc-url "$RLN_RELAY_ETH_CLIENT_ADDRESS"
then
echo "Approve transaction failed."
exit 1
fi
docker run -v "$(pwd)/keystore":/keystore/:Z wakuorg/nwaku:v0.36.0 generateRlnKeystore \

View File

@ -186,4 +186,4 @@ echocol "Your node is ready! enter the following command to start it:"
read -p "Press ENTER to continue..." foo
docker-compose up -d
echocol "✅ Node started successfully!"
echocol ""
echocol ""