#[allow(dead_code)]
pub mod token_timelock {
# [rustfmt :: skip] use ethcontract as ethcontract ;
#[doc = "Generated by `ethcontract`"]
#[derive(Clone)]
pub struct Contract {
methods: Methods,
}
impl Contract {
#[doc = r" Retrieves the truffle artifact used to generate the type safe"]
#[doc = r" API for this contract."]
pub fn artifact() -> &'static self::ethcontract::Artifact {
use self::ethcontract::private::lazy_static;
use self::ethcontract::Artifact;
lazy_static! {
pub static ref ARTIFACT: Artifact = {
# [allow (unused_mut)] let mut artifact = Artifact :: from_json ("{\n \"_format\": \"hh-sol-artifact-1\",\n \"contractName\": \"TokenTimelock\",\n \"sourceName\": \"contracts/token/ERC20/utils/TokenTimelock.sol\",\n \"abi\": [\n {\n \"inputs\": [\n {\n \"internalType\": \"contract IERC20\",\n \"name\": \"token_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"beneficiary_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"releaseTime_\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"constructor\"\n },\n {\n \"inputs\": [],\n \"name\": \"beneficiary\",\n \"outputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"release\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"releaseTime\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"token\",\n \"outputs\": [\n {\n \"internalType\": \"contract IERC20\",\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"bytecode\": \"0x60e060405234801561001057600080fd5b506040516107c63803806107c683398101604081905261002f916100c0565b42811161009d5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2072656c656173652074696d65206973206260448201527165666f72652063757272656e742074696d6560701b606482015260840160405180910390fd5b6001600160601b0319606093841b81166080529190921b1660a05260c05261011a565b6000806000606084860312156100d4578283fd5b83516100df81610102565b60208501519093506100f081610102565b80925050604084015190509250925092565b6001600160a01b038116811461011757600080fd5b50565b60805160601c60a05160601c60c05161065f61016760003960008181609f015260f0015260008181605301526102a701526000818160ca015281816101820152610285015261065f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f14610090578063b91d40011461009a578063fc0c546a146100c8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100986100ee565b005b6040517f00000000000000000000000000000000000000000000000000000000000000008152602001610087565b7f0000000000000000000000000000000000000000000000000000000000000000610073565b7f000000000000000000000000000000000000000000000000000000000000000042101561017e5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610592565b9050600081116102785760405162461bcd60e51b815260206004820152602360248201527f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560448201526261736560e81b6064820152608401610175565b6102cc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836102cf565b50565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610321908490610326565b505050565b600061037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f89092919063ffffffff16565b80519091501561032157808060200190518101906103999190610572565b6103215760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610175565b60606104078484600085610411565b90505b9392505050565b6060824710156104725760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610175565b843b6104c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610175565b600080866001600160a01b031685876040516104dc91906105aa565b60006040518083038185875af1925050503d8060008114610519576040519150601f19603f3d011682016040523d82523d6000602084013e61051e565b606091505b509150915061052e828286610539565b979650505050505050565b6060831561054857508161040a565b8251156105585782518084602001fd5b8160405162461bcd60e51b815260040161017591906105c6565b600060208284031215610583578081fd5b8151801515811461040a578182fd5b6000602082840312156105a3578081fd5b5051919050565b600082516105bc8184602087016105f9565b9190910192915050565b60006020825282518060208401526105e58160408501602087016105f9565b601f01601f19169190910160400192915050565b60005b838110156106145781810151838201526020016105fc565b83811115610623576000848401525b5050505056fea264697066735822122032a5240073634e4405656b19af0280d560b6a7aabef19c7407ed5713510ebfa164736f6c63430008030033\",\n \"deployedBytecode\": \"0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f14610090578063b91d40011461009a578063fc0c546a146100c8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100986100ee565b005b6040517f00000000000000000000000000000000000000000000000000000000000000008152602001610087565b7f0000000000000000000000000000000000000000000000000000000000000000610073565b7f000000000000000000000000000000000000000000000000000000000000000042101561017e5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610592565b9050600081116102785760405162461bcd60e51b815260206004820152602360248201527f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560448201526261736560e81b6064820152608401610175565b6102cc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836102cf565b50565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610321908490610326565b505050565b600061037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f89092919063ffffffff16565b80519091501561032157808060200190518101906103999190610572565b6103215760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610175565b60606104078484600085610411565b90505b9392505050565b6060824710156104725760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610175565b843b6104c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610175565b600080866001600160a01b031685876040516104dc91906105aa565b60006040518083038185875af1925050503d8060008114610519576040519150601f19603f3d011682016040523d82523d6000602084013e61051e565b606091505b509150915061052e828286610539565b979650505050505050565b6060831561054857508161040a565b8251156105585782518084602001fd5b8160405162461bcd60e51b815260040161017591906105c6565b600060208284031215610583578081fd5b8151801515811461040a578182fd5b6000602082840312156105a3578081fd5b5051919050565b600082516105bc8184602087016105f9565b9190910192915050565b60006020825282518060208401526105e58160408501602087016105f9565b601f01601f19169190910160400192915050565b60005b838110156106145781810151838201526020016105fc565b83811115610623576000848401525b5050505056fea264697066735822122032a5240073634e4405656b19af0280d560b6a7aabef19c7407ed5713510ebfa164736f6c63430008030033\",\n \"linkReferences\": {},\n \"deployedLinkReferences\": {}\n}\n") . expect ("valid artifact JSON") ;
artifact
};
}
&ARTIFACT
}
#[doc = r" Creates a new contract instance with the specified `web3`"]
#[doc = r" provider at the given `Address`."]
#[doc = r""]
#[doc = r" Note that this does not verify that a contract with a matching"]
#[doc = r" `Abi` is actually deployed at the given address."]
pub fn at<F, T>(
web3: &self::ethcontract::web3::api::Web3<T>,
address: self::ethcontract::Address,
) -> Self
where
F: std::future::Future<
Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
> + Send
+ 'static,
T: self::ethcontract::web3::Transport<Out = F> + Send + Sync + 'static,
{
Contract::with_deployment_info(web3, address, None)
}
#[doc = r" Creates a new contract instance with the specified `web3` provider with"]
#[doc = r" the given `Abi` at the given `Address` and an optional transaction hash."]
#[doc = r" This hash is used to retrieve contract related information such as the"]
#[doc = r" creation block (which is useful for fetching all historic events)."]
#[doc = r""]
#[doc = r" Note that this does not verify that a contract with a matching `Abi` is"]
#[doc = r" actually deployed at the given address nor that the transaction hash,"]
#[doc = r" when provided, is actually for this contract deployment."]
pub fn with_deployment_info<F, T>(
web3: &self::ethcontract::web3::api::Web3<T>,
address: self::ethcontract::Address,
deployment_information: Option<ethcontract::common::DeploymentInformation>,
) -> Self
where
F: std::future::Future<
Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
> + Send
+ 'static,
T: self::ethcontract::web3::Transport<Out = F> + Send + Sync + 'static,
{
use self::ethcontract::transport::DynTransport;
use self::ethcontract::web3::api::Web3;
use self::ethcontract::Instance;
let transport = DynTransport::new(web3.transport().clone());
let web3 = Web3::new(transport);
let abi = Self::artifact().abi.clone();
let instance = Instance::with_deployment_info(web3, abi, address, deployment_information);
Contract::from_raw(instance)
}
#[doc = r" Creates a contract from a raw instance."]
fn from_raw(instance: self::ethcontract::dyns::DynInstance) -> Self {
let methods = Methods { instance };
Contract { methods }
}
#[doc = r" Returns the contract address being used by this instance."]
pub fn address(&self) -> self::ethcontract::Address {
self.raw_instance().address()
}
#[doc = r" Returns the deployment information of the contract"]
#[doc = r" if it is known, `None` otherwise."]
pub fn deployment_information(&self) -> Option<ethcontract::common::DeploymentInformation> {
self.raw_instance().deployment_information()
}
#[doc = r" Returns a reference to the default method options used by this"]
#[doc = r" contract."]
pub fn defaults(&self) -> &self::ethcontract::contract::MethodDefaults {
&self.raw_instance().defaults
}
#[doc = r" Returns a mutable reference to the default method options used"]
#[doc = r" by this contract."]
pub fn defaults_mut(&mut self) -> &mut self::ethcontract::contract::MethodDefaults {
&mut self.raw_instance_mut().defaults
}
#[doc = r" Returns a reference to the raw runtime instance used by this"]
#[doc = r" contract."]
pub fn raw_instance(&self) -> &self::ethcontract::dyns::DynInstance {
&self.methods.instance
}
#[doc = r" Returns a mutable reference to the raw runtime instance used by"]
#[doc = r" this contract."]
fn raw_instance_mut(&mut self) -> &mut self::ethcontract::dyns::DynInstance {
&mut self.methods.instance
}
}
impl std::fmt::Debug for Contract {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_tuple(stringify!(TokenTimelock))
.field(&self.address())
.finish()
}
}
impl Contract {
#[doc = "Generated by `ethcontract`"]
#[allow(clippy::too_many_arguments)]
pub fn builder<F, T>(
web3: &self::ethcontract::web3::api::Web3<T>,
token: self::ethcontract::Address,
beneficiary: self::ethcontract::Address,
release_time: self::ethcontract::U256,
) -> self::ethcontract::dyns::DynDeployBuilder<Self>
where
F: std::future::Future<
Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
> + Send
+ 'static,
T: self::ethcontract::web3::Transport<Out = F> + Send + Sync + 'static,
{
use self::ethcontract::contract::DeployBuilder;
use self::ethcontract::dyns::DynTransport;
use self::ethcontract::web3::api::Web3;
let transport = DynTransport::new(web3.transport().clone());
let web3 = Web3::new(transport);
let bytecode = Self::artifact().bytecode.clone();
DeployBuilder::new(web3, bytecode, (token, beneficiary, release_time))
.expect("valid deployment args")
}
}
impl self::ethcontract::contract::Deploy<self::ethcontract::dyns::DynTransport> for Contract {
type Context = self::ethcontract::common::Bytecode;
fn bytecode(cx: &Self::Context) -> &self::ethcontract::common::Bytecode {
cx
}
fn abi(_: &Self::Context) -> &self::ethcontract::common::Abi {
&Self::artifact().abi
}
fn from_deployment(
web3: self::ethcontract::dyns::DynWeb3,
address: self::ethcontract::Address,
transaction_hash: self::ethcontract::H256,
_: Self::Context,
) -> Self {
Self::with_deployment_info(&web3, address, Some(transaction_hash.into()))
}
}
impl Contract {
#[doc = r" Retrieves a reference to type containing all the generated"]
#[doc = r" contract methods. This can be used for methods where the name"]
#[doc = r" would collide with a common method (like `at` or `deployed`)."]
pub fn methods(&self) -> &Methods {
&self.methods
}
}
#[doc = r" Type containing all contract methods for generated contract type."]
#[derive(Clone)]
pub struct Methods {
instance: self::ethcontract::dyns::DynInstance,
}
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
impl Methods {
#[doc = "Generated by `ethcontract`"]
pub fn beneficiary(
&self,
) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::Address> {
self
.instance
.view_method([56, 175, 62, 237], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn release(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([134, 209, 166, 159], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn token(
&self,
) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::Address> {
self
.instance
.view_method([252, 12, 84, 106], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn release_time(
&self,
) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::U256> {
self
.instance
.view_method([185, 29, 64, 1], ())
.expect("generated call")
}
}
impl std::ops::Deref for Contract {
type Target = Methods;
fn deref(&self) -> &Self::Target {
&self.methods
}
}
}
pub use self::token_timelock::Contract as TokenTimelock;