-
Notifications
You must be signed in to change notification settings - Fork 57
/
abi_json.go
129 lines (123 loc) · 5.02 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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 compatability of the OutgoingBatchTx message
OutgoingBatchTxCheckpointABIJSON = `[{
"name": "submitBatch",
"stateMutability": "pure",
"type": "function",
"inputs": [
{ "internalType": "bytes32", "name": "_gravityId", "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" }
],
"outputs": [
{ "internalType": "bytes32", "name": "", "type": "bytes32" }
]
}]`
// ValsetCheckpointABIJSON checks the ETH ABI for compatability of the Valset update message
ValsetCheckpointABIJSON = `[{
"name": "checkpoint",
"stateMutability": "pure",
"type": "function",
"inputs": [
{ "internalType": "bytes32", "name": "_gravityId", "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[]" },
{ "internalType": "uint256", "name": "_rewardAmount","type": "uint256" },
{ "internalType": "address", "name": "_rewardToken", "type": "address" }
],
"outputs": [
{ "internalType": "bytes32", "name": "", "type": "bytes32" }
]
}]`
// OutgoingLogicCallABIJSON checks the ETH ABI for compatability of the logic call message
OutgoingLogicCallABIJSON = `[{
"name": "checkpoint",
"outputs": [],
"stateMutability": "pure",
"type": "function",
"inputs": [
{ "internalType": "bytes32", "name": "_gravityId", "type": "bytes32" },
{ "internalType": "bytes32", "name": "_methodName", "type": "bytes32" },
{ "internalType": "uint256[]", "name": "_transferAmounts", "type": "uint256[]" },
{ "internalType": "address[]", "name": "_transferTokenContracts", "type": "address[]" },
{ "internalType": "uint256[]", "name": "_feeAmounts", "type": "uint256[]" },
{ "internalType": "address[]", "name": "_feeTokenContracts", "type": "address[]" },
{ "internalType": "address", "name": "_logicContractAddress", "type": "address" },
{ "internalType": "bytes", "name": "_payload", "type": "bytes" },
{ "internalType": "uint256", "name": "_timeout", "type": "uint256" },
{ "internalType": "bytes32", "name": "_invalidationId", "type": "bytes32" },
{ "internalType": "uint256", "name": "_invalidationNonce", "type": "uint256" }
]
}]`
DeployERC20ABIJSON = `[{
"inputs": [
{
"internalType": "string",
"name": "_cosmosDenom",
"type": "string"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8"
}
],
"name": "deployERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}]`
SendToCosmosABIJSON = `[{
"inputs": [
{
"internalType": "address",
"name": "_tokenContract",
"type": "address"
},
{
"internalType": "bytes32",
"name": "_destination",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "sendToCosmos",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}]`
)