Skip to content

Commit

Permalink
Merge branch 'main' into update-opbnb
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 authored Oct 18, 2024
2 parents d463fc0 + a8da0f8 commit 52fc0a6
Show file tree
Hide file tree
Showing 16 changed files with 316 additions and 66 deletions.
24 changes: 4 additions & 20 deletions .github/workflows/diamondEmergencyPause.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Pause PRODUCTION diamond (CAREFUL)
name: EMERGENCY >> Pause all PROD diamonds

on:
workflow_dispatch:
inputs:
Warning:
description: 'By clicking the next button you are pausing all PROUCTION diamonds. Please proceed with extreme caution !!!'
description: "By clicking the next button you are pausing all PROUCTION diamonds. Please proceed with extreme caution !!! You must type 'UNDERSTOOD' to proceed"
required: true
default: 'Type UNDERSTOOD to continue'

jobs:
diamond-emergency-pause:
Expand All @@ -18,24 +17,9 @@ jobs:
- name: Check input
if: ${{ inputs.Warning != 'UNDERSTOOD' }}
run: |
echo -e "\033[31mYou must type 'UNDERSTOOD' to proceed.\033[0m"
echo -e "\033[31mYou must type 'UNDERSTOOD' to proceed. Please try again. \033[0m"
exit 1
# Keeping this code for now until team member authentication has been tested successfully
# - name: Authenticate user
# id: check_user
# run: |
# ALLOWED_USERS=("0xDEnYO" "maxklenk" "ezynda3")
# USER=${{ github.actor }}
# if [[ ! " ${ALLOWED_USERS[@]} " =~ " $USER " ]]; then
# echo "User $USER is not allowed to run this workflow. Only the following users are:"
# echo "$ALLOWED_USERS"
# exit 1
# else
# echo "User $USER is allowed to run this workflow."
# fi
# shell: bash

- name: Authenticate git user (check membership in 'DiamondPauser' group)
if: ${{ inputs.Warning == 'UNDERSTOOD' }}
id: authenticate-user
Expand Down Expand Up @@ -96,7 +80,7 @@ jobs:
ETH_NODE_URI_TAIKO: ${{ secrets.ETH_NODE_URI_TAIKO }}
ETH_NODE_URI_XLAYER: ${{ secrets.ETH_NODE_URI_XLAYER }}
ETH_NODE_URI_ZKSYNC: ${{ secrets.ETH_NODE_URI_ZKSYNC }}
PRIVATE_KEY_PAUSER_WALLET: ${{ secrets.TEST_PRIV_KEY_SECRET }}
PRIVATE_KEY_PAUSER_WALLET: ${{ secrets.PRIV_KEY_PAUSER_WALLET }}

