mirror of
https://github.com/logos-messaging/logos-delivery-compose.git
synced 2026-06-07 20:59:28 +00:00
chore: Remove test token address and minting procedures (#170)
This commit is contained in:
parent
8e4a33b0a0
commit
1bbf42a1e8
@ -6,7 +6,7 @@
|
|||||||
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
|
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
|
||||||
|
|
||||||
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
|
# 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.
|
# 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.
|
# Note: make sure you don't use the '0x' prefix.
|
||||||
|
|||||||
@ -17,7 +17,7 @@ if test -n "${ETH_CLIENT_ADDRESS}"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
if ! command -v cast >/dev/null 2>&1; then
|
||||||
echo "Foundry toolkit (cast) not found. Installing Foundry..."
|
echo "Foundry toolkit (cast) not found. Installing Foundry..."
|
||||||
curl -L https://foundry.paradigm.xyz | bash
|
curl -L https://foundry.paradigm.xyz | bash
|
||||||
@ -26,44 +26,32 @@ if ! command -v cast >/dev/null 2>&1; then
|
|||||||
foundryup
|
foundryup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# default: do mint/approve
|
# default: do approve
|
||||||
NEED_MINTING=1
|
NEED_APPROVAL=1
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--no-mint) NEED_MINTING=0 ;;
|
--no-approve) NEED_APPROVAL=0 ;;
|
||||||
--mint) NEED_MINTING=1 ;;
|
--approve) NEED_APPROVAL=1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
||||||
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
|
TST_AMOUNT_WEI=5000000000000000000
|
||||||
TTT_AMOUNT_WEI=5000000000000000000
|
|
||||||
|
|
||||||
# Mint
|
# Approve
|
||||||
if [ "$NEED_MINTING" = "1" ]; then
|
if [ "$NEED_APPROVAL" = "1" ]; then
|
||||||
echo "\nMinting test token"
|
echo "Approve to spend TestStableToken"
|
||||||
if ! cast send "$TOKEN_CONTRACT_ADDRESS" "mint(address,uint256)" \
|
if ! cast send "$TOKEN_CONTRACT_ADDRESS" "approve(address,uint256)" \
|
||||||
"$ETH_TESTNET_ACCOUNT" "$TTT_AMOUNT_WEI" \
|
"$RLN_CONTRACT_ADDRESS" "$TST_AMOUNT_WEI" \
|
||||||
--private-key "$ETH_TESTNET_KEY" \
|
--private-key "$ETH_TESTNET_KEY" \
|
||||||
--rpc-url "$RLN_RELAY_ETH_CLIENT_ADDRESS"
|
--rpc-url "$RLN_RELAY_ETH_CLIENT_ADDRESS"
|
||||||
then
|
then
|
||||||
echo " Mint transaction failed."
|
echo "Approve transaction failed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
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 \
|
docker run -v "$(pwd)/keystore":/keystore/:Z wakuorg/nwaku:v0.36.0 generateRlnKeystore \
|
||||||
--rln-relay-eth-client-address=${RLN_RELAY_ETH_CLIENT_ADDRESS} \
|
--rln-relay-eth-client-address=${RLN_RELAY_ETH_CLIENT_ADDRESS} \
|
||||||
--rln-relay-eth-private-key=${ETH_TESTNET_KEY} \
|
--rln-relay-eth-private-key=${ETH_TESTNET_KEY} \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user