generated from AngleProtocol/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: script to check roles on all contracts
* ground work to check roles on all Angle contracts * first draft log roles * draft log roles * v1 Check roles working * almost complete full script testing access control * fix minor sidechains bugs * script final version and all chain in one call * feat: create test layerzero cross chain setup * chore: doublon contract name * fix: compilation * fix: @sogipec comment
- Loading branch information
1 parent
4412f16
commit 33b69f7
Showing
20 changed files
with
1,068 additions
and
246 deletions.
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
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,83 @@ | ||
function chain_to_uri { | ||
chain=$1 | ||
|
||
case $chain in | ||
"1") | ||
echo $ETH_NODE_URI_MAINNET | ||
;; | ||
"2") | ||
echo $ETH_NODE_URI_ARBITRUM | ||
;; | ||
"3") | ||
echo $ETH_NODE_URI_POLYGON | ||
;; | ||
"4") | ||
echo $ETH_NODE_URI_GNOSIS | ||
;; | ||
"5") | ||
echo $ETH_NODE_URI_AVALANCHE | ||
;; | ||
"6") | ||
echo $ETH_NODE_URI_BASE | ||
;; | ||
"7") | ||
echo $ETH_NODE_URI_BSC | ||
;; | ||
"8") | ||
echo $ETH_NODE_URI_CELO | ||
;; | ||
"9") | ||
echo $ETH_NODE_URI_POLYGON_ZKEVM | ||
;; | ||
"10") | ||
echo $ETH_NODE_URI_OPTIMISM | ||
;; | ||
"11") | ||
echo $ETH_NODE_URI_LINEA | ||
;; | ||
*) | ||
;; | ||
esac | ||
} | ||
|
||
function chain_to_chainId { | ||
chain=$1 | ||
|
||
case $chain in | ||
"1") | ||
echo "1" | ||
;; | ||
"2") | ||
echo "42161" | ||
;; | ||
"3") | ||
echo "137" | ||
;; | ||
"4") | ||
echo "100" | ||
;; | ||
"5") | ||
echo "43114" | ||
;; | ||
"6") | ||
echo "8453" | ||
;; | ||
"7") | ||
echo "56" | ||
;; | ||
"8") | ||
echo "42220" | ||
;; | ||
"9") | ||
echo "1101" | ||
;; | ||
"10") | ||
echo "10" | ||
;; | ||
"11") | ||
echo "59144" | ||
;; | ||
*) | ||
;; | ||
esac | ||
} |
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
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,108 @@ | ||
#! /bin/bash | ||
|
||
source helpers/common.sh | ||
|
||
|
||
function usage { | ||
echo "bash runScript.sh <script> <chain>" | ||
echo "" | ||
echo -e "script: path to the script to run" | ||
echo -e "chain: chain(s) to run the script on (separate with commas)" | ||
echo -e "\t1: Ethereum Mainnet" | ||
echo -e "\t2: Arbitrum" | ||
echo -e "\t3: Polygon" | ||
echo -e "\t4: Gnosis" | ||
echo -e "\t5: Avalanche" | ||
echo -e "\t6: Base" | ||
echo -e "\t7: Binance Smart Chain" | ||
echo -e "\t8: Celo" | ||
echo -e "\t9: Polygon ZkEvm" | ||
echo -e "\t10: Optimism" | ||
echo -e "\t11: Linea" | ||
echo -e "\t12: All" | ||
echo "" | ||
} | ||
|
||
function main { | ||
command=false | ||
if [[ $# -ne 2 && $# -ne 0 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
if [ $# -eq 2 ]; then | ||
script=$1 | ||
chains=$2 | ||
command=true | ||
fi | ||
|
||
if [ ! -f .env ]; then | ||
echo ".env not found!" | ||
exit 1 | ||
fi | ||
source .env | ||
|
||
if [ $command != true ]; then | ||
echo "" | ||
echo "What script would you like to run ?" | ||
|
||
read script | ||
|
||
if [ -z "$script" ]; then | ||
echo "No script provided" | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
|
||
echo "Which chain(s) would you like to run the script on ? (separate with commas)" | ||
echo "- 1: Ethereum Mainnet" | ||
echo "- 2: Arbitrum" | ||
echo "- 3: Polygon" | ||
echo "- 4: Gnosis" | ||
echo "- 5: Avalanche" | ||
echo "- 6: Base" | ||
echo "- 7: Binance Smart Chain" | ||
echo "- 8: Celo" | ||
echo "- 9: Polygon ZkEvm" | ||
echo "- 10: Optimism" | ||
echo "- 11: Linea" | ||
echo "- 12: All" | ||
|
||
read chains | ||
|
||
if [ -z "$chains" ]; then | ||
echo "No chain provided" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
mainnet_uri=$(chain_to_uri 1) | ||
|
||
if [[ "$chains" == "12" ]]; then | ||
# If user entered 12 (All), loop from 1 to 11 and add all chains | ||
chains="1,2,3,4,5,6,7,8,9,10,11" | ||
fi | ||
|
||
chainIds="" | ||
for chain in $(echo $chains | sed "s/,/ /g") | ||
do | ||
if [[ -z $chainIds ]]; then | ||
chainIds="$(chain_to_chainId $chain)" | ||
else | ||
chainIds="$chainIds,$(chain_to_chainId $chain)" | ||
fi | ||
done | ||
|
||
echo "" | ||
echo "Running on chains $chainIds" | ||
|
||
export CHAIN_IDS=$chainIds | ||
FOUNDRY_PROFILE=dev forge script $script | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "" | ||
echo "Script failed" | ||
fi | ||
} | ||
|
||
main $@ |
Submodule angle-router
added at
0cccd2
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
Oops, something went wrong.