Skip to content

Commit

Permalink
Merge branch 'main' into add-timelock-contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 authored Dec 19, 2024
2 parents 8c85ae5 + c9e6246 commit af28afa
Show file tree
Hide file tree
Showing 56 changed files with 2,366 additions and 297 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/forceMergePRBypassAudit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Force-Merge PR (Bypass Audit Requirement)
# - This git action may only be used in exceptional cases
# - Exceptional cases are for example issues in an audit-protected contract that do not touch the code itself such
# as an issue with the solidity pragma or some issue in a comment
# - it can only be executed by the CTO or the Information Security Manager/Architect
# - a valid reason must be provided in order to force-merge a given PR

on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to bypass'
required: true
justification:
description: 'Reason for bypass'
required: true

jobs:
force-merge-pr-bypass-audit:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Fetch Information Security Team Members
env:
GH_PAT: ${{ secrets.GIT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
##### Unset default GITHUB_TOKEN (insufficient permissions)
unset GITHUB_TOKEN
##### Authenticate with Personal Access Token
echo "::add-mask::$GH_PAT" # Mask the token
echo $GH_PAT | gh auth login --with-token
##### Fetch team members of 'informationsecuritymanager' team
ORG_NAME="lifinance"
TEAM_SLUG="informationsecuritymanager"
TEAM_MEMBERS=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/orgs/$ORG_NAME/teams/$TEAM_SLUG/members" | jq -r '.[].login')
if [[ -z "$TEAM_MEMBERS" ]]; then
echo -e "\033[31mERROR: Could not retrieve team members of $TEAM_SLUG.\033[0m"
exit 1
fi
echo "The following users are members of $TEAM_SLUG: $TEAM_MEMBERS"
echo "$TEAM_MEMBERS" > team_members.txt
- name: Verify Actor's Team Membership
run: |
##### Check if the actor is in the team members list
ACTOR="${{ github.actor }}"
TEAM_MEMBERS=$(cat team_members.txt)
# Strict validation of actor against team members
if echo "$TEAM_MEMBERS" | while read -r member; do
[[ "$member" == "$ACTOR" ]] && exit 0
done; then
echo -e "\033[32m$ACTOR is authorized to approve bypasses.\033[0m"
echo "CONTINUE=true" >> "$GITHUB_ENV"
else
echo -e "\033[31mERROR: $ACTOR is NOT authorized to approve bypasses\033[0m"
exit 1
fi
- name: Log Justification
if: env.CONTINUE == 'true'
run: |
echo "Bypass approved for PR #${{ github.event.inputs.pr_number }} by $ACTOR."
echo "Justification: ${{ github.event.inputs.justification }}"
- name: Merge the PR
uses: actions/[email protected]
if: env.CONTINUE == 'true'
with:
script: |
const pr = parseInt(core.getInput('pr_number'));
console.log(`Merging PR ${pr} now`)
// Fetch PR details
const { data: prData } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr
});
// Validate PR state
if (!prData.mergeable) {
throw new Error('PR is not in a mergeable state');
}
await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr,
merge_method: "squash",
commit_title: `[BYPASS] ${prData.title}`,
commit_message: `Bypassed by ${context.actor}\nJustification: ${core.getInput('justification')}`
});
- name: Send Discord message
uses: Ilshidur/[email protected]
with:
args: |
:warning: '${{ github.actor }} just bypassed the audit requirement controls to force-merge PR #${{ github.event.inputs.pr_number }}.'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_DEV_SMARTCONTRACTS }}
8 changes: 4 additions & 4 deletions .github/workflows/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
echo "Current version: $CURRENT_VERSION"
VERSION_FRAGMENT=""
BETA=""
# Determine the type of version bump
if [[ "$BRANCH_NAME" == "main" ]]; then
Expand Down Expand Up @@ -151,10 +152,9 @@ jobs:
PATCH=$((PATCH + 1))
elif [[ "$VERSION_FRAGMENT" == "beta" ]]; then
PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}-beta"
else
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
BETA="-beta"
fi
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}${BETA}"
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
Expand All @@ -169,7 +169,7 @@ jobs:
run: |
cd lifi-contract-types
TMP=$(mktemp)
jq '.version="${NEW_VERSION}"' package.json > "$TMP" && mv "$TMP" package.json
jq --arg version "$NEW_VERSION" '.version=$version' package.json > "$TMP" && mv "$TMP" package.json
git config user.name github-actions
git config user.email [email protected]
echo "Updating version from $LATEST_TAG to $NEW_VERSION"
Expand Down
87 changes: 73 additions & 14 deletions audit/auditLog.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,48 +49,107 @@
"auditReportPath": "./audit/reports/2024.11.22_Permit2Proxy.pdf",
"auditCommitHash": "0e3debb78abcdf9a9f934115338b611e16b039a0"
},
"audit20241202": {
"auditCompletedOn": "02.12.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024-12-02_RelayFacet(v1.0.0).pdf",
"auditCommitHash": "291d0a78bc4174b3ec29bb2ce0b27c6b5d3e8ec8"
},
"audit20241203": {
"auditCompletedOn": "03.12.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024.12.03_LiFiDexAggregator.pdf",
"auditCommitHash": "8a34562c912b5b19c919bb95338655c944428af5"
},
"audit20241206": {
"auditCompletedOn": "06.12.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024.12.06_AcrossFacetPackedV3(v1.2.0).pdf",
"auditCommitHash": "5f59b4957fe315ea2d7b5e9daa931785ccff488c"
}
},
"auditedContracts": {
"AcrossFacetPackedV3": {
"1.0.0": [
"audit20241007"
]
},
"AcrossFacetV3": {
"1.0.0": ["audit20241007"]
"1.0.0": [
"audit20241007"
]
},
"AcrossFacetPackedV3": {
"1.0.0": ["audit20241007"]
"1.0.0": [
"audit20241007"
],
"1.2.0": [
"audit20241206"
],
},
"EmergencyPauseFacet": {
"1.0.0": [
"audit20240913"
],
"1.0.1": [
"audit20241105"
]
},
"GasZipFacet": {
"2.0.0": ["audit20241107"]
"2.0.0": [
"audit20241107"
]
},
"GasZipPeriphery": {
"1.0.0": ["audit20241107"]
"1.0.0": [
"audit20241107"
]
},
"IGasZip": {
"1.0.0": ["audit20241107"]
"1.0.0": [
"audit20241107"
]
},
"EmergencyPauseFacet": {
"1.0.0": ["audit20240913"],
"1.0.1": ["audit20241105"]
"LibAsset": {
"1.0.1": [
"audit20241202"
]
},
"LiFiDEXAggregator": {
"1.5.0": ["audit20241203"]
"1.5.0": [
"audit20241203"
]
},
"Permit2Proxy": {
"1.0.0": ["audit20241122"]
"1.0.0": [
"audit20241122"
]
},
"ReceiverAcrossV3": {
"1.0.0": ["audit20241007"]
"1.0.0": [
"audit20241007"
],
"1.0.1": [
"audit20241206"
]
},
"RelayFacet": {
"1.0.0": [
"audit20241202"
]
},
"StargateFacetV2": {
"1.0.1": ["audit20240814"]
"1.0.1": [
"audit20240814"
]
},
"WithdrawablePeriphery": {
"1.0.0": ["audit20241014"]
"1.0.0": [
"audit20241014"
]
}
}
}
}
Binary file added audit/reports/2024-12-02_RelayFacet(v1.0.0).pdf
Binary file not shown.
Binary file not shown.
46 changes: 46 additions & 0 deletions config/relay.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"mainnet": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"optimism": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"polygon": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"boba": {
"relayReceiver": "0xa06e1351e2fd2d45b5d35633ca7ecf328684a109",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"arbitrum": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"avalanche": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"blast": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"mode": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"linea": {
"relayReceiver": "0x00000000aa467eba42a3d604b3d74d63b2b6c6cb",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"taiko": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"scroll": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
}
}
Loading

0 comments on commit af28afa

Please sign in to comment.