1pub use i_governor::*;
2#[allow(
5 clippy::enum_variant_names,
6 clippy::too_many_arguments,
7 clippy::upper_case_acronyms,
8 clippy::type_complexity,
9 dead_code,
10 non_camel_case_types,
11)]
12pub mod i_governor {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ProposalCanceled\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\",\"components\":[],\"indexed\":false},{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ProposalCreated\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ProposalExecuted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"VoteCast\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"VoteCastWithParams\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"payable\",\"type\":\"function\",\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"pure\",\"type\":\"function\",\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]}]";
15 pub static IGOVERNOR_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
17 ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
18 pub struct IGovernor<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for IGovernor<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for IGovernor<M> {
25 type Target = ::ethers_contract::Contract<M>;
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29 }
30 impl<M> ::core::ops::DerefMut for IGovernor<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for IGovernor<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(IGovernor)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> IGovernor<M> {
41 pub fn new<T: Into<::ethers_core::types::Address>>(
44 address: T,
45 client: ::std::sync::Arc<M>,
46 ) -> Self {
47 Self(
48 ::ethers_contract::Contract::new(
49 address.into(),
50 IGOVERNOR_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 pub fn clock_mode(
57 &self,
58 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
59 self.0
60 .method_hash([75, 245, 215, 233], ())
61 .expect("method not found (this should never happen)")
62 }
63 pub fn counting_mode(
65 &self,
66 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
67 self.0
68 .method_hash([221, 78, 43, 165], ())
69 .expect("method not found (this should never happen)")
70 }
71 pub fn cancel(
73 &self,
74 targets: ::std::vec::Vec<::ethers_core::types::Address>,
75 values: ::std::vec::Vec<::ethers_core::types::U256>,
76 calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
77 description_hash: [u8; 32],
78 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
79 self.0
80 .method_hash(
81 [69, 33, 21, 214],
82 (targets, values, calldatas, description_hash),
83 )
84 .expect("method not found (this should never happen)")
85 }
86 pub fn cast_vote(
88 &self,
89 proposal_id: ::ethers_core::types::U256,
90 support: u8,
91 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
92 self.0
93 .method_hash([86, 120, 19, 136], (proposal_id, support))
94 .expect("method not found (this should never happen)")
95 }
96 pub fn cast_vote_by_sig(
98 &self,
99 proposal_id: ::ethers_core::types::U256,
100 support: u8,
101 v: u8,
102 r: [u8; 32],
103 s: [u8; 32],
104 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
105 self.0
106 .method_hash([59, 204, 244, 253], (proposal_id, support, v, r, s))
107 .expect("method not found (this should never happen)")
108 }
109 pub fn cast_vote_with_reason(
111 &self,
112 proposal_id: ::ethers_core::types::U256,
113 support: u8,
114 reason: ::std::string::String,
115 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
116 self.0
117 .method_hash([123, 60, 113, 211], (proposal_id, support, reason))
118 .expect("method not found (this should never happen)")
119 }
120 pub fn cast_vote_with_reason_and_params(
122 &self,
123 proposal_id: ::ethers_core::types::U256,
124 support: u8,
125 reason: ::std::string::String,
126 params: ::ethers_core::types::Bytes,
127 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
128 self.0
129 .method_hash([95, 57, 138, 20], (proposal_id, support, reason, params))
130 .expect("method not found (this should never happen)")
131 }
132 pub fn cast_vote_with_reason_and_params_by_sig(
134 &self,
135 proposal_id: ::ethers_core::types::U256,
136 support: u8,
137 reason: ::std::string::String,
138 params: ::ethers_core::types::Bytes,
139 v: u8,
140 r: [u8; 32],
141 s: [u8; 32],
142 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
143 self.0
144 .method_hash(
145 [3, 66, 1, 129],
146 (proposal_id, support, reason, params, v, r, s),
147 )
148 .expect("method not found (this should never happen)")
149 }
150 pub fn clock(&self) -> ::ethers_contract::builders::ContractCall<M, u64> {
152 self.0
153 .method_hash([145, 221, 173, 244], ())
154 .expect("method not found (this should never happen)")
155 }
156 pub fn execute(
158 &self,
159 targets: ::std::vec::Vec<::ethers_core::types::Address>,
160 values: ::std::vec::Vec<::ethers_core::types::U256>,
161 calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
162 description_hash: [u8; 32],
163 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
164 self.0
165 .method_hash(
166 [38, 86, 34, 125],
167 (targets, values, calldatas, description_hash),
168 )
169 .expect("method not found (this should never happen)")
170 }
171 pub fn get_votes(
173 &self,
174 account: ::ethers_core::types::Address,
175 timepoint: ::ethers_core::types::U256,
176 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
177 self.0
178 .method_hash([235, 144, 25, 212], (account, timepoint))
179 .expect("method not found (this should never happen)")
180 }
181 pub fn get_votes_with_params(
183 &self,
184 account: ::ethers_core::types::Address,
185 timepoint: ::ethers_core::types::U256,
186 params: ::ethers_core::types::Bytes,
187 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
188 self.0
189 .method_hash([154, 128, 42, 109], (account, timepoint, params))
190 .expect("method not found (this should never happen)")
191 }
192 pub fn has_voted(
194 &self,
195 proposal_id: ::ethers_core::types::U256,
196 account: ::ethers_core::types::Address,
197 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
198 self.0
199 .method_hash([67, 133, 150, 50], (proposal_id, account))
200 .expect("method not found (this should never happen)")
201 }
202 pub fn hash_proposal(
204 &self,
205 targets: ::std::vec::Vec<::ethers_core::types::Address>,
206 values: ::std::vec::Vec<::ethers_core::types::U256>,
207 calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
208 description_hash: [u8; 32],
209 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
210 self.0
211 .method_hash(
212 [197, 144, 87, 228],
213 (targets, values, calldatas, description_hash),
214 )
215 .expect("method not found (this should never happen)")
216 }
217 pub fn name(
219 &self,
220 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
221 self.0
222 .method_hash([6, 253, 222, 3], ())
223 .expect("method not found (this should never happen)")
224 }
225 pub fn proposal_deadline(
227 &self,
228 proposal_id: ::ethers_core::types::U256,
229 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
230 self.0
231 .method_hash([192, 31, 158, 55], proposal_id)
232 .expect("method not found (this should never happen)")
233 }
234 pub fn proposal_proposer(
236 &self,
237 proposal_id: ::ethers_core::types::U256,
238 ) -> ::ethers_contract::builders::ContractCall<
239 M,
240 ::ethers_core::types::Address,
241 > {
242 self.0
243 .method_hash([20, 52, 137, 208], proposal_id)
244 .expect("method not found (this should never happen)")
245 }
246 pub fn proposal_snapshot(
248 &self,
249 proposal_id: ::ethers_core::types::U256,
250 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
251 self.0
252 .method_hash([45, 99, 246, 147], proposal_id)
253 .expect("method not found (this should never happen)")
254 }
255 pub fn propose(
257 &self,
258 targets: ::std::vec::Vec<::ethers_core::types::Address>,
259 values: ::std::vec::Vec<::ethers_core::types::U256>,
260 calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
261 description: ::std::string::String,
262 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
263 self.0
264 .method_hash(
265 [125, 94, 129, 226],
266 (targets, values, calldatas, description),
267 )
268 .expect("method not found (this should never happen)")
269 }
270 pub fn quorum(
272 &self,
273 timepoint: ::ethers_core::types::U256,
274 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
275 self.0
276 .method_hash([248, 206, 86, 10], timepoint)
277 .expect("method not found (this should never happen)")
278 }
279 pub fn state(
281 &self,
282 proposal_id: ::ethers_core::types::U256,
283 ) -> ::ethers_contract::builders::ContractCall<M, u8> {
284 self.0
285 .method_hash([62, 79, 73, 230], proposal_id)
286 .expect("method not found (this should never happen)")
287 }
288 pub fn supports_interface(
290 &self,
291 interface_id: [u8; 4],
292 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
293 self.0
294 .method_hash([1, 255, 201, 167], interface_id)
295 .expect("method not found (this should never happen)")
296 }
297 pub fn version(
299 &self,
300 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
301 self.0
302 .method_hash([84, 253, 77, 80], ())
303 .expect("method not found (this should never happen)")
304 }
305 pub fn voting_delay(
307 &self,
308 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
309 self.0
310 .method_hash([57, 50, 171, 177], ())
311 .expect("method not found (this should never happen)")
312 }
313 pub fn voting_period(
315 &self,
316 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
317 self.0
318 .method_hash([2, 162, 81, 163], ())
319 .expect("method not found (this should never happen)")
320 }
321 pub fn proposal_canceled_filter(
323 &self,
324 ) -> ::ethers_contract::builders::Event<
325 ::std::sync::Arc<M>,
326 M,
327 ProposalCanceledFilter,
328 > {
329 self.0.event()
330 }
331 pub fn proposal_created_filter(
333 &self,
334 ) -> ::ethers_contract::builders::Event<
335 ::std::sync::Arc<M>,
336 M,
337 ProposalCreatedFilter,
338 > {
339 self.0.event()
340 }
341 pub fn proposal_executed_filter(
343 &self,
344 ) -> ::ethers_contract::builders::Event<
345 ::std::sync::Arc<M>,
346 M,
347 ProposalExecutedFilter,
348 > {
349 self.0.event()
350 }
351 pub fn vote_cast_filter(
353 &self,
354 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, VoteCastFilter> {
355 self.0.event()
356 }
357 pub fn vote_cast_with_params_filter(
359 &self,
360 ) -> ::ethers_contract::builders::Event<
361 ::std::sync::Arc<M>,
362 M,
363 VoteCastWithParamsFilter,
364 > {
365 self.0.event()
366 }
367 pub fn events(
369 &self,
370 ) -> ::ethers_contract::builders::Event<
371 ::std::sync::Arc<M>,
372 M,
373 IGovernorEvents,
374 > {
375 self.0.event_with_filter(::core::default::Default::default())
376 }
377 }
378 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
379 for IGovernor<M> {
380 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
381 Self::new(contract.address(), contract.client())
382 }
383 }
384 #[derive(
385 Clone,
386 ::ethers_contract::EthEvent,
387 ::ethers_contract::EthDisplay,
388 Default,
389 Debug,
390 PartialEq,
391 Eq,
392 Hash
393 )]
394 #[ethevent(name = "ProposalCanceled", abi = "ProposalCanceled(uint256)")]
395 pub struct ProposalCanceledFilter {
396 pub proposal_id: ::ethers_core::types::U256,
397 }
398 #[derive(
399 Clone,
400 ::ethers_contract::EthEvent,
401 ::ethers_contract::EthDisplay,
402 Default,
403 Debug,
404 PartialEq,
405 Eq,
406 Hash
407 )]
408 #[ethevent(
409 name = "ProposalCreated",
410 abi = "ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)"
411 )]
412 pub struct ProposalCreatedFilter {
413 pub proposal_id: ::ethers_core::types::U256,
414 pub proposer: ::ethers_core::types::Address,
415 pub targets: ::std::vec::Vec<::ethers_core::types::Address>,
416 pub values: ::std::vec::Vec<::ethers_core::types::U256>,
417 pub signatures: ::std::vec::Vec<::std::string::String>,
418 pub calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
419 pub vote_start: ::ethers_core::types::U256,
420 pub vote_end: ::ethers_core::types::U256,
421 pub description: ::std::string::String,
422 }
423 #[derive(
424 Clone,
425 ::ethers_contract::EthEvent,
426 ::ethers_contract::EthDisplay,
427 Default,
428 Debug,
429 PartialEq,
430 Eq,
431 Hash
432 )]
433 #[ethevent(name = "ProposalExecuted", abi = "ProposalExecuted(uint256)")]
434 pub struct ProposalExecutedFilter {
435 pub proposal_id: ::ethers_core::types::U256,
436 }
437 #[derive(
438 Clone,
439 ::ethers_contract::EthEvent,
440 ::ethers_contract::EthDisplay,
441 Default,
442 Debug,
443 PartialEq,
444 Eq,
445 Hash
446 )]
447 #[ethevent(
448 name = "VoteCast",
449 abi = "VoteCast(address,uint256,uint8,uint256,string)"
450 )]
451 pub struct VoteCastFilter {
452 #[ethevent(indexed)]
453 pub voter: ::ethers_core::types::Address,
454 pub proposal_id: ::ethers_core::types::U256,
455 pub support: u8,
456 pub weight: ::ethers_core::types::U256,
457 pub reason: ::std::string::String,
458 }
459 #[derive(
460 Clone,
461 ::ethers_contract::EthEvent,
462 ::ethers_contract::EthDisplay,
463 Default,
464 Debug,
465 PartialEq,
466 Eq,
467 Hash
468 )]
469 #[ethevent(
470 name = "VoteCastWithParams",
471 abi = "VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)"
472 )]
473 pub struct VoteCastWithParamsFilter {
474 #[ethevent(indexed)]
475 pub voter: ::ethers_core::types::Address,
476 pub proposal_id: ::ethers_core::types::U256,
477 pub support: u8,
478 pub weight: ::ethers_core::types::U256,
479 pub reason: ::std::string::String,
480 pub params: ::ethers_core::types::Bytes,
481 }
482 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
484 pub enum IGovernorEvents {
485 ProposalCanceledFilter(ProposalCanceledFilter),
486 ProposalCreatedFilter(ProposalCreatedFilter),
487 ProposalExecutedFilter(ProposalExecutedFilter),
488 VoteCastFilter(VoteCastFilter),
489 VoteCastWithParamsFilter(VoteCastWithParamsFilter),
490 }
491 impl ::ethers_contract::EthLogDecode for IGovernorEvents {
492 fn decode_log(
493 log: &::ethers_core::abi::RawLog,
494 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
495 if let Ok(decoded) = ProposalCanceledFilter::decode_log(log) {
496 return Ok(IGovernorEvents::ProposalCanceledFilter(decoded));
497 }
498 if let Ok(decoded) = ProposalCreatedFilter::decode_log(log) {
499 return Ok(IGovernorEvents::ProposalCreatedFilter(decoded));
500 }
501 if let Ok(decoded) = ProposalExecutedFilter::decode_log(log) {
502 return Ok(IGovernorEvents::ProposalExecutedFilter(decoded));
503 }
504 if let Ok(decoded) = VoteCastFilter::decode_log(log) {
505 return Ok(IGovernorEvents::VoteCastFilter(decoded));
506 }
507 if let Ok(decoded) = VoteCastWithParamsFilter::decode_log(log) {
508 return Ok(IGovernorEvents::VoteCastWithParamsFilter(decoded));
509 }
510 Err(::ethers_core::abi::Error::InvalidData)
511 }
512 }
513 impl ::core::fmt::Display for IGovernorEvents {
514 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
515 match self {
516 Self::ProposalCanceledFilter(element) => {
517 ::core::fmt::Display::fmt(element, f)
518 }
519 Self::ProposalCreatedFilter(element) => {
520 ::core::fmt::Display::fmt(element, f)
521 }
522 Self::ProposalExecutedFilter(element) => {
523 ::core::fmt::Display::fmt(element, f)
524 }
525 Self::VoteCastFilter(element) => ::core::fmt::Display::fmt(element, f),
526 Self::VoteCastWithParamsFilter(element) => {
527 ::core::fmt::Display::fmt(element, f)
528 }
529 }
530 }
531 }
532 impl ::core::convert::From<ProposalCanceledFilter> for IGovernorEvents {
533 fn from(value: ProposalCanceledFilter) -> Self {
534 Self::ProposalCanceledFilter(value)
535 }
536 }
537 impl ::core::convert::From<ProposalCreatedFilter> for IGovernorEvents {
538 fn from(value: ProposalCreatedFilter) -> Self {
539 Self::ProposalCreatedFilter(value)
540 }
541 }
542 impl ::core::convert::From<ProposalExecutedFilter> for IGovernorEvents {
543 fn from(value: ProposalExecutedFilter) -> Self {
544 Self::ProposalExecutedFilter(value)
545 }
546 }
547 impl ::core::convert::From<VoteCastFilter> for IGovernorEvents {
548 fn from(value: VoteCastFilter) -> Self {
549 Self::VoteCastFilter(value)
550 }
551 }
552 impl ::core::convert::From<VoteCastWithParamsFilter> for IGovernorEvents {
553 fn from(value: VoteCastWithParamsFilter) -> Self {
554 Self::VoteCastWithParamsFilter(value)
555 }
556 }
557 #[derive(
559 Clone,
560 ::ethers_contract::EthCall,
561 ::ethers_contract::EthDisplay,
562 Default,
563 Debug,
564 PartialEq,
565 Eq,
566 Hash
567 )]
568 #[ethcall(name = "CLOCK_MODE", abi = "CLOCK_MODE()")]
569 pub struct ClockModeCall;
570 #[derive(
572 Clone,
573 ::ethers_contract::EthCall,
574 ::ethers_contract::EthDisplay,
575 Default,
576 Debug,
577 PartialEq,
578 Eq,
579 Hash
580 )]
581 #[ethcall(name = "COUNTING_MODE", abi = "COUNTING_MODE()")]
582 pub struct CountingModeCall;
583 #[derive(
585 Clone,
586 ::ethers_contract::EthCall,
587 ::ethers_contract::EthDisplay,
588 Default,
589 Debug,
590 PartialEq,
591 Eq,
592 Hash
593 )]
594 #[ethcall(name = "cancel", abi = "cancel(address[],uint256[],bytes[],bytes32)")]
595 pub struct CancelCall {
596 pub targets: ::std::vec::Vec<::ethers_core::types::Address>,
597 pub values: ::std::vec::Vec<::ethers_core::types::U256>,
598 pub calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
599 pub description_hash: [u8; 32],
600 }
601 #[derive(
603 Clone,
604 ::ethers_contract::EthCall,
605 ::ethers_contract::EthDisplay,
606 Default,
607 Debug,
608 PartialEq,
609 Eq,
610 Hash
611 )]
612 #[ethcall(name = "castVote", abi = "castVote(uint256,uint8)")]
613 pub struct CastVoteCall {
614 pub proposal_id: ::ethers_core::types::U256,
615 pub support: u8,
616 }
617 #[derive(
619 Clone,
620 ::ethers_contract::EthCall,
621 ::ethers_contract::EthDisplay,
622 Default,
623 Debug,
624 PartialEq,
625 Eq,
626 Hash
627 )]
628 #[ethcall(
629 name = "castVoteBySig",
630 abi = "castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)"
631 )]
632 pub struct CastVoteBySigCall {
633 pub proposal_id: ::ethers_core::types::U256,
634 pub support: u8,
635 pub v: u8,
636 pub r: [u8; 32],
637 pub s: [u8; 32],
638 }
639 #[derive(
641 Clone,
642 ::ethers_contract::EthCall,
643 ::ethers_contract::EthDisplay,
644 Default,
645 Debug,
646 PartialEq,
647 Eq,
648 Hash
649 )]
650 #[ethcall(
651 name = "castVoteWithReason",
652 abi = "castVoteWithReason(uint256,uint8,string)"
653 )]
654 pub struct CastVoteWithReasonCall {
655 pub proposal_id: ::ethers_core::types::U256,
656 pub support: u8,
657 pub reason: ::std::string::String,
658 }
659 #[derive(
661 Clone,
662 ::ethers_contract::EthCall,
663 ::ethers_contract::EthDisplay,
664 Default,
665 Debug,
666 PartialEq,
667 Eq,
668 Hash
669 )]
670 #[ethcall(
671 name = "castVoteWithReasonAndParams",
672 abi = "castVoteWithReasonAndParams(uint256,uint8,string,bytes)"
673 )]
674 pub struct CastVoteWithReasonAndParamsCall {
675 pub proposal_id: ::ethers_core::types::U256,
676 pub support: u8,
677 pub reason: ::std::string::String,
678 pub params: ::ethers_core::types::Bytes,
679 }
680 #[derive(
682 Clone,
683 ::ethers_contract::EthCall,
684 ::ethers_contract::EthDisplay,
685 Default,
686 Debug,
687 PartialEq,
688 Eq,
689 Hash
690 )]
691 #[ethcall(
692 name = "castVoteWithReasonAndParamsBySig",
693 abi = "castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)"
694 )]
695 pub struct CastVoteWithReasonAndParamsBySigCall {
696 pub proposal_id: ::ethers_core::types::U256,
697 pub support: u8,
698 pub reason: ::std::string::String,
699 pub params: ::ethers_core::types::Bytes,
700 pub v: u8,
701 pub r: [u8; 32],
702 pub s: [u8; 32],
703 }
704 #[derive(
706 Clone,
707 ::ethers_contract::EthCall,
708 ::ethers_contract::EthDisplay,
709 Default,
710 Debug,
711 PartialEq,
712 Eq,
713 Hash
714 )]
715 #[ethcall(name = "clock", abi = "clock()")]
716 pub struct ClockCall;
717 #[derive(
719 Clone,
720 ::ethers_contract::EthCall,
721 ::ethers_contract::EthDisplay,
722 Default,
723 Debug,
724 PartialEq,
725 Eq,
726 Hash
727 )]
728 #[ethcall(name = "execute", abi = "execute(address[],uint256[],bytes[],bytes32)")]
729 pub struct ExecuteCall {
730 pub targets: ::std::vec::Vec<::ethers_core::types::Address>,
731 pub values: ::std::vec::Vec<::ethers_core::types::U256>,
732 pub calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
733 pub description_hash: [u8; 32],
734 }
735 #[derive(
737 Clone,
738 ::ethers_contract::EthCall,
739 ::ethers_contract::EthDisplay,
740 Default,
741 Debug,
742 PartialEq,
743 Eq,
744 Hash
745 )]
746 #[ethcall(name = "getVotes", abi = "getVotes(address,uint256)")]
747 pub struct GetVotesCall {
748 pub account: ::ethers_core::types::Address,
749 pub timepoint: ::ethers_core::types::U256,
750 }
751 #[derive(
753 Clone,
754 ::ethers_contract::EthCall,
755 ::ethers_contract::EthDisplay,
756 Default,
757 Debug,
758 PartialEq,
759 Eq,
760 Hash
761 )]
762 #[ethcall(
763 name = "getVotesWithParams",
764 abi = "getVotesWithParams(address,uint256,bytes)"
765 )]
766 pub struct GetVotesWithParamsCall {
767 pub account: ::ethers_core::types::Address,
768 pub timepoint: ::ethers_core::types::U256,
769 pub params: ::ethers_core::types::Bytes,
770 }
771 #[derive(
773 Clone,
774 ::ethers_contract::EthCall,
775 ::ethers_contract::EthDisplay,
776 Default,
777 Debug,
778 PartialEq,
779 Eq,
780 Hash
781 )]
782 #[ethcall(name = "hasVoted", abi = "hasVoted(uint256,address)")]
783 pub struct HasVotedCall {
784 pub proposal_id: ::ethers_core::types::U256,
785 pub account: ::ethers_core::types::Address,
786 }
787 #[derive(
789 Clone,
790 ::ethers_contract::EthCall,
791 ::ethers_contract::EthDisplay,
792 Default,
793 Debug,
794 PartialEq,
795 Eq,
796 Hash
797 )]
798 #[ethcall(
799 name = "hashProposal",
800 abi = "hashProposal(address[],uint256[],bytes[],bytes32)"
801 )]
802 pub struct HashProposalCall {
803 pub targets: ::std::vec::Vec<::ethers_core::types::Address>,
804 pub values: ::std::vec::Vec<::ethers_core::types::U256>,
805 pub calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
806 pub description_hash: [u8; 32],
807 }
808 #[derive(
810 Clone,
811 ::ethers_contract::EthCall,
812 ::ethers_contract::EthDisplay,
813 Default,
814 Debug,
815 PartialEq,
816 Eq,
817 Hash
818 )]
819 #[ethcall(name = "name", abi = "name()")]
820 pub struct NameCall;
821 #[derive(
823 Clone,
824 ::ethers_contract::EthCall,
825 ::ethers_contract::EthDisplay,
826 Default,
827 Debug,
828 PartialEq,
829 Eq,
830 Hash
831 )]
832 #[ethcall(name = "proposalDeadline", abi = "proposalDeadline(uint256)")]
833 pub struct ProposalDeadlineCall {
834 pub proposal_id: ::ethers_core::types::U256,
835 }
836 #[derive(
838 Clone,
839 ::ethers_contract::EthCall,
840 ::ethers_contract::EthDisplay,
841 Default,
842 Debug,
843 PartialEq,
844 Eq,
845 Hash
846 )]
847 #[ethcall(name = "proposalProposer", abi = "proposalProposer(uint256)")]
848 pub struct ProposalProposerCall {
849 pub proposal_id: ::ethers_core::types::U256,
850 }
851 #[derive(
853 Clone,
854 ::ethers_contract::EthCall,
855 ::ethers_contract::EthDisplay,
856 Default,
857 Debug,
858 PartialEq,
859 Eq,
860 Hash
861 )]
862 #[ethcall(name = "proposalSnapshot", abi = "proposalSnapshot(uint256)")]
863 pub struct ProposalSnapshotCall {
864 pub proposal_id: ::ethers_core::types::U256,
865 }
866 #[derive(
868 Clone,
869 ::ethers_contract::EthCall,
870 ::ethers_contract::EthDisplay,
871 Default,
872 Debug,
873 PartialEq,
874 Eq,
875 Hash
876 )]
877 #[ethcall(name = "propose", abi = "propose(address[],uint256[],bytes[],string)")]
878 pub struct ProposeCall {
879 pub targets: ::std::vec::Vec<::ethers_core::types::Address>,
880 pub values: ::std::vec::Vec<::ethers_core::types::U256>,
881 pub calldatas: ::std::vec::Vec<::ethers_core::types::Bytes>,
882 pub description: ::std::string::String,
883 }
884 #[derive(
886 Clone,
887 ::ethers_contract::EthCall,
888 ::ethers_contract::EthDisplay,
889 Default,
890 Debug,
891 PartialEq,
892 Eq,
893 Hash
894 )]
895 #[ethcall(name = "quorum", abi = "quorum(uint256)")]
896 pub struct QuorumCall {
897 pub timepoint: ::ethers_core::types::U256,
898 }
899 #[derive(
901 Clone,
902 ::ethers_contract::EthCall,
903 ::ethers_contract::EthDisplay,
904 Default,
905 Debug,
906 PartialEq,
907 Eq,
908 Hash
909 )]
910 #[ethcall(name = "state", abi = "state(uint256)")]
911 pub struct StateCall {
912 pub proposal_id: ::ethers_core::types::U256,
913 }
914 #[derive(
916 Clone,
917 ::ethers_contract::EthCall,
918 ::ethers_contract::EthDisplay,
919 Default,
920 Debug,
921 PartialEq,
922 Eq,
923 Hash
924 )]
925 #[ethcall(name = "supportsInterface", abi = "supportsInterface(bytes4)")]
926 pub struct SupportsInterfaceCall {
927 pub interface_id: [u8; 4],
928 }
929 #[derive(
931 Clone,
932 ::ethers_contract::EthCall,
933 ::ethers_contract::EthDisplay,
934 Default,
935 Debug,
936 PartialEq,
937 Eq,
938 Hash
939 )]
940 #[ethcall(name = "version", abi = "version()")]
941 pub struct VersionCall;
942 #[derive(
944 Clone,
945 ::ethers_contract::EthCall,
946 ::ethers_contract::EthDisplay,
947 Default,
948 Debug,
949 PartialEq,
950 Eq,
951 Hash
952 )]
953 #[ethcall(name = "votingDelay", abi = "votingDelay()")]
954 pub struct VotingDelayCall;
955 #[derive(
957 Clone,
958 ::ethers_contract::EthCall,
959 ::ethers_contract::EthDisplay,
960 Default,
961 Debug,
962 PartialEq,
963 Eq,
964 Hash
965 )]
966 #[ethcall(name = "votingPeriod", abi = "votingPeriod()")]
967 pub struct VotingPeriodCall;
968 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
970 pub enum IGovernorCalls {
971 ClockMode(ClockModeCall),
972 CountingMode(CountingModeCall),
973 Cancel(CancelCall),
974 CastVote(CastVoteCall),
975 CastVoteBySig(CastVoteBySigCall),
976 CastVoteWithReason(CastVoteWithReasonCall),
977 CastVoteWithReasonAndParams(CastVoteWithReasonAndParamsCall),
978 CastVoteWithReasonAndParamsBySig(CastVoteWithReasonAndParamsBySigCall),
979 Clock(ClockCall),
980 Execute(ExecuteCall),
981 GetVotes(GetVotesCall),
982 GetVotesWithParams(GetVotesWithParamsCall),
983 HasVoted(HasVotedCall),
984 HashProposal(HashProposalCall),
985 Name(NameCall),
986 ProposalDeadline(ProposalDeadlineCall),
987 ProposalProposer(ProposalProposerCall),
988 ProposalSnapshot(ProposalSnapshotCall),
989 Propose(ProposeCall),
990 Quorum(QuorumCall),
991 State(StateCall),
992 SupportsInterface(SupportsInterfaceCall),
993 Version(VersionCall),
994 VotingDelay(VotingDelayCall),
995 VotingPeriod(VotingPeriodCall),
996 }
997 impl ::ethers_core::abi::AbiDecode for IGovernorCalls {
998 fn decode(
999 data: impl AsRef<[u8]>,
1000 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
1001 let data = data.as_ref();
1002 if let Ok(decoded)
1003 = <ClockModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1004 return Ok(Self::ClockMode(decoded));
1005 }
1006 if let Ok(decoded)
1007 = <CountingModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1008 return Ok(Self::CountingMode(decoded));
1009 }
1010 if let Ok(decoded)
1011 = <CancelCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1012 return Ok(Self::Cancel(decoded));
1013 }
1014 if let Ok(decoded)
1015 = <CastVoteCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1016 return Ok(Self::CastVote(decoded));
1017 }
1018 if let Ok(decoded)
1019 = <CastVoteBySigCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1020 return Ok(Self::CastVoteBySig(decoded));
1021 }
1022 if let Ok(decoded)
1023 = <CastVoteWithReasonCall as ::ethers_core::abi::AbiDecode>::decode(
1024 data,
1025 ) {
1026 return Ok(Self::CastVoteWithReason(decoded));
1027 }
1028 if let Ok(decoded)
1029 = <CastVoteWithReasonAndParamsCall as ::ethers_core::abi::AbiDecode>::decode(
1030 data,
1031 ) {
1032 return Ok(Self::CastVoteWithReasonAndParams(decoded));
1033 }
1034 if let Ok(decoded)
1035 = <CastVoteWithReasonAndParamsBySigCall as ::ethers_core::abi::AbiDecode>::decode(
1036 data,
1037 ) {
1038 return Ok(Self::CastVoteWithReasonAndParamsBySig(decoded));
1039 }
1040 if let Ok(decoded)
1041 = <ClockCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1042 return Ok(Self::Clock(decoded));
1043 }
1044 if let Ok(decoded)
1045 = <ExecuteCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1046 return Ok(Self::Execute(decoded));
1047 }
1048 if let Ok(decoded)
1049 = <GetVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1050 return Ok(Self::GetVotes(decoded));
1051 }
1052 if let Ok(decoded)
1053 = <GetVotesWithParamsCall as ::ethers_core::abi::AbiDecode>::decode(
1054 data,
1055 ) {
1056 return Ok(Self::GetVotesWithParams(decoded));
1057 }
1058 if let Ok(decoded)
1059 = <HasVotedCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1060 return Ok(Self::HasVoted(decoded));
1061 }
1062 if let Ok(decoded)
1063 = <HashProposalCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1064 return Ok(Self::HashProposal(decoded));
1065 }
1066 if let Ok(decoded)
1067 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1068 return Ok(Self::Name(decoded));
1069 }
1070 if let Ok(decoded)
1071 = <ProposalDeadlineCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1072 return Ok(Self::ProposalDeadline(decoded));
1073 }
1074 if let Ok(decoded)
1075 = <ProposalProposerCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1076 return Ok(Self::ProposalProposer(decoded));
1077 }
1078 if let Ok(decoded)
1079 = <ProposalSnapshotCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1080 return Ok(Self::ProposalSnapshot(decoded));
1081 }
1082 if let Ok(decoded)
1083 = <ProposeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1084 return Ok(Self::Propose(decoded));
1085 }
1086 if let Ok(decoded)
1087 = <QuorumCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1088 return Ok(Self::Quorum(decoded));
1089 }
1090 if let Ok(decoded)
1091 = <StateCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1092 return Ok(Self::State(decoded));
1093 }
1094 if let Ok(decoded)
1095 = <SupportsInterfaceCall as ::ethers_core::abi::AbiDecode>::decode(
1096 data,
1097 ) {
1098 return Ok(Self::SupportsInterface(decoded));
1099 }
1100 if let Ok(decoded)
1101 = <VersionCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1102 return Ok(Self::Version(decoded));
1103 }
1104 if let Ok(decoded)
1105 = <VotingDelayCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1106 return Ok(Self::VotingDelay(decoded));
1107 }
1108 if let Ok(decoded)
1109 = <VotingPeriodCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1110 return Ok(Self::VotingPeriod(decoded));
1111 }
1112 Err(::ethers_core::abi::Error::InvalidData.into())
1113 }
1114 }
1115 impl ::ethers_core::abi::AbiEncode for IGovernorCalls {
1116 fn encode(self) -> Vec<u8> {
1117 match self {
1118 Self::ClockMode(element) => {
1119 ::ethers_core::abi::AbiEncode::encode(element)
1120 }
1121 Self::CountingMode(element) => {
1122 ::ethers_core::abi::AbiEncode::encode(element)
1123 }
1124 Self::Cancel(element) => ::ethers_core::abi::AbiEncode::encode(element),
1125 Self::CastVote(element) => ::ethers_core::abi::AbiEncode::encode(element),
1126 Self::CastVoteBySig(element) => {
1127 ::ethers_core::abi::AbiEncode::encode(element)
1128 }
1129 Self::CastVoteWithReason(element) => {
1130 ::ethers_core::abi::AbiEncode::encode(element)
1131 }
1132 Self::CastVoteWithReasonAndParams(element) => {
1133 ::ethers_core::abi::AbiEncode::encode(element)
1134 }
1135 Self::CastVoteWithReasonAndParamsBySig(element) => {
1136 ::ethers_core::abi::AbiEncode::encode(element)
1137 }
1138 Self::Clock(element) => ::ethers_core::abi::AbiEncode::encode(element),
1139 Self::Execute(element) => ::ethers_core::abi::AbiEncode::encode(element),
1140 Self::GetVotes(element) => ::ethers_core::abi::AbiEncode::encode(element),
1141 Self::GetVotesWithParams(element) => {
1142 ::ethers_core::abi::AbiEncode::encode(element)
1143 }
1144 Self::HasVoted(element) => ::ethers_core::abi::AbiEncode::encode(element),
1145 Self::HashProposal(element) => {
1146 ::ethers_core::abi::AbiEncode::encode(element)
1147 }
1148 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
1149 Self::ProposalDeadline(element) => {
1150 ::ethers_core::abi::AbiEncode::encode(element)
1151 }
1152 Self::ProposalProposer(element) => {
1153 ::ethers_core::abi::AbiEncode::encode(element)
1154 }
1155 Self::ProposalSnapshot(element) => {
1156 ::ethers_core::abi::AbiEncode::encode(element)
1157 }
1158 Self::Propose(element) => ::ethers_core::abi::AbiEncode::encode(element),
1159 Self::Quorum(element) => ::ethers_core::abi::AbiEncode::encode(element),
1160 Self::State(element) => ::ethers_core::abi::AbiEncode::encode(element),
1161 Self::SupportsInterface(element) => {
1162 ::ethers_core::abi::AbiEncode::encode(element)
1163 }
1164 Self::Version(element) => ::ethers_core::abi::AbiEncode::encode(element),
1165 Self::VotingDelay(element) => {
1166 ::ethers_core::abi::AbiEncode::encode(element)
1167 }
1168 Self::VotingPeriod(element) => {
1169 ::ethers_core::abi::AbiEncode::encode(element)
1170 }
1171 }
1172 }
1173 }
1174 impl ::core::fmt::Display for IGovernorCalls {
1175 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1176 match self {
1177 Self::ClockMode(element) => ::core::fmt::Display::fmt(element, f),
1178 Self::CountingMode(element) => ::core::fmt::Display::fmt(element, f),
1179 Self::Cancel(element) => ::core::fmt::Display::fmt(element, f),
1180 Self::CastVote(element) => ::core::fmt::Display::fmt(element, f),
1181 Self::CastVoteBySig(element) => ::core::fmt::Display::fmt(element, f),
1182 Self::CastVoteWithReason(element) => {
1183 ::core::fmt::Display::fmt(element, f)
1184 }
1185 Self::CastVoteWithReasonAndParams(element) => {
1186 ::core::fmt::Display::fmt(element, f)
1187 }
1188 Self::CastVoteWithReasonAndParamsBySig(element) => {
1189 ::core::fmt::Display::fmt(element, f)
1190 }
1191 Self::Clock(element) => ::core::fmt::Display::fmt(element, f),
1192 Self::Execute(element) => ::core::fmt::Display::fmt(element, f),
1193 Self::GetVotes(element) => ::core::fmt::Display::fmt(element, f),
1194 Self::GetVotesWithParams(element) => {
1195 ::core::fmt::Display::fmt(element, f)
1196 }
1197 Self::HasVoted(element) => ::core::fmt::Display::fmt(element, f),
1198 Self::HashProposal(element) => ::core::fmt::Display::fmt(element, f),
1199 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
1200 Self::ProposalDeadline(element) => ::core::fmt::Display::fmt(element, f),
1201 Self::ProposalProposer(element) => ::core::fmt::Display::fmt(element, f),
1202 Self::ProposalSnapshot(element) => ::core::fmt::Display::fmt(element, f),
1203 Self::Propose(element) => ::core::fmt::Display::fmt(element, f),
1204 Self::Quorum(element) => ::core::fmt::Display::fmt(element, f),
1205 Self::State(element) => ::core::fmt::Display::fmt(element, f),
1206 Self::SupportsInterface(element) => ::core::fmt::Display::fmt(element, f),
1207 Self::Version(element) => ::core::fmt::Display::fmt(element, f),
1208 Self::VotingDelay(element) => ::core::fmt::Display::fmt(element, f),
1209 Self::VotingPeriod(element) => ::core::fmt::Display::fmt(element, f),
1210 }
1211 }
1212 }
1213 impl ::core::convert::From<ClockModeCall> for IGovernorCalls {
1214 fn from(value: ClockModeCall) -> Self {
1215 Self::ClockMode(value)
1216 }
1217 }
1218 impl ::core::convert::From<CountingModeCall> for IGovernorCalls {
1219 fn from(value: CountingModeCall) -> Self {
1220 Self::CountingMode(value)
1221 }
1222 }
1223 impl ::core::convert::From<CancelCall> for IGovernorCalls {
1224 fn from(value: CancelCall) -> Self {
1225 Self::Cancel(value)
1226 }
1227 }
1228 impl ::core::convert::From<CastVoteCall> for IGovernorCalls {
1229 fn from(value: CastVoteCall) -> Self {
1230 Self::CastVote(value)
1231 }
1232 }
1233 impl ::core::convert::From<CastVoteBySigCall> for IGovernorCalls {
1234 fn from(value: CastVoteBySigCall) -> Self {
1235 Self::CastVoteBySig(value)
1236 }
1237 }
1238 impl ::core::convert::From<CastVoteWithReasonCall> for IGovernorCalls {
1239 fn from(value: CastVoteWithReasonCall) -> Self {
1240 Self::CastVoteWithReason(value)
1241 }
1242 }
1243 impl ::core::convert::From<CastVoteWithReasonAndParamsCall> for IGovernorCalls {
1244 fn from(value: CastVoteWithReasonAndParamsCall) -> Self {
1245 Self::CastVoteWithReasonAndParams(value)
1246 }
1247 }
1248 impl ::core::convert::From<CastVoteWithReasonAndParamsBySigCall> for IGovernorCalls {
1249 fn from(value: CastVoteWithReasonAndParamsBySigCall) -> Self {
1250 Self::CastVoteWithReasonAndParamsBySig(value)
1251 }
1252 }
1253 impl ::core::convert::From<ClockCall> for IGovernorCalls {
1254 fn from(value: ClockCall) -> Self {
1255 Self::Clock(value)
1256 }
1257 }
1258 impl ::core::convert::From<ExecuteCall> for IGovernorCalls {
1259 fn from(value: ExecuteCall) -> Self {
1260 Self::Execute(value)
1261 }
1262 }
1263 impl ::core::convert::From<GetVotesCall> for IGovernorCalls {
1264 fn from(value: GetVotesCall) -> Self {
1265 Self::GetVotes(value)
1266 }
1267 }
1268 impl ::core::convert::From<GetVotesWithParamsCall> for IGovernorCalls {
1269 fn from(value: GetVotesWithParamsCall) -> Self {
1270 Self::GetVotesWithParams(value)
1271 }
1272 }
1273 impl ::core::convert::From<HasVotedCall> for IGovernorCalls {
1274 fn from(value: HasVotedCall) -> Self {
1275 Self::HasVoted(value)
1276 }
1277 }
1278 impl ::core::convert::From<HashProposalCall> for IGovernorCalls {
1279 fn from(value: HashProposalCall) -> Self {
1280 Self::HashProposal(value)
1281 }
1282 }
1283 impl ::core::convert::From<NameCall> for IGovernorCalls {
1284 fn from(value: NameCall) -> Self {
1285 Self::Name(value)
1286 }
1287 }
1288 impl ::core::convert::From<ProposalDeadlineCall> for IGovernorCalls {
1289 fn from(value: ProposalDeadlineCall) -> Self {
1290 Self::ProposalDeadline(value)
1291 }
1292 }
1293 impl ::core::convert::From<ProposalProposerCall> for IGovernorCalls {
1294 fn from(value: ProposalProposerCall) -> Self {
1295 Self::ProposalProposer(value)
1296 }
1297 }
1298 impl ::core::convert::From<ProposalSnapshotCall> for IGovernorCalls {
1299 fn from(value: ProposalSnapshotCall) -> Self {
1300 Self::ProposalSnapshot(value)
1301 }
1302 }
1303 impl ::core::convert::From<ProposeCall> for IGovernorCalls {
1304 fn from(value: ProposeCall) -> Self {
1305 Self::Propose(value)
1306 }
1307 }
1308 impl ::core::convert::From<QuorumCall> for IGovernorCalls {
1309 fn from(value: QuorumCall) -> Self {
1310 Self::Quorum(value)
1311 }
1312 }
1313 impl ::core::convert::From<StateCall> for IGovernorCalls {
1314 fn from(value: StateCall) -> Self {
1315 Self::State(value)
1316 }
1317 }
1318 impl ::core::convert::From<SupportsInterfaceCall> for IGovernorCalls {
1319 fn from(value: SupportsInterfaceCall) -> Self {
1320 Self::SupportsInterface(value)
1321 }
1322 }
1323 impl ::core::convert::From<VersionCall> for IGovernorCalls {
1324 fn from(value: VersionCall) -> Self {
1325 Self::Version(value)
1326 }
1327 }
1328 impl ::core::convert::From<VotingDelayCall> for IGovernorCalls {
1329 fn from(value: VotingDelayCall) -> Self {
1330 Self::VotingDelay(value)
1331 }
1332 }
1333 impl ::core::convert::From<VotingPeriodCall> for IGovernorCalls {
1334 fn from(value: VotingPeriodCall) -> Self {
1335 Self::VotingPeriod(value)
1336 }
1337 }
1338 #[derive(
1340 Clone,
1341 ::ethers_contract::EthAbiType,
1342 ::ethers_contract::EthAbiCodec,
1343 Default,
1344 Debug,
1345 PartialEq,
1346 Eq,
1347 Hash
1348 )]
1349 pub struct ClockModeReturn(pub ::std::string::String);
1350 #[derive(
1352 Clone,
1353 ::ethers_contract::EthAbiType,
1354 ::ethers_contract::EthAbiCodec,
1355 Default,
1356 Debug,
1357 PartialEq,
1358 Eq,
1359 Hash
1360 )]
1361 pub struct CountingModeReturn(pub ::std::string::String);
1362 #[derive(
1364 Clone,
1365 ::ethers_contract::EthAbiType,
1366 ::ethers_contract::EthAbiCodec,
1367 Default,
1368 Debug,
1369 PartialEq,
1370 Eq,
1371 Hash
1372 )]
1373 pub struct CancelReturn {
1374 pub proposal_id: ::ethers_core::types::U256,
1375 }
1376 #[derive(
1378 Clone,
1379 ::ethers_contract::EthAbiType,
1380 ::ethers_contract::EthAbiCodec,
1381 Default,
1382 Debug,
1383 PartialEq,
1384 Eq,
1385 Hash
1386 )]
1387 pub struct CastVoteReturn {
1388 pub balance: ::ethers_core::types::U256,
1389 }
1390 #[derive(
1392 Clone,
1393 ::ethers_contract::EthAbiType,
1394 ::ethers_contract::EthAbiCodec,
1395 Default,
1396 Debug,
1397 PartialEq,
1398 Eq,
1399 Hash
1400 )]
1401 pub struct CastVoteBySigReturn {
1402 pub balance: ::ethers_core::types::U256,
1403 }
1404 #[derive(
1406 Clone,
1407 ::ethers_contract::EthAbiType,
1408 ::ethers_contract::EthAbiCodec,
1409 Default,
1410 Debug,
1411 PartialEq,
1412 Eq,
1413 Hash
1414 )]
1415 pub struct CastVoteWithReasonReturn {
1416 pub balance: ::ethers_core::types::U256,
1417 }
1418 #[derive(
1420 Clone,
1421 ::ethers_contract::EthAbiType,
1422 ::ethers_contract::EthAbiCodec,
1423 Default,
1424 Debug,
1425 PartialEq,
1426 Eq,
1427 Hash
1428 )]
1429 pub struct CastVoteWithReasonAndParamsReturn {
1430 pub balance: ::ethers_core::types::U256,
1431 }
1432 #[derive(
1434 Clone,
1435 ::ethers_contract::EthAbiType,
1436 ::ethers_contract::EthAbiCodec,
1437 Default,
1438 Debug,
1439 PartialEq,
1440 Eq,
1441 Hash
1442 )]
1443 pub struct CastVoteWithReasonAndParamsBySigReturn {
1444 pub balance: ::ethers_core::types::U256,
1445 }
1446 #[derive(
1448 Clone,
1449 ::ethers_contract::EthAbiType,
1450 ::ethers_contract::EthAbiCodec,
1451 Default,
1452 Debug,
1453 PartialEq,
1454 Eq,
1455 Hash
1456 )]
1457 pub struct ClockReturn(pub u64);
1458 #[derive(
1460 Clone,
1461 ::ethers_contract::EthAbiType,
1462 ::ethers_contract::EthAbiCodec,
1463 Default,
1464 Debug,
1465 PartialEq,
1466 Eq,
1467 Hash
1468 )]
1469 pub struct ExecuteReturn {
1470 pub proposal_id: ::ethers_core::types::U256,
1471 }
1472 #[derive(
1474 Clone,
1475 ::ethers_contract::EthAbiType,
1476 ::ethers_contract::EthAbiCodec,
1477 Default,
1478 Debug,
1479 PartialEq,
1480 Eq,
1481 Hash
1482 )]
1483 pub struct GetVotesReturn(pub ::ethers_core::types::U256);
1484 #[derive(
1486 Clone,
1487 ::ethers_contract::EthAbiType,
1488 ::ethers_contract::EthAbiCodec,
1489 Default,
1490 Debug,
1491 PartialEq,
1492 Eq,
1493 Hash
1494 )]
1495 pub struct GetVotesWithParamsReturn(pub ::ethers_core::types::U256);
1496 #[derive(
1498 Clone,
1499 ::ethers_contract::EthAbiType,
1500 ::ethers_contract::EthAbiCodec,
1501 Default,
1502 Debug,
1503 PartialEq,
1504 Eq,
1505 Hash
1506 )]
1507 pub struct HasVotedReturn(pub bool);
1508 #[derive(
1510 Clone,
1511 ::ethers_contract::EthAbiType,
1512 ::ethers_contract::EthAbiCodec,
1513 Default,
1514 Debug,
1515 PartialEq,
1516 Eq,
1517 Hash
1518 )]
1519 pub struct HashProposalReturn(pub ::ethers_core::types::U256);
1520 #[derive(
1522 Clone,
1523 ::ethers_contract::EthAbiType,
1524 ::ethers_contract::EthAbiCodec,
1525 Default,
1526 Debug,
1527 PartialEq,
1528 Eq,
1529 Hash
1530 )]
1531 pub struct NameReturn(pub ::std::string::String);
1532 #[derive(
1534 Clone,
1535 ::ethers_contract::EthAbiType,
1536 ::ethers_contract::EthAbiCodec,
1537 Default,
1538 Debug,
1539 PartialEq,
1540 Eq,
1541 Hash
1542 )]
1543 pub struct ProposalDeadlineReturn(pub ::ethers_core::types::U256);
1544 #[derive(
1546 Clone,
1547 ::ethers_contract::EthAbiType,
1548 ::ethers_contract::EthAbiCodec,
1549 Default,
1550 Debug,
1551 PartialEq,
1552 Eq,
1553 Hash
1554 )]
1555 pub struct ProposalProposerReturn(pub ::ethers_core::types::Address);
1556 #[derive(
1558 Clone,
1559 ::ethers_contract::EthAbiType,
1560 ::ethers_contract::EthAbiCodec,
1561 Default,
1562 Debug,
1563 PartialEq,
1564 Eq,
1565 Hash
1566 )]
1567 pub struct ProposalSnapshotReturn(pub ::ethers_core::types::U256);
1568 #[derive(
1570 Clone,
1571 ::ethers_contract::EthAbiType,
1572 ::ethers_contract::EthAbiCodec,
1573 Default,
1574 Debug,
1575 PartialEq,
1576 Eq,
1577 Hash
1578 )]
1579 pub struct ProposeReturn {
1580 pub proposal_id: ::ethers_core::types::U256,
1581 }
1582 #[derive(
1584 Clone,
1585 ::ethers_contract::EthAbiType,
1586 ::ethers_contract::EthAbiCodec,
1587 Default,
1588 Debug,
1589 PartialEq,
1590 Eq,
1591 Hash
1592 )]
1593 pub struct QuorumReturn(pub ::ethers_core::types::U256);
1594 #[derive(
1596 Clone,
1597 ::ethers_contract::EthAbiType,
1598 ::ethers_contract::EthAbiCodec,
1599 Default,
1600 Debug,
1601 PartialEq,
1602 Eq,
1603 Hash
1604 )]
1605 pub struct StateReturn(pub u8);
1606 #[derive(
1608 Clone,
1609 ::ethers_contract::EthAbiType,
1610 ::ethers_contract::EthAbiCodec,
1611 Default,
1612 Debug,
1613 PartialEq,
1614 Eq,
1615 Hash
1616 )]
1617 pub struct SupportsInterfaceReturn(pub bool);
1618 #[derive(
1620 Clone,
1621 ::ethers_contract::EthAbiType,
1622 ::ethers_contract::EthAbiCodec,
1623 Default,
1624 Debug,
1625 PartialEq,
1626 Eq,
1627 Hash
1628 )]
1629 pub struct VersionReturn(pub ::std::string::String);
1630 #[derive(
1632 Clone,
1633 ::ethers_contract::EthAbiType,
1634 ::ethers_contract::EthAbiCodec,
1635 Default,
1636 Debug,
1637 PartialEq,
1638 Eq,
1639 Hash
1640 )]
1641 pub struct VotingDelayReturn(pub ::ethers_core::types::U256);
1642 #[derive(
1644 Clone,
1645 ::ethers_contract::EthAbiType,
1646 ::ethers_contract::EthAbiCodec,
1647 Default,
1648 Debug,
1649 PartialEq,
1650 Eq,
1651 Hash
1652 )]
1653 pub struct VotingPeriodReturn(pub ::ethers_core::types::U256);
1654}