-
Notifications
You must be signed in to change notification settings - Fork 12
/
abi_json.go
54 lines (51 loc) · 2.66 KB
/
abi_json.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package types
// The go-ethereum ABI encoder *only* encodes function calls and then it only encodes
// function calls for which you provide an ABI json just like you would get out of the
// solidity compiler with your compiled contract.
// You are supposed to compile your contract, use abigen to generate an ABI , import
// this generated go module and then use for that for all testing and development.
// This abstraction layer is more trouble than it's worth, because we don't want to
// encode a function call at all, but instead we want to emulate a Solidity encode operation
// which has no equal available from go-ethereum.
//
// In order to work around this absurd series of problems we have to manually write the below
// 'function specification' that will encode the same arguments into a function call. We can then
// truncate the first several bytes where the call name is encoded to finally get the equal of the
const (
// OutgoingBatchTxCheckpointABIJSON checks the ETH ABI for compatibility of the OutgoingBatchTx message
OutgoingBatchTxCheckpointABIJSON = `[{
"name":"submitBatch",
"stateMutability":"nonpayable",
"type":"function",
"inputs":[
{ "internalType": "bytes32", "name": "_fxbridgeId", "type": "bytes32" },
{ "internalType": "bytes32", "name": "_methodName", "type": "bytes32" },
{ "internalType": "uint256[]", "name": "_amounts", "type": "uint256[]" },
{ "internalType": "address[]", "name": "_destinations", "type": "address[]" },
{ "internalType": "uint256[]", "name": "_fees", "type": "uint256[]" },
{ "internalType": "uint256", "name": "_batchNonce", "type": "uint256" },
{ "internalType": "address", "name": "_tokenContract", "type": "address" },
{ "internalType": "uint256", "name": "_batchTimeout", "type": "uint256" },
{ "internalType": "address", "name": "_feeReceive", "type": "address" }
],
"outputs": [
{ "internalType": "bytes32", "name": "", "type": "bytes32" }
]
}]`
// ValsetCheckpointABIJSON checks the ETH ABI for compatibility of the Valset update message
ValsetCheckpointABIJSON = `[{
"name": "checkpoint",
"stateMutability": "pure",
"type": "function",
"inputs": [
{ "internalType": "bytes32", "name": "_fxbridgeId", "type": "bytes32" },
{ "internalType": "bytes32", "name": "_checkpoint", "type": "bytes32" },
{ "internalType": "uint256", "name": "_valsetNonce", "type": "uint256" },
{ "internalType": "address[]", "name": "_validators", "type": "address[]" },
{ "internalType": "uint256[]", "name": "_powers", "type": "uint256[]" }
],
"outputs": [
{ "internalType": "bytes32", "name": "", "type": "bytes32" }
]
}]`
)