Skip to content

Commit

Permalink
Merge pull request #10 from FastLane-Labs/new-chains
Browse files Browse the repository at this point in the history
update: reformat json + add bsc chain configs
  • Loading branch information
jj1980a authored Oct 28, 2024
2 parents 46d0c94 + 25a857e commit cfdf138
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 169 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/golang-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Golang Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Run Golang Tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.22.5']

steps:
- uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
working-directory: ./golang
run: go mod download

- name: Copy config file
working-directory: ./golang
run: make copy-config

- name: Run tests
working-directory: ./golang
run: make test

- name: Run lint
working-directory: ./golang
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
make lint
- name: Run all checks
working-directory: ./golang
run: make check
40 changes: 40 additions & 0 deletions .github/workflows/typescript-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: TypeScript Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Run TypeScript Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.9.0

- name: Install dependencies
working-directory: ./typescript
run: pnpm install --frozen-lockfile

- name: Build
working-directory: ./typescript
run: pnpm build

- name: Run tests
working-directory: ./typescript
run: pnpm test
96 changes: 49 additions & 47 deletions configs/chain-config.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"11155111": {
"contracts": {
"atlas": {
"address": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482"
},
"atlasVerification": {
"address": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3"
},
"sorter": {
"address": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C"
},
"simulator": {
"address": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482",
"atlasVerification": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3",
"sorter": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C",
"simulator": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
Expand All @@ -27,21 +17,11 @@

"137": {
"contracts": {
"atlas": {
"address": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5"
},
"atlasVerification": {
"address": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220"
},
"sorter": {
"address": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f"
},
"simulator": {
"address": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5",
"atlasVerification": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220",
"sorter": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f",
"simulator": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
Expand All @@ -50,30 +30,52 @@
"verifyingContract": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220"
}
},

"80002": {
"contracts": {
"atlas": {
"address": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9"
},
"atlasVerification": {
"address": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435"
},
"sorter": {
"address": "0xa55051bd82eFeA1dD487875C84fE9c016859659B"
},
"simulator": {
"address": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9",
"atlasVerification": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435",
"sorter": "0xa55051bd82eFeA1dD487875C84fE9c016859659B",
"simulator": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 80002,
"verifyingContract": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435"
}
}
},

"56": {
"contracts": {
"atlas": "0xD72D821dA82964c0546a5501347a3959808E072f",
"atlasVerification": "0xae631aCDC436b9Dfd75C5629F825330d91459445",
"sorter": "0xb47387995e866908B25b49e8BaC7e499170461A6",
"simulator": "0xAb665f032e6A20Ef7D43FfD4E92a2f4fd6d5771e",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 56,
"verifyingContract": "0xae631aCDC436b9Dfd75C5629F825330d91459445"
}
},

"97": {
"contracts": {
"atlas": "0x164d3f6Bd3e78220f59e33729aA0E473C57EB067",
"atlasVerification": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B",
"sorter": "0xc41EEF5317a0e477Fef550f792AF5b5Bb9e13b34",
"simulator": "0x91113eBDFD0c14BFAF48affD400800Bf851F6D11",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 97,
"verifyingContract": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B"
}
}
}
24 changes: 10 additions & 14 deletions golang/config/atlas_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ import (
"github.com/ethereum/go-ethereum/signer/core/apitypes"
)

type ContractJSON struct {
Address string `json:"address"`
}

type ContractsJSON struct {
Atlas ContractJSON `json:"atlas"`
AtlasVerification ContractJSON `json:"atlasVerification"`
Sorter ContractJSON `json:"sorter"`
Simulator ContractJSON `json:"simulator"`
Multicall3 ContractJSON `json:"multicall3"`
Atlas string `json:"atlas"`
AtlasVerification string `json:"atlasVerification"`
Sorter string `json:"sorter"`
Simulator string `json:"simulator"`
Multicall3 string `json:"multicall3"`
}

type Contracts struct {
Expand Down Expand Up @@ -84,11 +80,11 @@ func init() {
for chainID, config := range chainConfigJSON {
chainConfig[chainID] = ChainConfig{
Contracts: Contracts{
Atlas: common.HexToAddress(config.Contracts.Atlas.Address),
AtlasVerification: common.HexToAddress(config.Contracts.AtlasVerification.Address),
Sorter: common.HexToAddress(config.Contracts.Sorter.Address),
Simulator: common.HexToAddress(config.Contracts.Simulator.Address),
Multicall3: common.HexToAddress(config.Contracts.Multicall3.Address),
Atlas: common.HexToAddress(config.Contracts.Atlas),
AtlasVerification: common.HexToAddress(config.Contracts.AtlasVerification),
Sorter: common.HexToAddress(config.Contracts.Sorter),
Simulator: common.HexToAddress(config.Contracts.Simulator),
Multicall3: common.HexToAddress(config.Contracts.Multicall3),
},
EIP712Domain: config.EIP712Domain,
}
Expand Down
96 changes: 49 additions & 47 deletions golang/config/chain-config.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"11155111": {
"contracts": {
"atlas": {
"address": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482"
},
"atlasVerification": {
"address": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3"
},
"sorter": {
"address": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C"
},
"simulator": {
"address": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x9EE12d2fed4B43F4Be37F69930CcaD9B65133482",
"atlasVerification": "0xB6F66a1b7cec02324D83c8DEA192818cA23A08B3",
"sorter": "0xFE3c655d4D305Ac7f1c2F6306C79397560Afea0C",
"simulator": "0xc3ab39ebd49D80bc36208545021224BAF6d2Bdb0",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
Expand All @@ -27,21 +17,11 @@

"137": {
"contracts": {
"atlas": {
"address": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5"
},
"atlasVerification": {
"address": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220"
},
"sorter": {
"address": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f"
},
"simulator": {
"address": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x892F8f6779ca6927c1A6Cc74319e03d2abEf18D5",
"atlasVerification": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220",
"sorter": "0x81f1E70A11A9E10Fa314cC093D149E5ec56EE97f",
"simulator": "0xfBc81A39459E0D82EC31B4e585f7A318AFAdB49B",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
Expand All @@ -50,30 +30,52 @@
"verifyingContract": "0xc05DDBe9745ce9DB45C32F5e4C1DA7a3c4FDa220"
}
},

"80002": {
"contracts": {
"atlas": {
"address": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9"
},
"atlasVerification": {
"address": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435"
},
"sorter": {
"address": "0xa55051bd82eFeA1dD487875C84fE9c016859659B"
},
"simulator": {
"address": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2"
},
"multicall3": {
"address": "0xcA11bde05977b3631167028862bE2a173976CA11"
}
"atlas": "0x282BdDFF5e58793AcAb65438b257Dbd15A8745C9",
"atlasVerification": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435",
"sorter": "0xa55051bd82eFeA1dD487875C84fE9c016859659B",
"simulator": "0x3efbaBE0ee916A4677D281c417E895a3e7411Ac2",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 80002,
"verifyingContract": "0x3b7B38362bB7E2F000Cd2432343F3483F785F435"
}
}
},

"56": {
"contracts": {
"atlas": "0xD72D821dA82964c0546a5501347a3959808E072f",
"atlasVerification": "0xae631aCDC436b9Dfd75C5629F825330d91459445",
"sorter": "0xb47387995e866908B25b49e8BaC7e499170461A6",
"simulator": "0xAb665f032e6A20Ef7D43FfD4E92a2f4fd6d5771e",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 56,
"verifyingContract": "0xae631aCDC436b9Dfd75C5629F825330d91459445"
}
},

"97": {
"contracts": {
"atlas": "0x164d3f6Bd3e78220f59e33729aA0E473C57EB067",
"atlasVerification": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B",
"sorter": "0xc41EEF5317a0e477Fef550f792AF5b5Bb9e13b34",
"simulator": "0x91113eBDFD0c14BFAF48affD400800Bf851F6D11",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},
"eip712Domain": {
"name": "AtlasVerification",
"version": "1.0",
"chainId": 97,
"verifyingContract": "0xa4445464B090D92CD2BD1c6F487F5f6284B26F7B"
}
}
}
Loading

0 comments on commit cfdf138

Please sign in to comment.