/**
Generated by the following Solidity interface...
```solidity
interface ContractsRegistry {
function contractCount() external view returns (uint256);
function contractNames(uint256) external view returns (string memory);
function contracts(string memory) external view returns (address);
function registerContract(string memory name, address _contract) external;
}
```
...which was generated by the following JSON ABI:
```json
[
{
"type": "function",
"name": "contractCount",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "contractNames",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "contracts",
"inputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "registerContract",
"inputs": [
{
"name": "name",
"type": "string",
"internalType": "string"
},
{
"name": "_contract",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
```*/
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod ContractsRegistry {
use super::*;
use alloy::sol_types as alloy_sol_types;
/// The creation / init bytecode of the contract.
///
/// ```text
///0x608080604052346015576104c1908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c9081633ca6bb92146102f8575080637f3c2c28146100ca5780638736381a146100ad57638c5b838514610048575f80fd5b346100a95760203660031901126100a95760043567ffffffffffffffff81116100a95761007b6020913690600401610435565b8160405191805191829101835e5f90820190815281900382019020546040516001600160a01b039091168152f35b5f80fd5b346100a9575f3660031901126100a9576020600254604051908152f35b346100a95760403660031901126100a95760043567ffffffffffffffff81116100a9576100fb903690600401610435565b6024356001600160a01b038116908190036100a95760405182519060208401918083835e5f9082019081528190036020019020546001600160a01b03166102b3576020604051809285518091835e81015f815203019020906bffffffffffffffffffffffff60a01b8254161790556002545f52600160205260405f20815167ffffffffffffffff811161029f5761019282546103db565b601f811161025a575b50602092601f82116001146101fb57928192935f926101f0575b50508160011b915f199060031b1c19161790555b6002545f1981146101dc57600101600255005b634e487b7160e01b5f52601160045260245ffd5b0151905083806101b5565b601f19821693835f52805f20915f5b868110610242575083600195961061022a575b505050811b0190556101c9565b01515f1960f88460031b161c1916905583808061021d565b9192602060018192868501518155019401920161020a565b825f5260205f20601f830160051c81019160208410610295575b601f0160051c01905b81811061028a575061019b565b5f815560010161027d565b9091508190610274565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601b60248201527f636f6e747261637420616c7265616479207265676973746572656400000000006044820152606490fd5b346100a95760203660031901126100a9576004355f52600160205260405f20905f825492610325846103db565b9081845260208401946001811690815f146103be575060011461037e575b8460408561035381870382610413565b8151928391602083525180918160208501528484015e5f828201840152601f01601f19168101030190f35b5f90815260208120939250905b8082106103a45750909150810160200161035382610343565b91926001816020925483858801015201910190929161038b565b60ff191686525050151560051b8201602001905061035382610343565b90600182811c92168015610409575b60208310146103f557565b634e487b7160e01b5f52602260045260245ffd5b91607f16916103ea565b90601f8019910116810190811067ffffffffffffffff82111761029f57604052565b81601f820112156100a95780359067ffffffffffffffff821161029f576040519261046a601f8401601f191660200185610413565b828452602083830101116100a957815f92602080930183860137830101529056fea2646970667358221220b9fba6cc4f192072b3fefccb2c64d81390e1bd009f4ccd3c7e42465b694ba63064736f6c634300081b0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80\x80`@R4`\x15Wa\x04\xC1\x90\x81a\0\x1A\x829\xF3[_\x80\xFD\xFE`\x80\x80`@R`\x046\x10\x15a\0\x12W_\x80\xFD[_5`\xE0\x1C\x90\x81c<\xA6\xBB\x92\x14a\x02\xF8WP\x80c\x7F<,(\x14a\0\xCAW\x80c\x8768\x1A\x14a\0\xADWc\x8C[\x83\x85\x14a\0HW_\x80\xFD[4a\0\xA9W` 6`\x03\x19\x01\x12a\0\xA9W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xA9Wa\0{` \x916\x90`\x04\x01a\x045V[\x81`@Q\x91\x80Q\x91\x82\x91\x01\x83^_\x90\x82\x01\x90\x81R\x81\x90\x03\x82\x01\x90 T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R\xF3[_\x80\xFD[4a\0\xA9W_6`\x03\x19\x01\x12a\0\xA9W` `\x02T`@Q\x90\x81R\xF3[4a\0\xA9W`@6`\x03\x19\x01\x12a\0\xA9W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xA9Wa\0\xFB\x906\x90`\x04\x01a\x045V[`$5`\x01`\x01`\xA0\x1B\x03\x81\x16\x90\x81\x90\x03a\0\xA9W`@Q\x82Q\x90` \x84\x01\x91\x80\x83\x83^_\x90\x82\x01\x90\x81R\x81\x90\x03` \x01\x90 T`\x01`\x01`\xA0\x1B\x03\x16a\x02\xB3W` `@Q\x80\x92\x85Q\x80\x91\x83^\x81\x01_\x81R\x03\x01\x90 \x90k\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF`\xA0\x1B\x82T\x16\x17\x90U`\x02T_R`\x01` R`@_ \x81Qg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\x02\x9FWa\x01\x92\x82Ta\x03\xDBV[`\x1F\x81\x11a\x02ZW[P` \x92`\x1F\x82\x11`\x01\x14a\x01\xFBW\x92\x81\x92\x93_\x92a\x01\xF0W[PP\x81`\x01\x1B\x91_\x19\x90`\x03\x1B\x1C\x19\x16\x17\x90U[`\x02T_\x19\x81\x14a\x01\xDCW`\x01\x01`\x02U\0[cNH{q`\xE0\x1B_R`\x11`\x04R`$_\xFD[\x01Q\x90P\x83\x80a\x01\xB5V[`\x1F\x19\x82\x16\x93\x83_R\x80_ \x91_[\x86\x81\x10a\x02BWP\x83`\x01\x95\x96\x10a\x02*W[PPP\x81\x1B\x01\x90Ua\x01\xC9V[\x01Q_\x19`\xF8\x84`\x03\x1B\x16\x1C\x19\x16\x90U\x83\x80\x80a\x02\x1DV[\x91\x92` `\x01\x81\x92\x86\x85\x01Q\x81U\x01\x94\x01\x92\x01a\x02\nV[\x82_R` _ `\x1F\x83\x01`\x05\x1C\x81\x01\x91` \x84\x10a\x02\x95W[`\x1F\x01`\x05\x1C\x01\x90[\x81\x81\x10a\x02\x8AWPa\x01\x9BV[_\x81U`\x01\x01a\x02}V[\x90\x91P\x81\x90a\x02tV[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7Fcontract already registered\0\0\0\0\0`D\x82\x01R`d\x90\xFD[4a\0\xA9W` 6`\x03\x19\x01\x12a\0\xA9W`\x045_R`\x01` R`@_ \x90_\x82T\x92a\x03%\x84a\x03\xDBV[\x90\x81\x84R` \x84\x01\x94`\x01\x81\x16\x90\x81_\x14a\x03\xBEWP`\x01\x14a\x03~W[\x84`@\x85a\x03S\x81\x87\x03\x82a\x04\x13V[\x81Q\x92\x83\x91` \x83RQ\x80\x91\x81` \x85\x01R\x84\x84\x01^_\x82\x82\x01\x84\x01R`\x1F\x01`\x1F\x19\x16\x81\x01\x03\x01\x90\xF3[_\x90\x81R` \x81 \x93\x92P\x90[\x80\x82\x10a\x03\xA4WP\x90\x91P\x81\x01` \x01a\x03S\x82a\x03CV[\x91\x92`\x01\x81` \x92T\x83\x85\x88\x01\x01R\x01\x91\x01\x90\x92\x91a\x03\x8BV[`\xFF\x19\x16\x86RPP\x15\x15`\x05\x1B\x82\x01` \x01\x90Pa\x03S\x82a\x03CV[\x90`\x01\x82\x81\x1C\x92\x16\x80\x15a\x04\tW[` \x83\x10\x14a\x03\xF5WV[cNH{q`\xE0\x1B_R`\"`\x04R`$_\xFD[\x91`\x7F\x16\x91a\x03\xEAV[\x90`\x1F\x80\x19\x91\x01\x16\x81\x01\x90\x81\x10g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x17a\x02\x9FW`@RV[\x81`\x1F\x82\x01\x12\x15a\0\xA9W\x805\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11a\x02\x9FW`@Q\x92a\x04j`\x1F\x84\x01`\x1F\x19\x16` \x01\x85a\x04\x13V[\x82\x84R` \x83\x83\x01\x01\x11a\0\xA9W\x81_\x92` \x80\x93\x01\x83\x86\x017\x83\x01\x01R\x90V\xFE\xA2dipfsX\"\x12 \xB9\xFB\xA6\xCCO\x19 r\xB3\xFE\xFC\xCB,d\xD8\x13\x90\xE1\xBD\0\x9FL\xCD<~BF[iK\xA60dsolcC\0\x08\x1B\x003",
);
/// The runtime bytecode of the contract, as deployed on the network.
///
/// ```text
///0x6080806040526004361015610012575f80fd5b5f3560e01c9081633ca6bb92146102f8575080637f3c2c28146100ca5780638736381a146100ad57638c5b838514610048575f80fd5b346100a95760203660031901126100a95760043567ffffffffffffffff81116100a95761007b6020913690600401610435565b8160405191805191829101835e5f90820190815281900382019020546040516001600160a01b039091168152f35b5f80fd5b346100a9575f3660031901126100a9576020600254604051908152f35b346100a95760403660031901126100a95760043567ffffffffffffffff81116100a9576100fb903690600401610435565b6024356001600160a01b038116908190036100a95760405182519060208401918083835e5f9082019081528190036020019020546001600160a01b03166102b3576020604051809285518091835e81015f815203019020906bffffffffffffffffffffffff60a01b8254161790556002545f52600160205260405f20815167ffffffffffffffff811161029f5761019282546103db565b601f811161025a575b50602092601f82116001146101fb57928192935f926101f0575b50508160011b915f199060031b1c19161790555b6002545f1981146101dc57600101600255005b634e487b7160e01b5f52601160045260245ffd5b0151905083806101b5565b601f19821693835f52805f20915f5b868110610242575083600195961061022a575b505050811b0190556101c9565b01515f1960f88460031b161c1916905583808061021d565b9192602060018192868501518155019401920161020a565b825f5260205f20601f830160051c81019160208410610295575b601f0160051c01905b81811061028a575061019b565b5f815560010161027d565b9091508190610274565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601b60248201527f636f6e747261637420616c7265616479207265676973746572656400000000006044820152606490fd5b346100a95760203660031901126100a9576004355f52600160205260405f20905f825492610325846103db565b9081845260208401946001811690815f146103be575060011461037e575b8460408561035381870382610413565b8151928391602083525180918160208501528484015e5f828201840152601f01601f19168101030190f35b5f90815260208120939250905b8082106103a45750909150810160200161035382610343565b91926001816020925483858801015201910190929161038b565b60ff191686525050151560051b8201602001905061035382610343565b90600182811c92168015610409575b60208310146103f557565b634e487b7160e01b5f52602260045260245ffd5b91607f16916103ea565b90601f8019910116810190811067ffffffffffffffff82111761029f57604052565b81601f820112156100a95780359067ffffffffffffffff821161029f576040519261046a601f8401601f191660200185610413565b828452602083830101116100a957815f92602080930183860137830101529056fea2646970667358221220b9fba6cc4f192072b3fefccb2c64d81390e1bd009f4ccd3c7e42465b694ba63064736f6c634300081b0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80\x80`@R`\x046\x10\x15a\0\x12W_\x80\xFD[_5`\xE0\x1C\x90\x81c<\xA6\xBB\x92\x14a\x02\xF8WP\x80c\x7F<,(\x14a\0\xCAW\x80c\x8768\x1A\x14a\0\xADWc\x8C[\x83\x85\x14a\0HW_\x80\xFD[4a\0\xA9W` 6`\x03\x19\x01\x12a\0\xA9W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xA9Wa\0{` \x916\x90`\x04\x01a\x045V[\x81`@Q\x91\x80Q\x91\x82\x91\x01\x83^_\x90\x82\x01\x90\x81R\x81\x90\x03\x82\x01\x90 T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R\xF3[_\x80\xFD[4a\0\xA9W_6`\x03\x19\x01\x12a\0\xA9W` `\x02T`@Q\x90\x81R\xF3[4a\0\xA9W`@6`\x03\x19\x01\x12a\0\xA9W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xA9Wa\0\xFB\x906\x90`\x04\x01a\x045V[`$5`\x01`\x01`\xA0\x1B\x03\x81\x16\x90\x81\x90\x03a\0\xA9W`@Q\x82Q\x90` \x84\x01\x91\x80\x83\x83^_\x90\x82\x01\x90\x81R\x81\x90\x03` \x01\x90 T`\x01`\x01`\xA0\x1B\x03\x16a\x02\xB3W` `@Q\x80\x92\x85Q\x80\x91\x83^\x81\x01_\x81R\x03\x01\x90 \x90k\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF`\xA0\x1B\x82T\x16\x17\x90U`\x02T_R`\x01` R`@_ \x81Qg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\x02\x9FWa\x01\x92\x82Ta\x03\xDBV[`\x1F\x81\x11a\x02ZW[P` \x92`\x1F\x82\x11`\x01\x14a\x01\xFBW\x92\x81\x92\x93_\x92a\x01\xF0W[PP\x81`\x01\x1B\x91_\x19\x90`\x03\x1B\x1C\x19\x16\x17\x90U[`\x02T_\x19\x81\x14a\x01\xDCW`\x01\x01`\x02U\0[cNH{q`\xE0\x1B_R`\x11`\x04R`$_\xFD[\x01Q\x90P\x83\x80a\x01\xB5V[`\x1F\x19\x82\x16\x93\x83_R\x80_ \x91_[\x86\x81\x10a\x02BWP\x83`\x01\x95\x96\x10a\x02*W[PPP\x81\x1B\x01\x90Ua\x01\xC9V[\x01Q_\x19`\xF8\x84`\x03\x1B\x16\x1C\x19\x16\x90U\x83\x80\x80a\x02\x1DV[\x91\x92` `\x01\x81\x92\x86\x85\x01Q\x81U\x01\x94\x01\x92\x01a\x02\nV[\x82_R` _ `\x1F\x83\x01`\x05\x1C\x81\x01\x91` \x84\x10a\x02\x95W[`\x1F\x01`\x05\x1C\x01\x90[\x81\x81\x10a\x02\x8AWPa\x01\x9BV[_\x81U`\x01\x01a\x02}V[\x90\x91P\x81\x90a\x02tV[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7Fcontract already registered\0\0\0\0\0`D\x82\x01R`d\x90\xFD[4a\0\xA9W` 6`\x03\x19\x01\x12a\0\xA9W`\x045_R`\x01` R`@_ \x90_\x82T\x92a\x03%\x84a\x03\xDBV[\x90\x81\x84R` \x84\x01\x94`\x01\x81\x16\x90\x81_\x14a\x03\xBEWP`\x01\x14a\x03~W[\x84`@\x85a\x03S\x81\x87\x03\x82a\x04\x13V[\x81Q\x92\x83\x91` \x83RQ\x80\x91\x81` \x85\x01R\x84\x84\x01^_\x82\x82\x01\x84\x01R`\x1F\x01`\x1F\x19\x16\x81\x01\x03\x01\x90\xF3[_\x90\x81R` \x81 \x93\x92P\x90[\x80\x82\x10a\x03\xA4WP\x90\x91P\x81\x01` \x01a\x03S\x82a\x03CV[\x91\x92`\x01\x81` \x92T\x83\x85\x88\x01\x01R\x01\x91\x01\x90\x92\x91a\x03\x8BV[`\xFF\x19\x16\x86RPP\x15\x15`\x05\x1B\x82\x01` \x01\x90Pa\x03S\x82a\x03CV[\x90`\x01\x82\x81\x1C\x92\x16\x80\x15a\x04\tW[` \x83\x10\x14a\x03\xF5WV[cNH{q`\xE0\x1B_R`\"`\x04R`$_\xFD[\x91`\x7F\x16\x91a\x03\xEAV[\x90`\x1F\x80\x19\x91\x01\x16\x81\x01\x90\x81\x10g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x17a\x02\x9FW`@RV[\x81`\x1F\x82\x01\x12\x15a\0\xA9W\x805\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11a\x02\x9FW`@Q\x92a\x04j`\x1F\x84\x01`\x1F\x19\x16` \x01\x85a\x04\x13V[\x82\x84R` \x83\x83\x01\x01\x11a\0\xA9W\x81_\x92` \x80\x93\x01\x83\x86\x017\x83\x01\x01R\x90V\xFE\xA2dipfsX\"\x12 \xB9\xFB\xA6\xCCO\x19 r\xB3\xFE\xFC\xCB,d\xD8\x13\x90\xE1\xBD\0\x9FL\xCD<~BF[iK\xA60dsolcC\0\x08\x1B\x003",
);
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `contractCount()` and selector `0x8736381a`.
```solidity
function contractCount() external view returns (uint256);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractCountCall;
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`contractCount()`](contractCountCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractCountReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::primitives::aliases::U256,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = ();
#[doc(hidden)]
type UnderlyingRustTuple<'a> = ();
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractCountCall> for UnderlyingRustTuple<'_> {
fn from(value: contractCountCall) -> Self {
()
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractCountCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self
}
}
}
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::primitives::aliases::U256,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractCountReturn> for UnderlyingRustTuple<'_> {
fn from(value: contractCountReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractCountReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for contractCountCall {
type Parameters<'a> = ();
type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::primitives::aliases::U256;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,);
type ReturnToken<'a> = <Self::ReturnTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "contractCount()";
const SELECTOR: [u8; 4] = [135u8, 54u8, 56u8, 26u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
()
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Uint<256> as alloy_sol_types::SolType>::tokenize(
ret,
),
)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence(data).map(
|r| {
let r: contractCountReturn = r.into();
r._0
},
)
}
#[inline]
fn abi_decode_returns_validate(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence_validate(
data,
)
.map(|r| {
let r: contractCountReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `contractNames(uint256)` and selector `0x3ca6bb92`.
```solidity
function contractNames(uint256) external view returns (string memory);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractNamesCall(pub alloy::sol_types::private::primitives::aliases::U256);
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`contractNames(uint256)`](contractNamesCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractNamesReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::String,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::primitives::aliases::U256,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractNamesCall> for UnderlyingRustTuple<'_> {
fn from(value: contractNamesCall) -> Self {
(value.0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractNamesCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self(tuple.0)
}
}
}
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::String,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::String,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractNamesReturn> for UnderlyingRustTuple<'_> {
fn from(value: contractNamesReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractNamesReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for contractNamesCall {
type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,);
type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::String;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::String,);
type ReturnToken<'a> = <Self::ReturnTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "contractNames(uint256)";
const SELECTOR: [u8; 4] = [60u8, 166u8, 187u8, 146u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::Uint<256> as alloy_sol_types::SolType>::tokenize(
&self.0,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(<alloy::sol_types::sol_data::String as alloy_sol_types::SolType>::tokenize(ret),)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence(data).map(
|r| {
let r: contractNamesReturn = r.into();
r._0
},
)
}
#[inline]
fn abi_decode_returns_validate(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence_validate(
data,
)
.map(|r| {
let r: contractNamesReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `contracts(string)` and selector `0x8c5b8385`.
```solidity
function contracts(string memory) external view returns (address);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractsCall(pub alloy::sol_types::private::String);
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`contracts(string)`](contractsCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct contractsReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::String,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::String,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractsCall> for UnderlyingRustTuple<'_> {
fn from(value: contractsCall) -> Self {
(value.0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractsCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self(tuple.0)
}
}
}
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<contractsReturn> for UnderlyingRustTuple<'_> {
fn from(value: contractsReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for contractsReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for contractsCall {
type Parameters<'a> = (alloy::sol_types::sol_data::String,);
type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::Address;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,);
type ReturnToken<'a> = <Self::ReturnTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "contracts(string)";
const SELECTOR: [u8; 4] = [140u8, 91u8, 131u8, 133u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::String as alloy_sol_types::SolType>::tokenize(
&self.0,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
ret,
),
)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence(data).map(
|r| {
let r: contractsReturn = r.into();
r._0
},
)
}
#[inline]
fn abi_decode_returns_validate(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence_validate(
data,
)
.map(|r| {
let r: contractsReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize, Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `registerContract(string,address)` and selector `0x7f3c2c28`.
```solidity
function registerContract(string memory name, address _contract) external;
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct registerContractCall {
#[allow(missing_docs)]
pub name: alloy::sol_types::private::String,
#[allow(missing_docs)]
pub _contract: alloy::sol_types::private::Address,
}
///Container type for the return parameters of the [`registerContract(string,address)`](registerContractCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct registerContractReturn {}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::String,
alloy::sol_types::sol_data::Address,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::String,
alloy::sol_types::private::Address,
);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<registerContractCall> for UnderlyingRustTuple<'_> {
fn from(value: registerContractCall) -> Self {
(value.name, value._contract)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for registerContractCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
name: tuple.0,
_contract: tuple.1,
}
}
}
}
{
#[doc(hidden)]
type UnderlyingSolTuple<'a> = ();
#[doc(hidden)]
type UnderlyingRustTuple<'a> = ();
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<registerContractReturn> for UnderlyingRustTuple<'_> {
fn from(value: registerContractReturn) -> Self {
()
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for registerContractReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {}
}
}
}
impl registerContractReturn {
fn _tokenize(
&self,
) -> <registerContractCall as alloy_sol_types::SolCall>::ReturnToken<'_> {
()
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for registerContractCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::String,
alloy::sol_types::sol_data::Address,
);
type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
type Return = registerContractReturn;
type ReturnTuple<'a> = ();
type ReturnToken<'a> = <Self::ReturnTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "registerContract(string,address)";
const SELECTOR: [u8; 4] = [127u8, 60u8, 44u8, 40u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::String as alloy_sol_types::SolType>::tokenize(
&self.name,
),
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self._contract,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
registerContractReturn::_tokenize(ret)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence(data)
.map(Into::into)
}
#[inline]
fn abi_decode_returns_validate(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<'_> as alloy_sol_types::SolType>::abi_decode_sequence_validate(
data,
)
.map(Into::into)
}
}
};
///Container for all the [`ContractsRegistry`](self) function calls.
#[derive(serde::Serialize, serde::Deserialize)]
pub enum ContractsRegistryCalls {
#[allow(missing_docs)]
contractCount(contractCountCall),
#[allow(missing_docs)]
contractNames(contractNamesCall),
#[allow(missing_docs)]
contracts(contractsCall),
#[allow(missing_docs)]
registerContract(registerContractCall),
}
#[automatically_derived]
impl ContractsRegistryCalls {
/// All the selectors of this enum.
///
/// Note that the selectors might not be in the same order as the variants.
/// No guarantees are made about the order of the selectors.
///
/// Prefer using `SolInterface` methods instead.
pub const SELECTORS: &'static [[u8; 4usize]] = &[
[60u8, 166u8, 187u8, 146u8],
[127u8, 60u8, 44u8, 40u8],
[135u8, 54u8, 56u8, 26u8],
[140u8, 91u8, 131u8, 133u8],
];
}
#[automatically_derived]
impl alloy_sol_types::SolInterface for ContractsRegistryCalls {
const NAME: &'static str = "ContractsRegistryCalls";
const MIN_DATA_LENGTH: usize = 0usize;
const COUNT: usize = 4usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::contractCount(_) => <contractCountCall as alloy_sol_types::SolCall>::SELECTOR,
Self::contractNames(_) => <contractNamesCall as alloy_sol_types::SolCall>::SELECTOR,
Self::contracts(_) => <contractsCall as alloy_sol_types::SolCall>::SELECTOR,
Self::registerContract(_) => {
<registerContractCall as alloy_sol_types::SolCall>::SELECTOR
}
}
}
#[inline]
fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
Self::SELECTORS.get(i).copied()
}
#[inline]
fn valid_selector(selector: [u8; 4]) -> bool {
Self::SELECTORS.binary_search(&selector).is_ok()
}
#[inline]
#[allow(non_snake_case)]
fn abi_decode_raw(selector: [u8; 4], data: &[u8]) -> alloy_sol_types::Result<Self> {
static DECODE_SHIMS: &[fn(&[u8]) -> alloy_sol_types::Result<ContractsRegistryCalls>] =
&[
{
fn contractNames(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls>
{
<contractNamesCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ContractsRegistryCalls::contractNames)
}
contractNames
},
{
fn registerContract(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls>
{
<registerContractCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ContractsRegistryCalls::registerContract)
}
registerContract
},
{
fn contractCount(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls>
{
<contractCountCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ContractsRegistryCalls::contractCount)
}
contractCount
},
{
fn contracts(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls>
{
<contractsCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ContractsRegistryCalls::contracts)
}
contracts
},
];
let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
return Err(alloy_sol_types::Error::unknown_selector(
<Self as alloy_sol_types::SolInterface>::NAME,
selector,
));
};
DECODE_SHIMS[idx](data)
}
#[inline]
#[allow(non_snake_case)]
fn abi_decode_raw_validate(
selector: [u8; 4],
data: &[u8],
) -> alloy_sol_types::Result<Self> {
static DECODE_VALIDATE_SHIMS: &[fn(
&[u8],
) -> alloy_sol_types::Result<
ContractsRegistryCalls,
>] = &[
{
fn contractNames(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls> {
<contractNamesCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ContractsRegistryCalls::contractNames)
}
contractNames
},
{
fn registerContract(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls> {
<registerContractCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ContractsRegistryCalls::registerContract)
}
registerContract
},
{
fn contractCount(
data: &[u8],
) -> alloy_sol_types::Result<ContractsRegistryCalls> {
<contractCountCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ContractsRegistryCalls::contractCount)
}
contractCount
},
{
fn contracts(data: &[u8]) -> alloy_sol_types::Result<ContractsRegistryCalls> {
<contractsCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(data)
.map(ContractsRegistryCalls::contracts)
}
contracts
},
];
let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
return Err(alloy_sol_types::Error::unknown_selector(
<Self as alloy_sol_types::SolInterface>::NAME,
selector,
));
};
DECODE_VALIDATE_SHIMS[idx](data)
}
#[inline]
fn abi_encoded_size(&self) -> usize {
match self {
Self::contractCount(inner) => {
<contractCountCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
}
Self::contractNames(inner) => {
<contractNamesCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
}
Self::contracts(inner) => {
<contractsCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
}
Self::registerContract(inner) => {
<registerContractCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
}
}
}
#[inline]
fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
match self {
Self::contractCount(inner) => {
<contractCountCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
}
Self::contractNames(inner) => {
<contractNamesCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
}
Self::contracts(inner) => {
<contractsCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
}
Self::registerContract(inner) => {
<registerContractCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
}
}
}
}
use alloy::contract as alloy_contract;
/**Creates a new wrapper around an on-chain [`ContractsRegistry`](self) contract instance.
See the [wrapper's documentation](`ContractsRegistryInstance`) for more details.*/
#[inline]
pub const fn new<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(
address: alloy_sol_types::private::Address,
provider: P,
) -> ContractsRegistryInstance<P, N> {
ContractsRegistryInstance::<P, N>::new(address, provider)
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[inline]
pub fn deploy<P: alloy_contract::private::Provider<N>, N: alloy_contract::private::Network>(
provider: P,
) -> impl ::core::future::Future<Output = alloy_contract::Result<ContractsRegistryInstance<P, N>>>
{
ContractsRegistryInstance::<P, N>::deploy(provider)
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(
provider: P,
) -> alloy_contract::RawCallBuilder<P, N> {
ContractsRegistryInstance::<P, N>::deploy_builder(provider)
}
/**A [`ContractsRegistry`](self) instance.
Contains type-safe methods for interacting with an on-chain instance of the
[`ContractsRegistry`](self) contract located at a given `address`, using a given
provider `P`.
If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
documentation on how to provide it), the `deploy` and `deploy_builder` methods can
be used to deploy a new instance of the contract.
See the [module-level documentation](self) for all the available methods.*/
#[derive(Clone)]
pub struct ContractsRegistryInstance<P, N = alloy_contract::private::Ethereum> {
address: alloy_sol_types::private::Address,
provider: P,
_network: ::core::marker::PhantomData<N>,
}
#[automatically_derived]
impl<P, N> ::core::fmt::Debug for ContractsRegistryInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("ContractsRegistryInstance")
.field(&self.address)
.finish()
}
}
/// Instantiation and getters/setters.
#[automatically_derived]
impl<P: alloy_contract::private::Provider<N>, N: alloy_contract::private::Network>
ContractsRegistryInstance<P, N>
{
/**Creates a new wrapper around an on-chain [`ContractsRegistry`](self) contract instance.
See the [wrapper's documentation](`ContractsRegistryInstance`) for more details.*/
#[inline]
pub const fn new(address: alloy_sol_types::private::Address, provider: P) -> Self {
Self {
address,
provider,
_network: ::core::marker::PhantomData,
}
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[inline]
pub async fn deploy(
provider: P,
) -> alloy_contract::Result<ContractsRegistryInstance<P, N>> {
let call_builder = Self::deploy_builder(provider);
let contract_address = call_builder.deploy().await?;
Ok(Self::new(contract_address, call_builder.provider))
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
alloy_contract::RawCallBuilder::new_raw_deploy(
provider,
::core::clone::Clone::clone(&BYTECODE),
)
}
/// Returns a reference to the address.
#[inline]
pub const fn address(&self) -> &alloy_sol_types::private::Address {
&self.address
}
/// Sets the address.
#[inline]
pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
self.address = address;
}
/// Sets the address and returns `self`.
pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
self.set_address(address);
self
}
/// Returns a reference to the provider.
#[inline]
pub const fn provider(&self) -> &P {
&self.provider
}
}
impl<P: ::core::clone::Clone, N> ContractsRegistryInstance<&P, N> {
/// Clones the provider and returns a new instance with the cloned provider.
#[inline]
pub fn with_cloned_provider(self) -> ContractsRegistryInstance<P, N> {
ContractsRegistryInstance {
address: self.address,
provider: ::core::clone::Clone::clone(&self.provider),
_network: ::core::marker::PhantomData,
}
}
}
/// Function calls.
#[automatically_derived]
impl<P: alloy_contract::private::Provider<N>, N: alloy_contract::private::Network>
ContractsRegistryInstance<P, N>
{
/// Creates a new call builder using this contract instance's provider and address.
///
/// Note that the call can be any function call, not just those defined in this
/// contract. Prefer using the other methods for building type-safe contract calls.
pub fn call_builder<C: alloy_sol_types::SolCall>(
&self,
call: &C,
) -> alloy_contract::SolCallBuilder<&P, C, N> {
alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
}
///Creates a new call builder for the [`contractCount`] function.
pub fn contractCount(&self) -> alloy_contract::SolCallBuilder<&P, contractCountCall, N> {
self.call_builder(&contractCountCall)
}
///Creates a new call builder for the [`contractNames`] function.
pub fn contractNames(
&self,
_0: alloy::sol_types::private::primitives::aliases::U256,
) -> alloy_contract::SolCallBuilder<&P, contractNamesCall, N> {
self.call_builder(&contractNamesCall(_0))
}
///Creates a new call builder for the [`contracts`] function.
pub fn contracts(
&self,
_0: alloy::sol_types::private::String,
) -> alloy_contract::SolCallBuilder<&P, contractsCall, N> {
self.call_builder(&contractsCall(_0))
}
///Creates a new call builder for the [`registerContract`] function.
pub fn registerContract(
&self,
name: alloy::sol_types::private::String,
_contract: alloy::sol_types::private::Address,
) -> alloy_contract::SolCallBuilder<&P, registerContractCall, N> {
self.call_builder(®isterContractCall { name, _contract })
}
}
/// Event filters.
#[automatically_derived]
impl<P: alloy_contract::private::Provider<N>, N: alloy_contract::private::Network>
ContractsRegistryInstance<P, N>
{
/// Creates a new event filter using this contract instance's provider and address.
///
/// Note that the type can be any event, not just those defined in this contract.
/// Prefer using the other methods for building type-safe event filters.
pub fn event_filter<E: alloy_sol_types::SolEvent>(
&self,
) -> alloy_contract::Event<&P, E, N> {
alloy_contract::Event::new_sol(&self.provider, &self.address)
}
}
}