From 7a35e51f379bef3af3d5e1c01de0fff4b8e7225d Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 6 Jul 2023 10:52:57 +0200 Subject: [PATCH 1/6] abi and other changes --- packages/bridge-ui-v2/.eslintignore | 4 + packages/bridge-ui-v2/.prettierignore | 4 + packages/bridge-ui-v2/package.json | 13 +- packages/bridge-ui-v2/src/abi/index.ts | 1053 +++++++++++++++++ .../Activities/ListWithDetailsView.svelte | 3 +- .../components/Activities/TableView.svelte | 3 +- .../ChainSelector/ChainSelector.svelte | 2 +- .../bridge-ui-v2/src/libs/chain/chains.ts | 2 +- .../bridge-ui-v2/src/libs/wagmi/client.ts | 2 +- .../bridge-ui-v2/src/libs/wagmi/watcher.ts | 2 +- packages/bridge-ui-v2/src/stores/account.ts | 3 +- packages/bridge-ui-v2/src/stores/network.ts | 2 +- packages/bridge-ui-v2/tsconfig.json | 2 + packages/bridge-ui-v2/wagmi.config.ts | 36 + pnpm-lock.yaml | 354 +++--- 15 files changed, 1292 insertions(+), 193 deletions(-) create mode 100644 packages/bridge-ui-v2/src/abi/index.ts create mode 100644 packages/bridge-ui-v2/wagmi.config.ts diff --git a/packages/bridge-ui-v2/.eslintignore b/packages/bridge-ui-v2/.eslintignore index 38972655faf..cf90f39dfda 100644 --- a/packages/bridge-ui-v2/.eslintignore +++ b/packages/bridge-ui-v2/.eslintignore @@ -7,6 +7,10 @@ node_modules .env.* !.env.example +# Generated files +/src/abi/* +CHANGELOG.md + # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml package-lock.json diff --git a/packages/bridge-ui-v2/.prettierignore b/packages/bridge-ui-v2/.prettierignore index 38972655faf..cf90f39dfda 100644 --- a/packages/bridge-ui-v2/.prettierignore +++ b/packages/bridge-ui-v2/.prettierignore @@ -7,6 +7,10 @@ node_modules .env.* !.env.example +# Generated files +/src/abi/* +CHANGELOG.md + # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml package-lock.json diff --git a/packages/bridge-ui-v2/package.json b/packages/bridge-ui-v2/package.json index 6a572433a77..a2d6e3719a2 100644 --- a/packages/bridge-ui-v2/package.json +++ b/packages/bridge-ui-v2/package.json @@ -10,11 +10,12 @@ "test:unit": "vitest run", "test:unit:coverage": "vitest run --coverage", "test:unit:watch": "vitest", - "svelte:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "svelte:check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "svelte:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --ignore ./wagmi.config.ts", + "svelte:check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --ignore ./wagmi.config.ts --watch", "format": "prettier --plugin-search-dir . --write .", "lint": "prettier --plugin-search-dir . --check . && eslint .", - "lint:fix": "pnpm format && eslint . --fix" + "lint:fix": "pnpm format && eslint . --fix", + "generate:abi": "pnpm wagmi generate" }, "devDependencies": { "@playwright/test": "^1.28.1", @@ -24,6 +25,7 @@ "@types/debug": "^4.1.7", "@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", + "@wagmi/cli": "^1.0.1", "autoprefixer": "^10.4.14", "daisyui": "3.1.7", "eslint": "^8.28.0", @@ -44,11 +46,12 @@ }, "type": "module", "dependencies": { + "@wagmi/core": "^1.3.6", "@web3modal/ethereum": "^2.6.2", "@web3modal/html": "^2.6.2", + "abitype": "^0.8.2", "debug": "^4.3.4", "svelte-i18n": "^3.6.0", - "viem": "^1.2.9", - "wagmi": "^1.3.5" + "viem": "^1.2.9" } } diff --git a/packages/bridge-ui-v2/src/abi/index.ts b/packages/bridge-ui-v2/src/abi/index.ts new file mode 100644 index 00000000000..768bfb82069 --- /dev/null +++ b/packages/bridge-ui-v2/src/abi/index.ts @@ -0,0 +1,1053 @@ +// Generated by @wagmi/cli@1.0.0 on 7/6/2023 at 10:51:18 AM + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Bridge +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const bridgeABI = [ + { type: 'error', inputs: [], name: 'B_CANNOT_RECEIVE' }, + { type: 'error', inputs: [], name: 'B_DENIED' }, + { type: 'error', inputs: [], name: 'B_DENIED' }, + { type: 'error', inputs: [], name: 'B_ERC20_CANNOT_RECEIVE' }, + { type: 'error', inputs: [], name: 'B_ETHER_RELEASED_ALREADY' }, + { type: 'error', inputs: [], name: 'B_ETHER_RELEASED_ALREADY' }, + { type: 'error', inputs: [], name: 'B_EV_DO_NOT_BURN' }, + { type: 'error', inputs: [], name: 'B_EV_NOT_AUTHORIZED' }, + { type: 'error', inputs: [], name: 'B_EV_PARAM' }, + { type: 'error', inputs: [], name: 'B_FAILED_TRANSFER' }, + { type: 'error', inputs: [], name: 'B_FAILED_TRANSFER' }, + { type: 'error', inputs: [], name: 'B_FORBIDDEN' }, + { type: 'error', inputs: [], name: 'B_FORBIDDEN' }, + { type: 'error', inputs: [], name: 'B_GAS_LIMIT' }, + { type: 'error', inputs: [], name: 'B_GAS_LIMIT' }, + { type: 'error', inputs: [], name: 'B_INCORRECT_VALUE' }, + { type: 'error', inputs: [], name: 'B_INCORRECT_VALUE' }, + { type: 'error', inputs: [], name: 'B_INIT_PARAM_ERROR' }, + { type: 'error', inputs: [], name: 'B_MSG_HASH_NULL' }, + { type: 'error', inputs: [], name: 'B_MSG_HASH_NULL' }, + { type: 'error', inputs: [], name: 'B_MSG_NON_RETRIABLE' }, + { type: 'error', inputs: [], name: 'B_MSG_NON_RETRIABLE' }, + { type: 'error', inputs: [], name: 'B_MSG_NOT_FAILED' }, + { type: 'error', inputs: [], name: 'B_MSG_NOT_FAILED' }, + { type: 'error', inputs: [], name: 'B_NULL_APP_ADDR' }, + { type: 'error', inputs: [], name: 'B_OWNER_IS_NULL' }, + { type: 'error', inputs: [], name: 'B_OWNER_IS_NULL' }, + { type: 'error', inputs: [], name: 'B_OWNER_IS_NULL' }, + { type: 'error', inputs: [], name: 'B_SIGNAL_NOT_RECEIVED' }, + { type: 'error', inputs: [], name: 'B_SIGNAL_NOT_RECEIVED' }, + { type: 'error', inputs: [], name: 'B_STATUS_MISMATCH' }, + { type: 'error', inputs: [], name: 'B_STATUS_MISMATCH' }, + { type: 'error', inputs: [], name: 'B_WRONG_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'B_WRONG_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'B_WRONG_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'B_WRONG_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'B_WRONG_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'B_WRONG_TO_ADDRESS' }, + { type: 'error', inputs: [], name: 'B_WRONG_TO_ADDRESS' }, + { type: 'error', inputs: [], name: 'B_ZERO_SIGNAL' }, + { type: 'error', inputs: [], name: 'RESOLVER_DENIED' }, + { type: 'error', inputs: [], name: 'RESOLVER_INVALID_ADDR' }, + { + type: 'error', + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + ], + name: 'RESOLVER_ZERO_ADDR', + }, + { + type: 'event', + anonymous: false, + inputs: [{ name: 'addressManager', internalType: 'address', type: 'address', indexed: false }], + name: 'AddressManagerChanged', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256', indexed: true }, + { name: 'enabled', internalType: 'bool', type: 'bool', indexed: false }, + ], + name: 'DestChainEnabled', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'EtherReleased', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'EtherReleased', + }, + { + type: 'event', + anonymous: false, + inputs: [{ name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }], + name: 'Initialized', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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: 'MessageSent', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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: 'MessageSent', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'status', internalType: 'enum LibBridgeStatus.MessageStatus', type: 'uint8', indexed: false }, + { name: 'transactor', internalType: 'address', type: 'address', indexed: false }, + ], + name: 'MessageStatusChanged', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'status', internalType: 'enum LibBridgeStatus.MessageStatus', type: 'uint8', indexed: false }, + { name: 'transactor', internalType: 'address', type: 'address', indexed: false }, + ], + name: 'MessageStatusChanged', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true }, + { name: 'newOwner', internalType: 'address', type: 'address', indexed: true }, + ], + name: 'OwnershipTransferred', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'sender', internalType: 'address', type: 'address', indexed: false }, + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: false }, + ], + name: 'SignalSent', + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'addressManager', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'context', + outputs: [ + { + name: '', + internalType: 'struct IBridge.Context', + type: 'tuple', + components: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + ], + }, + ], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + name: 'getMessageStatus', + outputs: [{ name: '', internalType: 'enum LibBridgeStatus.MessageStatus', type: 'uint8' }], + }, + { + stateMutability: 'pure', + type: 'function', + inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + name: 'getMessageStatusSlot', + outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], + }, + { + stateMutability: 'pure', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', internalType: 'uint256', type: 'uint256' }, + { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, + { name: 'data', internalType: 'bytes', type: 'bytes' }, + { name: 'memo', internalType: 'string', type: 'string' }, + ], + }, + ], + name: 'hashMessage', + outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: '_addressManager', internalType: 'address', type: 'address' }], + name: 'init', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: '_chainId', internalType: 'uint256', type: 'uint256' }], + name: 'isDestChainEnabled', + outputs: [{ name: 'enabled', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + name: 'isEtherReleased', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'proof', internalType: 'bytes', type: 'bytes' }, + ], + name: 'isMessageFailed', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'proof', internalType: 'bytes', type: 'bytes' }, + ], + name: 'isMessageReceived', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + name: 'isMessageSent', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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: 'processMessage', + outputs: [], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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: 'releaseEther', + outputs: [], + }, + { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceOwnership', outputs: [] }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + { name: 'allowZeroAddress', internalType: 'bool', type: 'bool' }, + ], + name: 'resolve', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + { name: 'allowZeroAddress', internalType: 'bool', type: 'bool' }, + ], + name: 'resolve', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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' }, + ], + name: 'retryMessage', + outputs: [], + }, + { + stateMutability: 'payable', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', internalType: 'uint256', type: 'uint256' }, + { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, + { name: 'data', internalType: 'bytes', type: 'bytes' }, + { name: 'memo', internalType: 'string', type: 'string' }, + ], + }, + ], + name: 'sendMessage', + outputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'newAddressManager', internalType: 'address', type: 'address' }], + name: 'setAddressManager', + outputs: [], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], + name: 'transferOwnership', + outputs: [], + }, + { stateMutability: 'payable', type: 'receive' }, +] as const; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// TokenVault +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const tokenVaultABI = [ + { type: 'error', inputs: [], name: 'RESOLVER_DENIED' }, + { type: 'error', inputs: [], name: 'RESOLVER_INVALID_ADDR' }, + { + type: 'error', + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + ], + name: 'RESOLVER_ZERO_ADDR', + }, + { type: 'error', inputs: [], name: 'TOKENVAULT_CANONICAL_TOKEN_NOT_FOUND' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_AMOUNT' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_OWNER' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_SENDER' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_SRC_CHAIN_ID' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_TO' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_TOKEN' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_INVALID_VALUE' }, + { type: 'error', inputs: [], name: 'TOKENVAULT_MESSAGE_NOT_FAILED' }, + { + type: 'event', + anonymous: false, + inputs: [{ name: 'addressManager', internalType: 'address', type: 'address', indexed: false }], + name: 'AddressManagerChanged', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'srcChainId', internalType: 'uint256', type: 'uint256', indexed: true }, + { name: 'canonicalToken', internalType: 'address', type: 'address', indexed: true }, + { name: 'bridgedToken', internalType: 'address', type: 'address', indexed: true }, + { name: 'canonicalTokenSymbol', internalType: 'string', type: 'string', indexed: false }, + { name: 'canonicalTokenName', internalType: 'string', type: 'string', indexed: false }, + { name: 'canonicalTokenDecimal', internalType: 'uint8', type: 'uint8', indexed: false }, + ], + name: 'BridgedERC20Deployed', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256', indexed: false }, + { name: 'token', internalType: 'address', type: 'address', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'ERC20Received', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'token', internalType: 'address', type: 'address', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'ERC20Released', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256', indexed: false }, + { name: 'token', internalType: 'address', type: 'address', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'ERC20Sent', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'msgHash', internalType: 'bytes32', type: 'bytes32', indexed: true }, + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256', indexed: false }, + { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'EtherSent', + }, + { + type: 'event', + anonymous: false, + inputs: [{ name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }], + name: 'Initialized', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true }, + { name: 'newOwner', internalType: 'address', type: 'address', indexed: true }, + ], + name: 'OwnershipTransferred', + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'addressManager', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'bridgedAddress', internalType: 'address', type: 'address' }], + name: 'bridgedToCanonical', + outputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'addr', internalType: 'address', type: 'address' }, + { name: 'decimals', internalType: 'uint8', type: 'uint8' }, + { name: 'symbol', internalType: 'string', type: 'string' }, + { name: 'name', internalType: 'string', type: 'string' }, + ], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'canonicalAddress', internalType: 'address', type: 'address' }, + ], + name: 'canonicalToBridged', + outputs: [{ name: 'bridgedAddress', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'addressManager', internalType: 'address', type: 'address' }], + name: 'init', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tokenAddress', internalType: 'address', type: 'address' }], + name: 'isBridgedToken', + outputs: [{ name: 'isBridged', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'msgHash', internalType: 'bytes32', type: 'bytes32' }], + name: 'messageDeposits', + outputs: [ + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { + name: 'canonicalToken', + internalType: 'struct TokenVault.CanonicalERC20', + type: 'tuple', + components: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'addr', internalType: 'address', type: 'address' }, + { name: 'decimals', internalType: 'uint8', type: 'uint8' }, + { name: 'symbol', internalType: 'string', type: 'string' }, + { name: 'name', internalType: 'string', type: 'string' }, + ], + }, + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'receiveERC20', + outputs: [], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { + name: 'message', + internalType: 'struct IBridge.Message', + type: 'tuple', + components: [ + { name: 'id', internalType: 'uint256', type: 'uint256' }, + { name: 'sender', internalType: 'address', type: 'address' }, + { name: 'srcChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'depositValue', internalType: 'uint256', type: 'uint256' }, + { name: 'callValue', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', 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: 'releaseERC20', + outputs: [], + }, + { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceOwnership', outputs: [] }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'chainId', internalType: 'uint256', type: 'uint256' }, + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + { name: 'allowZeroAddress', internalType: 'bool', type: 'bool' }, + ], + name: 'resolve', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'name', internalType: 'bytes32', type: 'bytes32' }, + { name: 'allowZeroAddress', internalType: 'bool', type: 'bool' }, + ], + name: 'resolve', + outputs: [{ name: '', internalType: 'address payable', type: 'address' }], + }, + { + stateMutability: 'payable', + type: 'function', + inputs: [ + { name: 'destChainId', internalType: 'uint256', type: 'uint256' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'token', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: 'gasLimit', internalType: 'uint256', type: 'uint256' }, + { name: 'processingFee', internalType: 'uint256', type: 'uint256' }, + { name: 'refundAddress', internalType: 'address', type: 'address' }, + { name: 'memo', internalType: 'string', type: 'string' }, + ], + name: 'sendERC20', + outputs: [], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'newAddressManager', internalType: 'address', type: 'address' }], + name: 'setAddressManager', + outputs: [], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], + name: 'transferOwnership', + outputs: [], + }, +] as const; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CrossChainSync +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const crossChainSyncABI = [ + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'srcHeight', internalType: 'uint256', type: 'uint256', indexed: true }, + { name: 'blockHash', internalType: 'bytes32', type: 'bytes32', indexed: false }, + { name: 'signalRoot', internalType: 'bytes32', type: 'bytes32', indexed: false }, + ], + name: 'CrossChainSynced', + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'number', internalType: 'uint256', type: 'uint256' }], + name: 'getCrossChainBlockHash', + outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'number', internalType: 'uint256', type: 'uint256' }], + name: 'getCrossChainSignalRoot', + outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], + }, +] as const; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// FreeMintERC20 +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const freeMintErc20ABI = [ + { + stateMutability: 'nonpayable', + type: 'constructor', + inputs: [ + { name: 'name', internalType: 'string', type: 'string' }, + { name: 'symbol', internalType: 'string', type: 'string' }, + ], + }, + { type: 'error', inputs: [], name: 'HasMinted' }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'owner', internalType: 'address', type: 'address', indexed: true }, + { name: 'spender', internalType: 'address', type: 'address', indexed: true }, + { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'Approval', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'Transfer', + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'spender', internalType: 'address', type: 'address' }, + ], + name: 'allowance', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'account', internalType: 'address', type: 'address' }], + name: 'balanceOf', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'decimals', + outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'subtractedValue', internalType: 'uint256', type: 'uint256' }, + ], + name: 'decreaseAllowance', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'addedValue', internalType: 'uint256', type: 'uint256' }, + ], + name: 'increaseAllowance', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: 'to', internalType: 'address', type: 'address' }], + name: 'mint', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'minter', internalType: 'address', type: 'address' }], + name: 'minters', + outputs: [{ name: 'hasMinted', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'name', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'symbol', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'totalSupply', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, +] as const; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Erc20 +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const erc20ABI = [ + { + stateMutability: 'nonpayable', + type: 'constructor', + inputs: [ + { name: 'name_', internalType: 'string', type: 'string' }, + { name: 'symbol_', internalType: 'string', type: 'string' }, + ], + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'owner', internalType: 'address', type: 'address', indexed: true }, + { name: 'spender', internalType: 'address', type: 'address', indexed: true }, + { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'Approval', + }, + { + type: 'event', + anonymous: false, + inputs: [ + { name: 'from', internalType: 'address', type: 'address', indexed: true }, + { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false }, + ], + name: 'Transfer', + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'spender', internalType: 'address', type: 'address' }, + ], + name: 'allowance', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'account', internalType: 'address', type: 'address' }], + name: 'balanceOf', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'decimals', + outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'subtractedValue', internalType: 'uint256', type: 'uint256' }, + ], + name: 'decreaseAllowance', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'spender', internalType: 'address', type: 'address' }, + { name: 'addedValue', internalType: 'uint256', type: 'uint256' }, + ], + name: 'increaseAllowance', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'name', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'symbol', + outputs: [{ name: '', internalType: 'string', type: 'string' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'totalSupply', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'from', internalType: 'address', type: 'address' }, + { name: 'to', internalType: 'address', type: 'address' }, + { name: 'amount', internalType: 'uint256', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, +] as const; diff --git a/packages/bridge-ui-v2/src/components/Activities/ListWithDetailsView.svelte b/packages/bridge-ui-v2/src/components/Activities/ListWithDetailsView.svelte index c104c626445..021b55d32c4 100644 --- a/packages/bridge-ui-v2/src/components/Activities/ListWithDetailsView.svelte +++ b/packages/bridge-ui-v2/src/components/Activities/ListWithDetailsView.svelte @@ -215,7 +215,8 @@
  • {$t('activities.header.explorer')}

    - {$t('activities.link.explorer')} + {$t('activities.link.explorer')}
  • diff --git a/packages/bridge-ui-v2/src/components/Activities/TableView.svelte b/packages/bridge-ui-v2/src/components/Activities/TableView.svelte index 6f4c847bce7..e4e142ebfe3 100644 --- a/packages/bridge-ui-v2/src/components/Activities/TableView.svelte +++ b/packages/bridge-ui-v2/src/components/Activities/TableView.svelte @@ -225,7 +225,8 @@ - {$t('activities.link.explorer')} + {$t('activities.link.explorer')} diff --git a/packages/bridge-ui-v2/src/components/ChainSelector/ChainSelector.svelte b/packages/bridge-ui-v2/src/components/ChainSelector/ChainSelector.svelte index 2b6d0361117..34b455122ce 100644 --- a/packages/bridge-ui-v2/src/components/ChainSelector/ChainSelector.svelte +++ b/packages/bridge-ui-v2/src/components/ChainSelector/ChainSelector.svelte @@ -1,8 +1,8 @@
    Date: Thu, 6 Jul 2023 10:57:08 +0200 Subject: [PATCH 4/6] improvement --- packages/bridge-ui-v2/src/components/Header/Header.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bridge-ui-v2/src/components/Header/Header.svelte b/packages/bridge-ui-v2/src/components/Header/Header.svelte index 75a75c5e1f7..283b148df20 100644 --- a/packages/bridge-ui-v2/src/components/Header/Header.svelte +++ b/packages/bridge-ui-v2/src/components/Header/Header.svelte @@ -1,5 +1,6 @@