@avalabs/bridge-unified 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +25 -0
- package/CHANGELOG.md +18 -0
- package/README.md +137 -71
- package/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -34
- package/dist/index.d.ts +207 -34
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/jest.config.js +9 -0
- package/package.json +15 -9
- package/src/bridges/cctp/__mocks__/asset.mock.ts +15 -0
- package/src/bridges/cctp/__mocks__/bridge-transfer.mock.ts +48 -0
- package/src/bridges/cctp/__mocks__/chain.mocks.ts +31 -0
- package/src/bridges/cctp/__mocks__/config.mock.ts +45 -0
- package/src/bridges/cctp/abis/erc20.ts +117 -0
- package/src/bridges/cctp/abis/message-transmitter.ts +318 -0
- package/src/bridges/cctp/abis/token-router.ts +843 -0
- package/src/bridges/cctp/factory.test.ts +73 -0
- package/src/bridges/cctp/factory.ts +32 -0
- package/src/bridges/cctp/handlers/get-assets.test.ts +47 -0
- package/src/bridges/cctp/handlers/get-assets.ts +27 -0
- package/src/bridges/cctp/handlers/get-fees.test.ts +61 -0
- package/src/bridges/cctp/handlers/get-fees.ts +26 -0
- package/src/bridges/cctp/handlers/track-transfer.test.ts +779 -0
- package/src/bridges/cctp/handlers/track-transfer.ts +365 -0
- package/src/bridges/cctp/handlers/transfer-asset.test.ts +429 -0
- package/src/bridges/cctp/handlers/transfer-asset.ts +179 -0
- package/src/bridges/cctp/index.ts +1 -0
- package/src/bridges/cctp/types/chain.ts +4 -0
- package/src/bridges/cctp/types/config.ts +19 -0
- package/src/bridges/cctp/utils/config.test.ts +49 -0
- package/src/bridges/cctp/utils/config.ts +36 -0
- package/src/bridges/cctp/utils/transfer-data.test.ts +83 -0
- package/src/bridges/cctp/utils/transfer-data.ts +48 -0
- package/src/errors/bridge-error.ts +11 -0
- package/src/errors/bridge-initialization-error.ts +9 -0
- package/src/errors/bridge-unavailable-error.ts +9 -0
- package/src/errors/index.ts +4 -20
- package/src/errors/invalid-params-error.ts +9 -0
- package/src/index.ts +3 -1
- package/src/types/asset.ts +26 -0
- package/src/types/bridge.ts +63 -0
- package/src/types/chain.ts +10 -0
- package/src/types/config.ts +10 -0
- package/src/types/environment.ts +4 -0
- package/src/types/error.ts +19 -0
- package/src/types/index.ts +9 -0
- package/src/types/provider.ts +12 -0
- package/src/types/signer.ts +18 -0
- package/src/types/transfer.ts +35 -0
- package/src/unified-bridge-service.test.ts +208 -0
- package/src/unified-bridge-service.ts +90 -0
- package/src/utils/bridge-types.test.ts +103 -0
- package/src/utils/bridge-types.ts +32 -0
- package/src/utils/caip2.test.ts +44 -0
- package/src/utils/caip2.ts +41 -0
- package/src/utils/client.test.ts +97 -0
- package/src/utils/client.ts +44 -0
- package/src/utils/ensure-config.test.ts +43 -0
- package/src/utils/ensure-config.ts +12 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/network-fee.test.ts +24 -0
- package/src/utils/network-fee.ts +6 -0
- package/src/utils/retry-promise.test.ts +115 -0
- package/src/utils/retry-promise.ts +72 -0
- package/src/utils/wait.test.ts +33 -0
- package/src/utils/wait.ts +4 -0
- package/tsconfig.jest.json +7 -0
- package/tsconfig.json +2 -1
- package/src/bridge-service.ts +0 -18
- package/src/handlers/get-bridge-router.ts +0 -25
- package/src/handlers/submit-and-watch-bridge-transaction.ts +0 -1
- package/src/handlers/submit-bridge-transaction-step.ts +0 -22
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BridgeType, type BridgeTransfer, Environment, type Provider, type TrackingParams } from '../../../types';
|
|
2
|
+
import { SOURCE_CHAIN, TARGET_CHAIN } from './chain.mocks';
|
|
3
|
+
import { SOURCE_MINIMUM_CONFIRMATIONS, TARGET_MINIMUM_CONFIRMATIONS } from './config.mock';
|
|
4
|
+
|
|
5
|
+
const BRIDGE_TRANSFER_MOCK = {
|
|
6
|
+
type: BridgeType.CCTP,
|
|
7
|
+
environment: Environment.TEST,
|
|
8
|
+
fromAddress: '0x787',
|
|
9
|
+
toAddress: '0x787',
|
|
10
|
+
amount: 1_000_000,
|
|
11
|
+
symbol: 'USDC',
|
|
12
|
+
bridgeFee: 2_000_000,
|
|
13
|
+
sourceChain: SOURCE_CHAIN,
|
|
14
|
+
sourceStartedAt: 0,
|
|
15
|
+
sourceTxHash: '0x111',
|
|
16
|
+
sourceConfirmationCount: 0,
|
|
17
|
+
requiredSourceConfirmationCount: SOURCE_MINIMUM_CONFIRMATIONS,
|
|
18
|
+
targetChain: TARGET_CHAIN,
|
|
19
|
+
targetConfirmationCount: 0,
|
|
20
|
+
requiredTargetConfirmationCount: TARGET_MINIMUM_CONFIRMATIONS,
|
|
21
|
+
startBlockNumber: 0n,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const getBridgeTransferMock = (props?: Partial<BridgeTransfer>) => ({
|
|
25
|
+
...BRIDGE_TRANSFER_MOCK,
|
|
26
|
+
...(props ?? {}),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const getBridgeTrackinParams = ({
|
|
30
|
+
bridgeTransfer,
|
|
31
|
+
sourceProvider,
|
|
32
|
+
targetProvider,
|
|
33
|
+
updateListener,
|
|
34
|
+
}: {
|
|
35
|
+
bridgeTransfer?: Partial<BridgeTransfer>;
|
|
36
|
+
sourceProvider?: Provider;
|
|
37
|
+
targetProvider?: Provider;
|
|
38
|
+
updateListener: (transfer: BridgeTransfer) => void;
|
|
39
|
+
}) =>
|
|
40
|
+
({
|
|
41
|
+
bridgeTransfer: {
|
|
42
|
+
...BRIDGE_TRANSFER_MOCK,
|
|
43
|
+
...(bridgeTransfer ?? {}),
|
|
44
|
+
},
|
|
45
|
+
sourceProvider,
|
|
46
|
+
targetProvider,
|
|
47
|
+
updateListener,
|
|
48
|
+
}) as unknown as TrackingParams;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TokenType } from '../../../types/asset';
|
|
2
|
+
|
|
3
|
+
export const SOURCE_CHAIN = {
|
|
4
|
+
name: 'Source chain',
|
|
5
|
+
chainId: 'eip155:1',
|
|
6
|
+
rpcUrl: 'https://source-chain/rpc',
|
|
7
|
+
utilityAddresses: {
|
|
8
|
+
multicall: '0x0000000000000000000000000000000000000007',
|
|
9
|
+
},
|
|
10
|
+
networkToken: {
|
|
11
|
+
decimals: 18,
|
|
12
|
+
name: 'Source',
|
|
13
|
+
symbol: 'SRC',
|
|
14
|
+
type: TokenType.NATIVE,
|
|
15
|
+
},
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export const TARGET_CHAIN = {
|
|
19
|
+
name: 'Target chain',
|
|
20
|
+
chainId: 'eip155:2',
|
|
21
|
+
rpcUrl: 'https://target-chain/rpc',
|
|
22
|
+
utilityAddresses: {
|
|
23
|
+
multicall: '0x0000000000000000000000000000000000000008',
|
|
24
|
+
},
|
|
25
|
+
networkToken: {
|
|
26
|
+
decimals: 18,
|
|
27
|
+
name: 'Target',
|
|
28
|
+
symbol: 'TRGT',
|
|
29
|
+
type: TokenType.NATIVE,
|
|
30
|
+
},
|
|
31
|
+
} as const;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const SOURCE_ROUTER_ADDRESS = '0x0000000000abcdef000000000000000000000001';
|
|
2
|
+
// We use randomized casing in tests to make sure the implementation normalizes casing
|
|
3
|
+
// when searching through logs.
|
|
4
|
+
export const SOURCE_ROUTER_ADDRESS_RANDOMIZED_CASING = '0x0000000000aBcDeF000000000000000000000001';
|
|
5
|
+
export const SOURCE_TRANSMITTER_ADDRESS = '0x0000000000000000000000000000000000000002';
|
|
6
|
+
export const SOURCE_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000003';
|
|
7
|
+
export const SOURCE_MINIMUM_CONFIRMATIONS = 5;
|
|
8
|
+
|
|
9
|
+
export const TARGET_ROUTER_ADDRESS = '0x0000000000000000000000000000000000000004';
|
|
10
|
+
export const TARGET_TRANSMITTER_ADDRESS = '0x0000000000000000000000000000000000000005';
|
|
11
|
+
export const TARGET_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000006';
|
|
12
|
+
export const TARGET_MINIMUM_CONFIRMATIONS = 10;
|
|
13
|
+
|
|
14
|
+
export const CCTP_CONFIG = [
|
|
15
|
+
{
|
|
16
|
+
chainId: 'eip155:1',
|
|
17
|
+
domain: 0,
|
|
18
|
+
tokenRouterAddress: SOURCE_ROUTER_ADDRESS,
|
|
19
|
+
messageTransmitterAddress: SOURCE_TRANSMITTER_ADDRESS,
|
|
20
|
+
tokens: [
|
|
21
|
+
{
|
|
22
|
+
address: SOURCE_TOKEN_ADDRESS,
|
|
23
|
+
name: 'USD Coin',
|
|
24
|
+
symbol: 'USDC',
|
|
25
|
+
decimals: 6,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
minimumConfirmations: SOURCE_MINIMUM_CONFIRMATIONS,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
chainId: 'eip155:2',
|
|
32
|
+
domain: 1,
|
|
33
|
+
tokenRouterAddress: TARGET_ROUTER_ADDRESS,
|
|
34
|
+
messageTransmitterAddress: TARGET_TRANSMITTER_ADDRESS,
|
|
35
|
+
tokens: [
|
|
36
|
+
{
|
|
37
|
+
address: TARGET_TOKEN_ADDRESS,
|
|
38
|
+
name: 'USD Coin',
|
|
39
|
+
symbol: 'USDC',
|
|
40
|
+
decimals: 6,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
minimumConfirmations: TARGET_MINIMUM_CONFIRMATIONS,
|
|
44
|
+
},
|
|
45
|
+
] as const;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export const ERC20_ABI = [
|
|
2
|
+
{
|
|
3
|
+
constant: true,
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: 'name',
|
|
6
|
+
outputs: [{ name: '', type: 'string' }],
|
|
7
|
+
payable: false,
|
|
8
|
+
stateMutability: 'view',
|
|
9
|
+
type: 'function',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
constant: false,
|
|
13
|
+
inputs: [
|
|
14
|
+
{ name: '_spender', type: 'address' },
|
|
15
|
+
{ name: '_value', type: 'uint256' },
|
|
16
|
+
],
|
|
17
|
+
name: 'approve',
|
|
18
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
19
|
+
payable: false,
|
|
20
|
+
stateMutability: 'nonpayable',
|
|
21
|
+
type: 'function',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
constant: true,
|
|
25
|
+
inputs: [],
|
|
26
|
+
name: 'totalSupply',
|
|
27
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
28
|
+
payable: false,
|
|
29
|
+
stateMutability: 'view',
|
|
30
|
+
type: 'function',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
constant: false,
|
|
34
|
+
inputs: [
|
|
35
|
+
{ name: '_from', type: 'address' },
|
|
36
|
+
{ name: '_to', type: 'address' },
|
|
37
|
+
{ name: '_value', type: 'uint256' },
|
|
38
|
+
],
|
|
39
|
+
name: 'transferFrom',
|
|
40
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
41
|
+
payable: false,
|
|
42
|
+
stateMutability: 'nonpayable',
|
|
43
|
+
type: 'function',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
constant: true,
|
|
47
|
+
inputs: [],
|
|
48
|
+
name: 'decimals',
|
|
49
|
+
outputs: [{ name: '', type: 'uint8' }],
|
|
50
|
+
payable: false,
|
|
51
|
+
stateMutability: 'view',
|
|
52
|
+
type: 'function',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
constant: true,
|
|
56
|
+
inputs: [{ name: '_owner', type: 'address' }],
|
|
57
|
+
name: 'balanceOf',
|
|
58
|
+
outputs: [{ name: 'balance', type: 'uint256' }],
|
|
59
|
+
payable: false,
|
|
60
|
+
stateMutability: 'view',
|
|
61
|
+
type: 'function',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
constant: true,
|
|
65
|
+
inputs: [],
|
|
66
|
+
name: 'symbol',
|
|
67
|
+
outputs: [{ name: '', type: 'string' }],
|
|
68
|
+
payable: false,
|
|
69
|
+
stateMutability: 'view',
|
|
70
|
+
type: 'function',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
constant: false,
|
|
74
|
+
inputs: [
|
|
75
|
+
{ name: '_to', type: 'address' },
|
|
76
|
+
{ name: '_value', type: 'uint256' },
|
|
77
|
+
],
|
|
78
|
+
name: 'transfer',
|
|
79
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
80
|
+
payable: false,
|
|
81
|
+
stateMutability: 'nonpayable',
|
|
82
|
+
type: 'function',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
constant: true,
|
|
86
|
+
inputs: [
|
|
87
|
+
{ name: '_owner', type: 'address' },
|
|
88
|
+
{ name: '_spender', type: 'address' },
|
|
89
|
+
],
|
|
90
|
+
name: 'allowance',
|
|
91
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
92
|
+
payable: false,
|
|
93
|
+
stateMutability: 'view',
|
|
94
|
+
type: 'function',
|
|
95
|
+
},
|
|
96
|
+
{ payable: true, stateMutability: 'payable', type: 'fallback' },
|
|
97
|
+
{
|
|
98
|
+
anonymous: false,
|
|
99
|
+
inputs: [
|
|
100
|
+
{ indexed: true, name: 'owner', type: 'address' },
|
|
101
|
+
{ indexed: true, name: 'spender', type: 'address' },
|
|
102
|
+
{ indexed: false, name: 'value', type: 'uint256' },
|
|
103
|
+
],
|
|
104
|
+
name: 'Approval',
|
|
105
|
+
type: 'event',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
anonymous: false,
|
|
109
|
+
inputs: [
|
|
110
|
+
{ indexed: true, name: 'from', type: 'address' },
|
|
111
|
+
{ indexed: true, name: 'to', type: 'address' },
|
|
112
|
+
{ indexed: false, name: 'value', type: 'uint256' },
|
|
113
|
+
],
|
|
114
|
+
name: 'Transfer',
|
|
115
|
+
type: 'event',
|
|
116
|
+
},
|
|
117
|
+
] as const;
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
export const MESSAGE_TRANSMITTER_ABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{ internalType: 'uint32', name: '_localDomain', type: 'uint32' },
|
|
5
|
+
{ internalType: 'address', name: '_attester', type: 'address' },
|
|
6
|
+
{ internalType: 'uint32', name: '_maxMessageBodySize', type: 'uint32' },
|
|
7
|
+
{ internalType: 'uint32', name: '_version', type: 'uint32' },
|
|
8
|
+
],
|
|
9
|
+
stateMutability: 'nonpayable',
|
|
10
|
+
type: 'constructor',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
anonymous: false,
|
|
14
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'attester', type: 'address' }],
|
|
15
|
+
name: 'AttesterDisabled',
|
|
16
|
+
type: 'event',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
anonymous: false,
|
|
20
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'attester', type: 'address' }],
|
|
21
|
+
name: 'AttesterEnabled',
|
|
22
|
+
type: 'event',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
anonymous: false,
|
|
26
|
+
inputs: [
|
|
27
|
+
{ indexed: true, internalType: 'address', name: 'previousAttesterManager', type: 'address' },
|
|
28
|
+
{ indexed: true, internalType: 'address', name: 'newAttesterManager', type: 'address' },
|
|
29
|
+
],
|
|
30
|
+
name: 'AttesterManagerUpdated',
|
|
31
|
+
type: 'event',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
anonymous: false,
|
|
35
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'newMaxMessageBodySize', type: 'uint256' }],
|
|
36
|
+
name: 'MaxMessageBodySizeUpdated',
|
|
37
|
+
type: 'event',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
anonymous: false,
|
|
41
|
+
inputs: [
|
|
42
|
+
{ indexed: true, internalType: 'address', name: 'caller', type: 'address' },
|
|
43
|
+
{ indexed: false, internalType: 'uint32', name: 'sourceDomain', type: 'uint32' },
|
|
44
|
+
{ indexed: true, internalType: 'uint64', name: 'nonce', type: 'uint64' },
|
|
45
|
+
{ indexed: false, internalType: 'bytes32', name: 'sender', type: 'bytes32' },
|
|
46
|
+
{ indexed: false, internalType: 'bytes', name: 'messageBody', type: 'bytes' },
|
|
47
|
+
],
|
|
48
|
+
name: 'MessageReceived',
|
|
49
|
+
type: 'event',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
anonymous: false,
|
|
53
|
+
inputs: [{ indexed: false, internalType: 'bytes', name: 'message', type: 'bytes' }],
|
|
54
|
+
name: 'MessageSent',
|
|
55
|
+
type: 'event',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
anonymous: false,
|
|
59
|
+
inputs: [
|
|
60
|
+
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
|
|
61
|
+
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
|
|
62
|
+
],
|
|
63
|
+
name: 'OwnershipTransferStarted',
|
|
64
|
+
type: 'event',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
anonymous: false,
|
|
68
|
+
inputs: [
|
|
69
|
+
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
|
|
70
|
+
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
|
|
71
|
+
],
|
|
72
|
+
name: 'OwnershipTransferred',
|
|
73
|
+
type: 'event',
|
|
74
|
+
},
|
|
75
|
+
{ anonymous: false, inputs: [], name: 'Pause', type: 'event' },
|
|
76
|
+
{
|
|
77
|
+
anonymous: false,
|
|
78
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'newAddress', type: 'address' }],
|
|
79
|
+
name: 'PauserChanged',
|
|
80
|
+
type: 'event',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
anonymous: false,
|
|
84
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'newRescuer', type: 'address' }],
|
|
85
|
+
name: 'RescuerChanged',
|
|
86
|
+
type: 'event',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
anonymous: false,
|
|
90
|
+
inputs: [
|
|
91
|
+
{ indexed: false, internalType: 'uint256', name: 'oldSignatureThreshold', type: 'uint256' },
|
|
92
|
+
{ indexed: false, internalType: 'uint256', name: 'newSignatureThreshold', type: 'uint256' },
|
|
93
|
+
],
|
|
94
|
+
name: 'SignatureThresholdUpdated',
|
|
95
|
+
type: 'event',
|
|
96
|
+
},
|
|
97
|
+
{ anonymous: false, inputs: [], name: 'Unpause', type: 'event' },
|
|
98
|
+
{ inputs: [], name: 'acceptOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' },
|
|
99
|
+
{
|
|
100
|
+
inputs: [],
|
|
101
|
+
name: 'attesterManager',
|
|
102
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
103
|
+
stateMutability: 'view',
|
|
104
|
+
type: 'function',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
inputs: [{ internalType: 'address', name: 'attester', type: 'address' }],
|
|
108
|
+
name: 'disableAttester',
|
|
109
|
+
outputs: [],
|
|
110
|
+
stateMutability: 'nonpayable',
|
|
111
|
+
type: 'function',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
inputs: [{ internalType: 'address', name: 'newAttester', type: 'address' }],
|
|
115
|
+
name: 'enableAttester',
|
|
116
|
+
outputs: [],
|
|
117
|
+
stateMutability: 'nonpayable',
|
|
118
|
+
type: 'function',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],
|
|
122
|
+
name: 'getEnabledAttester',
|
|
123
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
124
|
+
stateMutability: 'view',
|
|
125
|
+
type: 'function',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
inputs: [],
|
|
129
|
+
name: 'getNumEnabledAttesters',
|
|
130
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
131
|
+
stateMutability: 'view',
|
|
132
|
+
type: 'function',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
inputs: [{ internalType: 'address', name: 'attester', type: 'address' }],
|
|
136
|
+
name: 'isEnabledAttester',
|
|
137
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
138
|
+
stateMutability: 'view',
|
|
139
|
+
type: 'function',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
inputs: [],
|
|
143
|
+
name: 'localDomain',
|
|
144
|
+
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
|
|
145
|
+
stateMutability: 'view',
|
|
146
|
+
type: 'function',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
inputs: [],
|
|
150
|
+
name: 'maxMessageBodySize',
|
|
151
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
152
|
+
stateMutability: 'view',
|
|
153
|
+
type: 'function',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
inputs: [],
|
|
157
|
+
name: 'nextAvailableNonce',
|
|
158
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
159
|
+
stateMutability: 'view',
|
|
160
|
+
type: 'function',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
inputs: [],
|
|
164
|
+
name: 'owner',
|
|
165
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
166
|
+
stateMutability: 'view',
|
|
167
|
+
type: 'function',
|
|
168
|
+
},
|
|
169
|
+
{ inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
|
|
170
|
+
{
|
|
171
|
+
inputs: [],
|
|
172
|
+
name: 'paused',
|
|
173
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
174
|
+
stateMutability: 'view',
|
|
175
|
+
type: 'function',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
inputs: [],
|
|
179
|
+
name: 'pauser',
|
|
180
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
181
|
+
stateMutability: 'view',
|
|
182
|
+
type: 'function',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
inputs: [],
|
|
186
|
+
name: 'pendingOwner',
|
|
187
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
188
|
+
stateMutability: 'view',
|
|
189
|
+
type: 'function',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
inputs: [
|
|
193
|
+
{ internalType: 'bytes', name: 'message', type: 'bytes' },
|
|
194
|
+
{ internalType: 'bytes', name: 'attestation', type: 'bytes' },
|
|
195
|
+
],
|
|
196
|
+
name: 'receiveMessage',
|
|
197
|
+
outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }],
|
|
198
|
+
stateMutability: 'nonpayable',
|
|
199
|
+
type: 'function',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
inputs: [
|
|
203
|
+
{ internalType: 'bytes', name: 'originalMessage', type: 'bytes' },
|
|
204
|
+
{ internalType: 'bytes', name: 'originalAttestation', type: 'bytes' },
|
|
205
|
+
{ internalType: 'bytes', name: 'newMessageBody', type: 'bytes' },
|
|
206
|
+
{ internalType: 'bytes32', name: 'newDestinationCaller', type: 'bytes32' },
|
|
207
|
+
],
|
|
208
|
+
name: 'replaceMessage',
|
|
209
|
+
outputs: [],
|
|
210
|
+
stateMutability: 'nonpayable',
|
|
211
|
+
type: 'function',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
inputs: [
|
|
215
|
+
{ internalType: 'contract IERC20', name: 'tokenContract', type: 'address' },
|
|
216
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
|
217
|
+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
|
|
218
|
+
],
|
|
219
|
+
name: 'rescueERC20',
|
|
220
|
+
outputs: [],
|
|
221
|
+
stateMutability: 'nonpayable',
|
|
222
|
+
type: 'function',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
inputs: [],
|
|
226
|
+
name: 'rescuer',
|
|
227
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
228
|
+
stateMutability: 'view',
|
|
229
|
+
type: 'function',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
inputs: [
|
|
233
|
+
{ internalType: 'uint32', name: 'destinationDomain', type: 'uint32' },
|
|
234
|
+
{ internalType: 'bytes32', name: 'recipient', type: 'bytes32' },
|
|
235
|
+
{ internalType: 'bytes', name: 'messageBody', type: 'bytes' },
|
|
236
|
+
],
|
|
237
|
+
name: 'sendMessage',
|
|
238
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
239
|
+
stateMutability: 'nonpayable',
|
|
240
|
+
type: 'function',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
inputs: [
|
|
244
|
+
{ internalType: 'uint32', name: 'destinationDomain', type: 'uint32' },
|
|
245
|
+
{ internalType: 'bytes32', name: 'recipient', type: 'bytes32' },
|
|
246
|
+
{ internalType: 'bytes32', name: 'destinationCaller', type: 'bytes32' },
|
|
247
|
+
{ internalType: 'bytes', name: 'messageBody', type: 'bytes' },
|
|
248
|
+
],
|
|
249
|
+
name: 'sendMessageWithCaller',
|
|
250
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
251
|
+
stateMutability: 'nonpayable',
|
|
252
|
+
type: 'function',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
inputs: [{ internalType: 'uint256', name: 'newMaxMessageBodySize', type: 'uint256' }],
|
|
256
|
+
name: 'setMaxMessageBodySize',
|
|
257
|
+
outputs: [],
|
|
258
|
+
stateMutability: 'nonpayable',
|
|
259
|
+
type: 'function',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
inputs: [{ internalType: 'uint256', name: 'newSignatureThreshold', type: 'uint256' }],
|
|
263
|
+
name: 'setSignatureThreshold',
|
|
264
|
+
outputs: [],
|
|
265
|
+
stateMutability: 'nonpayable',
|
|
266
|
+
type: 'function',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
inputs: [],
|
|
270
|
+
name: 'signatureThreshold',
|
|
271
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
272
|
+
stateMutability: 'view',
|
|
273
|
+
type: 'function',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
|
|
277
|
+
name: 'transferOwnership',
|
|
278
|
+
outputs: [],
|
|
279
|
+
stateMutability: 'nonpayable',
|
|
280
|
+
type: 'function',
|
|
281
|
+
},
|
|
282
|
+
{ inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
|
|
283
|
+
{
|
|
284
|
+
inputs: [{ internalType: 'address', name: 'newAttesterManager', type: 'address' }],
|
|
285
|
+
name: 'updateAttesterManager',
|
|
286
|
+
outputs: [],
|
|
287
|
+
stateMutability: 'nonpayable',
|
|
288
|
+
type: 'function',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
inputs: [{ internalType: 'address', name: '_newPauser', type: 'address' }],
|
|
292
|
+
name: 'updatePauser',
|
|
293
|
+
outputs: [],
|
|
294
|
+
stateMutability: 'nonpayable',
|
|
295
|
+
type: 'function',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
inputs: [{ internalType: 'address', name: 'newRescuer', type: 'address' }],
|
|
299
|
+
name: 'updateRescuer',
|
|
300
|
+
outputs: [],
|
|
301
|
+
stateMutability: 'nonpayable',
|
|
302
|
+
type: 'function',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
|
|
306
|
+
name: 'usedNonces',
|
|
307
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
308
|
+
stateMutability: 'view',
|
|
309
|
+
type: 'function',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
inputs: [],
|
|
313
|
+
name: 'version',
|
|
314
|
+
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
|
|
315
|
+
stateMutability: 'view',
|
|
316
|
+
type: 'function',
|
|
317
|
+
},
|
|
318
|
+
] as const;
|