Skip to content

Commit 03e8d23

Browse files
authored
Merge development into master (#87)
2 parents 04f9249 + e607ef2 commit 03e8d23

26 files changed

+2034
-495
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "CI"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- "master"
9+
10+
jobs:
11+
test:
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- name: "Check out the repo"
15+
uses: "actions/checkout@v4"
16+
17+
- name: "Install Node.js"
18+
uses: "actions/setup-node@v3"
19+
with:
20+
node-version: "20"
21+
22+
- name: "Install Yarn"
23+
run: "npm install --global yarn"
24+
25+
- name: "Install Node.js dependencies"
26+
run: "yarn install"
27+
28+
- name: "Create .env file"
29+
run: |
30+
echo 'PROVIDER_URL="https://mainnet.infura.io/v3/00000000000000000000000000000000"' > .env
31+
echo 'PROVIDER_WSS="wss://mainnet.infura.io/ws/v3/00000000000000000000000000000000"' >> .env
32+
echo 'FORWARD_URL="https://relay.flashbots.net"' >> .env
33+
echo 'OVAL_CONFIGS="{"0x000000000000000000000000000000000000beef":{"unlockerKey":"0x000000000000000000000000000000000000000000000000000000000000beef","refundAddress":"0x000000000000000000000000000000000000beef","refundPercent":90}}"' >> .env
34+
echo 'AUTH_PRIVATE_KEY="0x0000000000000000000000000000000000000000000000000000000000000000"' >> .env
35+
echo 'MAINNET_BLOCK_OFFSET=5' >> .env
36+
37+
- name: "Run the tests"
38+
run: "yarn test"
39+
40+
- name: "Add test summary"
41+
run: |
42+
echo "## Tests result" >> $GITHUB_STEP_SUMMARY
43+
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ build
33
*.log
44
.env
55
.DS_Store
6-
out
6+
out
7+
src/contract-types

.mocharc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"require": "ts-node/register",
3+
"extension": [
4+
"ts"
5+
],
6+
"spec": "test/**/*.ts",
7+
"watch-files": [
8+
"src/**/*.ts",
9+
"test/**/*.ts"
10+
]
11+
}

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Define a `.env` file and define, at minimum, the following (see [here](./src/lib
3434

3535
```
3636
OVAL_CONFIGS=<oval_configs_json> # JSON string that maps Oval contract addresses to their specific configurations (see below).
37+
OVAL_CONFIGS_SHARED=<oval_configs_shared_json># JSON string for shared unlocker configurations (see below).
3738
OVAL_ADDRESS=0x420 # (Only if not using OVAL_CONFIGS) The address of the Oval contract you want to target with the Oval Node.
3839
REFUND_ADDRESS=0x42069 # (Only if not using OVAL_CONFIGS) The refund address you want to send the OEV kickback to.
3940
REFUND_PERCENT=0.5 # (Only if not using OVAL_CONFIGS) The percentage of the OEV kickback to send to the refund address.
@@ -48,7 +49,6 @@ CHAIN_ID=<network_chain_id> # Chain ID of the Ethereum network
4849

4950
`OVAL_CONFIGS` is a JSON string that maps Oval contract addresses to their specific configurations. Each entry in this JSON object should have the following format:
5051

51-
5252
```json
5353
{
5454
"<Oval_Contract_Address>": {
@@ -66,6 +66,19 @@ CHAIN_ID=<network_chain_id> # Chain ID of the Ethereum network
6666
- `Refund_Address`: The Ethereum address where refunds will be sent.
6767
- `Refund_Percentage`: The percentage of the OEV kickback to send to the refund address.
6868

69+
`OVAL_CONFIGS_SHARED` is a JSON string that specifies the shared unlocker configurations for all Oval contracts. Each entry in this JSON object should have the following format:
70+
71+
```json
72+
[
73+
{
74+
"unlockerKey": "<Unlocker_Private_Key>", // Optional: Use either this or gckmsKeyId, not both.
75+
"gckmsKeyId": "<GCKMS_Key_ID>", // Optional: Use either this or unlockerKey, not both.
76+
},...
77+
]
78+
```
79+
80+
Note: If an Oval instance has an instance specific configuration, it will take precedence over the shared configuration.
81+
6982
### 2. Build & run the Oval Node:
7083

7184
Build the JS with:

package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@types/uuid": "^9.0.8",
1515
"@uma/logger": "^1.1.0",
1616
"axios": "^1.5.1",
17+
"bluebird": "^3.7.2",
1718
"body-parser": "^1.20.2",
1819
"ethers": "^6.8.0",
1920
"express": "^4.18.2",
@@ -26,16 +27,27 @@
2627
"typescript": "^5.2.2"
2728
},
2829
"devDependencies": {
30+
"@typechain/ethers-v6": "^0.5.1",
31+
"@types/bluebird": "^3.5.42",
32+
"@types/chai": "^4.3.16",
2933
"@types/eventsource": "^1.1.11",
34+
"@types/mocha": "^10.0.7",
3035
"@types/node": "^18.14.4",
36+
"@types/sinon": "^17.0.3",
3137
"@typescript-eslint/eslint-plugin": "^5.56.0",
3238
"@typescript-eslint/parser": "^5.56.0",
33-
"dotenv": "^16.3.1"
39+
"chai": "^4.4.1",
40+
"dotenv": "^16.3.1",
41+
"mocha": "^10.6.0",
42+
"sinon": "^18.0.0",
43+
"typechain": "^8.3.2"
3444
},
3545
"scripts": {
3646
"dev": "nodemon",
37-
"build": "tsc",
47+
"build": "yarn generate-contract-types && tsc",
48+
"test": "yarn generate-contract-types && mocha",
3849
"start": "node ./out/index.js",
39-
"lint": "prettier './**/*.ts' --write"
50+
"lint": "prettier './**/*.ts' --write",
51+
"generate-contract-types": "rm -rf src/contract-types && mkdir -p src/contract-types && typechain --target ethers-v6 --out-dir src/contract-types 'src/abi/*.json'"
4052
}
41-
}
53+
}

0 commit comments

Comments
 (0)