-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from trillion-network/minor/add-deploy-upgrade…
…-scripts minor: add deploy.sh and upgrade.sh to avoid error
- Loading branch information
Showing
8 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# <TOKEN> <CHAIN> | ||
|
||
DERIVATION_PATH= | ||
DEFAULT_ADMIN_ADDRESS= | ||
PAUSER_ADDRESS= | ||
MINTER_ADDRESS= | ||
UPGRADER_ADDRESS= | ||
RESCUER_ADDRESS= | ||
BLACKLISTER_ADDRESS= | ||
TOKEN_NAME= | ||
TOKEN_SYMBOL= | ||
|
||
RPC_URL= | ||
ETHERSCAN_API_KEY= | ||
|
||
FIAT_TOKEN_PROXY_ADDRESS= | ||
|
||
# <TOKEN> <CHAIN> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,5 @@ yarn.lock | |
# coverage stuff | ||
coverage/ | ||
lcov.info | ||
**/*.env | ||
!.env.example |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Check for arguments | ||
if [ -z "$1" ] || [ -z "$2" ] ; then | ||
echo "Usage: npm run deploy -- <token> <chain>" | ||
# Example: | ||
# npm run deploy -- tnusd eth-mainnet | ||
# npm run deploy -- tnsgd eth-sepolia | ||
# npm run deploy -- tnusd op-mainnet | ||
# npm run deploy -- tnusd op-sepolia | ||
exit 1 | ||
fi | ||
|
||
# Assign arguments to variables | ||
TOKEN=$1 | ||
CHAIN=$2 | ||
ENV_FILE="config/${TOKEN}/${CHAIN}.env" | ||
ROOT_ENV_FILE="./.env" | ||
|
||
# Load environment variables from .env file | ||
if [ -f "$ENV_FILE" ]; then | ||
source $ENV_FILE | ||
|
||
# Copy the .env file to the current directory | ||
cp "$ENV_FILE" "$ROOT_ENV_FILE" | ||
|
||
# Confirm the copy was successful | ||
if [[ -f "$ROOT_ENV_FILE" ]]; then | ||
echo "File '.env' has been successfully copied to the current folder." | ||
else | ||
echo "Error: Failed to copy '.env' to the current folder." | ||
fi | ||
else | ||
echo "$ENV_FILE file not found!" | ||
exit 1 | ||
fi | ||
|
||
if [[ -n "${ETHERSCAN_API_KEY}" ]]; then | ||
# with verify | ||
forge script script/DeployFiatToken.s.sol:DeployFiatToken --rpc-url $RPC_URL --ledger --hd-paths $DERIVATION_PATH --sender $DEFAULT_ADMIN_ADDRESS --broadcast --verify --ffi -vvvv | ||
else | ||
# no verify | ||
forge script script/DeployFiatToken.s.sol:DeployFiatToken --rpc-url $RPC_URL --ledger --hd-paths $DERIVATION_PATH --sender $DEFAULT_ADMIN_ADDRESS --broadcast --ffi -vvvv | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Check for arguments | ||
if [ -z "$1" ] || [ -z "$2" ] ; then | ||
echo "Usage: npm run deploy -- <token> <chain>" | ||
# Example: | ||
# npm run deploy -- tnusd eth-mainnet | ||
# npm run deploy -- tnsgd eth-sepolia | ||
# npm run deploy -- tnusd op-mainnet | ||
# npm run deploy -- tnusd op-sepolia | ||
exit 1 | ||
fi | ||
|
||
# Assign arguments to variables | ||
TOKEN=$1 | ||
CHAIN=$2 | ||
ENV_FILE="config/${TOKEN}/${CHAIN}.env" | ||
ROOT_ENV_FILE="./.env" | ||
|
||
# Load environment variables from .env file | ||
if [ -f "$ENV_FILE" ]; then | ||
source $ENV_FILE | ||
|
||
# Copy the .env file to the current directory | ||
cp "$ENV_FILE" "$ROOT_ENV_FILE" | ||
|
||
# Confirm the copy was successful | ||
if [[ -f "$ROOT_ENV_FILE" ]]; then | ||
echo "File '.env' has been successfully copied to the current folder." | ||
else | ||
echo "Error: Failed to copy '.env' to the current folder." | ||
fi | ||
else | ||
echo "$ENV_FILE file not found!" | ||
exit 1 | ||
fi | ||
|
||
if [[ -n "${ETHERSCAN_API_KEY}" ]]; then | ||
# with verify | ||
forge script script/UpgradeFiatToken.s.sol:UpgradeFiatToken --rpc-url $RPC_URL --ledger --hd-paths $DERIVATION_PATH --sender $DEFAULT_ADMIN_ADDRESS --broadcast --verify --ffi -vvvv | ||
else | ||
# no verify | ||
forge script script/UpgradeFiatToken.s.sol:UpgradeFiatToken --rpc-url $RPC_URL --ledger --hd-paths $DERIVATION_PATH --sender $DEFAULT_ADMIN_ADDRESS --broadcast --ffi -vvvv | ||
fi |