diff --git a/.github/_typos.toml b/.github/_typos.toml new file mode 100644 index 00000000000..6234b2c783f --- /dev/null +++ b/.github/_typos.toml @@ -0,0 +1,4 @@ +[default.extend-words] +TGE = "TGE" +TKO = "TKO" +Ethereum = "Ethereum" \ No newline at end of file diff --git a/.github/actions/install-pnpm-dependencies/action.yml b/.github/actions/install-pnpm-dependencies/action.yml index 5d98115c229..d3fec869f9e 100644 --- a/.github/actions/install-pnpm-dependencies/action.yml +++ b/.github/actions/install-pnpm-dependencies/action.yml @@ -5,12 +5,12 @@ runs: using: "composite" steps: - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 id: pnpm-install with: version: 8 @@ -23,7 +23,7 @@ runs: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Setup pnpm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 2155dc1341f..ea5584f3c41 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -11,3 +11,5 @@ jobs: - name: Check for typos uses: crate-ci/typos@master + with: + config: ${{github.workspace}}/.github/_typos.toml diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml index fea00761e31..70240c32d36 100644 --- a/.github/workflows/validate-pr-title.yml +++ b/.github/workflows/validate-pr-title.yml @@ -42,8 +42,8 @@ jobs: taikoon supplementary-contracts requireScope: true - subjectPattern: ^(?![A-Z]).+$ # Require lowercase PR title + subjectPattern: ^(?![A-Z])(?!.*\btypo\b).+$ # Require lowercase PR title and prohibit word "typo" subjectPatternError: | The subject "{subject}" found in the pull request title "{title}" didn't match the configured pattern. Please ensure that the subject - doesn't start with an uppercase character. + doesn't start with an uppercase character and doesn't contains word "typo". diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 45d0f2deaf1..35ae9eb9ecf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,11 +1,11 @@ { "packages/blobstorage": "0.1.0", "packages/branding": "0.3.0", - "packages/bridge-ui": "4.0.0", + "packages/bridge-ui": "4.2.0", "packages/eventindexer": "0.13.0", "packages/fork-diff": "0.4.0", "packages/guardian-prover-health-check": "0.1.0", "packages/guardian-prover-health-check-ui": "0.1.0", - "packages/protocol": "1.3.0", + "packages/protocol": "1.4.0", "packages/relayer": "0.12.0" } diff --git a/README.md b/README.md index 18e4e52d63d..40ed82d51f7 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,9 @@ taiko-mono/ │ ├── guardian-prover-health-check: Guardian prover health check service. │ ├── guardian-prover-health-check-ui: Guardian prover health check UI. │ ├── protocol: Taiko protocol smart contracts. -│ └── relayer: Bridge backend relayer. +│ ├── relayer: Bridge backend relayer. +│ ├── taikoon: Taikoon NFT contracts. +│ └── supplementary-contracts: Supplementary smart contracts that are not part of the Taiko rollup protocol. ... diff --git a/go.mod b/go.mod index 469b6e789ba..bb7542d4aa0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/ethereum-optimism/optimism v1.7.3 github.com/ethereum/go-ethereum v1.13.14 - github.com/go-git/go-git/v5 v5.11.0 + github.com/go-git/go-git/v5 v5.12.0 github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 github.com/google/uuid v1.6.0 github.com/joho/godotenv v1.5.1 @@ -51,7 +51,7 @@ require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.4 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/ProtonMail/go-crypto v1.0.0 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect @@ -65,7 +65,7 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cloudflare/circl v1.3.3 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 // indirect @@ -166,13 +166,13 @@ require ( github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/schollz/closestmatch v2.1.0+incompatible // indirect - github.com/sergi/go-diff v1.1.0 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sethvargo/go-retry v0.2.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/skeema/knownhosts v1.2.1 // indirect + github.com/skeema/knownhosts v1.2.2 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tdewolff/minify/v2 v2.12.7 // indirect diff --git a/go.sum b/go.sum index e714697fc48..3991d781536 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7 github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= +github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= @@ -110,8 +110,9 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= @@ -216,8 +217,8 @@ github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2Gihuqh github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= +github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= @@ -230,8 +231,8 @@ github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+ github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= -github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -573,8 +574,8 @@ github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiy github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec= github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -592,8 +593,8 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= diff --git a/packages/bridge-ui/.env.example b/packages/bridge-ui/.env.example index 35a9b244252..75876219180 100644 --- a/packages/bridge-ui/.env.example +++ b/packages/bridge-ui/.env.example @@ -34,4 +34,7 @@ export CONFIGURED_RELAYER= export CONFIGURED_EVENT_INDEXER= # Show the slow L1 bridging warning -export PUBLIC_SLOW_L1_BRIDGING_WARNING=false \ No newline at end of file +export PUBLIC_SLOW_L1_BRIDGING_WARNING=false + +# Fees +export PUBLIC_FEE_MULTIPLIER = \ No newline at end of file diff --git a/packages/bridge-ui/CHANGELOG.md b/packages/bridge-ui/CHANGELOG.md index 6b4d5effae8..ade38564f5f 100644 --- a/packages/bridge-ui/CHANGELOG.md +++ b/packages/bridge-ui/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## [4.2.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v4.1.0...bridge-ui-v4.2.0) (2024-04-24) + + +### Features + +* **bridge-ui:** update to protocol 1.0, two step bridging ([#16230](https://github.com/taikoxyz/taiko-mono/issues/16230)) +* **bridge-ui:** walletconnect not allowing to switch to unconfigured chains ([#16324](https://github.com/taikoxyz/taiko-mono/issues/16324)) +* **bridge-ui:** add testnet name to header ([#16619](https://github.com/taikoxyz/taiko-mono/issues/16619)) ([294bb01](https://github.com/taikoxyz/taiko-mono/commit/294bb017d90e4b8c2e1338a09f1cef90cdb54831)) +* **bridge-ui:** base64 NFT data ([#16645](https://github.com/taikoxyz/taiko-mono/issues/16645)) ([4516d0a](https://github.com/taikoxyz/taiko-mono/commit/4516d0aaa3c9ff0c50f16d1abc82999a8ac3d02f)) +* **bridge-ui:** mobile style for claim dialogs ([#16823](https://github.com/taikoxyz/taiko-mono/issues/16823)) ([63f15c9](https://github.com/taikoxyz/taiko-mono/commit/63f15c9dcad96aba755f7d618064b4149526cc22)) +* **bridge-ui:** prepare for hekla ([#16618](https://github.com/taikoxyz/taiko-mono/issues/16618)) ([6953b3c](https://github.com/taikoxyz/taiko-mono/commit/6953b3c141a1dec744a0e0bfa8c9aa0a1f405407)) +* **bridge-ui:** processingFee from API ([#16708](https://github.com/taikoxyz/taiko-mono/issues/16708)) ([3cd7cce](https://github.com/taikoxyz/taiko-mono/commit/3cd7cce1c52f94276011f4581143390c26acb49e)) +* **bridge-ui:** remove two step and change gasLimit ([#16765](https://github.com/taikoxyz/taiko-mono/issues/16765)) ([14576f7](https://github.com/taikoxyz/taiko-mono/commit/14576f78ae5a93fe5ec7972f3e32789f26723592)) +* **bridge-ui:** retry dialog ([#16536](https://github.com/taikoxyz/taiko-mono/issues/16536)) ([3beba21](https://github.com/taikoxyz/taiko-mono/commit/3beba214e62ad196bafd716cadaa3f133ecdb021)) +* **bridge-ui:** update to protocol 1.0, two step bridging ([#16230](https://github.com/taikoxyz/taiko-mono/issues/16230)) ([71babae](https://github.com/taikoxyz/taiko-mono/commit/71babae14645ff267c7baa101706860aa6f556f0)) +* **protocol:** risc0 verifier contract ([#16331](https://github.com/taikoxyz/taiko-mono/issues/16331)) ([17abc18](https://github.com/taikoxyz/taiko-mono/commit/17abc189ca3d2752beb5400c036a650fd5b9c895)) + + +### Bug Fixes + +* **bridge-ui:** add dependency ([#15999](https://github.com/taikoxyz/taiko-mono/issues/15999)) ([14484a0](https://github.com/taikoxyz/taiko-mono/commit/14484a00c1d59332361fba32b74d39db2ae4b864)) +* **bridge-ui:** add injected provider to connectors ([#16008](https://github.com/taikoxyz/taiko-mono/issues/16008)) ([0496ff4](https://github.com/taikoxyz/taiko-mono/commit/0496ff40e374354b83d17121e4760391fed90a31)) +* **bridge-ui:** add missing labels to i18n ([#16633](https://github.com/taikoxyz/taiko-mono/issues/16633)) ([3854467](https://github.com/taikoxyz/taiko-mono/commit/38544675bf6578bc1016ecfd60cb3a1f93207516)) +* **bridge-ui:** balance updating when connecting ([#16481](https://github.com/taikoxyz/taiko-mono/issues/16481)) ([2ec333f](https://github.com/taikoxyz/taiko-mono/commit/2ec333f5d3f3330c11dc0ab3afacc027c33cd5e0)) +* **bridge-ui:** canonical check can use wrong chain, incorrect supported chain check ([#16526](https://github.com/taikoxyz/taiko-mono/issues/16526)) ([d826e88](https://github.com/taikoxyz/taiko-mono/commit/d826e886eba989c35b3f28145f815642684f84d7)) +* **bridge-ui:** correct display of forward arrow and handling of invalid pagination input ([#16485](https://github.com/taikoxyz/taiko-mono/issues/16485)) ([d4d9ce9](https://github.com/taikoxyz/taiko-mono/commit/d4d9ce9bb7914b21f8ce6fc1ac5f986eb64d41f8)) +* **bridge-ui:** custom and none fee selection overwritten by error fetching recommended fee ([#16737](https://github.com/taikoxyz/taiko-mono/issues/16737)) ([9166ee3](https://github.com/taikoxyz/taiko-mono/commit/9166ee3e0a968db19d8cec2002565413d79cd708)) +* **bridge-ui:** defaulting to source chain explorer for link to canonical address ([#16701](https://github.com/taikoxyz/taiko-mono/issues/16701)) ([68bd435](https://github.com/taikoxyz/taiko-mono/commit/68bd4354d03429ceccd4b311db6e59066111af09)) +* **bridge-ui:** fix ERC721 and ERC1155 detection in NFT bridge ([#16680](https://github.com/taikoxyz/taiko-mono/issues/16680)) ([ca45aa6](https://github.com/taikoxyz/taiko-mono/commit/ca45aa6da6101f15fe9ef4c485e5d61a64f66f84)) +* **bridge-ui:** fix ETH self claiming ([#16344](https://github.com/taikoxyz/taiko-mono/issues/16344)) ([4271f0d](https://github.com/taikoxyz/taiko-mono/commit/4271f0d2b01da8179d604a0fbff0816a0d72e547)) +* **bridge-ui:** fix issue where balance is shown for wrong token ([#16541](https://github.com/taikoxyz/taiko-mono/issues/16541)) ([1dd47cf](https://github.com/taikoxyz/taiko-mono/commit/1dd47cf5eca91d47375547b23203a9f942e22e80)) +* **bridge-ui:** fix wrong balance updates on network switch ([#15980](https://github.com/taikoxyz/taiko-mono/issues/15980)) ([b556e00](https://github.com/taikoxyz/taiko-mono/commit/b556e000b25fc8d5405cba77f3eebb4152dc1497)) +* **bridge-ui:** incorrectly detecting bridged tokens ([#16007](https://github.com/taikoxyz/taiko-mono/issues/16007)) ([b151bcb](https://github.com/taikoxyz/taiko-mono/commit/b151bcb2e159ece03da3c2014e35dbbbed7d8410)) +* **bridge-ui:** manual import not resetting correctly ([#16347](https://github.com/taikoxyz/taiko-mono/issues/16347)) ([87398fe](https://github.com/taikoxyz/taiko-mono/commit/87398fe9606cf73ce66ed4f8321368fe8ac8fbb4)) +* **bridge-ui:** move label to i18n, fix some typos ([#16522](https://github.com/taikoxyz/taiko-mono/issues/16522)) ([c8c4773](https://github.com/taikoxyz/taiko-mono/commit/c8c4773dd3fe41decf13306eace73d65a9829529)) +* **bridge-ui:** preserve custom processing fee selection across components ([#16346](https://github.com/taikoxyz/taiko-mono/issues/16346)) ([9cf6b3a](https://github.com/taikoxyz/taiko-mono/commit/9cf6b3ae0981d1755d253cd7d6238771898fc3f4)) +* **bridge-ui:** prevent reverse tabnabbing attacks ([#16583](https://github.com/taikoxyz/taiko-mono/issues/16583)) ([fc57d82](https://github.com/taikoxyz/taiko-mono/commit/fc57d82cb7c049a656c2f08d947f4a5a42ffacf3)) +* **bridge-ui:** remove nft debug info from ui ([#16067](https://github.com/taikoxyz/taiko-mono/issues/16067)) ([5eddffe](https://github.com/taikoxyz/taiko-mono/commit/5eddffea3180e67c005d510ddaa7ffb90ce0a85a)) +* **bridge-ui:** renamed configuredCustomToken to configuredCustomTokens ([#15905](https://github.com/taikoxyz/taiko-mono/issues/15905)) ([a9f60b8](https://github.com/taikoxyz/taiko-mono/commit/a9f60b8c114dfd277e8dc227e7fbbe8716698d53)) +* **bridge-ui:** transactions view styling ([#15997](https://github.com/taikoxyz/taiko-mono/issues/15997)) ([620a22d](https://github.com/taikoxyz/taiko-mono/commit/620a22dcb1ce77a9335dff8bbe0546c4c5065b23)) +* **bridge-ui:** truncate selected token name to 5 characters ([#16066](https://github.com/taikoxyz/taiko-mono/issues/16066)) ([dc24155](https://github.com/taikoxyz/taiko-mono/commit/dc24155b306e447f0572d29918183570905866be)) +* **bridge-ui:** update disabled for chainselector ([#16814](https://github.com/taikoxyz/taiko-mono/issues/16814)) ([406b15a](https://github.com/taikoxyz/taiko-mono/commit/406b15a301c7a3454957518a2cc33a44fbf21cde)) +* **bridge-ui:** various small bugfixes ([#16078](https://github.com/taikoxyz/taiko-mono/issues/16078)) ([e610d19](https://github.com/taikoxyz/taiko-mono/commit/e610d1907ef47fb6e25d8bc26e9b7edf3954d886)) +* **bridge-ui:** walletconnect not allowing to switch to unconfigured chains ([#16324](https://github.com/taikoxyz/taiko-mono/issues/16324)) ([d6ef79e](https://github.com/taikoxyz/taiko-mono/commit/d6ef79eae0836a9dabd481cd0953bc03eea9bf7a)) + +## [4.1.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v4.0.0...bridge-ui-v4.1.0) (2024-04-24) + + +### Features + +* **bridge-ui:** processingFee from API ([#16708](https://github.com/taikoxyz/taiko-mono/issues/16708)) ([3cd7cce](https://github.com/taikoxyz/taiko-mono/commit/3cd7cce1c52f94276011f4581143390c26acb49e)) + + +### Bug Fixes + +* **bridge-ui:** custom and none fee selection overwritten by error fetching recommended fee ([#16737](https://github.com/taikoxyz/taiko-mono/issues/16737)) ([9166ee3](https://github.com/taikoxyz/taiko-mono/commit/9166ee3e0a968db19d8cec2002565413d79cd708)) +* **bridge-ui:** defaulting to source chain explorer for link to canonical address ([#16701](https://github.com/taikoxyz/taiko-mono/issues/16701)) ([68bd435](https://github.com/taikoxyz/taiko-mono/commit/68bd4354d03429ceccd4b311db6e59066111af09)) +* **bridge-ui:** fix ERC721 and ERC1155 detection in NFT bridge ([#16680](https://github.com/taikoxyz/taiko-mono/issues/16680)) ([ca45aa6](https://github.com/taikoxyz/taiko-mono/commit/ca45aa6da6101f15fe9ef4c485e5d61a64f66f84)) +* **bridge-ui:** update disabled for chainselector ([#16814](https://github.com/taikoxyz/taiko-mono/issues/16814)) ([406b15a](https://github.com/taikoxyz/taiko-mono/commit/406b15a301c7a3454957518a2cc33a44fbf21cde)) + ## [4.0.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v3.0.0...bridge-ui-v4.0.0) (2024-04-04) diff --git a/packages/bridge-ui/__mocks__/$customToken.ts b/packages/bridge-ui/__mocks__/$customToken.ts index f30b01fee2e..eabf9987a71 100644 --- a/packages/bridge-ui/__mocks__/$customToken.ts +++ b/packages/bridge-ui/__mocks__/$customToken.ts @@ -1,29 +1,3 @@ -import { zeroAddress } from 'viem'; +import { MOCK_ERC20, MOCK_ERC721 } from './../src/tests/mocks/tokens'; -const mockERC20 = { - name: 'MockERC20', - addresses: { '1': zeroAddress }, - symbol: 'MTF', - decimals: 18, - type: 'ERC20', -}; - -const mockERC1155 = { - name: 'MockERC1155', - addresses: { '1': zeroAddress }, - symbol: 'MNFT', - balance: 1337n, - tokenId: 123, - uri: 'some/uri/123', - type: 'ERC1155', -}; - -const mockERC721 = { - name: 'MockERC721', - addresses: { '1': zeroAddress }, - symbol: 'MNFT', - decimals: 18, - type: 'ERC721', -}; - -export const customToken = [mockERC20, mockERC1155, mockERC721]; +export const customToken = [MOCK_ERC20, MOCK_ERC721, MOCK_ERC721]; diff --git a/packages/bridge-ui/package.json b/packages/bridge-ui/package.json index fea06625712..357457a2cdf 100644 --- a/packages/bridge-ui/package.json +++ b/packages/bridge-ui/package.json @@ -1,6 +1,6 @@ { "name": "bridge-ui", - "version": "4.0.0", + "version": "4.2.0", "private": true, "scripts": { "dev": "vite dev", diff --git a/packages/bridge-ui/src/abi/index.ts b/packages/bridge-ui/src/abi/index.ts index 82687d42e8c..145ae25b2de 100644 --- a/packages/bridge-ui/src/abi/index.ts +++ b/packages/bridge-ui/src/abi/index.ts @@ -7,34 +7,31 @@ export const bridgeAbi = [ { type: 'function', inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'addr', internalType: 'address', type: 'address' }], - name: 'addressBanned', - outputs: [{ name: 'banned', internalType: 'bool', type: 'bool' }], + name: 'GAS_OVERHEAD', + outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], stateMutability: 'view', }, { type: 'function', inputs: [], - name: 'addressManager', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'GAS_RESERVE', + outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], stateMutability: 'view', }, { type: 'function', - inputs: [ - { name: '_addr', internalType: 'address', type: 'address' }, - { name: '_ban', internalType: 'bool', type: 'bool' }, - ], - name: 'banAddress', + inputs: [], + name: 'acceptOwnership', outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'addressManager', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -55,17 +52,36 @@ export const bridgeAbi = [ }, { type: 'function', - inputs: [], - name: 'getInvocationDelays', - outputs: [ - { name: 'invocationDelay_', internalType: 'uint256', type: 'uint256' }, + inputs: [ { - name: 'invocationExtraDelay_', - internalType: 'uint256', - type: 'uint256', + name: '_message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'destOwner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'value', internalType: 'uint256', type: 'uint256' }, + { name: 'data', internalType: 'bytes', type: 'bytes' }, + ], }, ], - stateMutability: 'view', + name: 'failMessage', + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + inputs: [{ name: 'dataLength', internalType: 'uint256', type: 'uint256' }], + name: 'getMessageMinGasLimit', + outputs: [{ name: '', internalType: 'uint32', type: 'uint32' }], + stateMutability: 'pure', }, { type: 'function', @@ -75,19 +91,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -105,6 +119,13 @@ export const bridgeAbi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'init2', + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', inputs: [{ name: '_chainId', internalType: 'uint64', type: 'uint64' }], @@ -123,19 +144,71 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'srcOwner', internalType: 'address', type: 'address' }, { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'destOwner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'value', internalType: 'uint256', type: 'uint256' }, + { name: 'data', internalType: 'bytes', type: 'bytes' }, + ], + }, + { name: '_proof', internalType: 'bytes', type: 'bytes' }, + ], + name: 'isMessageFailed', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { + name: '_message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, + { name: 'destOwner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'value', internalType: 'uint256', type: 'uint256' }, + { name: 'data', internalType: 'bytes', type: 'bytes' }, + ], + }, + { name: '_proof', internalType: 'bytes', type: 'bytes' }, + ], + name: 'isMessageReceived', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [ + { + name: '_message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -143,6 +216,13 @@ export const bridgeAbi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], @@ -156,7 +236,7 @@ export const bridgeAbi = [ type: 'function', inputs: [], name: 'nextMessageId', - outputs: [{ name: '', internalType: 'uint128', type: 'uint128' }], + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], stateMutability: 'view', }, { @@ -195,19 +275,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: '_proof', internalType: 'bytes', type: 'bytes' }, @@ -216,74 +294,6 @@ export const bridgeAbi = [ outputs: [], stateMutability: 'nonpayable', }, - { - type: 'function', - inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], - name: 'proofReceipt', - outputs: [ - { name: 'receivedAt', internalType: 'uint64', type: 'uint64' }, - { name: 'preferredExecutor', internalType: 'address', type: 'address' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { - name: '_message', - internalType: 'struct IBridge.Message', - type: 'tuple', - components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'srcOwner', internalType: 'address', type: 'address' }, - { name: 'destOwner', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, - ], - }, - { name: '_proof', internalType: 'bytes', type: 'bytes' }, - ], - name: 'proveMessageFailed', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { - name: '_message', - internalType: 'struct IBridge.Message', - type: 'tuple', - components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'srcOwner', internalType: 'address', type: 'address' }, - { name: 'destOwner', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, - ], - }, - { name: '_proof', internalType: 'bytes', type: 'bytes' }, - ], - name: 'proveMessageReceived', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, { type: 'function', inputs: [], @@ -299,19 +309,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: '_proof', internalType: 'bytes', type: 'bytes' }, @@ -356,19 +364,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: '_isLastAttempt', internalType: 'bool', type: 'bool' }, @@ -385,19 +391,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -409,19 +413,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -434,16 +436,6 @@ export const bridgeAbi = [ outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], stateMutability: 'pure', }, - { - type: 'function', - inputs: [ - { name: '_msgHashes', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: '_suspend', internalType: 'bool', type: 'bool' }, - ], - name: 'suspendMessages', - outputs: [], - stateMutability: 'nonpayable', - }, { type: 'function', inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], @@ -477,15 +469,6 @@ export const bridgeAbi = [ outputs: [], stateMutability: 'payable', }, - { - type: 'event', - anonymous: false, - inputs: [ - { name: 'addr', internalType: 'address', type: 'address', indexed: true }, - { name: 'banned', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'AddressBanned', - }, { type: 'event', anonymous: false, @@ -526,32 +509,6 @@ export const bridgeAbi = [ ], name: 'Initialized', }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'msgHash', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'MessageExecuted', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'msgHash', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, - }, - ], - name: 'MessageRecalled', - }, { type: 'event', anonymous: false, @@ -567,38 +524,33 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], indexed: false, }, - { name: 'isRecall', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'MessageReceived', - }, - { - type: 'event', - anonymous: false, - inputs: [ { - name: 'msgHash', - internalType: 'bytes32', - type: 'bytes32', - indexed: true, + name: 'stats', + internalType: 'struct Bridge.ProcessingStats', + type: 'tuple', + components: [ + { name: 'gasUsedInFeeCalc', internalType: 'uint32', type: 'uint32' }, + { name: 'proofSize', internalType: 'uint32', type: 'uint32' }, + { name: 'numCacheOps', internalType: 'uint32', type: 'uint32' }, + ], + indexed: false, }, ], - name: 'MessageRetried', + name: 'MessageProcessed', }, { type: 'event', @@ -615,19 +567,17 @@ export const bridgeAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], indexed: false, }, @@ -653,20 +603,6 @@ export const bridgeAbi = [ ], name: 'MessageStatusChanged', }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'msgHash', - internalType: 'bytes32', - type: 'bytes32', - indexed: false, - }, - { name: 'suspended', internalType: 'bool', type: 'bool', indexed: false }, - ], - name: 'MessageSuspended', - }, { type: 'event', anonymous: false, @@ -744,19 +680,18 @@ export const bridgeAbi = [ ], name: 'Upgraded', }, + { type: 'error', inputs: [], name: 'B_INSUFFICIENT_GAS' }, { type: 'error', inputs: [], name: 'B_INVALID_CHAINID' }, { type: 'error', inputs: [], name: 'B_INVALID_CONTEXT' }, + { type: 'error', inputs: [], name: 'B_INVALID_FEE' }, { type: 'error', inputs: [], name: 'B_INVALID_GAS_LIMIT' }, { type: 'error', inputs: [], name: 'B_INVALID_STATUS' }, { type: 'error', inputs: [], name: 'B_INVALID_USER' }, { type: 'error', inputs: [], name: 'B_INVALID_VALUE' }, - { type: 'error', inputs: [], name: 'B_INVOCATION_TOO_EARLY' }, { type: 'error', inputs: [], name: 'B_MESSAGE_NOT_SENT' }, - { type: 'error', inputs: [], name: 'B_NON_RETRIABLE' }, - { type: 'error', inputs: [], name: 'B_NOT_FAILED' }, - { type: 'error', inputs: [], name: 'B_NOT_RECEIVED' }, { type: 'error', inputs: [], name: 'B_PERMISSION_DENIED' }, - { type: 'error', inputs: [], name: 'B_STATUS_MISMATCH' }, + { type: 'error', inputs: [], name: 'B_RETRY_FAILED' }, + { type: 'error', inputs: [], name: 'B_SIGNAL_NOT_RECEIVED' }, { type: 'error', inputs: [], name: 'ETH_TRANSFER_FAILED' }, { type: 'error', inputs: [], name: 'INVALID_PAUSE_STATUS' }, { type: 'error', inputs: [], name: 'REENTRANT_CALL' }, @@ -836,20 +771,6 @@ export const crossChainSyncAbi = [ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const erc1155VaultAbi = [ - { - type: 'function', - inputs: [], - name: 'ERC1155_INTERFACE_ID', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'ERC721_INTERFACE_ID', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - stateMutability: 'view', - }, { type: 'function', inputs: [], @@ -903,6 +824,13 @@ export const erc1155VaultAbi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -951,19 +879,17 @@ export const erc1155VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }, @@ -1046,13 +972,11 @@ export const erc1155VaultAbi = [ { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, { name: 'token', internalType: 'address', type: 'address' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'tokenIds', internalType: 'uint256[]', type: 'uint256[]' }, { name: 'amounts', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -1063,19 +987,17 @@ export const erc1155VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -1086,7 +1008,7 @@ export const erc1155VaultAbi = [ inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }], name: 'supportsInterface', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + stateMutability: 'pure', }, { type: 'function', @@ -1507,6 +1429,13 @@ export const erc20VaultAbi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -1529,19 +1458,17 @@ export const erc20VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: '_msgHash', internalType: 'bytes32', type: 'bytes32' }, @@ -1624,12 +1551,10 @@ export const erc20VaultAbi = [ { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, { name: 'token', internalType: 'address', type: 'address' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -1640,19 +1565,17 @@ export const erc20VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -1663,7 +1586,7 @@ export const erc20VaultAbi = [ inputs: [{ name: '_interfaceId', internalType: 'bytes4', type: 'bytes4' }], name: 'supportsInterface', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + stateMutability: 'pure', }, { type: 'function', @@ -2047,20 +1970,6 @@ export const erc20VaultAbi = [ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const erc721VaultAbi = [ - { - type: 'function', - inputs: [], - name: 'ERC1155_INTERFACE_ID', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'ERC721_INTERFACE_ID', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], - stateMutability: 'view', - }, { type: 'function', inputs: [], @@ -2114,6 +2023,13 @@ export const erc721VaultAbi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -2148,19 +2064,17 @@ export const erc721VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, { name: '_msgHash', internalType: 'bytes32', type: 'bytes32' }, @@ -2243,13 +2157,11 @@ export const erc721VaultAbi = [ { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, { name: 'token', internalType: 'address', type: 'address' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'tokenIds', internalType: 'uint256[]', type: 'uint256[]' }, { name: 'amounts', internalType: 'uint256[]', type: 'uint256[]' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -2260,19 +2172,17 @@ export const erc721VaultAbi = [ internalType: 'struct IBridge.Message', type: 'tuple', components: [ - { name: 'id', internalType: 'uint128', type: 'uint128' }, + { name: 'id', internalType: 'uint64', type: 'uint64' }, + { name: 'fee', internalType: 'uint64', type: 'uint64' }, + { name: 'gasLimit', internalType: 'uint32', type: 'uint32' }, { name: 'from', internalType: 'address', type: 'address' }, { name: 'srcChainId', internalType: 'uint64', type: 'uint64' }, - { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'srcOwner', internalType: 'address', type: 'address' }, + { name: 'destChainId', internalType: 'uint64', type: 'uint64' }, { name: 'destOwner', internalType: 'address', type: 'address' }, { name: 'to', internalType: 'address', type: 'address' }, - { name: 'refundTo', internalType: 'address', type: 'address' }, { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'fee', internalType: 'uint256', type: 'uint256' }, - { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, { name: 'data', internalType: 'bytes', type: 'bytes' }, - { name: 'memo', internalType: 'string', type: 'string' }, ], }, ], @@ -2283,7 +2193,7 @@ export const erc721VaultAbi = [ inputs: [{ name: '_interfaceId', internalType: 'bytes4', type: 'bytes4' }], name: 'supportsInterface', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + stateMutability: 'pure', }, { type: 'function', @@ -2674,6 +2584,16 @@ export const erc1155Abi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'canonical', + outputs: [ + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -2698,6 +2618,13 @@ export const erc1155Abi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -3112,6 +3039,13 @@ export const erc1155Abi = [ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const erc20Abi = [ + { + type: 'function', + inputs: [], + name: 'CLOCK_MODE', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -3172,10 +3106,7 @@ export const erc20Abi = [ }, { type: 'function', - inputs: [ - { name: '_account', internalType: 'address', type: 'address' }, - { name: '_amount', internalType: 'uint256', type: 'uint256' }, - ], + inputs: [{ name: '_amount', internalType: 'uint256', type: 'uint256' }], name: 'burn', outputs: [], stateMutability: 'nonpayable', @@ -3220,6 +3151,13 @@ export const erc20Abi = [ ], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'clock', + outputs: [{ name: '', internalType: 'uint48', type: 'uint48' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -3267,7 +3205,22 @@ export const erc20Abi = [ }, { type: 'function', - inputs: [{ name: 'blockNumber', internalType: 'uint256', type: 'uint256' }], + inputs: [], + name: 'eip712Domain', + outputs: [ + { name: 'fields', internalType: 'bytes1', type: 'bytes1' }, + { name: 'name', internalType: 'string', type: 'string' }, + { name: 'version', internalType: 'string', type: 'string' }, + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'verifyingContract', internalType: 'address', type: 'address' }, + { name: 'salt', internalType: 'bytes32', type: 'bytes32' }, + { name: 'extensions', internalType: 'uint256[]', type: 'uint256[]' }, + ], + stateMutability: 'view', + }, + { + type: 'function', + inputs: [{ name: 'timepoint', internalType: 'uint256', type: 'uint256' }], name: 'getPastTotalSupply', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', @@ -3276,7 +3229,7 @@ export const erc20Abi = [ type: 'function', inputs: [ { name: 'account', internalType: 'address', type: 'address' }, - { name: 'blockNumber', internalType: 'uint256', type: 'uint256' }, + { name: 'timepoint', internalType: 'uint256', type: 'uint256' }, ], name: 'getPastVotes', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], @@ -3314,6 +3267,13 @@ export const erc20Abi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [], @@ -3437,15 +3397,6 @@ export const erc20Abi = [ outputs: [{ name: '', internalType: 'address payable', type: 'address' }], stateMutability: 'view', }, - { - type: 'function', - inputs: [ - { name: '_snapshooter', internalType: 'address', type: 'address' }, - ], - name: 'setSnapshoter', - outputs: [], - stateMutability: 'nonpayable', - }, { type: 'function', inputs: [], @@ -3453,13 +3404,6 @@ export const erc20Abi = [ outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', }, - { - type: 'function', - inputs: [], - name: 'snapshot', - outputs: [], - stateMutability: 'nonpayable', - }, { type: 'function', inputs: [], @@ -3656,6 +3600,7 @@ export const erc20Abi = [ ], name: 'DelegateVotesChanged', }, + { type: 'event', anonymous: false, inputs: [], name: 'EIP712DomainChanged' }, { type: 'event', anonymous: false, @@ -3808,7 +3753,6 @@ export const erc20Abi = [ { type: 'error', inputs: [], name: 'BB_PERMISSION_DENIED' }, { type: 'error', inputs: [], name: 'BTOKEN_CANNOT_RECEIVE' }, { type: 'error', inputs: [], name: 'BTOKEN_INVALID_PARAMS' }, - { type: 'error', inputs: [], name: 'BTOKEN_UNAUTHORIZED' }, { type: 'error', inputs: [], name: 'INVALID_PAUSE_STATUS' }, { type: 'error', inputs: [], name: 'REENTRANT_CALL' }, { type: 'error', inputs: [], name: 'RESOLVER_DENIED' }, @@ -3871,6 +3815,16 @@ export const erc721Abi = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [], + name: 'canonical', + outputs: [ + { name: '', internalType: 'address', type: 'address' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + stateMutability: 'view', + }, { type: 'function', inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256' }], @@ -3902,6 +3856,13 @@ export const erc721Abi = [ outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', }, + { + type: 'function', + inputs: [], + name: 'lastUnpausedAt', + outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }], + stateMutability: 'view', + }, { type: 'function', inputs: [ @@ -4523,7 +4484,9 @@ export const signalServiceAbi = [ { name: '_proof', internalType: 'bytes', type: 'bytes' }, ], name: 'proveSignalReceived', - outputs: [], + outputs: [ + { name: 'numCacheOps_', internalType: 'uint256', type: 'uint256' }, + ], stateMutability: 'nonpayable', }, { @@ -4556,6 +4519,18 @@ export const signalServiceAbi = [ outputs: [{ name: 'signal_', internalType: 'bytes32', type: 'bytes32' }], stateMutability: 'nonpayable', }, + { + type: 'function', + inputs: [ + { name: '_chainId', internalType: 'uint64', type: 'uint64' }, + { name: '_app', internalType: 'address', type: 'address' }, + { name: '_signal', internalType: 'bytes32', type: 'bytes32' }, + { name: '_proof', internalType: 'bytes', type: 'bytes' }, + ], + name: 'verifySignalReceived', + outputs: [], + stateMutability: 'view', + }, { type: 'event', anonymous: false, diff --git a/packages/bridge-ui/src/app.config.ts b/packages/bridge-ui/src/app.config.ts index 0afc7671bcc..e7726c80152 100644 --- a/packages/bridge-ui/src/app.config.ts +++ b/packages/bridge-ui/src/app.config.ts @@ -1,7 +1,8 @@ -export const recommendProcessingFeeConfig = { - ethGasLimit: BigInt(900_000), - erc20NotDeployedGasLimit: BigInt(1_650_000), - erc20DeployedGasLimit: BigInt(1_100_000), +export const gasLimitConfig = { + GAS_RESERVE: 650_000, // based on Bridge.sol + ethGasLimit: BigInt(100_000), + erc20NotDeployedGasLimit: BigInt(650_000), + erc20DeployedGasLimit: BigInt(200_000), erc721NotDeployedGasLimit: BigInt(2_400_000), erc721DeployedGasLimit: BigInt(1_100_000), erc1155NotDeployedGasLimit: BigInt(2_600_000), @@ -13,18 +14,6 @@ export const processingFeeComponent = { intervalComputeRecommendedFee: 20_000, }; -export const bridgeService = { - noOwnerGasLimit: BigInt(140_000), - noERC20TokenDeployedGasLimit: BigInt(3_000_000), - erc20GasLimitThreshold: BigInt(2_500_000), - - noERC721TokenDeployedGasLimit: BigInt(2_400_000), - erc721GasLimitThreshold: BigInt(3_000_000), - - noERC1155TokenDeployedGasLimit: BigInt(2_600_000), - erc1155GasLimitThreshold: BigInt(3_000_000), -}; - export const pendingTransaction = { waitTimeout: 300_000, }; @@ -39,7 +28,7 @@ export const bridgeTransactionPoller = { }; export const claimConfig = { - minimumEthToClaim: 0.0001, + minimumEthToClaim: 0.001, }; export const transactionConfig = { diff --git a/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ImportStep/TokenInput/TokenInput.svelte b/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ImportStep/TokenInput/TokenInput.svelte index 9f24c23da4c..8f81bbb7da8 100644 --- a/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ImportStep/TokenInput/TokenInput.svelte +++ b/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ImportStep/TokenInput/TokenInput.svelte @@ -25,8 +25,7 @@ import { OnNetwork } from '$components/OnNetwork'; import { TokenDropdown } from '$components/TokenDropdown'; import { getMaxAmountToBridge } from '$libs/bridge'; - import { UnknownTokenTypeError } from '$libs/error'; - import { fetchBalance, tokens, TokenType } from '$libs/token'; + import { fetchBalance, tokens } from '$libs/token'; import { refreshUserBalance, renderBalance } from '$libs/util/balance'; import { debounce } from '$libs/util/debounce'; import { getLogger } from '$libs/util/logger'; @@ -70,30 +69,6 @@ return; } - if (!$tokenBalance) { - $tokenBalance = await fetchBalance({ userAddress: user, token, srcChainId: $connectedSourceChain?.id }); - if (!$tokenBalance?.value) { - $insufficientBalance = true; - $validatingAmount = false; - } - } - - switch (token.type) { - case TokenType.ERC20: - case TokenType.ERC1155: - if ($tokenBalance?.value && ($ethBalance <= 0n || $enteredAmount > $tokenBalance?.value)) { - $insufficientBalance = true; - } - break; - case TokenType.ETH: - case TokenType.ERC721: - if ($enteredAmount >= $ethBalance) { - $insufficientBalance = true; - } - break; - default: - throw new UnknownTokenTypeError(); - } $validatingAmount = false; $computingBalance = false; } @@ -105,22 +80,7 @@ $validatingAmount = true; $errorComputingBalance = false; - if ($selectedToken.type === TokenType.ERC1155) { - // For ERC1155, no decimals are allowed - if (/[.,]/.test(value)) { - $errorComputingBalance = true; - return; - } - } - if ( - $selectedToken.type !== TokenType.ERC1155 && - $selectedToken.type !== TokenType.ERC721 && - !$selectedToken.decimals - ) { - $enteredAmount = BigInt(value); - } else { - $enteredAmount = parseUnits(value, $selectedToken.decimals); - } + $enteredAmount = parseUnits(value, $selectedToken.decimals); debouncedValidateAmount(); }; @@ -156,15 +116,14 @@ $computingBalance = true; value = ''; $enteredAmount = 0n; - if ($account && $account.address && $account?.isConnected) { + if ($account && $account.address && $account?.isConnected && $selectedToken) { validateAmount($selectedToken); refreshUserBalance(); - if ($selectedToken) - $tokenBalance = await fetchBalance({ - userAddress: $account.address, - token: $selectedToken, - srcChainId: $connectedSourceChain?.id, - }); + $tokenBalance = await fetchBalance({ + userAddress: $account.address, + token: $selectedToken, + srcChainId: $connectedSourceChain?.id, + }); previousSelectedToken = $selectedToken; } else { balance = '0.00'; diff --git a/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ManualImport.svelte b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ManualImport.svelte index 323c702e4ce..e750e410d81 100644 --- a/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ManualImport.svelte +++ b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ManualImport.svelte @@ -5,11 +5,12 @@ import { FlatAlert } from '$components/Alert'; import IdInput from '$components/Bridge/NFTBridgeComponents/IDInput/IDInput.svelte'; import { IDInputState } from '$components/Bridge/NFTBridgeComponents/IDInput/state'; + import TokenAmountInput from '$components/Bridge/NFTBridgeComponents/ImportStep/TokenAmountInput.svelte'; import AddressInput from '$components/Bridge/SharedBridgeComponents/AddressInput/AddressInput.svelte'; import { AddressInputState } from '$components/Bridge/SharedBridgeComponents/AddressInput/state'; import { enteredAmount, selectedNFTs, selectedToken, tokenBalance } from '$components/Bridge/state'; import { importDone } from '$components/Bridge/state'; - import TokenAmountInput from '$components/Bridge/TokenAmountInput.svelte'; + 1; import { detectContractType, type NFT, TokenType } from '$libs/token'; import { checkOwnership } from '$libs/token/checkOwnership'; import { getTokenWithInfoFromAddress } from '$libs/token/getTokenWithInfoFromAddress'; @@ -55,14 +56,6 @@ return; } - //TODO: not working as expected yet - - // interfaceSupported = await isSupportedNFTInterface(addr, detectedTokenType); - // if (!interfaceSupported) { - // addressInputState = AddressInputState.INVALID; - // } else { - // addressInputState = AddressInputState.VALID; - // } addressInputState = AddressInputState.VALID; } else { detectedTokenType = null; diff --git a/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ScannedImport.svelte b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ScannedImport.svelte index 1f3975fac37..3743a9a6c56 100644 --- a/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ScannedImport.svelte +++ b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/ScannedImport.svelte @@ -2,8 +2,8 @@ import { onMount } from 'svelte'; import { t } from 'svelte-i18n'; + import TokenAmountInput from '$components/Bridge/NFTBridgeComponents/ImportStep/TokenAmountInput.svelte'; import { enteredAmount, selectedNFTs, tokenBalance } from '$components/Bridge/state'; - import TokenAmountInput from '$components/Bridge/TokenAmountInput.svelte'; import { ImportMethod } from '$components/Bridge/types'; import { ActionButton, Button } from '$components/Button'; import { IconFlipper } from '$components/Icon'; diff --git a/packages/bridge-ui/src/components/Bridge/TokenAmountInput.svelte b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/TokenAmountInput.svelte similarity index 97% rename from packages/bridge-ui/src/components/Bridge/TokenAmountInput.svelte rename to packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/TokenAmountInput.svelte index d5a92e927b5..e37cd4030ae 100644 --- a/packages/bridge-ui/src/components/Bridge/TokenAmountInput.svelte +++ b/packages/bridge-ui/src/components/Bridge/NFTBridgeComponents/ImportStep/TokenAmountInput.svelte @@ -8,7 +8,6 @@ import { warningToast } from '$components/NotificationToast'; import { InvalidParametersProvidedError, UnknownTokenTypeError } from '$libs/error'; import { ETHToken, fetchBalance, fetchBalance as getTokenBalance, TokenType } from '$libs/token'; - import { renderBalance } from '$libs/util/balance'; import { debounce } from '$libs/util/debounce'; import { getLogger } from '$libs/util/logger'; import { uid } from '$libs/util/uid'; @@ -27,7 +26,7 @@ selectedToken, tokenBalance, validatingAmount, - } from './state'; + } from '../../state'; const log = getLogger('component:Amount'); @@ -212,7 +211,7 @@ {#if computingMaxAmount} {:else} - {renderBalance($tokenBalance)} + {/if} {/if} @@ -231,7 +230,6 @@ on:input={inputAmount} bind:this={inputBox} class="py-6 pr-16 px-[26px] title-subsection-bold border-0 {$$props.class}" /> - {#if maxButtonEnabled}