#[allow(dead_code)]
pub mod refund_escrow_upgradeable {
# [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\": \"RefundEscrowUpgradeable\",\n \"sourceName\": \"contracts/utils/escrow/RefundEscrowUpgradeable.sol\",\n \"abi\": [\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"payee\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"weiAmount\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Deposited\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"previousOwner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"OwnershipTransferred\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [],\n \"name\": \"RefundsClosed\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [],\n \"name\": \"RefundsEnabled\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"payee\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"weiAmount\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Withdrawn\",\n \"type\": \"event\"\n },\n {\n \"inputs\": [],\n \"name\": \"beneficiary\",\n \"outputs\": [\n {\n \"internalType\": \"address payable\",\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"beneficiaryWithdraw\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"close\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"refundee\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"deposit\",\n \"outputs\": [],\n \"stateMutability\": \"payable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"payee\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"depositsOf\",\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\": \"enableRefunds\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"initialize\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"owner\",\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\": \"renounceOwnership\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"state\",\n \"outputs\": [\n {\n \"internalType\": \"enum RefundEscrowUpgradeable.State\",\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"transferOwnership\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address payable\",\n \"name\": \"payee\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"withdraw\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"withdrawalAllowed\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"bytecode\": \"0x608060405234801561001057600080fd5b50610d68806100206000396000f3fe6080604052600436106100c25760003560e01c80638c52dc411161007f578063c19d93fb11610059578063c19d93fb146101e1578063e3a9db1a14610201578063f2fde38b14610245578063f340fa0114610265576100c2565b80638c52dc41146101995780638da5cb5b146101ae5780639af6549a146101cc576100c2565b806338af3eed146100c757806343d726d61461010857806351cff8d91461011f578063685ca1941461013f578063715018a61461016f5780638129fc1c14610184575b600080fd5b3480156100d357600080fd5b506100eb60c95461010090046001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011457600080fd5b5061011d610278565b005b34801561012b57600080fd5b5061011d61013a366004610c2b565b61036f565b34801561014b57600080fd5b5061015f61015a366004610c2b565b6103ec565b60405190151581526020016100ff565b34801561017b57600080fd5b5061011d610422565b34801561019057600080fd5b5061011d610496565b3480156101a557600080fd5b5061011d610509565b3480156101ba57600080fd5b506033546001600160a01b03166100eb565b3480156101d857600080fd5b5061011d610600565b3480156101ed57600080fd5b5060c95460ff166040516100ff9190610c4e565b34801561020d57600080fd5b5061023761021c366004610c2b565b6001600160a01b031660009081526065602052604090205490565b6040519081526020016100ff565b34801561025157600080fd5b5061011d610260366004610c2b565b6106cc565b61011d610273366004610c2b565b6107b7565b6033546001600160a01b031633146102ab5760405162461bcd60e51b81526004016102a290610cc4565b60405180910390fd5b60006102b960c95460ff1690565b60028111156102d857634e487b7160e01b600052602160045260246000fd5b146103375760405162461bcd60e51b815260206004820152602960248201527f526566756e64457363726f773a2063616e206f6e6c7920636c6f7365207768696044820152686c652061637469766560b81b60648201526084016102a2565b60c9805460ff191660021790556040517f088672c3a6e342f7cd94a65ba63b79df24a8973927b4d05d803c44bbf787d12f90600090a1565b610378816103ec565b6103e05760405162461bcd60e51b815260206004820152603360248201527f436f6e646974696f6e616c457363726f773a207061796565206973206e6f7420604482015272616c6c6f77656420746f20776974686472617760681b60648201526084016102a2565b6103e98161084e565b50565b600060016103fc60c95460ff1690565b600281111561041b57634e487b7160e01b600052602160045260246000fd5b1492915050565b6033546001600160a01b0316331461044c5760405162461bcd60e51b81526004016102a290610cc4565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b600054610100900460ff16806104af575060005460ff16155b6104cb5760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff161580156104ed576000805461ffff19166101011790555b6104f56108e7565b80156103e9576000805461ff001916905550565b6033546001600160a01b031633146105335760405162461bcd60e51b81526004016102a290610cc4565b600061054160c95460ff1690565b600281111561056057634e487b7160e01b600052602160045260246000fd5b146105c85760405162461bcd60e51b815260206004820152603260248201527f526566756e64457363726f773a2063616e206f6e6c7920656e61626c6520726560448201527166756e6473207768696c652061637469766560701b60648201526084016102a2565b60c9805460ff191660011790556040517f599d8e5a83cffb867d051598c4d70e805d59802d8081c1c7d6dffc5b6aca2b8990600090a1565b600261060e60c95460ff1690565b600281111561062d57634e487b7160e01b600052602160045260246000fd5b146106a05760405162461bcd60e51b815260206004820152603860248201527f526566756e64457363726f773a2062656e65666963696172792063616e206f6e60448201527f6c79207769746864726177207768696c6520636c6f736564000000000000000060648201526084016102a2565b6106ca476106bb60c95461010090046001600160a01b031690565b6001600160a01b031690610956565b565b6033546001600160a01b031633146106f65760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b03811661075b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107c560c95460ff1690565b60028111156107e457634e487b7160e01b600052602160045260246000fd5b146108455760405162461bcd60e51b815260206004820152602b60248201527f526566756e64457363726f773a2063616e206f6e6c79206465706f736974207760448201526a68696c652061637469766560a81b60648201526084016102a2565b6103e981610a74565b6033546001600160a01b031633146108785760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b03811660008181526065602052604081208054919055906108a09082610956565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516108db91815260200190565b60405180910390a25050565b600054610100900460ff1680610900575060005460ff16155b61091c5760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff1615801561093e576000805461ffff19166101011790555b610946610b13565b61094e610b7d565b6104f5610b13565b804710156109a65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102a2565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146109f3576040519150601f19603f3d011682016040523d82523d6000602084013e6109f8565b606091505b5050905080610a6f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102a2565b505050565b6033546001600160a01b03163314610a9e5760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b0381166000908152606560205260409020543490610ac4908290610cf9565b6001600160a01b038316600081815260656020526040908190209290925590517f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906108db9084815260200190565b600054610100900460ff1680610b2c575060005460ff16155b610b485760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff161580156104f5576000805461ffff191661010117905580156103e9576000805461ff001916905550565b600054610100900460ff1680610b96575060005460ff16155b610bb25760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff16158015610bd4576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156103e9576000805461ff001916905550565b600060208284031215610c3c578081fd5b8135610c4781610d1d565b9392505050565b6020810160038310610c7057634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d1857634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146103e957600080fdfea2646970667358221220c2b163a061fe3182bfcaeec14cbce6b50ee6c99fd9e69916947fbe92ab3cc6b464736f6c63430008030033\",\n \"deployedBytecode\": \"0x6080604052600436106100c25760003560e01c80638c52dc411161007f578063c19d93fb11610059578063c19d93fb146101e1578063e3a9db1a14610201578063f2fde38b14610245578063f340fa0114610265576100c2565b80638c52dc41146101995780638da5cb5b146101ae5780639af6549a146101cc576100c2565b806338af3eed146100c757806343d726d61461010857806351cff8d91461011f578063685ca1941461013f578063715018a61461016f5780638129fc1c14610184575b600080fd5b3480156100d357600080fd5b506100eb60c95461010090046001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011457600080fd5b5061011d610278565b005b34801561012b57600080fd5b5061011d61013a366004610c2b565b61036f565b34801561014b57600080fd5b5061015f61015a366004610c2b565b6103ec565b60405190151581526020016100ff565b34801561017b57600080fd5b5061011d610422565b34801561019057600080fd5b5061011d610496565b3480156101a557600080fd5b5061011d610509565b3480156101ba57600080fd5b506033546001600160a01b03166100eb565b3480156101d857600080fd5b5061011d610600565b3480156101ed57600080fd5b5060c95460ff166040516100ff9190610c4e565b34801561020d57600080fd5b5061023761021c366004610c2b565b6001600160a01b031660009081526065602052604090205490565b6040519081526020016100ff565b34801561025157600080fd5b5061011d610260366004610c2b565b6106cc565b61011d610273366004610c2b565b6107b7565b6033546001600160a01b031633146102ab5760405162461bcd60e51b81526004016102a290610cc4565b60405180910390fd5b60006102b960c95460ff1690565b60028111156102d857634e487b7160e01b600052602160045260246000fd5b146103375760405162461bcd60e51b815260206004820152602960248201527f526566756e64457363726f773a2063616e206f6e6c7920636c6f7365207768696044820152686c652061637469766560b81b60648201526084016102a2565b60c9805460ff191660021790556040517f088672c3a6e342f7cd94a65ba63b79df24a8973927b4d05d803c44bbf787d12f90600090a1565b610378816103ec565b6103e05760405162461bcd60e51b815260206004820152603360248201527f436f6e646974696f6e616c457363726f773a207061796565206973206e6f7420604482015272616c6c6f77656420746f20776974686472617760681b60648201526084016102a2565b6103e98161084e565b50565b600060016103fc60c95460ff1690565b600281111561041b57634e487b7160e01b600052602160045260246000fd5b1492915050565b6033546001600160a01b0316331461044c5760405162461bcd60e51b81526004016102a290610cc4565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b600054610100900460ff16806104af575060005460ff16155b6104cb5760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff161580156104ed576000805461ffff19166101011790555b6104f56108e7565b80156103e9576000805461ff001916905550565b6033546001600160a01b031633146105335760405162461bcd60e51b81526004016102a290610cc4565b600061054160c95460ff1690565b600281111561056057634e487b7160e01b600052602160045260246000fd5b146105c85760405162461bcd60e51b815260206004820152603260248201527f526566756e64457363726f773a2063616e206f6e6c7920656e61626c6520726560448201527166756e6473207768696c652061637469766560701b60648201526084016102a2565b60c9805460ff191660011790556040517f599d8e5a83cffb867d051598c4d70e805d59802d8081c1c7d6dffc5b6aca2b8990600090a1565b600261060e60c95460ff1690565b600281111561062d57634e487b7160e01b600052602160045260246000fd5b146106a05760405162461bcd60e51b815260206004820152603860248201527f526566756e64457363726f773a2062656e65666963696172792063616e206f6e60448201527f6c79207769746864726177207768696c6520636c6f736564000000000000000060648201526084016102a2565b6106ca476106bb60c95461010090046001600160a01b031690565b6001600160a01b031690610956565b565b6033546001600160a01b031633146106f65760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b03811661075b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a2565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107c560c95460ff1690565b60028111156107e457634e487b7160e01b600052602160045260246000fd5b146108455760405162461bcd60e51b815260206004820152602b60248201527f526566756e64457363726f773a2063616e206f6e6c79206465706f736974207760448201526a68696c652061637469766560a81b60648201526084016102a2565b6103e981610a74565b6033546001600160a01b031633146108785760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b03811660008181526065602052604081208054919055906108a09082610956565b816001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516108db91815260200190565b60405180910390a25050565b600054610100900460ff1680610900575060005460ff16155b61091c5760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff1615801561093e576000805461ffff19166101011790555b610946610b13565b61094e610b7d565b6104f5610b13565b804710156109a65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102a2565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146109f3576040519150601f19603f3d011682016040523d82523d6000602084013e6109f8565b606091505b5050905080610a6f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102a2565b505050565b6033546001600160a01b03163314610a9e5760405162461bcd60e51b81526004016102a290610cc4565b6001600160a01b0381166000908152606560205260409020543490610ac4908290610cf9565b6001600160a01b038316600081815260656020526040908190209290925590517f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4906108db9084815260200190565b600054610100900460ff1680610b2c575060005460ff16155b610b485760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff161580156104f5576000805461ffff191661010117905580156103e9576000805461ff001916905550565b600054610100900460ff1680610b96575060005460ff16155b610bb25760405162461bcd60e51b81526004016102a290610c76565b600054610100900460ff16158015610bd4576000805461ffff19166101011790555b603380546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156103e9576000805461ff001916905550565b600060208284031215610c3c578081fd5b8135610c4781610d1d565b9392505050565b6020810160038310610c7057634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d1857634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b03811681146103e957600080fdfea2646970667358221220c2b163a061fe3182bfcaeec14cbce6b50ee6c99fd9e69916947fbe92ab3cc6b464736f6c63430008030033\",\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!(RefundEscrowUpgradeable))
.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>,
) -> 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, ()).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 state(&self) -> self::ethcontract::dyns::DynViewMethodBuilder<u8> {
self
.instance
.view_method([193, 157, 147, 251], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn renounce_ownership(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([113, 80, 24, 166], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn beneficiary_withdraw(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([154, 246, 84, 154], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn close(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([67, 215, 38, 214], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn transfer_ownership(
&self,
new_owner: self::ethcontract::Address,
) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([242, 253, 227, 139], (new_owner,))
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn withdraw(
&self,
payee: self::ethcontract::Address,
) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([81, 207, 248, 217], (payee,))
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn owner(
&self,
) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::Address> {
self
.instance
.view_method([141, 165, 203, 91], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn initialize(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([129, 41, 252, 28], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn enable_refunds(&self) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([140, 82, 220, 65], ())
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn deposit(
&self,
refundee: self::ethcontract::Address,
) -> self::ethcontract::dyns::DynMethodBuilder<()> {
self
.instance
.method([243, 64, 250, 1], (refundee,))
.expect("generated call")
}
#[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 withdrawal_allowed(
&self,
p0: self::ethcontract::Address,
) -> self::ethcontract::dyns::DynViewMethodBuilder<bool> {
self
.instance
.view_method([104, 92, 161, 148], (p0,))
.expect("generated call")
}
#[doc = "Generated by `ethcontract`"]
pub fn deposits_of(
&self,
payee: self::ethcontract::Address,
) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::U256> {
self
.instance
.view_method([227, 169, 219, 26], (payee,))
.expect("generated call")
}
}
impl std::ops::Deref for Contract {
type Target = Methods;
fn deref(&self) -> &Self::Target {
&self.methods
}
}
#[doc = r" Module containing all generated data models for this contract's"]
#[doc = r" events."]
pub mod event_data {
use super::ethcontract;
#[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub struct Deposited {
pub payee: self::ethcontract::Address,
pub wei_amount: self::ethcontract::U256,
}
impl Deposited {
#[doc = r" Retrieves the signature for the event this data corresponds to."]
#[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
#[doc = r" this event."]
pub fn signature() -> self::ethcontract::H256 {
self::ethcontract::H256([
45, 164, 102, 167, 178, 67, 4, 244, 126, 135, 250, 46, 30, 90, 129, 185, 131, 28, 229,
79, 236, 25, 5, 92, 226, 119, 202, 47, 57, 186, 66, 196,
])
}
#[doc = r" Retrieves the ABI signature for the event this data corresponds"]
#[doc = r" to. For this event the value should always be:"]
#[doc = r""]
#[doc = "`Deposited(address,uint256)`"]
pub fn abi_signature() -> &'static str {
"Deposited(address,uint256)"
}
}
impl self::ethcontract::tokens::Tokenize for Deposited {
fn from_token(
token: self::ethcontract::common::abi::Token,
) -> Result<Self, self::ethcontract::tokens::Error> {
let (payee, wei_amount) = self::ethcontract::tokens::Tokenize::from_token(token)?;
Ok(Deposited { payee, wei_amount })
}
fn into_token(self) -> self::ethcontract::common::abi::Token {
unimplemented!("events are only decoded, not encoded")
}
}
#[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub struct RefundsClosed();
impl RefundsClosed {
#[doc = r" Retrieves the signature for the event this data corresponds to."]
#[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
#[doc = r" this event."]
pub fn signature() -> self::ethcontract::H256 {
self::ethcontract::H256([
8, 134, 114, 195, 166, 227, 66, 247, 205, 148, 166, 91, 166, 59, 121, 223, 36, 168, 151,
57, 39, 180, 208, 93, 128, 60, 68, 187, 247, 135, 209, 47,
])
}
#[doc = r" Retrieves the ABI signature for the event this data corresponds"]
#[doc = r" to. For this event the value should always be:"]
#[doc = r""]
#[doc = "`RefundsClosed()`"]
pub fn abi_signature() -> &'static str {
"RefundsClosed()"
}
}
impl self::ethcontract::tokens::Tokenize for RefundsClosed {
fn from_token(
token: self::ethcontract::common::abi::Token,
) -> Result<Self, self::ethcontract::tokens::Error> {
let () = self::ethcontract::tokens::Tokenize::from_token(token)?;
Ok(RefundsClosed())
}
fn into_token(self) -> self::ethcontract::common::abi::Token {
unimplemented!("events are only decoded, not encoded")
}
}
#[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub struct RefundsEnabled();
impl RefundsEnabled {
#[doc = r" Retrieves the signature for the event this data corresponds to."]
#[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
#[doc = r" this event."]
pub fn signature() -> self::ethcontract::H256 {
self::ethcontract::H256([
89, 157, 142, 90, 131, 207, 251, 134, 125, 5, 21, 152, 196, 215, 14, 128, 93, 89, 128,
45, 128, 129, 193, 199, 214, 223, 252, 91, 106, 202, 43, 137,
])
}
#[doc = r" Retrieves the ABI signature for the event this data corresponds"]
#[doc = r" to. For this event the value should always be:"]
#[doc = r""]
#[doc = "`RefundsEnabled()`"]
pub fn abi_signature() -> &'static str {
"RefundsEnabled()"
}
}
impl self::ethcontract::tokens::Tokenize for RefundsEnabled {
fn from_token(
token: self::ethcontract::common::abi::Token,
) -> Result<Self, self::ethcontract::tokens::Error> {
let () = self::ethcontract::tokens::Tokenize::from_token(token)?;
Ok(RefundsEnabled())
}
fn into_token(self) -> self::ethcontract::common::abi::Token {
unimplemented!("events are only decoded, not encoded")
}
}
#[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub struct OwnershipTransferred {
pub previous_owner: self::ethcontract::Address,
pub new_owner: self::ethcontract::Address,
}
impl OwnershipTransferred {
#[doc = r" Retrieves the signature for the event this data corresponds to."]
#[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
#[doc = r" this event."]
pub fn signature() -> self::ethcontract::H256 {
self::ethcontract::H256([
139, 224, 7, 156, 83, 22, 89, 20, 19, 68, 205, 31, 208, 164, 242, 132, 25, 73, 127, 151,
34, 163, 218, 175, 227, 180, 24, 111, 107, 100, 87, 224,
])
}
#[doc = r" Retrieves the ABI signature for the event this data corresponds"]
#[doc = r" to. For this event the value should always be:"]
#[doc = r""]
#[doc = "`OwnershipTransferred(address,address)`"]
pub fn abi_signature() -> &'static str {
"OwnershipTransferred(address,address)"
}
}
impl self::ethcontract::tokens::Tokenize for OwnershipTransferred {
fn from_token(
token: self::ethcontract::common::abi::Token,
) -> Result<Self, self::ethcontract::tokens::Error> {
let (previous_owner, new_owner) = self::ethcontract::tokens::Tokenize::from_token(token)?;
Ok(OwnershipTransferred {
previous_owner,
new_owner,
})
}
fn into_token(self) -> self::ethcontract::common::abi::Token {
unimplemented!("events are only decoded, not encoded")
}
}
#[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub struct Withdrawn {
pub payee: self::ethcontract::Address,
pub wei_amount: self::ethcontract::U256,
}
impl Withdrawn {
#[doc = r" Retrieves the signature for the event this data corresponds to."]
#[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
#[doc = r" this event."]
pub fn signature() -> self::ethcontract::H256 {
self::ethcontract::H256([
112, 132, 245, 71, 102, 24, 216, 230, 11, 17, 239, 13, 125, 63, 6, 145, 70, 85, 173, 184,
121, 62, 40, 255, 127, 1, 141, 76, 118, 213, 5, 213,
])
}
#[doc = r" Retrieves the ABI signature for the event this data corresponds"]
#[doc = r" to. For this event the value should always be:"]
#[doc = r""]
#[doc = "`Withdrawn(address,uint256)`"]
pub fn abi_signature() -> &'static str {
"Withdrawn(address,uint256)"
}
}
impl self::ethcontract::tokens::Tokenize for Withdrawn {
fn from_token(
token: self::ethcontract::common::abi::Token,
) -> Result<Self, self::ethcontract::tokens::Error> {
let (payee, wei_amount) = self::ethcontract::tokens::Tokenize::from_token(token)?;
Ok(Withdrawn { payee, wei_amount })
}
fn into_token(self) -> self::ethcontract::common::abi::Token {
unimplemented!("events are only decoded, not encoded")
}
}
}
impl Contract {
#[doc = r" Retrieves a handle to a type containing for creating event"]
#[doc = r" streams for all the contract events."]
pub fn events(&self) -> Events<'_> {
Events {
instance: self.raw_instance(),
}
}
}
pub struct Events<'a> {
instance: &'a self::ethcontract::dyns::DynInstance,
}
impl Events<'_> {
#[doc = r" Generated by `ethcontract`."]
pub fn deposited(&self) -> self::event_builders::DepositedBuilder {
self::event_builders::DepositedBuilder(
self
.instance
.event(self::ethcontract::H256([
45, 164, 102, 167, 178, 67, 4, 244, 126, 135, 250, 46, 30, 90, 129, 185, 131, 28, 229,
79, 236, 25, 5, 92, 226, 119, 202, 47, 57, 186, 66, 196,
]))
.expect("generated event filter"),
)
}
#[doc = r" Generated by `ethcontract`."]
pub fn refunds_closed(&self) -> self::event_builders::RefundsClosedBuilder {
self::event_builders::RefundsClosedBuilder(
self
.instance
.event(self::ethcontract::H256([
8, 134, 114, 195, 166, 227, 66, 247, 205, 148, 166, 91, 166, 59, 121, 223, 36, 168,
151, 57, 39, 180, 208, 93, 128, 60, 68, 187, 247, 135, 209, 47,
]))
.expect("generated event filter"),
)
}
#[doc = r" Generated by `ethcontract`."]
pub fn refunds_enabled(&self) -> self::event_builders::RefundsEnabledBuilder {
self::event_builders::RefundsEnabledBuilder(
self
.instance
.event(self::ethcontract::H256([
89, 157, 142, 90, 131, 207, 251, 134, 125, 5, 21, 152, 196, 215, 14, 128, 93, 89, 128,
45, 128, 129, 193, 199, 214, 223, 252, 91, 106, 202, 43, 137,
]))
.expect("generated event filter"),
)
}
#[doc = r" Generated by `ethcontract`."]
pub fn ownership_transferred(&self) -> self::event_builders::OwnershipTransferredBuilder {
self::event_builders::OwnershipTransferredBuilder(
self
.instance
.event(self::ethcontract::H256([
139, 224, 7, 156, 83, 22, 89, 20, 19, 68, 205, 31, 208, 164, 242, 132, 25, 73, 127,
151, 34, 163, 218, 175, 227, 180, 24, 111, 107, 100, 87, 224,
]))
.expect("generated event filter"),
)
}
#[doc = r" Generated by `ethcontract`."]
pub fn withdrawn(&self) -> self::event_builders::WithdrawnBuilder {
self::event_builders::WithdrawnBuilder(
self
.instance
.event(self::ethcontract::H256([
112, 132, 245, 71, 102, 24, 216, 230, 11, 17, 239, 13, 125, 63, 6, 145, 70, 85, 173,
184, 121, 62, 40, 255, 127, 1, 141, 76, 118, 213, 5, 213,
]))
.expect("generated event filter"),
)
}
}
#[doc = r" Module containing the generated event stream builders with type safe"]
#[doc = r" filter methods for this contract's events."]
pub mod event_builders {
use super::ethcontract;
use super::event_data;
#[doc = "A builder for creating a filtered stream of `Deposited` events."]
pub struct DepositedBuilder(
#[doc = r" The inner event builder."]
pub self::ethcontract::dyns::DynEventBuilder<self::event_data::Deposited>,
);
impl DepositedBuilder {
#[doc = r" Sets the starting block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the latest block."]
#[allow(clippy::wrong_self_convention)]
pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).from_block(block);
self
}
#[doc = r" Sets the last block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the streaming until the end of days."]
#[allow(clippy::wrong_self_convention)]
pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).to_block(block);
self
}
#[doc = r" Limit the number of events that can be retrieved by this filter."]
#[doc = r""]
#[doc = r" Note that this parameter is non-standard."]
pub fn limit(mut self, value: usize) -> Self {
self.0 = (self.0).limit(value);
self
}
#[doc = r" The polling interval. This is used as the interval between"]
#[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
self.0 = (self.0).poll_interval(value);
self
}
#[doc = "Adds a filter for the payee event parameter."]
pub fn payee(mut self, topic: self::ethcontract::Topic<self::ethcontract::Address>) -> Self {
self.0 = (self.0).topic0(topic);
self
}
#[doc = r" Returns a future that resolves with a collection of all existing"]
#[doc = r" logs matching the builder parameters."]
pub async fn query(
self,
) -> std::result::Result<
std::vec::Vec<self::ethcontract::Event<self::event_data::Deposited>>,
self::ethcontract::errors::EventError,
> {
(self.0).query().await
}
#[doc = r" Creates an event stream from the current event builder."]
pub fn stream(
self,
) -> impl self::ethcontract::futures::stream::Stream<
Item = std::result::Result<
self::ethcontract::StreamEvent<self::event_data::Deposited>,
self::ethcontract::errors::EventError,
>,
> {
(self.0).stream()
}
}
#[doc = "A builder for creating a filtered stream of `RefundsClosed` events."]
pub struct RefundsClosedBuilder(
#[doc = r" The inner event builder."]
pub self::ethcontract::dyns::DynEventBuilder<self::event_data::RefundsClosed>,
);
impl RefundsClosedBuilder {
#[doc = r" Sets the starting block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the latest block."]
#[allow(clippy::wrong_self_convention)]
pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).from_block(block);
self
}
#[doc = r" Sets the last block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the streaming until the end of days."]
#[allow(clippy::wrong_self_convention)]
pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).to_block(block);
self
}
#[doc = r" Limit the number of events that can be retrieved by this filter."]
#[doc = r""]
#[doc = r" Note that this parameter is non-standard."]
pub fn limit(mut self, value: usize) -> Self {
self.0 = (self.0).limit(value);
self
}
#[doc = r" The polling interval. This is used as the interval between"]
#[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
self.0 = (self.0).poll_interval(value);
self
}
#[doc = r" Returns a future that resolves with a collection of all existing"]
#[doc = r" logs matching the builder parameters."]
pub async fn query(
self,
) -> std::result::Result<
std::vec::Vec<self::ethcontract::Event<self::event_data::RefundsClosed>>,
self::ethcontract::errors::EventError,
> {
(self.0).query().await
}
#[doc = r" Creates an event stream from the current event builder."]
pub fn stream(
self,
) -> impl self::ethcontract::futures::stream::Stream<
Item = std::result::Result<
self::ethcontract::StreamEvent<self::event_data::RefundsClosed>,
self::ethcontract::errors::EventError,
>,
> {
(self.0).stream()
}
}
#[doc = "A builder for creating a filtered stream of `RefundsEnabled` events."]
pub struct RefundsEnabledBuilder(
#[doc = r" The inner event builder."]
pub self::ethcontract::dyns::DynEventBuilder<self::event_data::RefundsEnabled>,
);
impl RefundsEnabledBuilder {
#[doc = r" Sets the starting block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the latest block."]
#[allow(clippy::wrong_self_convention)]
pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).from_block(block);
self
}
#[doc = r" Sets the last block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the streaming until the end of days."]
#[allow(clippy::wrong_self_convention)]
pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).to_block(block);
self
}
#[doc = r" Limit the number of events that can be retrieved by this filter."]
#[doc = r""]
#[doc = r" Note that this parameter is non-standard."]
pub fn limit(mut self, value: usize) -> Self {
self.0 = (self.0).limit(value);
self
}
#[doc = r" The polling interval. This is used as the interval between"]
#[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
self.0 = (self.0).poll_interval(value);
self
}
#[doc = r" Returns a future that resolves with a collection of all existing"]
#[doc = r" logs matching the builder parameters."]
pub async fn query(
self,
) -> std::result::Result<
std::vec::Vec<self::ethcontract::Event<self::event_data::RefundsEnabled>>,
self::ethcontract::errors::EventError,
> {
(self.0).query().await
}
#[doc = r" Creates an event stream from the current event builder."]
pub fn stream(
self,
) -> impl self::ethcontract::futures::stream::Stream<
Item = std::result::Result<
self::ethcontract::StreamEvent<self::event_data::RefundsEnabled>,
self::ethcontract::errors::EventError,
>,
> {
(self.0).stream()
}
}
#[doc = "A builder for creating a filtered stream of `OwnershipTransferred` events."]
pub struct OwnershipTransferredBuilder(
#[doc = r" The inner event builder."]
pub self::ethcontract::dyns::DynEventBuilder<self::event_data::OwnershipTransferred>,
);
impl OwnershipTransferredBuilder {
#[doc = r" Sets the starting block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the latest block."]
#[allow(clippy::wrong_self_convention)]
pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).from_block(block);
self
}
#[doc = r" Sets the last block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the streaming until the end of days."]
#[allow(clippy::wrong_self_convention)]
pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).to_block(block);
self
}
#[doc = r" Limit the number of events that can be retrieved by this filter."]
#[doc = r""]
#[doc = r" Note that this parameter is non-standard."]
pub fn limit(mut self, value: usize) -> Self {
self.0 = (self.0).limit(value);
self
}
#[doc = r" The polling interval. This is used as the interval between"]
#[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
self.0 = (self.0).poll_interval(value);
self
}
#[doc = "Adds a filter for the previousOwner event parameter."]
pub fn previous_owner(
mut self,
topic: self::ethcontract::Topic<self::ethcontract::Address>,
) -> Self {
self.0 = (self.0).topic0(topic);
self
}
#[doc = "Adds a filter for the newOwner event parameter."]
pub fn new_owner(
mut self,
topic: self::ethcontract::Topic<self::ethcontract::Address>,
) -> Self {
self.0 = (self.0).topic1(topic);
self
}
#[doc = r" Returns a future that resolves with a collection of all existing"]
#[doc = r" logs matching the builder parameters."]
pub async fn query(
self,
) -> std::result::Result<
std::vec::Vec<self::ethcontract::Event<self::event_data::OwnershipTransferred>>,
self::ethcontract::errors::EventError,
> {
(self.0).query().await
}
#[doc = r" Creates an event stream from the current event builder."]
pub fn stream(
self,
) -> impl self::ethcontract::futures::stream::Stream<
Item = std::result::Result<
self::ethcontract::StreamEvent<self::event_data::OwnershipTransferred>,
self::ethcontract::errors::EventError,
>,
> {
(self.0).stream()
}
}
#[doc = "A builder for creating a filtered stream of `Withdrawn` events."]
pub struct WithdrawnBuilder(
#[doc = r" The inner event builder."]
pub self::ethcontract::dyns::DynEventBuilder<self::event_data::Withdrawn>,
);
impl WithdrawnBuilder {
#[doc = r" Sets the starting block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the latest block."]
#[allow(clippy::wrong_self_convention)]
pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).from_block(block);
self
}
#[doc = r" Sets the last block from which to stream logs for."]
#[doc = r""]
#[doc = r" If left unset defaults to the streaming until the end of days."]
#[allow(clippy::wrong_self_convention)]
pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
self.0 = (self.0).to_block(block);
self
}
#[doc = r" Limit the number of events that can be retrieved by this filter."]
#[doc = r""]
#[doc = r" Note that this parameter is non-standard."]
pub fn limit(mut self, value: usize) -> Self {
self.0 = (self.0).limit(value);
self
}
#[doc = r" The polling interval. This is used as the interval between"]
#[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
self.0 = (self.0).poll_interval(value);
self
}
#[doc = "Adds a filter for the payee event parameter."]
pub fn payee(mut self, topic: self::ethcontract::Topic<self::ethcontract::Address>) -> Self {
self.0 = (self.0).topic0(topic);
self
}
#[doc = r" Returns a future that resolves with a collection of all existing"]
#[doc = r" logs matching the builder parameters."]
pub async fn query(
self,
) -> std::result::Result<
std::vec::Vec<self::ethcontract::Event<self::event_data::Withdrawn>>,
self::ethcontract::errors::EventError,
> {
(self.0).query().await
}
#[doc = r" Creates an event stream from the current event builder."]
pub fn stream(
self,
) -> impl self::ethcontract::futures::stream::Stream<
Item = std::result::Result<
self::ethcontract::StreamEvent<self::event_data::Withdrawn>,
self::ethcontract::errors::EventError,
>,
> {
(self.0).stream()
}
}
}
impl Contract {
#[doc = r" Returns a log stream with all events."]
pub fn all_events(&self) -> self::ethcontract::dyns::DynAllEventsBuilder<Event> {
self::ethcontract::dyns::DynAllEventsBuilder::new(
self.raw_instance().web3(),
self.address(),
self.deployment_information(),
)
}
}
#[doc = r" A contract event."]
#[derive(Clone, Debug, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
pub enum Event {
Deposited(self::event_data::Deposited),
OwnershipTransferred(self::event_data::OwnershipTransferred),
RefundsClosed(self::event_data::RefundsClosed),
RefundsEnabled(self::event_data::RefundsEnabled),
Withdrawn(self::event_data::Withdrawn),
}
impl self::ethcontract::contract::ParseLog for Event {
fn parse_log(
log: self::ethcontract::RawLog,
) -> Result<Self, self::ethcontract::errors::ExecutionError> {
let standard_event = log . topics . get (0) . copied () . map (| topic | match topic { self :: ethcontract :: H256 ([45 , 164 , 102 , 167 , 178 , 67 , 4 , 244 , 126 , 135 , 250 , 46 , 30 , 90 , 129 , 185 , 131 , 28 , 229 , 79 , 236 , 25 , 5 , 92 , 226 , 119 , 202 , 47 , 57 , 186 , 66 , 196]) => Ok (Event :: Deposited (log . clone () . decode (Contract :: artifact () . abi . event ("Deposited") . expect ("generated event decode")) ?)) , self :: ethcontract :: H256 ([139 , 224 , 7 , 156 , 83 , 22 , 89 , 20 , 19 , 68 , 205 , 31 , 208 , 164 , 242 , 132 , 25 , 73 , 127 , 151 , 34 , 163 , 218 , 175 , 227 , 180 , 24 , 111 , 107 , 100 , 87 , 224]) => Ok (Event :: OwnershipTransferred (log . clone () . decode (Contract :: artifact () . abi . event ("OwnershipTransferred") . expect ("generated event decode")) ?)) , self :: ethcontract :: H256 ([8 , 134 , 114 , 195 , 166 , 227 , 66 , 247 , 205 , 148 , 166 , 91 , 166 , 59 , 121 , 223 , 36 , 168 , 151 , 57 , 39 , 180 , 208 , 93 , 128 , 60 , 68 , 187 , 247 , 135 , 209 , 47]) => Ok (Event :: RefundsClosed (log . clone () . decode (Contract :: artifact () . abi . event ("RefundsClosed") . expect ("generated event decode")) ?)) , self :: ethcontract :: H256 ([89 , 157 , 142 , 90 , 131 , 207 , 251 , 134 , 125 , 5 , 21 , 152 , 196 , 215 , 14 , 128 , 93 , 89 , 128 , 45 , 128 , 129 , 193 , 199 , 214 , 223 , 252 , 91 , 106 , 202 , 43 , 137]) => Ok (Event :: RefundsEnabled (log . clone () . decode (Contract :: artifact () . abi . event ("RefundsEnabled") . expect ("generated event decode")) ?)) , self :: ethcontract :: H256 ([112 , 132 , 245 , 71 , 102 , 24 , 216 , 230 , 11 , 17 , 239 , 13 , 125 , 63 , 6 , 145 , 70 , 85 , 173 , 184 , 121 , 62 , 40 , 255 , 127 , 1 , 141 , 76 , 118 , 213 , 5 , 213]) => Ok (Event :: Withdrawn (log . clone () . decode (Contract :: artifact () . abi . event ("Withdrawn") . expect ("generated event decode")) ?)) , _ => Err (self :: ethcontract :: errors :: ExecutionError :: from (self :: ethcontract :: common :: abi :: Error :: InvalidData)) , }) ;
if let Some(Ok(data)) = standard_event {
return Ok(data);
}
Err(self::ethcontract::errors::ExecutionError::from(
self::ethcontract::common::abi::Error::InvalidData,
))
}
}
}
pub use self::refund_escrow_upgradeable::Contract as RefundEscrowUpgradeable;