Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L2 bots unification #558

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
efd8dae
feat: POC of l2 bots unification on Scroll example
arwer13 Jun 6, 2024
ad5d0a7
new scroll: restore govWatcher, proxyEventWatcher, monitorWithdrawals
arwer13 Jun 7, 2024
1550b8e
feat: fix monitorWithdrawals + its historical test
arwer13 Jun 11, 2024
466edde
refactor(l2-bridges/scroll): remove leftovers of ProxyWatcher
arwer13 Jun 17, 2024
b593127
Merge branch 'main' into feat/l2-bridges-unification
arwer13 Jun 17, 2024
c33e21a
Merge branch 'main' into feat/l2-bridges-unification
arwer13 Jul 14, 2024
affdf45
refactor: move more agent.ts code to common code base
arwer13 Jul 14, 2024
7390246
feat(l2-bridges): add initial mantle agent version
arwer13 Jul 15, 2024
ec0e69d
chore(mantle): remove unused abi file
arwer13 Jul 15, 2024
49a2021
refactor: store events in constants object right away
arwer13 Jul 16, 2024
86c3a60
refactor: rename monitor_withdrawals test files
arwer13 Jul 16, 2024
a6c3d79
fix(l2,monitor_withdrawals): fix HUGE-WITHDRAWALS-FROM-L2 alert text
arwer13 Jul 26, 2024
204d2b2
feat(l2 unified): add mvp for ZkSync
arwer13 Jul 26, 2024
af38485
Merge branch 'main' into feat/l2-bridges-unification
arwer13 Jul 26, 2024
3df3ecf
test: fix build of monitor_withdrawal tests
arwer13 Jul 26, 2024
fd71e27
test: add setup for running unit tests on test fork node
arwer13 Jul 27, 2024
35df628
test: add mvp example test which simulates event condition on the fork
arwer13 Jul 29, 2024
ff2459e
fix(MonitorWithdrawals): fix error in checking events addresses
arwer13 Jul 29, 2024
656e01f
Merge branch 'main' into feat/l2-bridges-unification
arwer13 Aug 4, 2024
57c2a6d
feat: prototype for event-based alert bundles for Mantle
arwer13 Aug 20, 2024
78f858e
refactor: use bigint instead of BigNumber for MonitorWithdrawals
arwer13 Aug 20, 2024
62fe2f9
Merge branch 'main' into feat/l2-bridges-unification
arwer13 Aug 20, 2024
9ff36e6
feat: add optimism network
arwer13 Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ forta.config.json
version.json
.DS_Store
.idea
.vscode
2 changes: 2 additions & 0 deletions l2-bridges/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
common/generated
**/src/generated
24 changes: 24 additions & 0 deletions l2-bridges/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build stage: compile Typescript to Javascript
FROM node:20.9.0-alpine3.18 AS base

FROM base as builder

ARG L2_NETWORK_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass env though linux .env

ENV L2_NETWORK_NAME ${L2_NETWORK_NAME}

WORKDIR /app

COPY package.json yarn.lock tsconfig.json \
version.json \
start-agent.ts \
./

COPY common ./common/
COPY $L2_NETWORK_NAME ./$L2_NETWORK_NAME/

RUN yarn install --frozen-lockfile

Check failure on line 19 in l2-bridges/Dockerfile

View workflow job for this annotation

GitHub Actions / docker / Check docker issues

DL3060 info: `yarn cache clean` missing after `yarn install` was run.

# Build app
RUN yarn build

Check failure on line 22 in l2-bridges/Dockerfile

View workflow job for this annotation

GitHub Actions / docker / Check docker issues

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

CMD yarn start ${L2_NETWORK_NAME} prod

Check failure on line 24 in l2-bridges/Dockerfile

View workflow job for this annotation

GitHub Actions / docker / Check docker issues

DL3025 warning: Use arguments JSON notation for CMD and ENTRYPOINT arguments
34 changes: 34 additions & 0 deletions l2-bridges/common/abi/ERC20Short.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speaking about abi.

Move it please into root 'brief' folder like in steth. Because we have to have smt some and also we have to add here grpc capabilities.

{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
28 changes: 28 additions & 0 deletions l2-bridges/common/abi/OssifiableProxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"inputs": [],
"name": "proxy__getAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxy__getImplementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
151 changes: 151 additions & 0 deletions l2-bridges/common/abi/ProxyAdmin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [
{
"internalType": "contract ITransparentUpgradeableProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeProxyAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ITransparentUpgradeableProxy",
"name": "proxy",
"type": "address"
}
],
"name": "getProxyAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ITransparentUpgradeableProxy",
"name": "proxy",
"type": "address"
}
],
"name": "getProxyImplementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ITransparentUpgradeableProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ITransparentUpgradeableProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "implementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
76 changes: 76 additions & 0 deletions l2-bridges/common/abi/TransparentUpgradableProxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
Loading
Loading