vertex_sdk/vertex_utils/bindings/
token.rs1pub use engine_token::*;
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 engine_token {
13 #[allow(deprecated)]
14 fn __abi() -> ::ethers::core::abi::Abi {
15 ::ethers::core::abi::ethabi::Contract {
16 constructor: ::core::option::Option::None,
17 functions: ::core::convert::From::from([
18 (
19 ::std::borrow::ToOwned::to_owned("decimals"),
20 ::std::vec![::ethers::core::abi::ethabi::Function {
21 name: ::std::borrow::ToOwned::to_owned("decimals"),
22 inputs: ::std::vec![],
23 outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
24 name: ::std::string::String::new(),
25 kind: ::ethers::core::abi::ethabi::ParamType::Uint(8usize),
26 internal_type: ::core::option::Option::Some(
27 ::std::borrow::ToOwned::to_owned("uint8"),
28 ),
29 },],
30 constant: ::core::option::Option::None,
31 state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
32 },],
33 ),
34 (
35 ::std::borrow::ToOwned::to_owned("initialize"),
36 ::std::vec![::ethers::core::abi::ethabi::Function {
37 name: ::std::borrow::ToOwned::to_owned("initialize"),
38 inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
39 name: ::std::borrow::ToOwned::to_owned("decimals_"),
40 kind: ::ethers::core::abi::ethabi::ParamType::Uint(8usize),
41 internal_type: ::core::option::Option::Some(
42 ::std::borrow::ToOwned::to_owned("uint8"),
43 ),
44 },],
45 outputs: ::std::vec![],
46 constant: ::core::option::Option::None,
47 state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
48 },],
49 ),
50 ]),
51 events: ::std::collections::BTreeMap::new(),
52 errors: ::std::collections::BTreeMap::new(),
53 receive: false,
54 fallback: false,
55 }
56 }
57 pub static ENGINETOKEN_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
59 ::ethers::contract::Lazy::new(__abi);
60 #[rustfmt::skip]
61 const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\xD1\x80a\0\x1F`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c1<\xE5g\x14`7W\x80cCQ\xE6\xB6\x14`PW[`\0\x80\xFD[`\0T`@\x80Q`\xFF\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`q`[6`\x04`sV[`\0\x80T`\xFF\x19\x16`\xFF\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\0[`\0` \x82\x84\x03\x12\x15`\x84W`\0\x80\xFD[\x815`\xFF\x81\x16\x81\x14`\x94W`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xD0\xFD\x9EU\xAB\xF5\xDB\xD6\xAB\xEB\xFD\x87{\x8C\xBF\x95\x99\x06\xDD\xCD\xFA\x88\xA5p\xCD\xD4S\xA0\xC5\xB9c\x13dsolcC\0\x08\r\x003";
62 pub static ENGINETOKEN_BYTECODE: ::ethers::core::types::Bytes =
64 ::ethers::core::types::Bytes::from_static(__BYTECODE);
65 #[rustfmt::skip]
66 const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c1<\xE5g\x14`7W\x80cCQ\xE6\xB6\x14`PW[`\0\x80\xFD[`\0T`@\x80Q`\xFF\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`q`[6`\x04`sV[`\0\x80T`\xFF\x19\x16`\xFF\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\0[`\0` \x82\x84\x03\x12\x15`\x84W`\0\x80\xFD[\x815`\xFF\x81\x16\x81\x14`\x94W`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xD0\xFD\x9EU\xAB\xF5\xDB\xD6\xAB\xEB\xFD\x87{\x8C\xBF\x95\x99\x06\xDD\xCD\xFA\x88\xA5p\xCD\xD4S\xA0\xC5\xB9c\x13dsolcC\0\x08\r\x003";
67 pub static ENGINETOKEN_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
69 ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
70 pub struct EngineToken<M>(::ethers::contract::Contract<M>);
71 impl<M> ::core::clone::Clone for EngineToken<M> {
72 fn clone(&self) -> Self {
73 Self(::core::clone::Clone::clone(&self.0))
74 }
75 }
76 impl<M> ::core::ops::Deref for EngineToken<M> {
77 type Target = ::ethers::contract::Contract<M>;
78 fn deref(&self) -> &Self::Target {
79 &self.0
80 }
81 }
82 impl<M> ::core::ops::DerefMut for EngineToken<M> {
83 fn deref_mut(&mut self) -> &mut Self::Target {
84 &mut self.0
85 }
86 }
87 impl<M> ::core::fmt::Debug for EngineToken<M> {
88 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
89 f.debug_tuple(::core::stringify!(EngineToken))
90 .field(&self.address())
91 .finish()
92 }
93 }
94 impl<M: ::ethers::providers::Middleware> EngineToken<M> {
95 pub fn new<T: Into<::ethers::core::types::Address>>(
98 address: T,
99 client: ::std::sync::Arc<M>,
100 ) -> Self {
101 Self(::ethers::contract::Contract::new(
102 address.into(),
103 ENGINETOKEN_ABI.clone(),
104 client,
105 ))
106 }
107 pub fn deploy<T: ::ethers::core::abi::Tokenize>(
131 client: ::std::sync::Arc<M>,
132 constructor_args: T,
133 ) -> ::core::result::Result<
134 ::ethers::contract::builders::ContractDeployer<M, Self>,
135 ::ethers::contract::ContractError<M>,
136 > {
137 let factory = ::ethers::contract::ContractFactory::new(
138 ENGINETOKEN_ABI.clone(),
139 ENGINETOKEN_BYTECODE.clone().into(),
140 client,
141 );
142 let deployer = factory.deploy(constructor_args)?;
143 let deployer = ::ethers::contract::ContractDeployer::new(deployer);
144 Ok(deployer)
145 }
146 pub fn decimals(&self) -> ::ethers::contract::builders::ContractCall<M, u8> {
148 self.0
149 .method_hash([49, 60, 229, 103], ())
150 .expect("method not found (this should never happen)")
151 }
152 pub fn initialize(
154 &self,
155 decimals: u8,
156 ) -> ::ethers::contract::builders::ContractCall<M, ()> {
157 self.0
158 .method_hash([67, 81, 230, 182], decimals)
159 .expect("method not found (this should never happen)")
160 }
161 }
162 impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> for EngineToken<M> {
163 fn from(contract: ::ethers::contract::Contract<M>) -> Self {
164 Self::new(contract.address(), contract.client())
165 }
166 }
167 #[derive(
169 Clone,
170 ::ethers::contract::EthCall,
171 ::ethers::contract::EthDisplay,
172 Default,
173 Debug,
174 PartialEq,
175 Eq,
176 Hash,
177 )]
178 #[ethcall(name = "decimals", abi = "decimals()")]
179 pub struct DecimalsCall;
180 #[derive(
182 Clone,
183 ::ethers::contract::EthCall,
184 ::ethers::contract::EthDisplay,
185 Default,
186 Debug,
187 PartialEq,
188 Eq,
189 Hash,
190 )]
191 #[ethcall(name = "initialize", abi = "initialize(uint8)")]
192 pub struct InitializeCall {
193 pub decimals: u8,
194 }
195 #[derive(Clone, ::ethers::contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
197 pub enum EngineTokenCalls {
198 Decimals(DecimalsCall),
199 Initialize(InitializeCall),
200 }
201 impl ::ethers::core::abi::AbiDecode for EngineTokenCalls {
202 fn decode(
203 data: impl AsRef<[u8]>,
204 ) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
205 let data = data.as_ref();
206 if let Ok(decoded) = <DecimalsCall as ::ethers::core::abi::AbiDecode>::decode(data) {
207 return Ok(Self::Decimals(decoded));
208 }
209 if let Ok(decoded) = <InitializeCall as ::ethers::core::abi::AbiDecode>::decode(data) {
210 return Ok(Self::Initialize(decoded));
211 }
212 Err(::ethers::core::abi::Error::InvalidData.into())
213 }
214 }
215 impl ::ethers::core::abi::AbiEncode for EngineTokenCalls {
216 fn encode(self) -> Vec<u8> {
217 match self {
218 Self::Decimals(element) => ::ethers::core::abi::AbiEncode::encode(element),
219 Self::Initialize(element) => ::ethers::core::abi::AbiEncode::encode(element),
220 }
221 }
222 }
223 impl ::core::fmt::Display for EngineTokenCalls {
224 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
225 match self {
226 Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
227 Self::Initialize(element) => ::core::fmt::Display::fmt(element, f),
228 }
229 }
230 }
231 impl ::core::convert::From<DecimalsCall> for EngineTokenCalls {
232 fn from(value: DecimalsCall) -> Self {
233 Self::Decimals(value)
234 }
235 }
236 impl ::core::convert::From<InitializeCall> for EngineTokenCalls {
237 fn from(value: InitializeCall) -> Self {
238 Self::Initialize(value)
239 }
240 }
241 #[derive(
243 Clone,
244 ::ethers::contract::EthAbiType,
245 ::ethers::contract::EthAbiCodec,
246 Default,
247 Debug,
248 PartialEq,
249 Eq,
250 Hash,
251 )]
252 pub struct DecimalsReturn(pub u8);
253}