/**
Generated by the following Solidity interface...
```solidity
interface ExternalLibMerkle32 {
function merkleRoot(bytes32[] memory leaves, uint256 height) external pure returns (bytes32);
function merkleRootAfterReplacement(bytes32[] memory sibs, uint256 index, bytes32 leaf) external pure returns (bytes32);
function siblings(bytes32[] memory leaves, uint256 index, uint256 height) external pure returns (bytes32[] memory);
}
```
...which was generated by the following JSON ABI:
```json
[
{
"type": "function",
"name": "merkleRoot",
"inputs": [
{
"name": "leaves",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{
"name": "height",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "merkleRootAfterReplacement",
"inputs": [
{
"name": "sibs",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "siblings",
"inputs": [
{
"name": "leaves",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "height",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32[]",
"internalType": "bytes32[]"
}
],
"stateMutability": "pure"
}
]
```*/
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod ExternalLibMerkle32 {
use super::*;
use alloy::sol_types as alloy_sol_types;
/// The creation / init bytecode of the contract.
///
/// ```text
///0x608080604052346019576104ef908161001e823930815050f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80635f2d1f8d146101be5780639af7ce9b146100cb5763a8cdd8e61461003a575f80fd5b60603660031901126100c75760043567ffffffffffffffff81116100c757610066903690600401610241565b5f6024356044355b838310156100b3578260051b8501359060018316155f146100a1575f52602052600160405f20915b811c9201919061006e565b905f52602052600160405f2091610096565b6100bf602092156103a6565b604051908152f35b5f80fd5b60603660031901126100c75760043567ffffffffffffffff81116100c7576100fa610104913690600401610241565b60443592916102c4565b6024359061011183610356565b925f905f905b80821061017b578561013760018661012f89156103a6565b51111561030a565b6040518091602082016020835281518091526020604084019201905f5b818110610162575050500390f35b8251845285945060209384019390920191600101610154565b91939092846101a2916101928260018618836104a1565b61019c878a61037e565b526103f1565b93805f52602052600160405f2091811c93019091939293610117565b60403660031901126100c75760043567ffffffffffffffff81116100c7576101ed6101f7913690600401610241565b60243592916102c4565b5f915f905b80821061021d5760206100bf858561021860018251111561030a565b610483565b909183610229916103f1565b92805f52602052600160405f209201909291926101fc565b9181601f840112156100c75782359167ffffffffffffffff83116100c7576020808501948460051b0101116100c757565b6040519190601f01601f1916820167ffffffffffffffff81118382101761029857604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116102985760051b60200190565b6102d56102d0836102ac565b610272565b91602083828152019060051b8201913683116100c757905b8282106102fa5750505090565b81358152602091820191016102ed565b1561031157565b60405162461bcd60e51b815260206004820152601c60248201527f4c69624d65726b6c6533323a20746f6f206d616e79206c6561766573000000006044820152606490fd5b906103636102d0836102ac565b8281528092610374601f19916102ac565b0190602036910137565b80518210156103925760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b156103ad57565b606460405162461bcd60e51b815260206004820152602060248201527f4c69624d65726b6c6533323a20696e646578206f7574206f6620626f756e64736044820152fd5b80516001810180911161046f5760011c61040a81610356565b925f5b82811061041b575050505090565b600181901b906001600160ff1b038116810361046f5761043b828661037e565b516001830180931161046f5761045484600194886104a1565b905f5260205260405f20610468828861037e565b520161040d565b634e487b7160e01b5f52601160045260245ffd5b80519091901561049c57505f6104989161037e565b5190565b905090565b80518210156104b457610498925061037e565b50509056fea26469706673582212208417ff67092d1c55826a4883d3827a7226056f8beae23f323c548e4a1fd9b4c464736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80\x80`@R4`\x19Wa\x04\xEF\x90\x81a\0\x1E\x8290\x81PP\xF3[_\x80\xFD\xFE`\x80`@R`\x046\x10\x15a\0\x11W_\x80\xFD[_5`\xE0\x1C\x80c_-\x1F\x8D\x14a\x01\xBEW\x80c\x9A\xF7\xCE\x9B\x14a\0\xCBWc\xA8\xCD\xD8\xE6\x14a\0:W_\x80\xFD[``6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\0f\x906\x90`\x04\x01a\x02AV[_`$5`D5[\x83\x83\x10\x15a\0\xB3W\x82`\x05\x1B\x85\x015\x90`\x01\x83\x16\x15_\x14a\0\xA1W_R` R`\x01`@_ \x91[\x81\x1C\x92\x01\x91\x90a\0nV[\x90_R` R`\x01`@_ \x91a\0\x96V[a\0\xBF` \x92\x15a\x03\xA6V[`@Q\x90\x81R\xF3[_\x80\xFD[``6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\0\xFAa\x01\x04\x916\x90`\x04\x01a\x02AV[`D5\x92\x91a\x02\xC4V[`$5\x90a\x01\x11\x83a\x03VV[\x92_\x90_\x90[\x80\x82\x10a\x01{W\x85a\x017`\x01\x86a\x01/\x89\x15a\x03\xA6V[Q\x11\x15a\x03\nV[`@Q\x80\x91` \x82\x01` \x83R\x81Q\x80\x91R` `@\x84\x01\x92\x01\x90_[\x81\x81\x10a\x01bWPPP\x03\x90\xF3[\x82Q\x84R\x85\x94P` \x93\x84\x01\x93\x90\x92\x01\x91`\x01\x01a\x01TV[\x91\x93\x90\x92\x84a\x01\xA2\x91a\x01\x92\x82`\x01\x86\x18\x83a\x04\xA1V[a\x01\x9C\x87\x8Aa\x03~V[Ra\x03\xF1V[\x93\x80_R` R`\x01`@_ \x91\x81\x1C\x93\x01\x90\x91\x93\x92\x93a\x01\x17V[`@6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\x01\xEDa\x01\xF7\x916\x90`\x04\x01a\x02AV[`$5\x92\x91a\x02\xC4V[_\x91_\x90[\x80\x82\x10a\x02\x1DW` a\0\xBF\x85\x85a\x02\x18`\x01\x82Q\x11\x15a\x03\nV[a\x04\x83V[\x90\x91\x83a\x02)\x91a\x03\xF1V[\x92\x80_R` R`\x01`@_ \x92\x01\x90\x92\x91\x92a\x01\xFCV[\x91\x81`\x1F\x84\x01\x12\x15a\0\xC7W\x825\x91g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83\x11a\0\xC7W` \x80\x85\x01\x94\x84`\x05\x1B\x01\x01\x11a\0\xC7WV[`@Q\x91\x90`\x1F\x01`\x1F\x19\x16\x82\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x83\x82\x10\x17a\x02\x98W`@RV[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\x02\x98W`\x05\x1B` \x01\x90V[a\x02\xD5a\x02\xD0\x83a\x02\xACV[a\x02rV[\x91` \x83\x82\x81R\x01\x90`\x05\x1B\x82\x01\x916\x83\x11a\0\xC7W\x90[\x82\x82\x10a\x02\xFAWPPP\x90V[\x815\x81R` \x91\x82\x01\x91\x01a\x02\xEDV[\x15a\x03\x11WV[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1C`$\x82\x01R\x7FLibMerkle32: too many leaves\0\0\0\0`D\x82\x01R`d\x90\xFD[\x90a\x03ca\x02\xD0\x83a\x02\xACV[\x82\x81R\x80\x92a\x03t`\x1F\x19\x91a\x02\xACV[\x01\x90` 6\x91\x017V[\x80Q\x82\x10\x15a\x03\x92W` \x91`\x05\x1B\x01\x01\x90V[cNH{q`\xE0\x1B_R`2`\x04R`$_\xFD[\x15a\x03\xADWV[`d`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R` `$\x82\x01R\x7FLibMerkle32: index out of bounds`D\x82\x01R\xFD[\x80Q`\x01\x81\x01\x80\x91\x11a\x04oW`\x01\x1Ca\x04\n\x81a\x03VV[\x92_[\x82\x81\x10a\x04\x1BWPPPP\x90V[`\x01\x81\x90\x1B\x90`\x01`\x01`\xFF\x1B\x03\x81\x16\x81\x03a\x04oWa\x04;\x82\x86a\x03~V[Q`\x01\x83\x01\x80\x93\x11a\x04oWa\x04T\x84`\x01\x94\x88a\x04\xA1V[\x90_R` R`@_ a\x04h\x82\x88a\x03~V[R\x01a\x04\rV[cNH{q`\xE0\x1B_R`\x11`\x04R`$_\xFD[\x80Q\x90\x91\x90\x15a\x04\x9CWP_a\x04\x98\x91a\x03~V[Q\x90V[\x90P\x90V[\x80Q\x82\x10\x15a\x04\xB4Wa\x04\x98\x92Pa\x03~V[PP\x90V\xFE\xA2dipfsX\"\x12 \x84\x17\xFFg\t-\x1CU\x82jH\x83\xD3\x82zr&\x05o\x8B\xEA\xE2?2<T\x8EJ\x1F\xD9\xB4\xC4dsolcC\0\x08\x1E\x003",
);
/// The runtime bytecode of the contract, as deployed on the network.
///
/// ```text
///0x60806040526004361015610011575f80fd5b5f3560e01c80635f2d1f8d146101be5780639af7ce9b146100cb5763a8cdd8e61461003a575f80fd5b60603660031901126100c75760043567ffffffffffffffff81116100c757610066903690600401610241565b5f6024356044355b838310156100b3578260051b8501359060018316155f146100a1575f52602052600160405f20915b811c9201919061006e565b905f52602052600160405f2091610096565b6100bf602092156103a6565b604051908152f35b5f80fd5b60603660031901126100c75760043567ffffffffffffffff81116100c7576100fa610104913690600401610241565b60443592916102c4565b6024359061011183610356565b925f905f905b80821061017b578561013760018661012f89156103a6565b51111561030a565b6040518091602082016020835281518091526020604084019201905f5b818110610162575050500390f35b8251845285945060209384019390920191600101610154565b91939092846101a2916101928260018618836104a1565b61019c878a61037e565b526103f1565b93805f52602052600160405f2091811c93019091939293610117565b60403660031901126100c75760043567ffffffffffffffff81116100c7576101ed6101f7913690600401610241565b60243592916102c4565b5f915f905b80821061021d5760206100bf858561021860018251111561030a565b610483565b909183610229916103f1565b92805f52602052600160405f209201909291926101fc565b9181601f840112156100c75782359167ffffffffffffffff83116100c7576020808501948460051b0101116100c757565b6040519190601f01601f1916820167ffffffffffffffff81118382101761029857604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff81116102985760051b60200190565b6102d56102d0836102ac565b610272565b91602083828152019060051b8201913683116100c757905b8282106102fa5750505090565b81358152602091820191016102ed565b1561031157565b60405162461bcd60e51b815260206004820152601c60248201527f4c69624d65726b6c6533323a20746f6f206d616e79206c6561766573000000006044820152606490fd5b906103636102d0836102ac565b8281528092610374601f19916102ac565b0190602036910137565b80518210156103925760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b156103ad57565b606460405162461bcd60e51b815260206004820152602060248201527f4c69624d65726b6c6533323a20696e646578206f7574206f6620626f756e64736044820152fd5b80516001810180911161046f5760011c61040a81610356565b925f5b82811061041b575050505090565b600181901b906001600160ff1b038116810361046f5761043b828661037e565b516001830180931161046f5761045484600194886104a1565b905f5260205260405f20610468828861037e565b520161040d565b634e487b7160e01b5f52601160045260245ffd5b80519091901561049c57505f6104989161037e565b5190565b905090565b80518210156104b457610498925061037e565b50509056fea26469706673582212208417ff67092d1c55826a4883d3827a7226056f8beae23f323c548e4a1fd9b4c464736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80`@R`\x046\x10\x15a\0\x11W_\x80\xFD[_5`\xE0\x1C\x80c_-\x1F\x8D\x14a\x01\xBEW\x80c\x9A\xF7\xCE\x9B\x14a\0\xCBWc\xA8\xCD\xD8\xE6\x14a\0:W_\x80\xFD[``6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\0f\x906\x90`\x04\x01a\x02AV[_`$5`D5[\x83\x83\x10\x15a\0\xB3W\x82`\x05\x1B\x85\x015\x90`\x01\x83\x16\x15_\x14a\0\xA1W_R` R`\x01`@_ \x91[\x81\x1C\x92\x01\x91\x90a\0nV[\x90_R` R`\x01`@_ \x91a\0\x96V[a\0\xBF` \x92\x15a\x03\xA6V[`@Q\x90\x81R\xF3[_\x80\xFD[``6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\0\xFAa\x01\x04\x916\x90`\x04\x01a\x02AV[`D5\x92\x91a\x02\xC4V[`$5\x90a\x01\x11\x83a\x03VV[\x92_\x90_\x90[\x80\x82\x10a\x01{W\x85a\x017`\x01\x86a\x01/\x89\x15a\x03\xA6V[Q\x11\x15a\x03\nV[`@Q\x80\x91` \x82\x01` \x83R\x81Q\x80\x91R` `@\x84\x01\x92\x01\x90_[\x81\x81\x10a\x01bWPPP\x03\x90\xF3[\x82Q\x84R\x85\x94P` \x93\x84\x01\x93\x90\x92\x01\x91`\x01\x01a\x01TV[\x91\x93\x90\x92\x84a\x01\xA2\x91a\x01\x92\x82`\x01\x86\x18\x83a\x04\xA1V[a\x01\x9C\x87\x8Aa\x03~V[Ra\x03\xF1V[\x93\x80_R` R`\x01`@_ \x91\x81\x1C\x93\x01\x90\x91\x93\x92\x93a\x01\x17V[`@6`\x03\x19\x01\x12a\0\xC7W`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\0\xC7Wa\x01\xEDa\x01\xF7\x916\x90`\x04\x01a\x02AV[`$5\x92\x91a\x02\xC4V[_\x91_\x90[\x80\x82\x10a\x02\x1DW` a\0\xBF\x85\x85a\x02\x18`\x01\x82Q\x11\x15a\x03\nV[a\x04\x83V[\x90\x91\x83a\x02)\x91a\x03\xF1V[\x92\x80_R` R`\x01`@_ \x92\x01\x90\x92\x91\x92a\x01\xFCV[\x91\x81`\x1F\x84\x01\x12\x15a\0\xC7W\x825\x91g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83\x11a\0\xC7W` \x80\x85\x01\x94\x84`\x05\x1B\x01\x01\x11a\0\xC7WV[`@Q\x91\x90`\x1F\x01`\x1F\x19\x16\x82\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x83\x82\x10\x17a\x02\x98W`@RV[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11a\x02\x98W`\x05\x1B` \x01\x90V[a\x02\xD5a\x02\xD0\x83a\x02\xACV[a\x02rV[\x91` \x83\x82\x81R\x01\x90`\x05\x1B\x82\x01\x916\x83\x11a\0\xC7W\x90[\x82\x82\x10a\x02\xFAWPPP\x90V[\x815\x81R` \x91\x82\x01\x91\x01a\x02\xEDV[\x15a\x03\x11WV[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1C`$\x82\x01R\x7FLibMerkle32: too many leaves\0\0\0\0`D\x82\x01R`d\x90\xFD[\x90a\x03ca\x02\xD0\x83a\x02\xACV[\x82\x81R\x80\x92a\x03t`\x1F\x19\x91a\x02\xACV[\x01\x90` 6\x91\x017V[\x80Q\x82\x10\x15a\x03\x92W` \x91`\x05\x1B\x01\x01\x90V[cNH{q`\xE0\x1B_R`2`\x04R`$_\xFD[\x15a\x03\xADWV[`d`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R` `$\x82\x01R\x7FLibMerkle32: index out of bounds`D\x82\x01R\xFD[\x80Q`\x01\x81\x01\x80\x91\x11a\x04oW`\x01\x1Ca\x04\n\x81a\x03VV[\x92_[\x82\x81\x10a\x04\x1BWPPPP\x90V[`\x01\x81\x90\x1B\x90`\x01`\x01`\xFF\x1B\x03\x81\x16\x81\x03a\x04oWa\x04;\x82\x86a\x03~V[Q`\x01\x83\x01\x80\x93\x11a\x04oWa\x04T\x84`\x01\x94\x88a\x04\xA1V[\x90_R` R`@_ a\x04h\x82\x88a\x03~V[R\x01a\x04\rV[cNH{q`\xE0\x1B_R`\x11`\x04R`$_\xFD[\x80Q\x90\x91\x90\x15a\x04\x9CWP_a\x04\x98\x91a\x03~V[Q\x90V[\x90P\x90V[\x80Q\x82\x10\x15a\x04\xB4Wa\x04\x98\x92Pa\x03~V[PP\x90V\xFE\xA2dipfsX\"\x12 \x84\x17\xFFg\t-\x1CU\x82jH\x83\xD3\x82zr&\x05o\x8B\xEA\xE2?2<T\x8EJ\x1F\xD9\xB4\xC4dsolcC\0\x08\x1E\x003",
);
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `merkleRoot(bytes32[],uint256)` and selector `0x5f2d1f8d`.
```solidity
function merkleRoot(bytes32[] memory leaves, uint256 height) external pure returns (bytes32);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct merkleRootCall {
#[allow(missing_docs)]
pub leaves: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
#[allow(missing_docs)]
pub height: alloy::sol_types::private::primitives::aliases::U256,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`merkleRoot(bytes32[],uint256)`](merkleRootCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct merkleRootReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::FixedBytes<32>,
}
#[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)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
alloy::sol_types::sol_data::Uint<256>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
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<merkleRootCall> for UnderlyingRustTuple<'_> {
fn from(value: merkleRootCall) -> Self {
(value.leaves, value.height)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for merkleRootCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
leaves: tuple.0,
height: tuple.1,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,);
#[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<merkleRootReturn> for UnderlyingRustTuple<'_> {
fn from(value: merkleRootReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for merkleRootReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for merkleRootCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
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::FixedBytes<32>;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "merkleRoot(bytes32[],uint256)";
const SELECTOR: [u8; 4] = [95u8, 45u8, 31u8, 141u8];
#[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::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
> as alloy_sol_types::SolType>::tokenize(&self.leaves),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.height),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::FixedBytes<
32,
> 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: merkleRootReturn = 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: merkleRootReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `merkleRootAfterReplacement(bytes32[],uint256,bytes32)` and selector `0xa8cdd8e6`.
```solidity
function merkleRootAfterReplacement(bytes32[] memory sibs, uint256 index, bytes32 leaf) external pure returns (bytes32);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct merkleRootAfterReplacementCall {
#[allow(missing_docs)]
pub sibs: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
#[allow(missing_docs)]
pub index: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub leaf: alloy::sol_types::private::FixedBytes<32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`merkleRootAfterReplacement(bytes32[],uint256,bytes32)`](merkleRootAfterReplacementCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct merkleRootAfterReplacementReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::FixedBytes<32>,
}
#[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)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
alloy::sol_types::private::primitives::aliases::U256,
alloy::sol_types::private::FixedBytes<32>,
);
#[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<merkleRootAfterReplacementCall>
for UnderlyingRustTuple<'_> {
fn from(value: merkleRootAfterReplacementCall) -> Self {
(value.sibs, value.index, value.leaf)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for merkleRootAfterReplacementCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
sibs: tuple.0,
index: tuple.1,
leaf: tuple.2,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,);
#[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<merkleRootAfterReplacementReturn>
for UnderlyingRustTuple<'_> {
fn from(value: merkleRootAfterReplacementReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for merkleRootAfterReplacementReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for merkleRootAfterReplacementCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::FixedBytes<32>;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "merkleRootAfterReplacement(bytes32[],uint256,bytes32)";
const SELECTOR: [u8; 4] = [168u8, 205u8, 216u8, 230u8];
#[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::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
> as alloy_sol_types::SolType>::tokenize(&self.sibs),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.index),
<alloy::sol_types::sol_data::FixedBytes<
32,
> as alloy_sol_types::SolType>::tokenize(&self.leaf),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::FixedBytes<
32,
> 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: merkleRootAfterReplacementReturn = 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: merkleRootAfterReplacementReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `siblings(bytes32[],uint256,uint256)` and selector `0x9af7ce9b`.
```solidity
function siblings(bytes32[] memory leaves, uint256 index, uint256 height) external pure returns (bytes32[] memory);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct siblingsCall {
#[allow(missing_docs)]
pub leaves: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
#[allow(missing_docs)]
pub index: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub height: alloy::sol_types::private::primitives::aliases::U256,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`siblings(bytes32[],uint256,uint256)`](siblingsCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct siblingsReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
}
#[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)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::Uint<256>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
alloy::sol_types::private::primitives::aliases::U256,
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<siblingsCall> for UnderlyingRustTuple<'_> {
fn from(value: siblingsCall) -> Self {
(value.leaves, value.index, value.height)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for siblingsCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
leaves: tuple.0,
index: tuple.1,
height: tuple.2,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
);
#[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<siblingsReturn> for UnderlyingRustTuple<'_> {
fn from(value: siblingsReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for siblingsReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for siblingsCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
alloy::sol_types::sol_data::Uint<256>,
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::Vec<
alloy::sol_types::private::FixedBytes<32>,
>;
type ReturnTuple<'a> = (
alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
>,
);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "siblings(bytes32[],uint256,uint256)";
const SELECTOR: [u8; 4] = [154u8, 247u8, 206u8, 155u8];
#[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::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
> as alloy_sol_types::SolType>::tokenize(&self.leaves),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.index),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.height),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::FixedBytes<32>,
> 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: siblingsReturn = 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: siblingsReturn = r.into();
r._0
})
}
}
};
///Container for all the [`ExternalLibMerkle32`](self) function calls.
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive()]
pub enum ExternalLibMerkle32Calls {
#[allow(missing_docs)]
merkleRoot(merkleRootCall),
#[allow(missing_docs)]
merkleRootAfterReplacement(merkleRootAfterReplacementCall),
#[allow(missing_docs)]
siblings(siblingsCall),
}
impl ExternalLibMerkle32Calls {
/// 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]] = &[
[95u8, 45u8, 31u8, 141u8],
[154u8, 247u8, 206u8, 155u8],
[168u8, 205u8, 216u8, 230u8],
];
/// The names of the variants in the same order as `SELECTORS`.
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(merkleRoot),
::core::stringify!(siblings),
::core::stringify!(merkleRootAfterReplacement),
];
/// The signatures in the same order as `SELECTORS`.
pub const SIGNATURES: &'static [&'static str] = &[
<merkleRootCall as alloy_sol_types::SolCall>::SIGNATURE,
<siblingsCall as alloy_sol_types::SolCall>::SIGNATURE,
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::SIGNATURE,
];
/// Returns the signature for the given selector, if known.
#[inline]
pub fn signature_by_selector(
selector: [u8; 4usize],
) -> ::core::option::Option<&'static str> {
match Self::SELECTORS.binary_search(&selector) {
::core::result::Result::Ok(idx) => {
::core::option::Option::Some(Self::SIGNATURES[idx])
}
::core::result::Result::Err(_) => ::core::option::Option::None,
}
}
/// Returns the enum variant name for the given selector, if known.
#[inline]
pub fn name_by_selector(
selector: [u8; 4usize],
) -> ::core::option::Option<&'static str> {
let sig = Self::signature_by_selector(selector)?;
sig.split_once('(').map(|(name, _)| name)
}
}
#[automatically_derived]
impl alloy_sol_types::SolInterface for ExternalLibMerkle32Calls {
const NAME: &'static str = "ExternalLibMerkle32Calls";
const MIN_DATA_LENGTH: usize = 96usize;
const COUNT: usize = 3usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::merkleRoot(_) => {
<merkleRootCall as alloy_sol_types::SolCall>::SELECTOR
}
Self::merkleRootAfterReplacement(_) => {
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::SELECTOR
}
Self::siblings(_) => <siblingsCall 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<ExternalLibMerkle32Calls>] = &[
{
fn merkleRoot(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<merkleRootCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(ExternalLibMerkle32Calls::merkleRoot)
}
merkleRoot
},
{
fn siblings(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<siblingsCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ExternalLibMerkle32Calls::siblings)
}
siblings
},
{
fn merkleRootAfterReplacement(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(ExternalLibMerkle32Calls::merkleRootAfterReplacement)
}
merkleRootAfterReplacement
},
];
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<ExternalLibMerkle32Calls>] = &[
{
fn merkleRoot(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<merkleRootCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ExternalLibMerkle32Calls::merkleRoot)
}
merkleRoot
},
{
fn siblings(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<siblingsCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ExternalLibMerkle32Calls::siblings)
}
siblings
},
{
fn merkleRootAfterReplacement(
data: &[u8],
) -> alloy_sol_types::Result<ExternalLibMerkle32Calls> {
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ExternalLibMerkle32Calls::merkleRootAfterReplacement)
}
merkleRootAfterReplacement
},
];
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::merkleRoot(inner) => {
<merkleRootCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
}
Self::merkleRootAfterReplacement(inner) => {
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
Self::siblings(inner) => {
<siblingsCall 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::merkleRoot(inner) => {
<merkleRootCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::merkleRootAfterReplacement(inner) => {
<merkleRootAfterReplacementCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::siblings(inner) => {
<siblingsCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
}
}
}
use alloy::contract as alloy_contract;
/**Creates a new wrapper around an on-chain [`ExternalLibMerkle32`](self) contract instance.
See the [wrapper's documentation](`ExternalLibMerkle32Instance`) 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,
) -> ExternalLibMerkle32Instance<P, N> {
ExternalLibMerkle32Instance::<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<ExternalLibMerkle32Instance<P, N>>,
> {
ExternalLibMerkle32Instance::<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> {
ExternalLibMerkle32Instance::<P, N>::deploy_builder(__provider)
}
/**A [`ExternalLibMerkle32`](self) instance.
Contains type-safe methods for interacting with an on-chain instance of the
[`ExternalLibMerkle32`](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 ExternalLibMerkle32Instance<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 ExternalLibMerkle32Instance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("ExternalLibMerkle32Instance").field(&self.address).finish()
}
}
/// Instantiation and getters/setters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ExternalLibMerkle32Instance<P, N> {
/**Creates a new wrapper around an on-chain [`ExternalLibMerkle32`](self) contract instance.
See the [wrapper's documentation](`ExternalLibMerkle32Instance`) for more details.*/
#[inline]
pub const fn new(
address: alloy_sol_types::private::Address,
__provider: P,
) -> Self {
Self {
address,
provider: __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<ExternalLibMerkle32Instance<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> ExternalLibMerkle32Instance<&P, N> {
/// Clones the provider and returns a new instance with the cloned provider.
#[inline]
pub fn with_cloned_provider(self) -> ExternalLibMerkle32Instance<P, N> {
ExternalLibMerkle32Instance {
address: self.address,
provider: ::core::clone::Clone::clone(&self.provider),
_network: ::core::marker::PhantomData,
}
}
}
/// Function calls.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ExternalLibMerkle32Instance<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 [`merkleRoot`] function.
pub fn merkleRoot(
&self,
leaves: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
height: alloy::sol_types::private::primitives::aliases::U256,
) -> alloy_contract::SolCallBuilder<&P, merkleRootCall, N> {
self.call_builder(&merkleRootCall { leaves, height })
}
///Creates a new call builder for the [`merkleRootAfterReplacement`] function.
pub fn merkleRootAfterReplacement(
&self,
sibs: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
index: alloy::sol_types::private::primitives::aliases::U256,
leaf: alloy::sol_types::private::FixedBytes<32>,
) -> alloy_contract::SolCallBuilder<&P, merkleRootAfterReplacementCall, N> {
self.call_builder(
&merkleRootAfterReplacementCall {
sibs,
index,
leaf,
},
)
}
///Creates a new call builder for the [`siblings`] function.
pub fn siblings(
&self,
leaves: alloy::sol_types::private::Vec<
alloy::sol_types::private::FixedBytes<32>,
>,
index: alloy::sol_types::private::primitives::aliases::U256,
height: alloy::sol_types::private::primitives::aliases::U256,
) -> alloy_contract::SolCallBuilder<&P, siblingsCall, N> {
self.call_builder(
&siblingsCall {
leaves,
index,
height,
},
)
}
}
/// Event filters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ExternalLibMerkle32Instance<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)
}
}
}