- name: Send Discord message
uses: Ilshidur/[email protected]
Expand Down
16 changes: 10 additions & 6 deletions audit/auditLog.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024.09.13_EmergencyPauseFacet.pdf",
"auditCommitHash": "77441a088e0789513db4e068f7ef6c5c0988ee42"
},
"audit20241014": {
"auditCompletedOn": "14.10.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024.10.14_WithdrawablePeriphery.pdf",
"auditCommitHash": "b03e658b359f1696388e2aaeaf24a7c107ba462a"
}
},
"auditedContracts": {
"EmergencyPauseFacet": {
"1.0.0": ["audit20240913"]
},
"GenericErrors": {
"1.0.0": ["audit20240913"]
},
"LibDiamondLoupe": {
"1.0.0": ["audit20240913"]
},
"StargateFacetV2": {
"1.0.1": ["audit20240814"]
},
"WithdrawablePeriphery": {
"1.0.0": ["audit20241014"]
}
}
}
Binary file not shown.
1 change: 0 additions & 1 deletion config/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"pauserWallet": "0x3b6211981d47Fb6375E0125A6a401830616f7906",
"lifuelRebalanceWallet": "0xC71284231A726A18ac85c94D75f9fe17A185BeAF",
"deployerWallet": "0x11F1022cA6AdEF6400e5677528a80d49a069C00c",
"pauserWallet": "0x29DaCdF7cCaDf4eE67c923b4C22255A4B2494eD7",
"approvedSigsForRefundWallet": [
{
"sig": "0x0d19e519",
Expand Down
26 changes: 13 additions & 13 deletions deployments/_deployments_log_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -23451,12 +23451,12 @@
"staging": {
"1.0.0": [
{
"ADDRESS": "0x6DCDA5EEb0eb10D61eB9AAF93C3B89704955dA42",
"ADDRESS": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-07-21 15:50:57",
"CONSTRUCTOR_ARGS": "0x00000000000000000000000029dacdf7ccadf4ee67c923b4c22255a4b2494ed7",
"SALT": "",
"VERIFIED": "false"
"TIMESTAMP": "2024-10-09 13:34:31",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000b9c0de368bece5e76b52545a8e377a4c118f597b",
"SALT": "20241009",
"VERIFIED": "true"
}
]
}
Expand All @@ -23479,11 +23479,11 @@
"staging": {
"1.0.0": [
{
"ADDRESS": "0x9a0988b17D4419807DfC8E8fd2182A21eabB1361",
"ADDRESS": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-10-08 11:23:04",
"CONSTRUCTOR_ARGS": "0x00000000000000000000000029dacdf7ccadf4ee67c923b4c22255a4b2494ed7",
"SALT": "",
"TIMESTAMP": "2024-10-09 13:37:13",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000b9c0de368bece5e76b52545a8e377a4c118f597b",
"SALT": "20241009",
"VERIFIED": "true"
}
]
Expand All @@ -23493,11 +23493,11 @@
"staging": {
"1.0.0": [
{
"ADDRESS": "0x9a0988b17D4419807DfC8E8fd2182A21eabB1361",
"ADDRESS": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-10-08 11:25:56",
"CONSTRUCTOR_ARGS": "0x00000000000000000000000029dacdf7ccadf4ee67c923b4c22255a4b2494ed7",
"SALT": "",
"TIMESTAMP": "2024-10-09 13:32:11",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000b9c0de368bece5e76b52545a8e377a4c118f597b",
"SALT": "20241009",
"VERIFIED": "true"
}
]
Expand Down
10 changes: 7 additions & 3 deletions deployments/arbitrum.diamond.staging.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"LiFiDiamond": {
"Facets": {
"0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b": {
"Name": "EmergencyPauseFacet",
"Version": "1.0.0"
},
"0xB2A8517734CDf985d53F303A1f7759A34fdC772F": {
"Name": "DiamondCutFacet",
"Version": "1.0.0"
Expand Down Expand Up @@ -133,9 +137,9 @@
"Name": "",
"Version": ""
},
"0x9a0988b17D4419807DfC8E8fd2182A21eabB1361": {
"Name": "EmergencyPauseFacet",
"Version": "1.0.0"
"0xaF5001e4cd39B3515B244B18A88DD5b2fE65c5cD": {
"Name": "",
"Version": ""
}
},
"Periphery": {
Expand Down
2 changes: 1 addition & 1 deletion deployments/arbitrum.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
"HopFacetOptimized": "0xf82135385765f1324257ffF74489F16382EBBb8A",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70",
"EmergencyPauseFacet": "0x9a0988b17D4419807DfC8E8fd2182A21eabB1361"
"EmergencyPauseFacet": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b"
}
8 changes: 4 additions & 4 deletions deployments/optimism.diamond.staging.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"LiFiDiamond": {
"Facets": {
"0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b": {
"Name": "EmergencyPauseFacet",
"Version": "1.0.0"
},
"0xB2A8517734CDf985d53F303A1f7759A34fdC772F": {
"Name": "DiamondCutFacet",
"Version": "1.0.0"
Expand Down Expand Up @@ -120,10 +124,6 @@
"0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b": {
"Name": "",
"Version": ""
},
"0x9a0988b17D4419807DfC8E8fd2182A21eabB1361": {
"Name": "EmergencyPauseFacet",
"Version": "1.0.0"
}
},
"Periphery": {
Expand Down
2 changes: 1 addition & 1 deletion deployments/optimism.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"RelayerCelerIM": "0xC1906dC6b43EbE6AE511cc4abeB8711120Ab622e",
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70",
"EmergencyPauseFacet": "0x9a0988b17D4419807DfC8E8fd2182A21eabB1361"
"EmergencyPauseFacet": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b"
}
10 changes: 9 additions & 1 deletion deployments/polygon.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@
"0x21571D628B0bCBeb954D5933A604eCac35bAF2c7": {
"Name": "SymbiosisFacet",
"Version": "1.0.0"
},
"0xaF5001e4cd39B3515B244B18A88DD5b2fE65c5cD": {
"Name": "",
"Version": ""
},
"0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b": {
"Name": "EmergencyPauseFacet",
"Version": "1.0.0"
}
},
"Periphery": {
Expand All @@ -128,4 +136,4 @@
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70"
}
}
}
}
4 changes: 2 additions & 2 deletions deployments/polygon.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"GasRebateDistributor": "0x3116B8F099D7eFA6e24f39F80146Aac423365EB9",
"GenericSwapFacetV3": "0xFf6Fa203573Baaaa4AE375EB7ac2819d539e16FF",
"StargateFacetV2": "0xeb3f9490d8cbD0C34C0642a8d0495e5E0B0745AA",
"EmergencyPauseFacet": "0x6DCDA5EEb0eb10D61eB9AAF93C3B89704955dA42",
"EmergencyPauseFacet": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"StandardizedCallFacet": "0xA7ffe57ee70Ac4998e9E9fC6f17341173E081A8f",
"CalldataVerificationFacet": "0x90B5b319cA20D9E466cB5b843952363C34d1b54E",
"CelerCircleBridgeFacet": "0x371E073f6A09DCBEE1D2Ac56E940F878a0Ba9DAE",
"HopFacetOptimized": "0xf82135385765f1324257ffF74489F16382EBBb8A",
"SymbiosisFacet": "0x21571D628B0bCBeb954D5933A604eCac35bAF2c7"
}
}
32 changes: 32 additions & 0 deletions script/tasks/diamondEMERGENCYPause.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,38 @@ function handleNetwork() {
echoDebug "BLACKLIST=$BLACKLIST"
echo ""

# check if the diamond is already paused by calling owner() function and analyzing the response
local RESPONSE=$(cast call "$DIAMOND_ADDRESS" "owner()" --rpc-url "$RPC_URL" 2>&1)
# only required if we dont expect the diamond to be paused
if [[ "$ACTION" != "unpause the diamond" ]]; then
# Check for errors in the response
if [[ "$RESPONSE" == 0x* ]]; then
# If the response starts with "0x", it is a valid response, and the diamond is not paused
echo "[network: $NETWORK] The diamond is not yet paused. Proceeding..."
elif [[ "$RESPONSE" == *"$DIAMOND_IS_PAUSED_SELECTOR"* || "$RESPONSE" == *"DiamondIsPaused"* ]]; then
# If the response contains the pause selector or "DiamondIsPaused", the diamond is paused
success "[network: $NETWORK] The diamond is already paused."
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end network $NETWORK <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
exit 0
else
# Handle other RPC or network errors
error "[network: $NETWORK] RPC or network error while checking if diamond is paused: $RESPONSE"
fi
fi


if [[ "$ACTION" != "unpause the diamond" && ( "$RESPONSE" == *"$DIAMOND_IS_PAUSED_SELECTOR"* || "$RESPONSE" == *"DiamondIsPaused"* ) ]]; then
if [[ "$ACTION" == "remove a single facet" ]]; then
error "[network: $NETWORK] Cannot remove a facet while diamond is paused."
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end network $NETWORK <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
exit 1
else
success "[network: $NETWORK] The diamond is already paused. No further action required."
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end network $NETWORK <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
exit 0
fi
fi

# execute the requested action
local ATTEMPTS=1
while [ $ATTEMPTS -le "$MAX_ATTEMPTS_PER_SCRIPT_EXECUTION" ]; do
Expand Down
Loading

0 comments on commit 52fc0a6

Please sign in to comment.