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

Merge develop into main branch #29

Merged
merged 15 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Build

on:
push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
pull_request:
branches: [ main, develop ]

jobs:

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker Image to GitHub Package Registry

on:
push:
tags:
- '*'

jobs:
build-and-push-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ WORKDIR /app

RUN go mod download

COPY ./bindings /app/bindings
COPY ./core /app/core
COPY ./cmd /app/cmd
COPY ./Makefile /app/Makefile
COPY ./bot.toml /app/bot.toml
COPY ./bot.testnet.toml /app/bot.testnet.toml
COPY ./bot.mainnet.toml /app/bot.mainnet.toml

WORKDIR /app/

RUN make build-go

FROM alpine:3.18

COPY --from=builder /app/bot /usr/local/bin
COPY --from=builder /app/bot.toml /app/bot.toml
COPY --from=builder /app/bot /usr/local/bin
COPY --from=builder /app/bot.testnet.toml /bot.testnet.toml
COPY --from=builder /app/bot.mainnet.toml /bot.mainnet.toml

WORKDIR /app

CMD ["bot", "run", "--config", "/app/bot.toml"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ build-solidity:
forge build; \
popd;

bindings: build-solidity
jq '.abi' contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.json > contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.abi; \
abigen --abi contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.abi --pkg bindings --type L2StandardBridgeBot --out bindings/L2StandardBridgeBot.go

.PHONY: \
bot \
build-go \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ references

### Getting Started at opBNB testnet

1. Prepare a PostgreSQL database
1. Prepare a MySQL database

```
docker-compose up -d
Expand Down
896 changes: 896 additions & 0 deletions bindings/L2StandardBridgeBot.go

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions bot.mainnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
l2-starting-number = 12602733
propose-time-window = 3600
challenge-time-window = 604800

[rpcs]
l1-rpc = "$OPBNB_BRIDGE_BOT_L1_RPC"
l2-rpc = "$OPBNB_BRIDGE_BOT_L2_RPC"

[tx-signer]
privkey = "$OPBNB_BRIDGE_BOT_PRIVKEY"
gas-price = 3000000000 # 3 gwei

[db]
host = "$OPBNB_BRIDGE_BOT_DB_HOST"
port = $OPBNB_BRIDGE_BOT_DB_PORT
user = "$OPBNB_BRIDGE_BOT_DB_USER"
password = "$OPBNB_BRIDGE_BOT_DB_PASSWORD"
name = "$OPBNB_BRIDGE_BOT_DB_NAME"

[l1-contracts]
optimism-portal = "0x1876EA7702C0ad0C6A2ae6036DE7733edfBca519"
l2-output-oracle = "0x153CAB79f4767E2ff862C94aa49573294B13D169"
l1-cross-domain-messenger = "0xd95D508f13f7029CCF0fb61984d5dfD11b879c4f"

[l2-standard-bridge-bot]
contract-address = "0x1aa15a27115589e107ec1d2b581adbb92bbc04b7"
log-filter-block-range = 1000

# See https://github.com/bnb-chain/opbnb-bridge-tokens/blob/main/opbnb.tokenlist.json
whitelist-l2-token-list = [
"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", # Native token
"0x7c6b91d9be155a6db01f749217d76ff02a7227f2", # BTCB
"0xe7798f023fc62146e8aa1b36da45fb70855a77ea", # ETH
"0x50c5725949a6f0c72e6c4a641f24049a917db0cb", # FDUSD
"0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3" # USDT
]
39 changes: 39 additions & 0 deletions bot.testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
propose-time-window = 240
challenge-time-window = 120 # in seconds. Adjust the setting to 120 seconds for convenience during testing.
l2-starting-number = $OPBNB_BRIDGE_BOT_L2_STARTING_NUMBER

[rpcs]
l1-rpc = "$OPBNB_BRIDGE_BOT_L1_RPC"
l2-rpc = "$OPBNB_BRIDGE_BOT_L2_RPC"

[tx-signer]
privkey = "$OPBNB_BRIDGE_BOT_PRIVKEY"
gas-price = 5000000000 # 5 gwei

[db]
host = "$OPBNB_BRIDGE_BOT_DB_HOST"
port = $OPBNB_BRIDGE_BOT_DB_PORT
user = "$OPBNB_BRIDGE_BOT_DB_USER"
password = "$OPBNB_BRIDGE_BOT_DB_PASSWORD"
name = "$OPBNB_BRIDGE_BOT_DB_NAME"

[l1-contracts]
optimism-portal = "0x4386c8abf2009ac0c263462da568dd9d46e52a31"
l2-output-oracle = "0xff2394bb843012562f4349c6632a0ecb92fc8810"
l1-cross-domain-messenger = "0xd506952e78eecd5d4424b1990a0c99b1568e7c2c"

[l2-standard-bridge-bot]
contract-address = "0xE750d1f9180294473baCd960Ce5F9576eFBd70f2"
log-filter-block-range = 1000

# See https://github.com/bnb-chain/opbnb-bridge-tokens#opbnb-testnet-token-list
whitelist-l2-token-list = [
"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", # Native token
"0xa9aD1484D9Bfb27adbc2bf50A6E495777CC8cFf2", # BUSD
"0x3AB4E696E31173409dbfBb1FEB5b9A7cC55A212c", # BTCB
"0x584f7b986d9942B0859a1E6921efA5342A673d04", # ETH
"0xCF712f20c85421d00EAa1B6F6545AaEEb4492B75", # USDT
"0x845E27B8A4ad1Fe3dc0b41b900dC8C1Bb45141C3", # USDC
"0xf46896fbEf6478eaCcFB1C815915daa7e6f87b22", # DAI
"0x2C58b64b4BA448A9b60e9398E58d17F1824da962" # tBEP20
]
25 changes: 0 additions & 25 deletions bot.toml

This file was deleted.

Loading
Loading