diff --git a/.env.example b/.env.example index a768428..1468d01 100644 --- a/.env.example +++ b/.env.example @@ -41,4 +41,6 @@ LIGHTBRIDGE_POLLING_INTERVAL= LIGHTBRIDGE_BLOCK_RANGE_PER_POLLING= # Etherscan ETHERSCAN_API_KEY= +OPTIMISMSCAN_API_KEY= +ARBISCAN_API_KEY= diff --git a/.github/workflows/lb-release.yml b/.github/workflows/lb-release.yml index dc40153..8595352 100644 --- a/.github/workflows/lb-release.yml +++ b/.github/workflows/lb-release.yml @@ -1,9 +1,9 @@ name: Build & Release Light Bridge on: - workflow_dispatch: - release: - types: [published] + push: + tags: + - 'v*.*.*' jobs: build_docker: @@ -20,14 +20,19 @@ jobs: with: username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} - - name: Get project versions - run: | - echo "version=$(cat ./package.json | jq ".version" | tr -d '"\r\n')" >> $GITHUB_OUTPUT - id: version + - name: Create tag artifact + uses: actions/upload-artifact@v2 + with: + name: ${{github.ref_name}} + path: Release + #- name: Get project versions + # run: | + # echo "version=$(cat ./package.json | jq ".version" | tr -d '"\r\n')" >> $GITHUB_OUTPUT + # id: version - name: Build version specific docker image - run: docker build . --file ./Dockerfile.prod --tag bobanetwork/lightbridge:v${{ steps.version.outputs.version }} + run: docker build . --file ./Dockerfile.prod --tag bobanetwork/lightbridge:${{ github.ref_name }} - name: Push version specific docker image - run: docker push bobanetwork/lightbridge:v${{ steps.version.outputs.version }} + run: docker push bobanetwork/lightbridge:${{ github.ref_name }} - name: Build stable docker image run: docker build . --file ./Dockerfile.prod --tag bobanetwork/lightbridge:stable - name: Push stable docker image diff --git a/README.md b/README.md index 05256b6..96fadc1 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,17 @@ Make sure disbursers have enough liquidity in form of the native asset (such as - LightBridge deployed to: `0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9` - Proxy__LightBridge deployed to: `0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801` +### Optimism Mainnet +- LightBridge deployed to: `0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9` +- Proxy__LightBridge deployed to: `0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801` + +### Arbitrum Mainnet +- LightBridge deployed to: `0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9` +- Proxy__LightBridge deployed to: `0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801` + +### Boba ETH Mainnet +- LightBridge deployed to: `0x670b130112C6f03E17192e63c67866e67D77c3ee` +- Proxy__LightBridge deployed to: `0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5` ## Testnet deployments @@ -72,6 +83,7 @@ Make sure disbursers have enough liquidity in form of the native asset (such as ### Boba Sepolia - LightBridge deployed to: `0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9` - Proxy__LightBridge deployed to: `0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801` +- No alerts set yet, since no Tenderly support available (14 Feb 2024) ### Boba Goerli - LightBridge deployed to: `0x95ec63aE2573bD5e70C223E075D9483573968699` diff --git a/deploy/contract.deploy.ts b/deploy/contract.deploy.ts index 267b240..14ce765 100644 --- a/deploy/contract.deploy.ts +++ b/deploy/contract.deploy.ts @@ -71,6 +71,7 @@ async function main() { deployer ) + //const gasPrice = BigNumber.from("110000000") let gasLimit = prompt("Custom gas limit? [number/N]") if (isNaN(gasLimit?.toLowerCase())) { gasLimit = null; @@ -78,6 +79,10 @@ async function main() { gasLimit = parseInt(gasLimit) } + /*const deployData = Factory__LightBridge.interface.encodeDeploy() + const estimatedGas = await provider.estimateGas({ data: deployData }) + console.log("ESTIMATED GAS: ", estimatedGas, deployData)*/ + const redeploy = prompt("Want to redeploy? [Y/n]")?.toLowerCase() === "y" if (redeploy) { LightBridge = await Factory__LightBridge.deploy({gasLimit}) diff --git a/hardhat.config.ts b/hardhat.config.ts index 3c8e13d..4d4ed28 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -13,7 +13,7 @@ const config: HardhatUserConfig & {etherscan: {apiKey: any, customChains: any}} }, networks: { mainnet: { - url: 'https://eth.llamarpc.com', + url: process.env.LIGHTBRIDGE_RPC_ETHMAINNET ?? 'https://eth.llamarpc.com', accounts: [process.env.DEPLOYER_PK ?? LOCAL_PK], }, bsc: { @@ -29,7 +29,7 @@ const config: HardhatUserConfig & {etherscan: {apiKey: any, customChains: any}} accounts: [process.env.DEPLOYER_PK ?? LOCAL_PK], }, boba_eth_mainnet: { - url: 'https://mainnet.boba.network', + url: process.env.LIGHTBRIDGE_RPC_BOBAETHMAINNET ?? 'https://mainnet.boba.network', accounts: [process.env.DEPLOYER_PK ?? LOCAL_PK], }, boba_bnb_mainnet: { @@ -60,7 +60,7 @@ const config: HardhatUserConfig & {etherscan: {apiKey: any, customChains: any}} solidity: { version: '0.8.9', settings: { - optimizer: { enabled: true, runs: 10_000 }, + optimizer: { enabled: true, runs: 200 }, }, }, paths: { @@ -72,18 +72,19 @@ const config: HardhatUserConfig & {etherscan: {apiKey: any, customChains: any}} etherscan: { apiKey: { sepolia: process.env.ETHERSCAN_API_KEY, - arbitrumOne: "", + arbitrumOne: process.env.ARBISCAN_API_KEY, bsc: "", mainnet: process.env.ETHERSCAN_API_KEY, - optimisticEthereum: "", + optimisticEthereum: process.env.OPTIMISMSCAN_API_KEY, + boba_eth_mainnet: "boba", // not required, set placeholder }, customChains: [ { network: "boba_eth_mainnet", chainId: 288, urls: { - apiURL: "", - browserURL: "", + apiURL: "https://api.routescan.io/v2/network/mainnet/evm/288/etherscan", + browserURL: "https://bobascan.com" }, }, { diff --git a/lightbridge_deploy_logs/lightbridge-0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5-288.txt b/lightbridge_deploy_logs/lightbridge-0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5-288.txt new file mode 100644 index 0000000..50845a5 --- /dev/null +++ b/lightbridge_deploy_logs/lightbridge-0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5-288.txt @@ -0,0 +1,9 @@ +LightBridge deployed to: 0x670b130112C6f03E17192e63c67866e67D77c3ee +Proxy__LightBridge deployed to: 0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5 +Initialized proxy: [object Object] +LightBridge initialized: [object Object] +Added route for 1 chain, and token: 0x0000000000000000000000000000000000000000, receipt: [object Object] +Added route for 1 chain, and token: 0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7, receipt: [object Object] +Added route for 56288 chain, and token: 0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7, receipt: [object Object] +Added route for 56 chain, and token: 0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7, receipt: [object Object] +Network iteration done diff --git a/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-10.txt b/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-10.txt new file mode 100644 index 0000000..52c21e9 --- /dev/null +++ b/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-10.txt @@ -0,0 +1,6 @@ +LightBridge deployed to: 0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9 +Proxy__LightBridge deployed to: 0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801 +Initialized proxy: [object Object] +LightBridge initialized: [object Object] +Added route for 288 chain, and token: 0x0000000000000000000000000000000000000000, receipt: [object Object] +Network iteration done diff --git a/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-42161.txt b/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-42161.txt new file mode 100644 index 0000000..52c21e9 --- /dev/null +++ b/lightbridge_deploy_logs/lightbridge-0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801-42161.txt @@ -0,0 +1,6 @@ +LightBridge deployed to: 0x3f7Da9C51138E0475aA26E80677d27A568cFD6b9 +Proxy__LightBridge deployed to: 0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801 +Initialized proxy: [object Object] +LightBridge initialized: [object Object] +Added route for 288 chain, and token: 0x0000000000000000000000000000000000000000, receipt: [object Object] +Network iteration done diff --git a/src/utils/chains.ts b/src/utils/chains.ts index 48d9c68..45dfe9d 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -27,19 +27,18 @@ export const BobaChains: IBobaChains = { //#region boba_networks 288: { - // TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) --> boba listed though, but requires a hosted service url: process.env.LIGHTBRIDGE_RPC_BOBAETHMAINNET ?? 'https://boba-ethereum.gateway.tenderly.co', testnet: false, name: 'Boba Ethereum Mainnet', - teleportationAddress: '0xd68809330075C792C171C450B983F4D18128e9BF', - height: 873302, + teleportationAddress: '0x0dfFd3Efe9c3237Ad7bf94252296272c96237FF5', + height: 1111267, supportedAssets: { ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.ETH, ['0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7'.toLowerCase()]: Asset.BOBA, - ['0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d'.toLowerCase()]: Asset.USDT, - ['0x68ac1623ACf9eB9F88b65B5F229fE3e2c0d5789e'.toLowerCase()]: Asset.BNB, + //['0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d'.toLowerCase()]: Asset.USDT, + //['0x68ac1623ACf9eB9F88b65B5F229fE3e2c0d5789e'.toLowerCase()]: Asset.BNB, }, }, 56288: { @@ -57,7 +56,6 @@ export const BobaChains: IBobaChains = { }, }, 2888: { - // TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) url: process.env.LIGHTBRIDGE_RPC_BOBAETHGOERLI ?? 'https://replica.goerli.boba.network', @@ -71,7 +69,6 @@ export const BobaChains: IBobaChains = { }, }, 9728: { - // TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) url: process.env.LIGHTBRIDGE_RPC_BOBABNBTESTNET ?? 'https://boba-bnb-testnet.gateway.tenderly.co', @@ -110,27 +107,25 @@ export const BobaChains: IBobaChains = { }, }, 42161: { - // TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) url: process.env.LIGHTBRIDGE_RPC_ARBITRUMMAINNET ?? 'https://arbitrum.llamarpc.com', testnet: false, name: 'Arbitrum Mainnet', - teleportationAddress: '0xd68809330075C792C171C450B983F4D18128e9BF', - height: 3393, + teleportationAddress: '0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801', + height: 180755096, supportedAssets: { ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.ETH, }, }, 10: { - // TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) url: process.env.LIGHTBRIDGE_RPC_OPTIMISMMAINNET ?? 'https://optimism.llamarpc.com', testnet: false, name: 'Optimism Mainnet', - teleportationAddress: '0xd68809330075C792C171C450B983F4D18128e9BF', - height: 3393, + teleportationAddress: '0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801', + height: 116168267, supportedAssets: { ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.ETH, }, @@ -138,12 +133,11 @@ export const BobaChains: IBobaChains = { //#endregion //#region l1 1: { - // TODO: Public nodes available, deploy once contract is live url: process.env.LIGHTBRIDGE_RPC_ETHMAINNET ?? 'https://eth.llamarpc.com', testnet: false, name: 'Ethereum Mainnet', - teleportationAddress: '0x0', - height: 17565090, + teleportationAddress: '0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801', + height: 19227141, supportedAssets: { ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.ETH, ['0x42bBFa2e77757C645eeaAd1655E0911a7553Efbc'.toLowerCase()]: Asset.BOBA, @@ -152,17 +146,16 @@ export const BobaChains: IBobaChains = { }, }, 56: { - // TODO: Public nodes available, deploy once contract is live + // TODO: Replace light bridge contract url: process.env.LIGHTBRIDGE_RPC_BNBMAINNET ?? 'https://rpc.ankr.com/bsc', testnet: false, name: 'BNB Mainnet', teleportationAddress: '0x0', height: 30907682, supportedAssets: { - /*'0x0000000000000000000000000000000000000000': 'ETH', - '0x42bBFa2e77757C645eeaAd1655E0911a7553Efbc': 'BOBA', - '0xdAC17F958D2ee523a2206206994597C13D831ec7': 'USDT', - '0xB8c77482e45F1F44dE1745F52C74426C631bDD52': 'BNB',*/ + ['0xE0DB679377A0F5Ae2BaE485DE475c9e1d8A4607D'.toLowerCase()]: Asset.BOBA, + ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.BNB, + ['0x2170Ed0880ac9A755fd29B2688956BD959F933F8'.toLowerCase()]: Asset.ETH, }, }, // Sepolia @@ -187,7 +180,7 @@ export const BobaChains: IBobaChains = { testnet: true, name: 'Boba Sepolia Testnet', teleportationAddress: '0x2dE73Bd1660Fbf4D521a52Ec2a91CCc106113801', - height: 19220000, // TODO: might need to be adapted + height: 1043907, // TODO: might need to be adapted supportedAssets: { ['0x0000000000000000000000000000000000000000'.toLowerCase()]: Asset.ETH, ['0x4200000000000000000000000000000000000023'.toLowerCase()]: Asset.BOBA,