Skip to content

Commit 63c3099

Browse files
committed
add agent contract support
1 parent 20ddf67 commit 63c3099

32 files changed

Lines changed: 3106 additions & 1244 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ run:
5353

5454
.PHONY: docker
5555
docker:
56-
$(DOCKERCMD) build -t $(USER)/iotex-election:latest .
56+
$(DOCKERCMD) build -t $(USER)/iotex-election:latest .

contract/abigen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ abigen --abi clerk.abi --pkg contract --type Clerk --out clerk.go
77
abigen --abi vita.abi --pkg contract --type Vita --out vita.go
88
abigen --abi register.abi --pkg contract --type Register --out register.go
99
abigen --abi staking.abi --pkg contract --type Staking --out staking.go
10-
abigen --abi pyggstaking.abi --pkg contract --type PyggStaking --out pyggstaking.go
10+
abigen --abi pyggstaking.abi --pkg contract --type PyggStaking --out pyggstaking.go
11+
abigen --abi agent.abi --pkg contract --type Agent --out agent.go

contract/agent.abi

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
[
2+
{
3+
"inputs": [
4+
{
5+
"internalType": "address",
6+
"name": "_vita",
7+
"type": "address"
8+
},
9+
{
10+
"internalType": "address",
11+
"name": "_notary",
12+
"type": "address"
13+
}
14+
],
15+
"stateMutability": "nonpayable",
16+
"type": "constructor"
17+
},
18+
{
19+
"inputs": [],
20+
"name": "AUTHENTICATION_TYPEHASH",
21+
"outputs": [
22+
{
23+
"internalType": "bytes32",
24+
"name": "",
25+
"type": "bytes32"
26+
}
27+
],
28+
"stateMutability": "view",
29+
"type": "function"
30+
},
31+
{
32+
"inputs": [],
33+
"name": "DOMAIN_SEPARATOR",
34+
"outputs": [
35+
{
36+
"internalType": "bytes32",
37+
"name": "",
38+
"type": "bytes32"
39+
}
40+
],
41+
"stateMutability": "view",
42+
"type": "function"
43+
},
44+
{
45+
"inputs": [],
46+
"name": "EIP712DOMAIN_TYPEHASH",
47+
"outputs": [
48+
{
49+
"internalType": "bytes32",
50+
"name": "",
51+
"type": "bytes32"
52+
}
53+
],
54+
"stateMutability": "view",
55+
"type": "function"
56+
},
57+
{
58+
"inputs": [
59+
{
60+
"internalType": "uint256",
61+
"name": "_amount",
62+
"type": "uint256"
63+
},
64+
{
65+
"internalType": "uint256",
66+
"name": "_deadline",
67+
"type": "uint256"
68+
},
69+
{
70+
"internalType": "uint8",
71+
"name": "_v",
72+
"type": "uint8"
73+
},
74+
{
75+
"internalType": "bytes32",
76+
"name": "_r",
77+
"type": "bytes32"
78+
},
79+
{
80+
"internalType": "bytes32",
81+
"name": "_s",
82+
"type": "bytes32"
83+
}
84+
],
85+
"name": "claim",
86+
"outputs": [],
87+
"stateMutability": "nonpayable",
88+
"type": "function"
89+
},
90+
{
91+
"inputs": [
92+
{
93+
"internalType": "address",
94+
"name": "_owner",
95+
"type": "address"
96+
},
97+
{
98+
"internalType": "uint256",
99+
"name": "_amount",
100+
"type": "uint256"
101+
},
102+
{
103+
"internalType": "uint256",
104+
"name": "_deadline",
105+
"type": "uint256"
106+
},
107+
{
108+
"internalType": "uint8",
109+
"name": "_v",
110+
"type": "uint8"
111+
},
112+
{
113+
"internalType": "bytes32",
114+
"name": "_r",
115+
"type": "bytes32"
116+
},
117+
{
118+
"internalType": "bytes32",
119+
"name": "_s",
120+
"type": "bytes32"
121+
}
122+
],
123+
"name": "claimFor",
124+
"outputs": [],
125+
"stateMutability": "nonpayable",
126+
"type": "function"
127+
},
128+
{
129+
"inputs": [],
130+
"name": "claimVita",
131+
"outputs": [],
132+
"stateMutability": "nonpayable",
133+
"type": "function"
134+
},
135+
{
136+
"inputs": [
137+
{
138+
"internalType": "address",
139+
"name": "_user",
140+
"type": "address"
141+
}
142+
],
143+
"name": "claimed",
144+
"outputs": [
145+
{
146+
"internalType": "uint256",
147+
"name": "",
148+
"type": "uint256"
149+
},
150+
{
151+
"internalType": "uint256",
152+
"name": "",
153+
"type": "uint256"
154+
},
155+
{
156+
"internalType": "bool",
157+
"name": "",
158+
"type": "bool"
159+
}
160+
],
161+
"stateMutability": "view",
162+
"type": "function"
163+
},
164+
{
165+
"inputs": [
166+
{
167+
"internalType": "address",
168+
"name": "wallet",
169+
"type": "address"
170+
},
171+
{
172+
"internalType": "uint256",
173+
"name": "amount",
174+
"type": "uint256"
175+
},
176+
{
177+
"internalType": "uint256",
178+
"name": "deadline",
179+
"type": "uint256"
180+
}
181+
],
182+
"name": "digest",
183+
"outputs": [
184+
{
185+
"internalType": "bytes32",
186+
"name": "",
187+
"type": "bytes32"
188+
}
189+
],
190+
"stateMutability": "view",
191+
"type": "function"
192+
},
193+
{
194+
"inputs": [
195+
{
196+
"internalType": "address",
197+
"name": "",
198+
"type": "address"
199+
}
200+
],
201+
"name": "lastClaimCycles",
202+
"outputs": [
203+
{
204+
"internalType": "uint256",
205+
"name": "",
206+
"type": "uint256"
207+
}
208+
],
209+
"stateMutability": "view",
210+
"type": "function"
211+
},
212+
{
213+
"inputs": [],
214+
"name": "notary",
215+
"outputs": [
216+
{
217+
"internalType": "address",
218+
"name": "",
219+
"type": "address"
220+
}
221+
],
222+
"stateMutability": "view",
223+
"type": "function"
224+
},
225+
{
226+
"inputs": [],
227+
"name": "poolSize",
228+
"outputs": [
229+
{
230+
"internalType": "uint256",
231+
"name": "",
232+
"type": "uint256"
233+
}
234+
],
235+
"stateMutability": "view",
236+
"type": "function"
237+
},
238+
{
239+
"inputs": [],
240+
"name": "vita",
241+
"outputs": [
242+
{
243+
"internalType": "contract Vita",
244+
"name": "",
245+
"type": "address"
246+
}
247+
],
248+
"stateMutability": "view",
249+
"type": "function"
250+
}
251+
]

0 commit comments

Comments
 (0)