From 29b6ddf10cf5a15350a56f945c29d9d9f842e43c Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Mon, 4 Nov 2024 19:18:29 +0800 Subject: [PATCH 1/6] Add mapping of mappings test cases to the integration test. --- .../leaf_mapping_of_mappings.rs | 2 +- mp2-v1/test-contracts/src/Simple.sol | 69 +- mp2-v1/tests/common/bindings/simple.rs | 2231 ++++++++++++++--- mp2-v1/tests/common/cases/contract.rs | 171 +- mp2-v1/tests/common/cases/indexing.rs | 273 +- mp2-v1/tests/common/cases/mod.rs | 2 +- mp2-v1/tests/common/cases/slot_info.rs | 296 +++ .../tests/common/cases/storage_slot_value.rs | 197 -- mp2-v1/tests/common/cases/table_source.rs | 277 +- mp2-v1/tests/common/mod.rs | 18 + mp2-v1/tests/common/storage_trie.rs | 28 +- mp2-v1/tests/integrated_tests.rs | 26 + 12 files changed, 2955 insertions(+), 635 deletions(-) create mode 100644 mp2-v1/tests/common/cases/slot_info.rs delete mode 100644 mp2-v1/tests/common/cases/storage_slot_value.rs diff --git a/mp2-v1/src/values_extraction/leaf_mapping_of_mappings.rs b/mp2-v1/src/values_extraction/leaf_mapping_of_mappings.rs index b51aa25a8..dafb3dad4 100644 --- a/mp2-v1/src/values_extraction/leaf_mapping_of_mappings.rs +++ b/mp2-v1/src/values_extraction/leaf_mapping_of_mappings.rs @@ -186,9 +186,9 @@ where .collect(); let hash = b.hash_n_to_hash_no_pad::(inputs); let row_id = hash_to_int_target(b, hash); - let row_id = b.biguint_to_nonnative(&row_id); // values_digest = values_digest * row_id + let row_id = b.biguint_to_nonnative(&row_id); let values_digest = b.curve_scalar_mul(values_digest, &row_id); // Only one leaf in this node. diff --git a/mp2-v1/test-contracts/src/Simple.sol b/mp2-v1/test-contracts/src/Simple.sol index c7cea6fea..aa9538659 100644 --- a/mp2-v1/test-contracts/src/Simple.sol +++ b/mp2-v1/test-contracts/src/Simple.sol @@ -22,6 +22,22 @@ contract Simple { MappingOperation operation; } + struct MappingOfSingleValueMappingsChange { + uint256 outerKey; + uint256 innerKey; + uint256 value; + MappingOperation operation; + } + + struct MappingOfStructMappingsChange { + uint256 outerKey; + uint256 innerKey; + uint256 field1; + uint128 field2; + uint128 field3; + MappingOperation operation; + } + struct LargeStruct { // This field should live in one EVM word uint256 field1; @@ -48,9 +64,13 @@ contract Simple { // Test mapping struct (slot 8) mapping(uint256 => LargeStruct) public structMapping; - // Test mapping of mappings (slot 9) + // Test mapping of single value mappings (slot 9) + mapping(uint256 => mapping(uint256 => uint256)) + public mappingOfSingleValueMappings; + + // Test mapping of struct mappings (slot 10) mapping(uint256 => mapping(uint256 => LargeStruct)) - public mappingOfMappings; + public mappingOfStructMappings; // Set the simple slots. function setSimples( @@ -125,4 +145,49 @@ contract Simple { } } + // Set mapping of single value mappings. + function setMappingOfSingleValueMappings( + uint256 outerKey, + uint256 innerKey, + uint256 value + ) public { + mappingOfSingleValueMappings[outerKey][innerKey] = value; + } + + function changeMappingOfSingleValueMappings(MappingOfSingleValueMappingsChange[] memory changes) public { + for (uint256 i = 0; i < changes.length; i++) { + if (changes[i].operation == MappingOperation.Deletion) { + delete mappingOfSingleValueMappings[changes[i].outerKey][changes[i].innerKey]; + } else if ( + changes[i].operation == MappingOperation.Insertion || + changes[i].operation == MappingOperation.Update + ) { + setMappingOfSingleValueMappings(changes[i].outerKey, changes[i].innerKey, changes[i].value); + } + } + } + + // Set mapping of struct mappings. + function setMappingOfStructMappings( + uint256 outerKey, + uint256 innerKey, + uint256 field1, + uint128 field2, + uint128 field3 + ) public { + mappingOfStructMappings[outerKey][innerKey] = LargeStruct(field1, field2, field3); + } + + function changeMappingOfStructMappings(MappingOfStructMappingsChange[] memory changes) public { + for (uint256 i = 0; i < changes.length; i++) { + if (changes[i].operation == MappingOperation.Deletion) { + delete mappingOfStructMappings[changes[i].outerKey][changes[i].innerKey]; + } else if ( + changes[i].operation == MappingOperation.Insertion || + changes[i].operation == MappingOperation.Update + ) { + setMappingOfStructMappings(changes[i].outerKey, changes[i].innerKey, changes[i].field1, changes[i].field2, changes[i].field3); + } + } + } } diff --git a/mp2-v1/tests/common/bindings/simple.rs b/mp2-v1/tests/common/bindings/simple.rs index db613b22e..1b1bcae41 100644 --- a/mp2-v1/tests/common/bindings/simple.rs +++ b/mp2-v1/tests/common/bindings/simple.rs @@ -9,6 +9,20 @@ interface Simple { address value; MappingOperation operation; } + struct MappingOfSingleValueMappingsChange { + uint256 outerKey; + uint256 innerKey; + uint256 value; + MappingOperation operation; + } + struct MappingOfStructMappingsChange { + uint256 outerKey; + uint256 innerKey; + uint256 field1; + uint128 field2; + uint128 field3; + MappingOperation operation; + } struct MappingStructChange { uint256 key; uint256 field1; @@ -20,14 +34,19 @@ interface Simple { function addToArray(uint256 value) external; function arr1(uint256) external view returns (uint256); function changeMapping(MappingChange[] memory changes) external; + function changeMappingOfSingleValueMappings(MappingOfSingleValueMappingsChange[] memory changes) external; + function changeMappingOfStructMappings(MappingOfStructMappingsChange[] memory changes) external; function changeMappingStruct(MappingStructChange[] memory changes) external; function m1(uint256) external view returns (address); - function mappingOfMappings(uint256, uint256) external view returns (uint256 field1, uint128 field2, uint128 field3); + function mappingOfSingleValueMappings(uint256, uint256) external view returns (uint256); + function mappingOfStructMappings(uint256, uint256) external view returns (uint256 field1, uint128 field2, uint128 field3); function s1() external view returns (bool); function s2() external view returns (uint256); function s3() external view returns (string memory); function s4() external view returns (address); function setMapping(uint256 key, address value) external; + function setMappingOfSingleValueMappings(uint256 outerKey, uint256 innerKey, uint256 value) external; + function setMappingOfStructMappings(uint256 outerKey, uint256 innerKey, uint256 field1, uint128 field2, uint128 field3) external; function setMappingStruct(uint256 _key, uint256 _field1, uint128 _field2, uint128 _field3) external; function setS2(uint256 newS2) external; function setSimpleStruct(uint256 _field1, uint128 _field2, uint128 _field3) external; @@ -102,6 +121,86 @@ interface Simple { "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "changeMappingOfSingleValueMappings", + "inputs": [ + { + "name": "changes", + "type": "tuple[]", + "internalType": "struct Simple.MappingOfSingleValueMappingsChange[]", + "components": [ + { + "name": "outerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "innerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "operation", + "type": "uint8", + "internalType": "enum Simple.MappingOperation" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "changeMappingOfStructMappings", + "inputs": [ + { + "name": "changes", + "type": "tuple[]", + "internalType": "struct Simple.MappingOfStructMappingsChange[]", + "components": [ + { + "name": "outerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "innerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "field1", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "field2", + "type": "uint128", + "internalType": "uint128" + }, + { + "name": "field3", + "type": "uint128", + "internalType": "uint128" + }, + { + "name": "operation", + "type": "uint8", + "internalType": "enum Simple.MappingOperation" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "changeMappingStruct", @@ -163,7 +262,31 @@ interface Simple { }, { "type": "function", - "name": "mappingOfMappings", + "name": "mappingOfSingleValueMappings", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "mappingOfStructMappings", "inputs": [ { "name": "", @@ -265,6 +388,62 @@ interface Simple { "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "setMappingOfSingleValueMappings", + "inputs": [ + { + "name": "outerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "innerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMappingOfStructMappings", + "inputs": [ + { + "name": "outerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "innerKey", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "field1", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "field2", + "type": "uint128", + "internalType": "uint128" + }, + { + "name": "field3", + "type": "uint128", + "internalType": "uint128" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "setMappingStruct", @@ -418,22 +597,22 @@ pub mod Simple { /// The creation / init bytecode of the contract. /// /// ```text - ///0x608060405234801561000f575f80fd5b50610d998061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610106575f3560e01c80638026de311161009e578063c7bf4db51161006e578063c7bf4db5146102c9578063c8af3aa6146102dc578063d15ec851146102ef578063ead1840014610331578063f25d54f514610353575f80fd5b80638026de311461025e57806388dfddc614610271578063a314150f146102ab578063a5d666a9146102b4575f80fd5b80631c134315116100d95780631c134315146101ce5780632ae42686146101e15780636987b1fb146102215780636cc014de14610242575f80fd5b80630200225c1461010a5780630a4d04f71461011f5780630c1616c91461018e5780631417a4f0146101a1575b5f80fd5b61011d610118366004610835565b610366565b005b61016461012d3660046108f4565b600960209081525f9283526040808420909152908252902080546001909101546001600160801b0380821691600160801b90041683565b604080519384526001600160801b0392831660208501529116908201526060015b60405180910390f35b61011d61019c366004610945565b6103aa565b61011d6101af366004610a25565b6006929092556001600160801b03918216600160801b02911617600755565b61011d6101dc366004610a5e565b6104eb565b6102096101ef366004610a88565b60046020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610185565b61023461022f366004610a88565b610518565b604051908152602001610185565b5f5461024e9060ff1681565b6040519015158152602001610185565b61011d61026c366004610a9f565b610537565b61016461027f366004610a88565b60086020525f9081526040902080546001909101546001600160801b0380821691600160801b90041683565b61023460015481565b6102bc610589565b6040516101859190610ad7565b61011d6102d7366004610b23565b610615565b600354610209906001600160a01b031681565b61011d6102fd366004610a88565b600580546001810182555f919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00155565b60065460075461016491906001600160801b0380821691600160801b90041683565b61011d610361366004610a88565b600155565b5f805460ff1916851515179055600183905560026103848382610c7b565b50600380546001600160a01b0319166001600160a01b0392909216919091179055505050565b5f5b81518110156104e7575f8282815181106103c8576103c8610d4f565b60200260200101516040015160028111156103e5576103e5610d3b565b0361042c5760045f8383815181106103ff576103ff610d4f565b6020908102919091018101515182528101919091526040015f2080546001600160a01b03191690556104df565b600282828151811061044057610440610d4f565b602002602001015160400151600281111561045d5761045d610d3b565b14806104975750600182828151811061047857610478610d4f565b602002602001015160400151600281111561049557610495610d3b565b145b156104df576104df8282815181106104b1576104b1610d4f565b60200260200101515f01518383815181106104ce576104ce610d4f565b6020026020010151602001516104eb565b6001016103ac565b5050565b5f9182526004602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b60058181548110610527575f80fd5b5f91825260209091200154905081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f9687526008909352942092518355925192518116600160801b02921691909117600190910155565b6002805461059690610bf7565b80601f01602080910402602001604051908101604052809291908181526020018280546105c290610bf7565b801561060d5780601f106105e45761010080835404028352916020019161060d565b820191905f5260205f20905b8154815290600101906020018083116105f057829003601f168201915b505050505081565b5f5b81518110156104e7575f82828151811061063357610633610d4f565b602002602001015160800151600281111561065057610650610d3b565b036106925760085f83838151811061066a5761066a610d4f565b6020908102919091018101515182528101919091526040015f90812081815560010155610781565b60028282815181106106a6576106a6610d4f565b60200260200101516080015160028111156106c3576106c3610d3b565b14806106fd575060018282815181106106de576106de610d4f565b60200260200101516080015160028111156106fb576106fb610d3b565b145b156107815761078182828151811061071757610717610d4f565b60200260200101515f015183838151811061073457610734610d4f565b60200260200101516020015184848151811061075257610752610d4f565b60200260200101516040015185858151811061077057610770610d4f565b602002602001015160600151610537565b600101610617565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156107c0576107c0610789565b60405290565b60405160a0810167ffffffffffffffff811182821017156107c0576107c0610789565b604051601f8201601f1916810167ffffffffffffffff8111828210171561081257610812610789565b604052919050565b80356001600160a01b0381168114610830575f80fd5b919050565b5f805f8060808587031215610848575f80fd5b84358015158114610857575f80fd5b93506020858101359350604086013567ffffffffffffffff8082111561087b575f80fd5b818801915088601f83011261088e575f80fd5b8135818111156108a0576108a0610789565b6108b2601f8201601f191685016107e9565b915080825289848285010111156108c7575f80fd5b80848401858401375f848284010152508094505050506108e96060860161081a565b905092959194509250565b5f8060408385031215610905575f80fd5b50508035926020909101359150565b5f67ffffffffffffffff82111561092d5761092d610789565b5060051b60200190565b803560038110610830575f80fd5b5f6020808385031215610956575f80fd5b823567ffffffffffffffff81111561096c575f80fd5b8301601f8101851361097c575f80fd5b803561098f61098a82610914565b6107e9565b818152606091820283018401918482019190888411156109ad575f80fd5b938501935b83851015610a035780858a0312156109c8575f80fd5b6109d061079d565b853581526109df87870161081a565b8782015260406109f0818801610937565b90820152835293840193918501916109b2565b50979650505050505050565b80356001600160801b0381168114610830575f80fd5b5f805f60608486031215610a37575f80fd5b83359250610a4760208501610a0f565b9150610a5560408501610a0f565b90509250925092565b5f8060408385031215610a6f575f80fd5b82359150610a7f6020840161081a565b90509250929050565b5f60208284031215610a98575f80fd5b5035919050565b5f805f8060808587031215610ab2575f80fd5b8435935060208501359250610ac960408601610a0f565b91506108e960608601610a0f565b5f602080835283518060208501525f5b81811015610b0357858101830151858201604001528201610ae7565b505f604082860101526040601f19601f8301168501019250505092915050565b5f6020808385031215610b34575f80fd5b823567ffffffffffffffff811115610b4a575f80fd5b8301601f81018513610b5a575f80fd5b8035610b6861098a82610914565b81815260a09182028301840191848201919088841115610b86575f80fd5b938501935b83851015610a035780858a031215610ba1575f80fd5b610ba96107c6565b8535815286860135878201526040610bc2818801610a0f565b908201526060610bd3878201610a0f565b908201526080610be4878201610937565b9082015283529384019391850191610b8b565b600181811c90821680610c0b57607f821691505b602082108103610c2957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115610c7657805f5260205f20601f840160051c81016020851015610c545750805b601f840160051c820191505b81811015610c73575f8155600101610c60565b50505b505050565b815167ffffffffffffffff811115610c9557610c95610789565b610ca981610ca38454610bf7565b84610c2f565b602080601f831160018114610cdc575f8415610cc55750858301515b5f19600386901b1c1916600185901b178555610d33565b5f85815260208120601f198616915b82811015610d0a57888601518255948401946001909101908401610ceb565b5085821015610d2757878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffdfea26469706673582212206590d836561d8340d2d83d5cd063d2c751fdea336b0e3302a990dd0600d171d464736f6c63430008180033 + ///0x608060405234801561000f575f80fd5b5061146a8061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061013d575f3560e01c806388dfddc6116100b4578063c7bf4db511610079578063c7bf4db514610379578063c8af3aa61461038c578063d15ec8511461039f578063ead18400146103e1578063f25d54f514610403578063fb586c7d14610416575f80fd5b806388dfddc6146102e457806396dc9a411461031e578063a314150f14610348578063a5d666a914610351578063c6a7f0fe14610366575f80fd5b80632eb5cfd8116101055780632eb5cfd8146101ee5780634cf5a94a146102015780636987b1fb1461022a5780636cc014de1461024b5780638026de311461026757806385b6489f1461027a575f80fd5b80630200225c146101415780630c1616c9146101565780631417a4f0146101695780631c134315146101965780632ae42686146101a9575b5f80fd5b61015461014f366004610ce8565b610429565b005b610154610164366004610dd8565b61046d565b610154610177366004610eb8565b6006929092556001600160801b03918216600160801b02911617600755565b6101546101a4366004610ef1565b6105ae565b6101d16101b7366004610f1b565b60046020525f90815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101546101fc366004610f32565b6105db565b61015461020f366004610ffd565b5f928352600960209081526040808520938552929052912055565b61023d610238366004610f1b565b61076b565b6040519081526020016101e5565b5f546102579060ff1681565b60405190151581526020016101e5565b610154610275366004611026565b61078a565b6102bf61028836600461105e565b600a60209081525f9283526040808420909152908252902080546001909101546001600160801b0380821691600160801b90041683565b604080519384526001600160801b0392831660208501529116908201526060016101e5565b6102bf6102f2366004610f1b565b60086020525f9081526040902080546001909101546001600160801b0380821691600160801b90041683565b61023d61032c36600461105e565b600960209081525f928352604080842090915290825290205481565b61023d60015481565b6103596107dc565b6040516101e5919061107e565b6101546103743660046110ca565b610868565b610154610387366004611116565b6108c3565b6003546101d1906001600160a01b031681565b6101546103ad366004610f1b565b600580546001810182555f919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00155565b6006546007546102bf91906001600160801b0380821691600160801b90041683565b610154610411366004610f1b565b600155565b6101546104243660046111ea565b610a37565b5f805460ff191685151517905560018390556002610447838261134c565b50600380546001600160a01b0319166001600160a01b0392909216919091179055505050565b5f5b81518110156105aa575f82828151811061048b5761048b611420565b60200260200101516040015160028111156104a8576104a861140c565b036104ef5760045f8383815181106104c2576104c2611420565b6020908102919091018101515182528101919091526040015f2080546001600160a01b03191690556105a2565b600282828151811061050357610503611420565b60200260200101516040015160028111156105205761052061140c565b148061055a5750600182828151811061053b5761053b611420565b60200260200101516040015160028111156105585761055861140c565b145b156105a2576105a282828151811061057457610574611420565b60200260200101515f015183838151811061059157610591611420565b6020026020010151602001516105ae565b60010161046f565b5050565b5f9182526004602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b5f5b81518110156105aa575f8282815181106105f9576105f9611420565b60200260200101516060015160028111156106165761061661140c565b0361067c5760095f83838151811061063057610630611420565b60200260200101515f015181526020019081526020015f205f83838151811061065b5761065b611420565b60200260200101516020015181526020019081526020015f205f9055610763565b600282828151811061069057610690611420565b60200260200101516060015160028111156106ad576106ad61140c565b14806106e7575060018282815181106106c8576106c8611420565b60200260200101516060015160028111156106e5576106e561140c565b145b156107635761076382828151811061070157610701611420565b60200260200101515f015183838151811061071e5761071e611420565b60200260200101516020015184848151811061073c5761073c611420565b6020026020010151604001515f928352600960209081526040808520938552929052912055565b6001016105dd565b6005818154811061077a575f80fd5b5f91825260209091200154905081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f9687526008909352942092518355925192518116600160801b02921691909117600190910155565b600280546107e9906112c8565b80601f0160208091040260200160405190810160405280929190818152602001828054610815906112c8565b80156108605780601f1061083757610100808354040283529160200191610860565b820191905f5260205f20905b81548152906001019060200180831161084357829003601f168201915b505050505081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f978852600a84528288209688529590925290942091518255925191518316600160801b029190921617600190910155565b5f5b81518110156105aa575f8282815181106108e1576108e1611420565b60200260200101516080015160028111156108fe576108fe61140c565b036109405760085f83838151811061091857610918611420565b6020908102919091018101515182528101919091526040015f90812081815560010155610a2f565b600282828151811061095457610954611420565b60200260200101516080015160028111156109715761097161140c565b14806109ab5750600182828151811061098c5761098c611420565b60200260200101516080015160028111156109a9576109a961140c565b145b15610a2f57610a2f8282815181106109c5576109c5611420565b60200260200101515f01518383815181106109e2576109e2611420565b602002602001015160200151848481518110610a0057610a00611420565b602002602001015160400151858581518110610a1e57610a1e611420565b60200260200101516060015161078a565b6001016108c5565b5f5b81518110156105aa575f828281518110610a5557610a55611420565b602002602001015160a001516002811115610a7257610a7261140c565b03610ae157600a5f838381518110610a8c57610a8c611420565b60200260200101515f015181526020019081526020015f205f838381518110610ab757610ab7611420565b60209081029190910181015181015182528101919091526040015f90812081815560010155610bee565b6002828281518110610af557610af5611420565b602002602001015160a001516002811115610b1257610b1261140c565b1480610b4c57506001828281518110610b2d57610b2d611420565b602002602001015160a001516002811115610b4a57610b4a61140c565b145b15610bee57610bee828281518110610b6657610b66611420565b60200260200101515f0151838381518110610b8357610b83611420565b602002602001015160200151848481518110610ba157610ba1611420565b602002602001015160400151858581518110610bbf57610bbf611420565b602002602001015160600151868681518110610bdd57610bdd611420565b602002602001015160800151610868565b600101610a39565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405290565b6040516080810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405160a0810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405160c0810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b604051601f8201601f1916810167ffffffffffffffff81118282101715610cc557610cc5610bf6565b604052919050565b80356001600160a01b0381168114610ce3575f80fd5b919050565b5f805f8060808587031215610cfb575f80fd5b84358015158114610d0a575f80fd5b93506020858101359350604086013567ffffffffffffffff80821115610d2e575f80fd5b818801915088601f830112610d41575f80fd5b813581811115610d5357610d53610bf6565b610d65601f8201601f19168501610c9c565b91508082528984828501011115610d7a575f80fd5b80848401858401375f84828401015250809450505050610d9c60608601610ccd565b905092959194509250565b5f67ffffffffffffffff821115610dc057610dc0610bf6565b5060051b60200190565b803560038110610ce3575f80fd5b5f6020808385031215610de9575f80fd5b823567ffffffffffffffff811115610dff575f80fd5b8301601f81018513610e0f575f80fd5b8035610e22610e1d82610da7565b610c9c565b81815260609182028301840191848201919088841115610e40575f80fd5b938501935b83851015610e965780858a031215610e5b575f80fd5b610e63610c0a565b85358152610e72878701610ccd565b878201526040610e83818801610dca565b9082015283529384019391850191610e45565b50979650505050505050565b80356001600160801b0381168114610ce3575f80fd5b5f805f60608486031215610eca575f80fd5b83359250610eda60208501610ea2565b9150610ee860408501610ea2565b90509250925092565b5f8060408385031215610f02575f80fd5b82359150610f1260208401610ccd565b90509250929050565b5f60208284031215610f2b575f80fd5b5035919050565b5f6020808385031215610f43575f80fd5b823567ffffffffffffffff811115610f59575f80fd5b8301601f81018513610f69575f80fd5b8035610f77610e1d82610da7565b81815260079190911b82018301908381019087831115610f95575f80fd5b928401925b82841015610ff25760808489031215610fb1575f80fd5b610fb9610c33565b843581528585013586820152604080860135908201526060610fdc818701610dca565b9082015282526080939093019290840190610f9a565b979650505050505050565b5f805f6060848603121561100f575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215611039575f80fd5b843593506020850135925061105060408601610ea2565b9150610d9c60608601610ea2565b5f806040838503121561106f575f80fd5b50508035926020909101359150565b5f602080835283518060208501525f5b818110156110aa5785810183015185820160400152820161108e565b505f604082860101526040601f19601f8301168501019250505092915050565b5f805f805f60a086880312156110de575f80fd5b8535945060208601359350604086013592506110fc60608701610ea2565b915061110a60808701610ea2565b90509295509295909350565b5f6020808385031215611127575f80fd5b823567ffffffffffffffff81111561113d575f80fd5b8301601f8101851361114d575f80fd5b803561115b610e1d82610da7565b81815260a09182028301840191848201919088841115611179575f80fd5b938501935b83851015610e965780858a031215611194575f80fd5b61119c610c56565b85358152868601358782015260406111b5818801610ea2565b9082015260606111c6878201610ea2565b9082015260806111d7878201610dca565b908201528352938401939185019161117e565b5f60208083850312156111fb575f80fd5b823567ffffffffffffffff811115611211575f80fd5b8301601f81018513611221575f80fd5b803561122f610e1d82610da7565b81815260c0918202830184019184820191908884111561124d575f80fd5b938501935b83851015610e965780858a031215611268575f80fd5b611270610c79565b853581528686013587820152604080870135908201526060611293818801610ea2565b9082015260806112a4878201610ea2565b9082015260a06112b5878201610dca565b9082015283529384019391850191611252565b600181811c908216806112dc57607f821691505b6020821081036112fa57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561134757805f5260205f20601f840160051c810160208510156113255750805b601f840160051c820191505b81811015611344575f8155600101611331565b50505b505050565b815167ffffffffffffffff81111561136657611366610bf6565b61137a8161137484546112c8565b84611300565b602080601f8311600181146113ad575f84156113965750858301515b5f19600386901b1c1916600185901b178555611404565b5f85815260208120601f198616915b828110156113db578886015182559484019460019091019084016113bc565b50858210156113f857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffdfea2646970667358221220d2b83ac3b43e98360c903f68c0dc0b247343ee73bff7368b1c2ef1412d6cb2dc64736f6c63430008180033 /// ``` #[rustfmt::skip] #[allow(clippy::all)] pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( - b"`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[Pa\r\x99\x80a\0\x1D_9_\xF3\xFE`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[P`\x046\x10a\x01\x06W_5`\xE0\x1C\x80c\x80&\xDE1\x11a\0\x9EW\x80c\xC7\xBFM\xB5\x11a\0nW\x80c\xC7\xBFM\xB5\x14a\x02\xC9W\x80c\xC8\xAF:\xA6\x14a\x02\xDCW\x80c\xD1^\xC8Q\x14a\x02\xEFW\x80c\xEA\xD1\x84\0\x14a\x031W\x80c\xF2]T\xF5\x14a\x03SW_\x80\xFD[\x80c\x80&\xDE1\x14a\x02^W\x80c\x88\xDF\xDD\xC6\x14a\x02qW\x80c\xA3\x14\x15\x0F\x14a\x02\xABW\x80c\xA5\xD6f\xA9\x14a\x02\xB4W_\x80\xFD[\x80c\x1C\x13C\x15\x11a\0\xD9W\x80c\x1C\x13C\x15\x14a\x01\xCEW\x80c*\xE4&\x86\x14a\x01\xE1W\x80ci\x87\xB1\xFB\x14a\x02!W\x80cl\xC0\x14\xDE\x14a\x02BW_\x80\xFD[\x80c\x02\0\"\\\x14a\x01\nW\x80c\nM\x04\xF7\x14a\x01\x1FW\x80c\x0C\x16\x16\xC9\x14a\x01\x8EW\x80c\x14\x17\xA4\xF0\x14a\x01\xA1W[_\x80\xFD[a\x01\x1Da\x01\x186`\x04a\x085V[a\x03fV[\0[a\x01da\x01-6`\x04a\x08\xF4V[`\t` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[`@\x80Q\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x85\x01R\x91\x16\x90\x82\x01R``\x01[`@Q\x80\x91\x03\x90\xF3[a\x01\x1Da\x01\x9C6`\x04a\tEV[a\x03\xAAV[a\x01\x1Da\x01\xAF6`\x04a\n%V[`\x06\x92\x90\x92U`\x01`\x01`\x80\x1B\x03\x91\x82\x16`\x01`\x80\x1B\x02\x91\x16\x17`\x07UV[a\x01\x1Da\x01\xDC6`\x04a\n^V[a\x04\xEBV[a\x02\ta\x01\xEF6`\x04a\n\x88V[`\x04` R_\x90\x81R`@\x90 T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\x01\x85V[a\x024a\x02/6`\x04a\n\x88V[a\x05\x18V[`@Q\x90\x81R` \x01a\x01\x85V[_Ta\x02N\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\x01\x85V[a\x01\x1Da\x02l6`\x04a\n\x9FV[a\x057V[a\x01da\x02\x7F6`\x04a\n\x88V[`\x08` R_\x90\x81R`@\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x024`\x01T\x81V[a\x02\xBCa\x05\x89V[`@Qa\x01\x85\x91\x90a\n\xD7V[a\x01\x1Da\x02\xD76`\x04a\x0B#V[a\x06\x15V[`\x03Ta\x02\t\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\x01\x1Da\x02\xFD6`\x04a\n\x88V[`\x05\x80T`\x01\x81\x01\x82U_\x91\x90\x91R\x7F\x03kc\x84\xB5\xEC\xA7\x91\xC6'a\x15-\x0Cy\xBB\x06\x04\xC1\x04\xA5\xFBoN\xB0p?1T\xBB=\xB0\x01UV[`\x06T`\x07Ta\x01d\x91\x90`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x01\x1Da\x03a6`\x04a\n\x88V[`\x01UV[_\x80T`\xFF\x19\x16\x85\x15\x15\x17\x90U`\x01\x83\x90U`\x02a\x03\x84\x83\x82a\x0C{V[P`\x03\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UPPPV[_[\x81Q\x81\x10\x15a\x04\xE7W_\x82\x82\x81Q\x81\x10a\x03\xC8Wa\x03\xC8a\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x03\xE5Wa\x03\xE5a\r;V[\x03a\x04,W`\x04_\x83\x83\x81Q\x81\x10a\x03\xFFWa\x03\xFFa\rOV[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_ \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90Ua\x04\xDFV[`\x02\x82\x82\x81Q\x81\x10a\x04@Wa\x04@a\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04]Wa\x04]a\r;V[\x14\x80a\x04\x97WP`\x01\x82\x82\x81Q\x81\x10a\x04xWa\x04xa\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04\x95Wa\x04\x95a\r;V[\x14[\x15a\x04\xDFWa\x04\xDF\x82\x82\x81Q\x81\x10a\x04\xB1Wa\x04\xB1a\rOV[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x04\xCEWa\x04\xCEa\rOV[` \x02` \x01\x01Q` \x01Qa\x04\xEBV[`\x01\x01a\x03\xACV[PPV[_\x91\x82R`\x04` R`@\x90\x91 \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x91\x90\x91\x17\x90UV[`\x05\x81\x81T\x81\x10a\x05'W_\x80\xFD[_\x91\x82R` \x90\x91 \x01T\x90P\x81V[`@\x80Q``\x81\x01\x82R\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x80\x86\x01\x91\x82R\x92\x84\x16\x85\x83\x01\x90\x81R_\x96\x87R`\x08\x90\x93R\x94 \x92Q\x83U\x92Q\x92Q\x81\x16`\x01`\x80\x1B\x02\x92\x16\x91\x90\x91\x17`\x01\x90\x91\x01UV[`\x02\x80Ta\x05\x96\x90a\x0B\xF7V[\x80`\x1F\x01` \x80\x91\x04\x02` \x01`@Q\x90\x81\x01`@R\x80\x92\x91\x90\x81\x81R` \x01\x82\x80Ta\x05\xC2\x90a\x0B\xF7V[\x80\x15a\x06\rW\x80`\x1F\x10a\x05\xE4Wa\x01\0\x80\x83T\x04\x02\x83R\x91` \x01\x91a\x06\rV[\x82\x01\x91\x90_R` _ \x90[\x81T\x81R\x90`\x01\x01\x90` \x01\x80\x83\x11a\x05\xF0W\x82\x90\x03`\x1F\x16\x82\x01\x91[PPPPP\x81V[_[\x81Q\x81\x10\x15a\x04\xE7W_\x82\x82\x81Q\x81\x10a\x063Wa\x063a\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06PWa\x06Pa\r;V[\x03a\x06\x92W`\x08_\x83\x83\x81Q\x81\x10a\x06jWa\x06ja\rOV[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_\x90\x81 \x81\x81U`\x01\x01Ua\x07\x81V[`\x02\x82\x82\x81Q\x81\x10a\x06\xA6Wa\x06\xA6a\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06\xC3Wa\x06\xC3a\r;V[\x14\x80a\x06\xFDWP`\x01\x82\x82\x81Q\x81\x10a\x06\xDEWa\x06\xDEa\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06\xFBWa\x06\xFBa\r;V[\x14[\x15a\x07\x81Wa\x07\x81\x82\x82\x81Q\x81\x10a\x07\x17Wa\x07\x17a\rOV[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x074Wa\x074a\rOV[` \x02` \x01\x01Q` \x01Q\x84\x84\x81Q\x81\x10a\x07RWa\x07Ra\rOV[` \x02` \x01\x01Q`@\x01Q\x85\x85\x81Q\x81\x10a\x07pWa\x07pa\rOV[` \x02` \x01\x01Q``\x01Qa\x057V[`\x01\x01a\x06\x17V[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[`@Q``\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x07\xC0Wa\x07\xC0a\x07\x89V[`@R\x90V[`@Q`\xA0\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x07\xC0Wa\x07\xC0a\x07\x89V[`@Q`\x1F\x82\x01`\x1F\x19\x16\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x08\x12Wa\x08\x12a\x07\x89V[`@R\x91\x90PV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x080W_\x80\xFD[\x91\x90PV[_\x80_\x80`\x80\x85\x87\x03\x12\x15a\x08HW_\x80\xFD[\x845\x80\x15\x15\x81\x14a\x08WW_\x80\xFD[\x93P` \x85\x81\x015\x93P`@\x86\x015g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x80\x82\x11\x15a\x08{W_\x80\xFD[\x81\x88\x01\x91P\x88`\x1F\x83\x01\x12a\x08\x8EW_\x80\xFD[\x815\x81\x81\x11\x15a\x08\xA0Wa\x08\xA0a\x07\x89V[a\x08\xB2`\x1F\x82\x01`\x1F\x19\x16\x85\x01a\x07\xE9V[\x91P\x80\x82R\x89\x84\x82\x85\x01\x01\x11\x15a\x08\xC7W_\x80\xFD[\x80\x84\x84\x01\x85\x84\x017_\x84\x82\x84\x01\x01RP\x80\x94PPPPa\x08\xE9``\x86\x01a\x08\x1AV[\x90P\x92\x95\x91\x94P\x92PV[_\x80`@\x83\x85\x03\x12\x15a\t\x05W_\x80\xFD[PP\x805\x92` \x90\x91\x015\x91PV[_g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x15a\t-Wa\t-a\x07\x89V[P`\x05\x1B` \x01\x90V[\x805`\x03\x81\x10a\x080W_\x80\xFD[_` \x80\x83\x85\x03\x12\x15a\tVW_\x80\xFD[\x825g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\tlW_\x80\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\t|W_\x80\xFD[\x805a\t\x8Fa\t\x8A\x82a\t\x14V[a\x07\xE9V[\x81\x81R``\x91\x82\x02\x83\x01\x84\x01\x91\x84\x82\x01\x91\x90\x88\x84\x11\x15a\t\xADW_\x80\xFD[\x93\x85\x01\x93[\x83\x85\x10\x15a\n\x03W\x80\x85\x8A\x03\x12\x15a\t\xC8W_\x80\xFD[a\t\xD0a\x07\x9DV[\x855\x81Ra\t\xDF\x87\x87\x01a\x08\x1AV[\x87\x82\x01R`@a\t\xF0\x81\x88\x01a\t7V[\x90\x82\x01R\x83R\x93\x84\x01\x93\x91\x85\x01\x91a\t\xB2V[P\x97\x96PPPPPPPV[\x805`\x01`\x01`\x80\x1B\x03\x81\x16\x81\x14a\x080W_\x80\xFD[_\x80_``\x84\x86\x03\x12\x15a\n7W_\x80\xFD[\x835\x92Pa\nG` \x85\x01a\n\x0FV[\x91Pa\nU`@\x85\x01a\n\x0FV[\x90P\x92P\x92P\x92V[_\x80`@\x83\x85\x03\x12\x15a\noW_\x80\xFD[\x825\x91Pa\n\x7F` \x84\x01a\x08\x1AV[\x90P\x92P\x92\x90PV[_` \x82\x84\x03\x12\x15a\n\x98W_\x80\xFD[P5\x91\x90PV[_\x80_\x80`\x80\x85\x87\x03\x12\x15a\n\xB2W_\x80\xFD[\x845\x93P` \x85\x015\x92Pa\n\xC9`@\x86\x01a\n\x0FV[\x91Pa\x08\xE9``\x86\x01a\n\x0FV[_` \x80\x83R\x83Q\x80` \x85\x01R_[\x81\x81\x10\x15a\x0B\x03W\x85\x81\x01\x83\x01Q\x85\x82\x01`@\x01R\x82\x01a\n\xE7V[P_`@\x82\x86\x01\x01R`@`\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x92PPP\x92\x91PPV[_` \x80\x83\x85\x03\x12\x15a\x0B4W_\x80\xFD[\x825g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\x0BJW_\x80\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\x0BZW_\x80\xFD[\x805a\x0Bha\t\x8A\x82a\t\x14V[\x81\x81R`\xA0\x91\x82\x02\x83\x01\x84\x01\x91\x84\x82\x01\x91\x90\x88\x84\x11\x15a\x0B\x86W_\x80\xFD[\x93\x85\x01\x93[\x83\x85\x10\x15a\n\x03W\x80\x85\x8A\x03\x12\x15a\x0B\xA1W_\x80\xFD[a\x0B\xA9a\x07\xC6V[\x855\x81R\x86\x86\x015\x87\x82\x01R`@a\x0B\xC2\x81\x88\x01a\n\x0FV[\x90\x82\x01R``a\x0B\xD3\x87\x82\x01a\n\x0FV[\x90\x82\x01R`\x80a\x0B\xE4\x87\x82\x01a\t7V[\x90\x82\x01R\x83R\x93\x84\x01\x93\x91\x85\x01\x91a\x0B\x8BV[`\x01\x81\x81\x1C\x90\x82\x16\x80a\x0C\x0BW`\x7F\x82\x16\x91P[` \x82\x10\x81\x03a\x0C)WcNH{q`\xE0\x1B_R`\"`\x04R`$_\xFD[P\x91\x90PV[`\x1F\x82\x11\x15a\x0CvW\x80_R` _ `\x1F\x84\x01`\x05\x1C\x81\x01` \x85\x10\x15a\x0CTWP\x80[`\x1F\x84\x01`\x05\x1C\x82\x01\x91P[\x81\x81\x10\x15a\x0CsW_\x81U`\x01\x01a\x0C`V[PP[PPPV[\x81Qg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\x0C\x95Wa\x0C\x95a\x07\x89V[a\x0C\xA9\x81a\x0C\xA3\x84Ta\x0B\xF7V[\x84a\x0C/V[` \x80`\x1F\x83\x11`\x01\x81\x14a\x0C\xDCW_\x84\x15a\x0C\xC5WP\x85\x83\x01Q[_\x19`\x03\x86\x90\x1B\x1C\x19\x16`\x01\x85\x90\x1B\x17\x85Ua\r3V[_\x85\x81R` \x81 `\x1F\x19\x86\x16\x91[\x82\x81\x10\x15a\r\nW\x88\x86\x01Q\x82U\x94\x84\x01\x94`\x01\x90\x91\x01\x90\x84\x01a\x0C\xEBV[P\x85\x82\x10\x15a\r'W\x87\x85\x01Q_\x19`\x03\x88\x90\x1B`\xF8\x16\x1C\x19\x16\x81U[PP`\x01\x84`\x01\x1B\x01\x85U[PPPPPPV[cNH{q`\xE0\x1B_R`!`\x04R`$_\xFD[cNH{q`\xE0\x1B_R`2`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 e\x90\xD86V\x1D\x83@\xD2\xD8=\\\xD0c\xD2\xC7Q\xFD\xEA3k\x0E3\x02\xA9\x90\xDD\x06\0\xD1q\xD4dsolcC\0\x08\x18\x003", + b"`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[Pa\x14j\x80a\0\x1D_9_\xF3\xFE`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[P`\x046\x10a\x01=W_5`\xE0\x1C\x80c\x88\xDF\xDD\xC6\x11a\0\xB4W\x80c\xC7\xBFM\xB5\x11a\0yW\x80c\xC7\xBFM\xB5\x14a\x03yW\x80c\xC8\xAF:\xA6\x14a\x03\x8CW\x80c\xD1^\xC8Q\x14a\x03\x9FW\x80c\xEA\xD1\x84\0\x14a\x03\xE1W\x80c\xF2]T\xF5\x14a\x04\x03W\x80c\xFBXl}\x14a\x04\x16W_\x80\xFD[\x80c\x88\xDF\xDD\xC6\x14a\x02\xE4W\x80c\x96\xDC\x9AA\x14a\x03\x1EW\x80c\xA3\x14\x15\x0F\x14a\x03HW\x80c\xA5\xD6f\xA9\x14a\x03QW\x80c\xC6\xA7\xF0\xFE\x14a\x03fW_\x80\xFD[\x80c.\xB5\xCF\xD8\x11a\x01\x05W\x80c.\xB5\xCF\xD8\x14a\x01\xEEW\x80cL\xF5\xA9J\x14a\x02\x01W\x80ci\x87\xB1\xFB\x14a\x02*W\x80cl\xC0\x14\xDE\x14a\x02KW\x80c\x80&\xDE1\x14a\x02gW\x80c\x85\xB6H\x9F\x14a\x02zW_\x80\xFD[\x80c\x02\0\"\\\x14a\x01AW\x80c\x0C\x16\x16\xC9\x14a\x01VW\x80c\x14\x17\xA4\xF0\x14a\x01iW\x80c\x1C\x13C\x15\x14a\x01\x96W\x80c*\xE4&\x86\x14a\x01\xA9W[_\x80\xFD[a\x01Ta\x01O6`\x04a\x0C\xE8V[a\x04)V[\0[a\x01Ta\x01d6`\x04a\r\xD8V[a\x04mV[a\x01Ta\x01w6`\x04a\x0E\xB8V[`\x06\x92\x90\x92U`\x01`\x01`\x80\x1B\x03\x91\x82\x16`\x01`\x80\x1B\x02\x91\x16\x17`\x07UV[a\x01Ta\x01\xA46`\x04a\x0E\xF1V[a\x05\xAEV[a\x01\xD1a\x01\xB76`\x04a\x0F\x1BV[`\x04` R_\x90\x81R`@\x90 T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\x01Ta\x01\xFC6`\x04a\x0F2V[a\x05\xDBV[a\x01Ta\x02\x0F6`\x04a\x0F\xFDV[_\x92\x83R`\t` \x90\x81R`@\x80\x85 \x93\x85R\x92\x90R\x91 UV[a\x02=a\x0286`\x04a\x0F\x1BV[a\x07kV[`@Q\x90\x81R` \x01a\x01\xE5V[_Ta\x02W\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\x01\xE5V[a\x01Ta\x02u6`\x04a\x10&V[a\x07\x8AV[a\x02\xBFa\x02\x886`\x04a\x10^V[`\n` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[`@\x80Q\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x85\x01R\x91\x16\x90\x82\x01R``\x01a\x01\xE5V[a\x02\xBFa\x02\xF26`\x04a\x0F\x1BV[`\x08` R_\x90\x81R`@\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x02=a\x03,6`\x04a\x10^V[`\t` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 T\x81V[a\x02=`\x01T\x81V[a\x03Ya\x07\xDCV[`@Qa\x01\xE5\x91\x90a\x10~V[a\x01Ta\x03t6`\x04a\x10\xCAV[a\x08hV[a\x01Ta\x03\x876`\x04a\x11\x16V[a\x08\xC3V[`\x03Ta\x01\xD1\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\x01Ta\x03\xAD6`\x04a\x0F\x1BV[`\x05\x80T`\x01\x81\x01\x82U_\x91\x90\x91R\x7F\x03kc\x84\xB5\xEC\xA7\x91\xC6'a\x15-\x0Cy\xBB\x06\x04\xC1\x04\xA5\xFBoN\xB0p?1T\xBB=\xB0\x01UV[`\x06T`\x07Ta\x02\xBF\x91\x90`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x01Ta\x04\x116`\x04a\x0F\x1BV[`\x01UV[a\x01Ta\x04$6`\x04a\x11\xEAV[a\n7V[_\x80T`\xFF\x19\x16\x85\x15\x15\x17\x90U`\x01\x83\x90U`\x02a\x04G\x83\x82a\x13LV[P`\x03\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UPPPV[_[\x81Q\x81\x10\x15a\x05\xAAW_\x82\x82\x81Q\x81\x10a\x04\x8BWa\x04\x8Ba\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04\xA8Wa\x04\xA8a\x14\x0CV[\x03a\x04\xEFW`\x04_\x83\x83\x81Q\x81\x10a\x04\xC2Wa\x04\xC2a\x14 V[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_ \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90Ua\x05\xA2V[`\x02\x82\x82\x81Q\x81\x10a\x05\x03Wa\x05\x03a\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x05 Wa\x05 a\x14\x0CV[\x14\x80a\x05ZWP`\x01\x82\x82\x81Q\x81\x10a\x05;Wa\x05;a\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x05XWa\x05Xa\x14\x0CV[\x14[\x15a\x05\xA2Wa\x05\xA2\x82\x82\x81Q\x81\x10a\x05tWa\x05ta\x14 V[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x05\x91Wa\x05\x91a\x14 V[` \x02` \x01\x01Q` \x01Qa\x05\xAEV[`\x01\x01a\x04oV[PPV[_\x91\x82R`\x04` R`@\x90\x91 \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x91\x90\x91\x17\x90UV[_[\x81Q\x81\x10\x15a\x05\xAAW_\x82\x82\x81Q\x81\x10a\x05\xF9Wa\x05\xF9a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\x16Wa\x06\x16a\x14\x0CV[\x03a\x06|W`\t_\x83\x83\x81Q\x81\x10a\x060Wa\x060a\x14 V[` \x02` \x01\x01Q_\x01Q\x81R` \x01\x90\x81R` \x01_ _\x83\x83\x81Q\x81\x10a\x06[Wa\x06[a\x14 V[` \x02` \x01\x01Q` \x01Q\x81R` \x01\x90\x81R` \x01_ _\x90Ua\x07cV[`\x02\x82\x82\x81Q\x81\x10a\x06\x90Wa\x06\x90a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\xADWa\x06\xADa\x14\x0CV[\x14\x80a\x06\xE7WP`\x01\x82\x82\x81Q\x81\x10a\x06\xC8Wa\x06\xC8a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\xE5Wa\x06\xE5a\x14\x0CV[\x14[\x15a\x07cWa\x07c\x82\x82\x81Q\x81\x10a\x07\x01Wa\x07\x01a\x14 V[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x07\x1EWa\x07\x1Ea\x14 V[` \x02` \x01\x01Q` \x01Q\x84\x84\x81Q\x81\x10a\x07\x986\x0C\x90?h\xC0\xDC\x0B$sC\xEEs\xBF\xF76\x8B\x1C.\xF1A-l\xB2\xDCdsolcC\0\x08\x18\x003", ); /// The runtime bytecode of the contract, as deployed on the network. /// /// ```text - ///0x608060405234801561000f575f80fd5b5060043610610106575f3560e01c80638026de311161009e578063c7bf4db51161006e578063c7bf4db5146102c9578063c8af3aa6146102dc578063d15ec851146102ef578063ead1840014610331578063f25d54f514610353575f80fd5b80638026de311461025e57806388dfddc614610271578063a314150f146102ab578063a5d666a9146102b4575f80fd5b80631c134315116100d95780631c134315146101ce5780632ae42686146101e15780636987b1fb146102215780636cc014de14610242575f80fd5b80630200225c1461010a5780630a4d04f71461011f5780630c1616c91461018e5780631417a4f0146101a1575b5f80fd5b61011d610118366004610835565b610366565b005b61016461012d3660046108f4565b600960209081525f9283526040808420909152908252902080546001909101546001600160801b0380821691600160801b90041683565b604080519384526001600160801b0392831660208501529116908201526060015b60405180910390f35b61011d61019c366004610945565b6103aa565b61011d6101af366004610a25565b6006929092556001600160801b03918216600160801b02911617600755565b61011d6101dc366004610a5e565b6104eb565b6102096101ef366004610a88565b60046020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610185565b61023461022f366004610a88565b610518565b604051908152602001610185565b5f5461024e9060ff1681565b6040519015158152602001610185565b61011d61026c366004610a9f565b610537565b61016461027f366004610a88565b60086020525f9081526040902080546001909101546001600160801b0380821691600160801b90041683565b61023460015481565b6102bc610589565b6040516101859190610ad7565b61011d6102d7366004610b23565b610615565b600354610209906001600160a01b031681565b61011d6102fd366004610a88565b600580546001810182555f919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00155565b60065460075461016491906001600160801b0380821691600160801b90041683565b61011d610361366004610a88565b600155565b5f805460ff1916851515179055600183905560026103848382610c7b565b50600380546001600160a01b0319166001600160a01b0392909216919091179055505050565b5f5b81518110156104e7575f8282815181106103c8576103c8610d4f565b60200260200101516040015160028111156103e5576103e5610d3b565b0361042c5760045f8383815181106103ff576103ff610d4f565b6020908102919091018101515182528101919091526040015f2080546001600160a01b03191690556104df565b600282828151811061044057610440610d4f565b602002602001015160400151600281111561045d5761045d610d3b565b14806104975750600182828151811061047857610478610d4f565b602002602001015160400151600281111561049557610495610d3b565b145b156104df576104df8282815181106104b1576104b1610d4f565b60200260200101515f01518383815181106104ce576104ce610d4f565b6020026020010151602001516104eb565b6001016103ac565b5050565b5f9182526004602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b60058181548110610527575f80fd5b5f91825260209091200154905081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f9687526008909352942092518355925192518116600160801b02921691909117600190910155565b6002805461059690610bf7565b80601f01602080910402602001604051908101604052809291908181526020018280546105c290610bf7565b801561060d5780601f106105e45761010080835404028352916020019161060d565b820191905f5260205f20905b8154815290600101906020018083116105f057829003601f168201915b505050505081565b5f5b81518110156104e7575f82828151811061063357610633610d4f565b602002602001015160800151600281111561065057610650610d3b565b036106925760085f83838151811061066a5761066a610d4f565b6020908102919091018101515182528101919091526040015f90812081815560010155610781565b60028282815181106106a6576106a6610d4f565b60200260200101516080015160028111156106c3576106c3610d3b565b14806106fd575060018282815181106106de576106de610d4f565b60200260200101516080015160028111156106fb576106fb610d3b565b145b156107815761078182828151811061071757610717610d4f565b60200260200101515f015183838151811061073457610734610d4f565b60200260200101516020015184848151811061075257610752610d4f565b60200260200101516040015185858151811061077057610770610d4f565b602002602001015160600151610537565b600101610617565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156107c0576107c0610789565b60405290565b60405160a0810167ffffffffffffffff811182821017156107c0576107c0610789565b604051601f8201601f1916810167ffffffffffffffff8111828210171561081257610812610789565b604052919050565b80356001600160a01b0381168114610830575f80fd5b919050565b5f805f8060808587031215610848575f80fd5b84358015158114610857575f80fd5b93506020858101359350604086013567ffffffffffffffff8082111561087b575f80fd5b818801915088601f83011261088e575f80fd5b8135818111156108a0576108a0610789565b6108b2601f8201601f191685016107e9565b915080825289848285010111156108c7575f80fd5b80848401858401375f848284010152508094505050506108e96060860161081a565b905092959194509250565b5f8060408385031215610905575f80fd5b50508035926020909101359150565b5f67ffffffffffffffff82111561092d5761092d610789565b5060051b60200190565b803560038110610830575f80fd5b5f6020808385031215610956575f80fd5b823567ffffffffffffffff81111561096c575f80fd5b8301601f8101851361097c575f80fd5b803561098f61098a82610914565b6107e9565b818152606091820283018401918482019190888411156109ad575f80fd5b938501935b83851015610a035780858a0312156109c8575f80fd5b6109d061079d565b853581526109df87870161081a565b8782015260406109f0818801610937565b90820152835293840193918501916109b2565b50979650505050505050565b80356001600160801b0381168114610830575f80fd5b5f805f60608486031215610a37575f80fd5b83359250610a4760208501610a0f565b9150610a5560408501610a0f565b90509250925092565b5f8060408385031215610a6f575f80fd5b82359150610a7f6020840161081a565b90509250929050565b5f60208284031215610a98575f80fd5b5035919050565b5f805f8060808587031215610ab2575f80fd5b8435935060208501359250610ac960408601610a0f565b91506108e960608601610a0f565b5f602080835283518060208501525f5b81811015610b0357858101830151858201604001528201610ae7565b505f604082860101526040601f19601f8301168501019250505092915050565b5f6020808385031215610b34575f80fd5b823567ffffffffffffffff811115610b4a575f80fd5b8301601f81018513610b5a575f80fd5b8035610b6861098a82610914565b81815260a09182028301840191848201919088841115610b86575f80fd5b938501935b83851015610a035780858a031215610ba1575f80fd5b610ba96107c6565b8535815286860135878201526040610bc2818801610a0f565b908201526060610bd3878201610a0f565b908201526080610be4878201610937565b9082015283529384019391850191610b8b565b600181811c90821680610c0b57607f821691505b602082108103610c2957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115610c7657805f5260205f20601f840160051c81016020851015610c545750805b601f840160051c820191505b81811015610c73575f8155600101610c60565b50505b505050565b815167ffffffffffffffff811115610c9557610c95610789565b610ca981610ca38454610bf7565b84610c2f565b602080601f831160018114610cdc575f8415610cc55750858301515b5f19600386901b1c1916600185901b178555610d33565b5f85815260208120601f198616915b82811015610d0a57888601518255948401946001909101908401610ceb565b5085821015610d2757878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffdfea26469706673582212206590d836561d8340d2d83d5cd063d2c751fdea336b0e3302a990dd0600d171d464736f6c63430008180033 + ///0x608060405234801561000f575f80fd5b506004361061013d575f3560e01c806388dfddc6116100b4578063c7bf4db511610079578063c7bf4db514610379578063c8af3aa61461038c578063d15ec8511461039f578063ead18400146103e1578063f25d54f514610403578063fb586c7d14610416575f80fd5b806388dfddc6146102e457806396dc9a411461031e578063a314150f14610348578063a5d666a914610351578063c6a7f0fe14610366575f80fd5b80632eb5cfd8116101055780632eb5cfd8146101ee5780634cf5a94a146102015780636987b1fb1461022a5780636cc014de1461024b5780638026de311461026757806385b6489f1461027a575f80fd5b80630200225c146101415780630c1616c9146101565780631417a4f0146101695780631c134315146101965780632ae42686146101a9575b5f80fd5b61015461014f366004610ce8565b610429565b005b610154610164366004610dd8565b61046d565b610154610177366004610eb8565b6006929092556001600160801b03918216600160801b02911617600755565b6101546101a4366004610ef1565b6105ae565b6101d16101b7366004610f1b565b60046020525f90815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101546101fc366004610f32565b6105db565b61015461020f366004610ffd565b5f928352600960209081526040808520938552929052912055565b61023d610238366004610f1b565b61076b565b6040519081526020016101e5565b5f546102579060ff1681565b60405190151581526020016101e5565b610154610275366004611026565b61078a565b6102bf61028836600461105e565b600a60209081525f9283526040808420909152908252902080546001909101546001600160801b0380821691600160801b90041683565b604080519384526001600160801b0392831660208501529116908201526060016101e5565b6102bf6102f2366004610f1b565b60086020525f9081526040902080546001909101546001600160801b0380821691600160801b90041683565b61023d61032c36600461105e565b600960209081525f928352604080842090915290825290205481565b61023d60015481565b6103596107dc565b6040516101e5919061107e565b6101546103743660046110ca565b610868565b610154610387366004611116565b6108c3565b6003546101d1906001600160a01b031681565b6101546103ad366004610f1b565b600580546001810182555f919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00155565b6006546007546102bf91906001600160801b0380821691600160801b90041683565b610154610411366004610f1b565b600155565b6101546104243660046111ea565b610a37565b5f805460ff191685151517905560018390556002610447838261134c565b50600380546001600160a01b0319166001600160a01b0392909216919091179055505050565b5f5b81518110156105aa575f82828151811061048b5761048b611420565b60200260200101516040015160028111156104a8576104a861140c565b036104ef5760045f8383815181106104c2576104c2611420565b6020908102919091018101515182528101919091526040015f2080546001600160a01b03191690556105a2565b600282828151811061050357610503611420565b60200260200101516040015160028111156105205761052061140c565b148061055a5750600182828151811061053b5761053b611420565b60200260200101516040015160028111156105585761055861140c565b145b156105a2576105a282828151811061057457610574611420565b60200260200101515f015183838151811061059157610591611420565b6020026020010151602001516105ae565b60010161046f565b5050565b5f9182526004602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b5f5b81518110156105aa575f8282815181106105f9576105f9611420565b60200260200101516060015160028111156106165761061661140c565b0361067c5760095f83838151811061063057610630611420565b60200260200101515f015181526020019081526020015f205f83838151811061065b5761065b611420565b60200260200101516020015181526020019081526020015f205f9055610763565b600282828151811061069057610690611420565b60200260200101516060015160028111156106ad576106ad61140c565b14806106e7575060018282815181106106c8576106c8611420565b60200260200101516060015160028111156106e5576106e561140c565b145b156107635761076382828151811061070157610701611420565b60200260200101515f015183838151811061071e5761071e611420565b60200260200101516020015184848151811061073c5761073c611420565b6020026020010151604001515f928352600960209081526040808520938552929052912055565b6001016105dd565b6005818154811061077a575f80fd5b5f91825260209091200154905081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f9687526008909352942092518355925192518116600160801b02921691909117600190910155565b600280546107e9906112c8565b80601f0160208091040260200160405190810160405280929190818152602001828054610815906112c8565b80156108605780601f1061083757610100808354040283529160200191610860565b820191905f5260205f20905b81548152906001019060200180831161084357829003601f168201915b505050505081565b604080516060810182529384526001600160801b0392831660208086019182529284168583019081525f978852600a84528288209688529590925290942091518255925191518316600160801b029190921617600190910155565b5f5b81518110156105aa575f8282815181106108e1576108e1611420565b60200260200101516080015160028111156108fe576108fe61140c565b036109405760085f83838151811061091857610918611420565b6020908102919091018101515182528101919091526040015f90812081815560010155610a2f565b600282828151811061095457610954611420565b60200260200101516080015160028111156109715761097161140c565b14806109ab5750600182828151811061098c5761098c611420565b60200260200101516080015160028111156109a9576109a961140c565b145b15610a2f57610a2f8282815181106109c5576109c5611420565b60200260200101515f01518383815181106109e2576109e2611420565b602002602001015160200151848481518110610a0057610a00611420565b602002602001015160400151858581518110610a1e57610a1e611420565b60200260200101516060015161078a565b6001016108c5565b5f5b81518110156105aa575f828281518110610a5557610a55611420565b602002602001015160a001516002811115610a7257610a7261140c565b03610ae157600a5f838381518110610a8c57610a8c611420565b60200260200101515f015181526020019081526020015f205f838381518110610ab757610ab7611420565b60209081029190910181015181015182528101919091526040015f90812081815560010155610bee565b6002828281518110610af557610af5611420565b602002602001015160a001516002811115610b1257610b1261140c565b1480610b4c57506001828281518110610b2d57610b2d611420565b602002602001015160a001516002811115610b4a57610b4a61140c565b145b15610bee57610bee828281518110610b6657610b66611420565b60200260200101515f0151838381518110610b8357610b83611420565b602002602001015160200151848481518110610ba157610ba1611420565b602002602001015160400151858581518110610bbf57610bbf611420565b602002602001015160600151868681518110610bdd57610bdd611420565b602002602001015160800151610868565b600101610a39565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405290565b6040516080810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405160a0810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b60405160c0810167ffffffffffffffff81118282101715610c2d57610c2d610bf6565b604051601f8201601f1916810167ffffffffffffffff81118282101715610cc557610cc5610bf6565b604052919050565b80356001600160a01b0381168114610ce3575f80fd5b919050565b5f805f8060808587031215610cfb575f80fd5b84358015158114610d0a575f80fd5b93506020858101359350604086013567ffffffffffffffff80821115610d2e575f80fd5b818801915088601f830112610d41575f80fd5b813581811115610d5357610d53610bf6565b610d65601f8201601f19168501610c9c565b91508082528984828501011115610d7a575f80fd5b80848401858401375f84828401015250809450505050610d9c60608601610ccd565b905092959194509250565b5f67ffffffffffffffff821115610dc057610dc0610bf6565b5060051b60200190565b803560038110610ce3575f80fd5b5f6020808385031215610de9575f80fd5b823567ffffffffffffffff811115610dff575f80fd5b8301601f81018513610e0f575f80fd5b8035610e22610e1d82610da7565b610c9c565b81815260609182028301840191848201919088841115610e40575f80fd5b938501935b83851015610e965780858a031215610e5b575f80fd5b610e63610c0a565b85358152610e72878701610ccd565b878201526040610e83818801610dca565b9082015283529384019391850191610e45565b50979650505050505050565b80356001600160801b0381168114610ce3575f80fd5b5f805f60608486031215610eca575f80fd5b83359250610eda60208501610ea2565b9150610ee860408501610ea2565b90509250925092565b5f8060408385031215610f02575f80fd5b82359150610f1260208401610ccd565b90509250929050565b5f60208284031215610f2b575f80fd5b5035919050565b5f6020808385031215610f43575f80fd5b823567ffffffffffffffff811115610f59575f80fd5b8301601f81018513610f69575f80fd5b8035610f77610e1d82610da7565b81815260079190911b82018301908381019087831115610f95575f80fd5b928401925b82841015610ff25760808489031215610fb1575f80fd5b610fb9610c33565b843581528585013586820152604080860135908201526060610fdc818701610dca565b9082015282526080939093019290840190610f9a565b979650505050505050565b5f805f6060848603121561100f575f80fd5b505081359360208301359350604090920135919050565b5f805f8060808587031215611039575f80fd5b843593506020850135925061105060408601610ea2565b9150610d9c60608601610ea2565b5f806040838503121561106f575f80fd5b50508035926020909101359150565b5f602080835283518060208501525f5b818110156110aa5785810183015185820160400152820161108e565b505f604082860101526040601f19601f8301168501019250505092915050565b5f805f805f60a086880312156110de575f80fd5b8535945060208601359350604086013592506110fc60608701610ea2565b915061110a60808701610ea2565b90509295509295909350565b5f6020808385031215611127575f80fd5b823567ffffffffffffffff81111561113d575f80fd5b8301601f8101851361114d575f80fd5b803561115b610e1d82610da7565b81815260a09182028301840191848201919088841115611179575f80fd5b938501935b83851015610e965780858a031215611194575f80fd5b61119c610c56565b85358152868601358782015260406111b5818801610ea2565b9082015260606111c6878201610ea2565b9082015260806111d7878201610dca565b908201528352938401939185019161117e565b5f60208083850312156111fb575f80fd5b823567ffffffffffffffff811115611211575f80fd5b8301601f81018513611221575f80fd5b803561122f610e1d82610da7565b81815260c0918202830184019184820191908884111561124d575f80fd5b938501935b83851015610e965780858a031215611268575f80fd5b611270610c79565b853581528686013587820152604080870135908201526060611293818801610ea2565b9082015260806112a4878201610ea2565b9082015260a06112b5878201610dca565b9082015283529384019391850191611252565b600181811c908216806112dc57607f821691505b6020821081036112fa57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561134757805f5260205f20601f840160051c810160208510156113255750805b601f840160051c820191505b81811015611344575f8155600101611331565b50505b505050565b815167ffffffffffffffff81111561136657611366610bf6565b61137a8161137484546112c8565b84611300565b602080601f8311600181146113ad575f84156113965750858301515b5f19600386901b1c1916600185901b178555611404565b5f85815260208120601f198616915b828110156113db578886015182559484019460019091019084016113bc565b50858210156113f857878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffdfea2646970667358221220d2b83ac3b43e98360c903f68c0dc0b247343ee73bff7368b1c2ef1412d6cb2dc64736f6c63430008180033 /// ``` #[rustfmt::skip] #[allow(clippy::all)] pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( - b"`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[P`\x046\x10a\x01\x06W_5`\xE0\x1C\x80c\x80&\xDE1\x11a\0\x9EW\x80c\xC7\xBFM\xB5\x11a\0nW\x80c\xC7\xBFM\xB5\x14a\x02\xC9W\x80c\xC8\xAF:\xA6\x14a\x02\xDCW\x80c\xD1^\xC8Q\x14a\x02\xEFW\x80c\xEA\xD1\x84\0\x14a\x031W\x80c\xF2]T\xF5\x14a\x03SW_\x80\xFD[\x80c\x80&\xDE1\x14a\x02^W\x80c\x88\xDF\xDD\xC6\x14a\x02qW\x80c\xA3\x14\x15\x0F\x14a\x02\xABW\x80c\xA5\xD6f\xA9\x14a\x02\xB4W_\x80\xFD[\x80c\x1C\x13C\x15\x11a\0\xD9W\x80c\x1C\x13C\x15\x14a\x01\xCEW\x80c*\xE4&\x86\x14a\x01\xE1W\x80ci\x87\xB1\xFB\x14a\x02!W\x80cl\xC0\x14\xDE\x14a\x02BW_\x80\xFD[\x80c\x02\0\"\\\x14a\x01\nW\x80c\nM\x04\xF7\x14a\x01\x1FW\x80c\x0C\x16\x16\xC9\x14a\x01\x8EW\x80c\x14\x17\xA4\xF0\x14a\x01\xA1W[_\x80\xFD[a\x01\x1Da\x01\x186`\x04a\x085V[a\x03fV[\0[a\x01da\x01-6`\x04a\x08\xF4V[`\t` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[`@\x80Q\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x85\x01R\x91\x16\x90\x82\x01R``\x01[`@Q\x80\x91\x03\x90\xF3[a\x01\x1Da\x01\x9C6`\x04a\tEV[a\x03\xAAV[a\x01\x1Da\x01\xAF6`\x04a\n%V[`\x06\x92\x90\x92U`\x01`\x01`\x80\x1B\x03\x91\x82\x16`\x01`\x80\x1B\x02\x91\x16\x17`\x07UV[a\x01\x1Da\x01\xDC6`\x04a\n^V[a\x04\xEBV[a\x02\ta\x01\xEF6`\x04a\n\x88V[`\x04` R_\x90\x81R`@\x90 T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\x01\x85V[a\x024a\x02/6`\x04a\n\x88V[a\x05\x18V[`@Q\x90\x81R` \x01a\x01\x85V[_Ta\x02N\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\x01\x85V[a\x01\x1Da\x02l6`\x04a\n\x9FV[a\x057V[a\x01da\x02\x7F6`\x04a\n\x88V[`\x08` R_\x90\x81R`@\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x024`\x01T\x81V[a\x02\xBCa\x05\x89V[`@Qa\x01\x85\x91\x90a\n\xD7V[a\x01\x1Da\x02\xD76`\x04a\x0B#V[a\x06\x15V[`\x03Ta\x02\t\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\x01\x1Da\x02\xFD6`\x04a\n\x88V[`\x05\x80T`\x01\x81\x01\x82U_\x91\x90\x91R\x7F\x03kc\x84\xB5\xEC\xA7\x91\xC6'a\x15-\x0Cy\xBB\x06\x04\xC1\x04\xA5\xFBoN\xB0p?1T\xBB=\xB0\x01UV[`\x06T`\x07Ta\x01d\x91\x90`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x01\x1Da\x03a6`\x04a\n\x88V[`\x01UV[_\x80T`\xFF\x19\x16\x85\x15\x15\x17\x90U`\x01\x83\x90U`\x02a\x03\x84\x83\x82a\x0C{V[P`\x03\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UPPPV[_[\x81Q\x81\x10\x15a\x04\xE7W_\x82\x82\x81Q\x81\x10a\x03\xC8Wa\x03\xC8a\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x03\xE5Wa\x03\xE5a\r;V[\x03a\x04,W`\x04_\x83\x83\x81Q\x81\x10a\x03\xFFWa\x03\xFFa\rOV[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_ \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90Ua\x04\xDFV[`\x02\x82\x82\x81Q\x81\x10a\x04@Wa\x04@a\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04]Wa\x04]a\r;V[\x14\x80a\x04\x97WP`\x01\x82\x82\x81Q\x81\x10a\x04xWa\x04xa\rOV[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04\x95Wa\x04\x95a\r;V[\x14[\x15a\x04\xDFWa\x04\xDF\x82\x82\x81Q\x81\x10a\x04\xB1Wa\x04\xB1a\rOV[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x04\xCEWa\x04\xCEa\rOV[` \x02` \x01\x01Q` \x01Qa\x04\xEBV[`\x01\x01a\x03\xACV[PPV[_\x91\x82R`\x04` R`@\x90\x91 \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x91\x90\x91\x17\x90UV[`\x05\x81\x81T\x81\x10a\x05'W_\x80\xFD[_\x91\x82R` \x90\x91 \x01T\x90P\x81V[`@\x80Q``\x81\x01\x82R\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x80\x86\x01\x91\x82R\x92\x84\x16\x85\x83\x01\x90\x81R_\x96\x87R`\x08\x90\x93R\x94 \x92Q\x83U\x92Q\x92Q\x81\x16`\x01`\x80\x1B\x02\x92\x16\x91\x90\x91\x17`\x01\x90\x91\x01UV[`\x02\x80Ta\x05\x96\x90a\x0B\xF7V[\x80`\x1F\x01` \x80\x91\x04\x02` \x01`@Q\x90\x81\x01`@R\x80\x92\x91\x90\x81\x81R` \x01\x82\x80Ta\x05\xC2\x90a\x0B\xF7V[\x80\x15a\x06\rW\x80`\x1F\x10a\x05\xE4Wa\x01\0\x80\x83T\x04\x02\x83R\x91` \x01\x91a\x06\rV[\x82\x01\x91\x90_R` _ \x90[\x81T\x81R\x90`\x01\x01\x90` \x01\x80\x83\x11a\x05\xF0W\x82\x90\x03`\x1F\x16\x82\x01\x91[PPPPP\x81V[_[\x81Q\x81\x10\x15a\x04\xE7W_\x82\x82\x81Q\x81\x10a\x063Wa\x063a\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06PWa\x06Pa\r;V[\x03a\x06\x92W`\x08_\x83\x83\x81Q\x81\x10a\x06jWa\x06ja\rOV[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_\x90\x81 \x81\x81U`\x01\x01Ua\x07\x81V[`\x02\x82\x82\x81Q\x81\x10a\x06\xA6Wa\x06\xA6a\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06\xC3Wa\x06\xC3a\r;V[\x14\x80a\x06\xFDWP`\x01\x82\x82\x81Q\x81\x10a\x06\xDEWa\x06\xDEa\rOV[` \x02` \x01\x01Q`\x80\x01Q`\x02\x81\x11\x15a\x06\xFBWa\x06\xFBa\r;V[\x14[\x15a\x07\x81Wa\x07\x81\x82\x82\x81Q\x81\x10a\x07\x17Wa\x07\x17a\rOV[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x074Wa\x074a\rOV[` \x02` \x01\x01Q` \x01Q\x84\x84\x81Q\x81\x10a\x07RWa\x07Ra\rOV[` \x02` \x01\x01Q`@\x01Q\x85\x85\x81Q\x81\x10a\x07pWa\x07pa\rOV[` \x02` \x01\x01Q``\x01Qa\x057V[`\x01\x01a\x06\x17V[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[`@Q``\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x07\xC0Wa\x07\xC0a\x07\x89V[`@R\x90V[`@Q`\xA0\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x07\xC0Wa\x07\xC0a\x07\x89V[`@Q`\x1F\x82\x01`\x1F\x19\x16\x81\x01g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x82\x82\x10\x17\x15a\x08\x12Wa\x08\x12a\x07\x89V[`@R\x91\x90PV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x080W_\x80\xFD[\x91\x90PV[_\x80_\x80`\x80\x85\x87\x03\x12\x15a\x08HW_\x80\xFD[\x845\x80\x15\x15\x81\x14a\x08WW_\x80\xFD[\x93P` \x85\x81\x015\x93P`@\x86\x015g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x80\x82\x11\x15a\x08{W_\x80\xFD[\x81\x88\x01\x91P\x88`\x1F\x83\x01\x12a\x08\x8EW_\x80\xFD[\x815\x81\x81\x11\x15a\x08\xA0Wa\x08\xA0a\x07\x89V[a\x08\xB2`\x1F\x82\x01`\x1F\x19\x16\x85\x01a\x07\xE9V[\x91P\x80\x82R\x89\x84\x82\x85\x01\x01\x11\x15a\x08\xC7W_\x80\xFD[\x80\x84\x84\x01\x85\x84\x017_\x84\x82\x84\x01\x01RP\x80\x94PPPPa\x08\xE9``\x86\x01a\x08\x1AV[\x90P\x92\x95\x91\x94P\x92PV[_\x80`@\x83\x85\x03\x12\x15a\t\x05W_\x80\xFD[PP\x805\x92` \x90\x91\x015\x91PV[_g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x15a\t-Wa\t-a\x07\x89V[P`\x05\x1B` \x01\x90V[\x805`\x03\x81\x10a\x080W_\x80\xFD[_` \x80\x83\x85\x03\x12\x15a\tVW_\x80\xFD[\x825g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\tlW_\x80\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\t|W_\x80\xFD[\x805a\t\x8Fa\t\x8A\x82a\t\x14V[a\x07\xE9V[\x81\x81R``\x91\x82\x02\x83\x01\x84\x01\x91\x84\x82\x01\x91\x90\x88\x84\x11\x15a\t\xADW_\x80\xFD[\x93\x85\x01\x93[\x83\x85\x10\x15a\n\x03W\x80\x85\x8A\x03\x12\x15a\t\xC8W_\x80\xFD[a\t\xD0a\x07\x9DV[\x855\x81Ra\t\xDF\x87\x87\x01a\x08\x1AV[\x87\x82\x01R`@a\t\xF0\x81\x88\x01a\t7V[\x90\x82\x01R\x83R\x93\x84\x01\x93\x91\x85\x01\x91a\t\xB2V[P\x97\x96PPPPPPPV[\x805`\x01`\x01`\x80\x1B\x03\x81\x16\x81\x14a\x080W_\x80\xFD[_\x80_``\x84\x86\x03\x12\x15a\n7W_\x80\xFD[\x835\x92Pa\nG` \x85\x01a\n\x0FV[\x91Pa\nU`@\x85\x01a\n\x0FV[\x90P\x92P\x92P\x92V[_\x80`@\x83\x85\x03\x12\x15a\noW_\x80\xFD[\x825\x91Pa\n\x7F` \x84\x01a\x08\x1AV[\x90P\x92P\x92\x90PV[_` \x82\x84\x03\x12\x15a\n\x98W_\x80\xFD[P5\x91\x90PV[_\x80_\x80`\x80\x85\x87\x03\x12\x15a\n\xB2W_\x80\xFD[\x845\x93P` \x85\x015\x92Pa\n\xC9`@\x86\x01a\n\x0FV[\x91Pa\x08\xE9``\x86\x01a\n\x0FV[_` \x80\x83R\x83Q\x80` \x85\x01R_[\x81\x81\x10\x15a\x0B\x03W\x85\x81\x01\x83\x01Q\x85\x82\x01`@\x01R\x82\x01a\n\xE7V[P_`@\x82\x86\x01\x01R`@`\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x92PPP\x92\x91PPV[_` \x80\x83\x85\x03\x12\x15a\x0B4W_\x80\xFD[\x825g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\x0BJW_\x80\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\x0BZW_\x80\xFD[\x805a\x0Bha\t\x8A\x82a\t\x14V[\x81\x81R`\xA0\x91\x82\x02\x83\x01\x84\x01\x91\x84\x82\x01\x91\x90\x88\x84\x11\x15a\x0B\x86W_\x80\xFD[\x93\x85\x01\x93[\x83\x85\x10\x15a\n\x03W\x80\x85\x8A\x03\x12\x15a\x0B\xA1W_\x80\xFD[a\x0B\xA9a\x07\xC6V[\x855\x81R\x86\x86\x015\x87\x82\x01R`@a\x0B\xC2\x81\x88\x01a\n\x0FV[\x90\x82\x01R``a\x0B\xD3\x87\x82\x01a\n\x0FV[\x90\x82\x01R`\x80a\x0B\xE4\x87\x82\x01a\t7V[\x90\x82\x01R\x83R\x93\x84\x01\x93\x91\x85\x01\x91a\x0B\x8BV[`\x01\x81\x81\x1C\x90\x82\x16\x80a\x0C\x0BW`\x7F\x82\x16\x91P[` \x82\x10\x81\x03a\x0C)WcNH{q`\xE0\x1B_R`\"`\x04R`$_\xFD[P\x91\x90PV[`\x1F\x82\x11\x15a\x0CvW\x80_R` _ `\x1F\x84\x01`\x05\x1C\x81\x01` \x85\x10\x15a\x0CTWP\x80[`\x1F\x84\x01`\x05\x1C\x82\x01\x91P[\x81\x81\x10\x15a\x0CsW_\x81U`\x01\x01a\x0C`V[PP[PPPV[\x81Qg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11\x15a\x0C\x95Wa\x0C\x95a\x07\x89V[a\x0C\xA9\x81a\x0C\xA3\x84Ta\x0B\xF7V[\x84a\x0C/V[` \x80`\x1F\x83\x11`\x01\x81\x14a\x0C\xDCW_\x84\x15a\x0C\xC5WP\x85\x83\x01Q[_\x19`\x03\x86\x90\x1B\x1C\x19\x16`\x01\x85\x90\x1B\x17\x85Ua\r3V[_\x85\x81R` \x81 `\x1F\x19\x86\x16\x91[\x82\x81\x10\x15a\r\nW\x88\x86\x01Q\x82U\x94\x84\x01\x94`\x01\x90\x91\x01\x90\x84\x01a\x0C\xEBV[P\x85\x82\x10\x15a\r'W\x87\x85\x01Q_\x19`\x03\x88\x90\x1B`\xF8\x16\x1C\x19\x16\x81U[PP`\x01\x84`\x01\x1B\x01\x85U[PPPPPPV[cNH{q`\xE0\x1B_R`!`\x04R`$_\xFD[cNH{q`\xE0\x1B_R`2`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 e\x90\xD86V\x1D\x83@\xD2\xD8=\\\xD0c\xD2\xC7Q\xFD\xEA3k\x0E3\x02\xA9\x90\xDD\x06\0\xD1q\xD4dsolcC\0\x08\x18\x003", + b"`\x80`@R4\x80\x15a\0\x0FW_\x80\xFD[P`\x046\x10a\x01=W_5`\xE0\x1C\x80c\x88\xDF\xDD\xC6\x11a\0\xB4W\x80c\xC7\xBFM\xB5\x11a\0yW\x80c\xC7\xBFM\xB5\x14a\x03yW\x80c\xC8\xAF:\xA6\x14a\x03\x8CW\x80c\xD1^\xC8Q\x14a\x03\x9FW\x80c\xEA\xD1\x84\0\x14a\x03\xE1W\x80c\xF2]T\xF5\x14a\x04\x03W\x80c\xFBXl}\x14a\x04\x16W_\x80\xFD[\x80c\x88\xDF\xDD\xC6\x14a\x02\xE4W\x80c\x96\xDC\x9AA\x14a\x03\x1EW\x80c\xA3\x14\x15\x0F\x14a\x03HW\x80c\xA5\xD6f\xA9\x14a\x03QW\x80c\xC6\xA7\xF0\xFE\x14a\x03fW_\x80\xFD[\x80c.\xB5\xCF\xD8\x11a\x01\x05W\x80c.\xB5\xCF\xD8\x14a\x01\xEEW\x80cL\xF5\xA9J\x14a\x02\x01W\x80ci\x87\xB1\xFB\x14a\x02*W\x80cl\xC0\x14\xDE\x14a\x02KW\x80c\x80&\xDE1\x14a\x02gW\x80c\x85\xB6H\x9F\x14a\x02zW_\x80\xFD[\x80c\x02\0\"\\\x14a\x01AW\x80c\x0C\x16\x16\xC9\x14a\x01VW\x80c\x14\x17\xA4\xF0\x14a\x01iW\x80c\x1C\x13C\x15\x14a\x01\x96W\x80c*\xE4&\x86\x14a\x01\xA9W[_\x80\xFD[a\x01Ta\x01O6`\x04a\x0C\xE8V[a\x04)V[\0[a\x01Ta\x01d6`\x04a\r\xD8V[a\x04mV[a\x01Ta\x01w6`\x04a\x0E\xB8V[`\x06\x92\x90\x92U`\x01`\x01`\x80\x1B\x03\x91\x82\x16`\x01`\x80\x1B\x02\x91\x16\x17`\x07UV[a\x01Ta\x01\xA46`\x04a\x0E\xF1V[a\x05\xAEV[a\x01\xD1a\x01\xB76`\x04a\x0F\x1BV[`\x04` R_\x90\x81R`@\x90 T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\x01Ta\x01\xFC6`\x04a\x0F2V[a\x05\xDBV[a\x01Ta\x02\x0F6`\x04a\x0F\xFDV[_\x92\x83R`\t` \x90\x81R`@\x80\x85 \x93\x85R\x92\x90R\x91 UV[a\x02=a\x0286`\x04a\x0F\x1BV[a\x07kV[`@Q\x90\x81R` \x01a\x01\xE5V[_Ta\x02W\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\x01\xE5V[a\x01Ta\x02u6`\x04a\x10&V[a\x07\x8AV[a\x02\xBFa\x02\x886`\x04a\x10^V[`\n` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[`@\x80Q\x93\x84R`\x01`\x01`\x80\x1B\x03\x92\x83\x16` \x85\x01R\x91\x16\x90\x82\x01R``\x01a\x01\xE5V[a\x02\xBFa\x02\xF26`\x04a\x0F\x1BV[`\x08` R_\x90\x81R`@\x90 \x80T`\x01\x90\x91\x01T`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x02=a\x03,6`\x04a\x10^V[`\t` \x90\x81R_\x92\x83R`@\x80\x84 \x90\x91R\x90\x82R\x90 T\x81V[a\x02=`\x01T\x81V[a\x03Ya\x07\xDCV[`@Qa\x01\xE5\x91\x90a\x10~V[a\x01Ta\x03t6`\x04a\x10\xCAV[a\x08hV[a\x01Ta\x03\x876`\x04a\x11\x16V[a\x08\xC3V[`\x03Ta\x01\xD1\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\x01Ta\x03\xAD6`\x04a\x0F\x1BV[`\x05\x80T`\x01\x81\x01\x82U_\x91\x90\x91R\x7F\x03kc\x84\xB5\xEC\xA7\x91\xC6'a\x15-\x0Cy\xBB\x06\x04\xC1\x04\xA5\xFBoN\xB0p?1T\xBB=\xB0\x01UV[`\x06T`\x07Ta\x02\xBF\x91\x90`\x01`\x01`\x80\x1B\x03\x80\x82\x16\x91`\x01`\x80\x1B\x90\x04\x16\x83V[a\x01Ta\x04\x116`\x04a\x0F\x1BV[`\x01UV[a\x01Ta\x04$6`\x04a\x11\xEAV[a\n7V[_\x80T`\xFF\x19\x16\x85\x15\x15\x17\x90U`\x01\x83\x90U`\x02a\x04G\x83\x82a\x13LV[P`\x03\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UPPPV[_[\x81Q\x81\x10\x15a\x05\xAAW_\x82\x82\x81Q\x81\x10a\x04\x8BWa\x04\x8Ba\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x04\xA8Wa\x04\xA8a\x14\x0CV[\x03a\x04\xEFW`\x04_\x83\x83\x81Q\x81\x10a\x04\xC2Wa\x04\xC2a\x14 V[` \x90\x81\x02\x91\x90\x91\x01\x81\x01QQ\x82R\x81\x01\x91\x90\x91R`@\x01_ \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90Ua\x05\xA2V[`\x02\x82\x82\x81Q\x81\x10a\x05\x03Wa\x05\x03a\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x05 Wa\x05 a\x14\x0CV[\x14\x80a\x05ZWP`\x01\x82\x82\x81Q\x81\x10a\x05;Wa\x05;a\x14 V[` \x02` \x01\x01Q`@\x01Q`\x02\x81\x11\x15a\x05XWa\x05Xa\x14\x0CV[\x14[\x15a\x05\xA2Wa\x05\xA2\x82\x82\x81Q\x81\x10a\x05tWa\x05ta\x14 V[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x05\x91Wa\x05\x91a\x14 V[` \x02` \x01\x01Q` \x01Qa\x05\xAEV[`\x01\x01a\x04oV[PPV[_\x91\x82R`\x04` R`@\x90\x91 \x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x91\x90\x91\x17\x90UV[_[\x81Q\x81\x10\x15a\x05\xAAW_\x82\x82\x81Q\x81\x10a\x05\xF9Wa\x05\xF9a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\x16Wa\x06\x16a\x14\x0CV[\x03a\x06|W`\t_\x83\x83\x81Q\x81\x10a\x060Wa\x060a\x14 V[` \x02` \x01\x01Q_\x01Q\x81R` \x01\x90\x81R` \x01_ _\x83\x83\x81Q\x81\x10a\x06[Wa\x06[a\x14 V[` \x02` \x01\x01Q` \x01Q\x81R` \x01\x90\x81R` \x01_ _\x90Ua\x07cV[`\x02\x82\x82\x81Q\x81\x10a\x06\x90Wa\x06\x90a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\xADWa\x06\xADa\x14\x0CV[\x14\x80a\x06\xE7WP`\x01\x82\x82\x81Q\x81\x10a\x06\xC8Wa\x06\xC8a\x14 V[` \x02` \x01\x01Q``\x01Q`\x02\x81\x11\x15a\x06\xE5Wa\x06\xE5a\x14\x0CV[\x14[\x15a\x07cWa\x07c\x82\x82\x81Q\x81\x10a\x07\x01Wa\x07\x01a\x14 V[` \x02` \x01\x01Q_\x01Q\x83\x83\x81Q\x81\x10a\x07\x1EWa\x07\x1Ea\x14 V[` \x02` \x01\x01Q` \x01Q\x84\x84\x81Q\x81\x10a\x07\x986\x0C\x90?h\xC0\xDC\x0B$sC\xEEs\xBF\xF76\x8B\x1C.\xF1A-l\xB2\xDCdsolcC\0\x08\x18\x003", ); #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] @@ -746,15 +925,14 @@ pub mod Simple { } }; /**```solidity - struct MappingStructChange { uint256 key; uint256 field1; uint128 field2; uint128 field3; MappingOperation operation; } + struct MappingOfSingleValueMappingsChange { uint256 outerKey; uint256 innerKey; uint256 value; MappingOperation operation; } ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct MappingStructChange { - pub key: alloy::sol_types::private::U256, - pub field1: alloy::sol_types::private::U256, - pub field2: u128, - pub field3: u128, + pub struct MappingOfSingleValueMappingsChange { + pub outerKey: alloy::sol_types::private::U256, + pub innerKey: alloy::sol_types::private::U256, + pub value: alloy::sol_types::private::U256, pub operation: ::RustType, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] @@ -764,16 +942,14 @@ pub mod Simple { type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Uint<256>, alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Uint<128>, - alloy::sol_types::sol_data::Uint<128>, + alloy::sol_types::sol_data::Uint<256>, MappingOperation, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::U256, alloy::sol_types::private::U256, - u128, - u128, + alloy::sol_types::private::U256, ::RustType, ); #[cfg(test)] @@ -787,50 +963,40 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: MappingStructChange) -> Self { - ( - value.key, - value.field1, - value.field2, - value.field3, - value.operation, - ) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: MappingOfSingleValueMappingsChange) -> Self { + (value.outerKey, value.innerKey, value.value, value.operation) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for MappingStructChange { + impl ::core::convert::From> for MappingOfSingleValueMappingsChange { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { - key: tuple.0, - field1: tuple.1, - field2: tuple.2, - field3: tuple.3, - operation: tuple.4, + outerKey: tuple.0, + innerKey: tuple.1, + value: tuple.2, + operation: tuple.3, } } } #[automatically_derived] - impl alloy_sol_types::SolValue for MappingStructChange { + impl alloy_sol_types::SolValue for MappingOfSingleValueMappingsChange { type SolType = Self; } #[automatically_derived] - impl alloy_sol_types::private::SolTypeValue for MappingStructChange { + impl alloy_sol_types::private::SolTypeValue for MappingOfSingleValueMappingsChange { #[inline] fn stv_to_tokens(&self) -> ::Token<'_> { ( as alloy_sol_types::SolType>::tokenize( - &self.key, + &self.outerKey, ), as alloy_sol_types::SolType>::tokenize( - &self.field1, + &self.innerKey, ), - as alloy_sol_types::SolType>::tokenize( - &self.field2, - ), - as alloy_sol_types::SolType>::tokenize( - &self.field3, + as alloy_sol_types::SolType>::tokenize( + &self.value, ), ::tokenize(&self.operation), ) @@ -869,7 +1035,7 @@ pub mod Simple { } } #[automatically_derived] - impl alloy_sol_types::SolType for MappingStructChange { + impl alloy_sol_types::SolType for MappingOfSingleValueMappingsChange { type RustType = Self; type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; const SOL_NAME: &'static str = ::NAME; @@ -888,12 +1054,12 @@ pub mod Simple { } } #[automatically_derived] - impl alloy_sol_types::SolStruct for MappingStructChange { - const NAME: &'static str = "MappingStructChange"; + impl alloy_sol_types::SolStruct for MappingOfSingleValueMappingsChange { + const NAME: &'static str = "MappingOfSingleValueMappingsChange"; #[inline] fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { alloy_sol_types::private::Cow::Borrowed( - "MappingStructChange(uint256 key,uint256 field1,uint128 field2,uint128 field3,uint8 operation)", + "MappingOfSingleValueMappingsChange(uint256 outerKey,uint256 innerKey,uint256 value,uint8 operation)", ) } #[inline] @@ -911,19 +1077,15 @@ pub mod Simple { [ as alloy_sol_types::SolType>::eip712_data_word(&self.key) + > as alloy_sol_types::SolType>::eip712_data_word(&self.outerKey) .0, as alloy_sol_types::SolType>::eip712_data_word(&self.field1) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.field2) + > as alloy_sol_types::SolType>::eip712_data_word(&self.innerKey) .0, as alloy_sol_types::SolType>::eip712_data_word(&self.field3) + 256, + > as alloy_sol_types::SolType>::eip712_data_word(&self.value) .0, ::eip712_data_word( &self.operation, @@ -934,28 +1096,23 @@ pub mod Simple { } } #[automatically_derived] - impl alloy_sol_types::EventTopic for MappingStructChange { + impl alloy_sol_types::EventTopic for MappingOfSingleValueMappingsChange { #[inline] fn topic_preimage_length(rust: &Self::RustType) -> usize { 0usize - + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.key) + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.field1, + &rust.outerKey, ) + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.field2, + &rust.innerKey, ) + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.field3, - ) + 256, + > as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.value) + ::topic_preimage_length( &rust.operation, ) @@ -966,25 +1123,22 @@ pub mod Simple { out: &mut alloy_sol_types::private::Vec, ) { out.reserve(::topic_preimage_length(rust)); - as alloy_sol_types::EventTopic>::encode_topic_preimage(&rust.key, out); as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.field1, + &rust.outerKey, out, ); as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.field2, + &rust.innerKey, out, ); as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.field3, + &rust.value, out, ); ::encode_topic_preimage( @@ -1000,48 +1154,811 @@ pub mod Simple { } } }; - /**Function with signature `addToArray(uint256)` and selector `0xd15ec851`. - ```solidity - function addToArray(uint256 value) external; + /**```solidity + struct MappingOfStructMappingsChange { uint256 outerKey; uint256 innerKey; uint256 field1; uint128 field2; uint128 field3; MappingOperation operation; } ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct addToArrayCall { - pub value: alloy::sol_types::private::U256, + pub struct MappingOfStructMappingsChange { + pub outerKey: alloy::sol_types::private::U256, + pub innerKey: alloy::sol_types::private::U256, + pub field1: alloy::sol_types::private::U256, + pub field2: u128, + pub field3: u128, + pub operation: ::RustType, } - ///Container type for the return parameters of the [`addToArray(uint256)`](addToArrayCall) function. - #[allow(non_camel_case_types, non_snake_case)] - #[derive(Clone)] - pub struct addToArrayReturn {} #[allow(non_camel_case_types, non_snake_case, 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::U256,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<128>, + alloy::sol_types::sol_data::Uint<128>, + MappingOperation, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + u128, + u128, + ::RustType, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: MappingOfStructMappingsChange) -> Self { + ( + value.outerKey, + value.innerKey, + value.field1, + value.field2, + value.field3, + value.operation, + ) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for MappingOfStructMappingsChange { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + outerKey: tuple.0, + innerKey: tuple.1, + field1: tuple.2, + field2: tuple.3, + field3: tuple.4, + operation: tuple.5, + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolValue for MappingOfStructMappingsChange { + type SolType = Self; + } + #[automatically_derived] + impl alloy_sol_types::private::SolTypeValue for MappingOfStructMappingsChange { + #[inline] + fn stv_to_tokens(&self) -> ::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize( + &self.outerKey, + ), + as alloy_sol_types::SolType>::tokenize( + &self.innerKey, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field1, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field2, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field3, + ), + ::tokenize(&self.operation), + ) + } + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + if let Some(size) = ::ENCODED_SIZE { + return size; + } + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encoded_size(&tuple) + } + #[inline] + fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { + ::eip712_hash_struct(self) + } + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut alloy_sol_types::private::Vec) { + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encode_packed_to( + &tuple, out, + ) + } + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + if let Some(size) = ::PACKED_ENCODED_SIZE { + return size; + } + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_packed_encoded_size( + &tuple, + ) + } + } + #[automatically_derived] + impl alloy_sol_types::SolType for MappingOfStructMappingsChange { + type RustType = Self; + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SOL_NAME: &'static str = ::NAME; + const ENCODED_SIZE: Option = + as alloy_sol_types::SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = + as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; + #[inline] + fn valid_token(token: &Self::Token<'_>) -> bool { + as alloy_sol_types::SolType>::valid_token(token) + } + #[inline] + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + let tuple = as alloy_sol_types::SolType>::detokenize(token); + >>::from(tuple) + } + } + #[automatically_derived] + impl alloy_sol_types::SolStruct for MappingOfStructMappingsChange { + const NAME: &'static str = "MappingOfStructMappingsChange"; + #[inline] + fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { + alloy_sol_types::private::Cow::Borrowed( + "MappingOfStructMappingsChange(uint256 outerKey,uint256 innerKey,uint256 field1,uint128 field2,uint128 field3,uint8 operation)", + ) + } + #[inline] + fn eip712_components( + ) -> alloy_sol_types::private::Vec> + { + alloy_sol_types::private::Vec::new() + } + #[inline] + fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { + ::eip712_root_type() + } + #[inline] + fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { + [ + as alloy_sol_types::SolType>::eip712_data_word(&self.outerKey) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.innerKey) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field1) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field2) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field3) + .0, + ::eip712_data_word( + &self.operation, + ) + .0, + ] + .concat() + } + } + #[automatically_derived] + impl alloy_sol_types::EventTopic for MappingOfStructMappingsChange { + #[inline] + fn topic_preimage_length(rust: &Self::RustType) -> usize { + 0usize + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.outerKey, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.innerKey, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field1, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field2, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field3, + ) + + ::topic_preimage_length( + &rust.operation, + ) + } + #[inline] + fn encode_topic_preimage( + rust: &Self::RustType, + out: &mut alloy_sol_types::private::Vec, + ) { + out.reserve(::topic_preimage_length(rust)); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.outerKey, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.innerKey, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field1, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field2, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field3, + out, + ); + ::encode_topic_preimage( + &rust.operation, + out, + ); + } + #[inline] + fn encode_topic(rust: &Self::RustType) -> alloy_sol_types::abi::token::WordToken { + let mut out = alloy_sol_types::private::Vec::new(); + ::encode_topic_preimage(rust, &mut out); + alloy_sol_types::abi::token::WordToken(alloy_sol_types::private::keccak256(out)) + } + } + }; + /**```solidity + struct MappingStructChange { uint256 key; uint256 field1; uint128 field2; uint128 field3; MappingOperation operation; } + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct MappingStructChange { + pub key: alloy::sol_types::private::U256, + pub field1: alloy::sol_types::private::U256, + pub field2: u128, + pub field3: u128, + pub operation: ::RustType, + } + #[allow(non_camel_case_types, non_snake_case, clippy::style)] + const _: () = { + use alloy::sol_types as alloy_sol_types; + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<128>, + alloy::sol_types::sol_data::Uint<128>, + MappingOperation, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + u128, + u128, + ::RustType, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: MappingStructChange) -> Self { + ( + value.key, + value.field1, + value.field2, + value.field3, + value.operation, + ) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for MappingStructChange { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + key: tuple.0, + field1: tuple.1, + field2: tuple.2, + field3: tuple.3, + operation: tuple.4, + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolValue for MappingStructChange { + type SolType = Self; + } + #[automatically_derived] + impl alloy_sol_types::private::SolTypeValue for MappingStructChange { + #[inline] + fn stv_to_tokens(&self) -> ::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize( + &self.key, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field1, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field2, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field3, + ), + ::tokenize(&self.operation), + ) + } + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + if let Some(size) = ::ENCODED_SIZE { + return size; + } + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encoded_size(&tuple) + } + #[inline] + fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { + ::eip712_hash_struct(self) + } + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut alloy_sol_types::private::Vec) { + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encode_packed_to( + &tuple, out, + ) + } + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + if let Some(size) = ::PACKED_ENCODED_SIZE { + return size; + } + let tuple = + as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_packed_encoded_size( + &tuple, + ) + } + } + #[automatically_derived] + impl alloy_sol_types::SolType for MappingStructChange { + type RustType = Self; + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SOL_NAME: &'static str = ::NAME; + const ENCODED_SIZE: Option = + as alloy_sol_types::SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = + as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; + #[inline] + fn valid_token(token: &Self::Token<'_>) -> bool { + as alloy_sol_types::SolType>::valid_token(token) + } + #[inline] + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + let tuple = as alloy_sol_types::SolType>::detokenize(token); + >>::from(tuple) + } + } + #[automatically_derived] + impl alloy_sol_types::SolStruct for MappingStructChange { + const NAME: &'static str = "MappingStructChange"; + #[inline] + fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { + alloy_sol_types::private::Cow::Borrowed( + "MappingStructChange(uint256 key,uint256 field1,uint128 field2,uint128 field3,uint8 operation)", + ) + } + #[inline] + fn eip712_components( + ) -> alloy_sol_types::private::Vec> + { + alloy_sol_types::private::Vec::new() + } + #[inline] + fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { + ::eip712_root_type() + } + #[inline] + fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { + [ + as alloy_sol_types::SolType>::eip712_data_word(&self.key) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field1) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field2) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.field3) + .0, + ::eip712_data_word( + &self.operation, + ) + .0, + ] + .concat() + } + } + #[automatically_derived] + impl alloy_sol_types::EventTopic for MappingStructChange { + #[inline] + fn topic_preimage_length(rust: &Self::RustType) -> usize { + 0usize + + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.key) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field1, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field2, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.field3, + ) + + ::topic_preimage_length( + &rust.operation, + ) + } + #[inline] + fn encode_topic_preimage( + rust: &Self::RustType, + out: &mut alloy_sol_types::private::Vec, + ) { + out.reserve(::topic_preimage_length(rust)); + as alloy_sol_types::EventTopic>::encode_topic_preimage(&rust.key, out); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field1, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field2, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.field3, + out, + ); + ::encode_topic_preimage( + &rust.operation, + out, + ); + } + #[inline] + fn encode_topic(rust: &Self::RustType) -> alloy_sol_types::abi::token::WordToken { + let mut out = alloy_sol_types::private::Vec::new(); + ::encode_topic_preimage(rust, &mut out); + alloy_sol_types::abi::token::WordToken(alloy_sol_types::private::keccak256(out)) + } + } + }; + /**Function with signature `addToArray(uint256)` and selector `0xd15ec851`. + ```solidity + function addToArray(uint256 value) external; + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct addToArrayCall { + pub value: alloy::sol_types::private::U256, + } + ///Container type for the return parameters of the [`addToArray(uint256)`](addToArrayCall) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct addToArrayReturn {} + #[allow(non_camel_case_types, non_snake_case, 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::U256,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: addToArrayCall) -> Self { + (value.value,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for addToArrayCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { value: tuple.0 } + } + } + } + { + #[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) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: addToArrayReturn) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for addToArrayReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for addToArrayCall { + type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = addToArrayReturn; + type ReturnTuple<'a> = (); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "addToArray(uint256)"; + const SELECTOR: [u8; 4] = [209u8, 94u8, 200u8, 81u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize( + &self.value, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `arr1(uint256)` and selector `0x6987b1fb`. + ```solidity + function arr1(uint256) external view returns (uint256); + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct arr1Call { + pub _0: alloy::sol_types::private::U256, + } + ///Container type for the return parameters of the [`arr1(uint256)`](arr1Call) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct arr1Return { + pub _0: alloy::sol_types::private::U256, + } + #[allow(non_camel_case_types, non_snake_case, 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::U256,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: arr1Call) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for arr1Call { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: arr1Return) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for arr1Return { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for arr1Call { + type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = arr1Return; + type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "arr1(uint256)"; + const SELECTOR: [u8; 4] = [105u8, 135u8, 177u8, 251u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize( + &self._0, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `changeMapping((uint256,address,uint8)[])` and selector `0x0c1616c9`. + ```solidity + function changeMapping(MappingChange[] memory changes) external; + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct changeMappingCall { + pub changes: + alloy::sol_types::private::Vec<::RustType>, + } + ///Container type for the return parameters of the [`changeMapping((uint256,address,uint8)[])`](changeMappingCall) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct changeMappingReturn {} + #[allow(non_camel_case_types, non_snake_case, clippy::style)] + const _: () = { + use alloy::sol_types as alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Array,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::Vec< + ::RustType, + >, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: addToArrayCall) -> Self { - (value.value,) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingCall) -> Self { + (value.changes,) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for addToArrayCall { + impl ::core::convert::From> for changeMappingCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { value: tuple.0 } + Self { changes: tuple.0 } } } } @@ -1061,28 +1978,28 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: addToArrayReturn) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingReturn) -> Self { () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for addToArrayReturn { + impl ::core::convert::From> for changeMappingReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } #[automatically_derived] - impl alloy_sol_types::SolCall for addToArrayCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + impl alloy_sol_types::SolCall for changeMappingCall { + type Parameters<'a> = (alloy::sol_types::sol_data::Array,); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = addToArrayReturn; + type Return = changeMappingReturn; type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "addToArray(uint256)"; - const SELECTOR: [u8; 4] = [209u8, 94u8, 200u8, 81u8]; + const SIGNATURE: &'static str = "changeMapping((uint256,address,uint8)[])"; + const SELECTOR: [u8; 4] = [12u8, 22u8, 22u8, 201u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1092,9 +2009,9 @@ pub mod Simple { #[inline] fn tokenize(&self) -> Self::Token<'_> { ( - as alloy_sol_types::SolType>::tokenize( - &self.value, - ), + as alloy_sol_types::SolType>::tokenize(&self.changes), ) } #[inline] @@ -1109,29 +2026,34 @@ pub mod Simple { } } }; - /**Function with signature `arr1(uint256)` and selector `0x6987b1fb`. + /**Function with signature `changeMappingOfSingleValueMappings((uint256,uint256,uint256,uint8)[])` and selector `0x2eb5cfd8`. ```solidity - function arr1(uint256) external view returns (uint256); + function changeMappingOfSingleValueMappings(MappingOfSingleValueMappingsChange[] memory changes) external; ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct arr1Call { - pub _0: alloy::sol_types::private::U256, + pub struct changeMappingOfSingleValueMappingsCall { + pub changes: alloy::sol_types::private::Vec< + ::RustType, + >, } - ///Container type for the return parameters of the [`arr1(uint256)`](arr1Call) function. + ///Container type for the return parameters of the [`changeMappingOfSingleValueMappings((uint256,uint256,uint256,uint8)[])`](changeMappingOfSingleValueMappingsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct arr1Return { - pub _0: alloy::sol_types::private::U256, - } + pub struct changeMappingOfSingleValueMappingsReturn {} #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type UnderlyingSolTuple<'a> = + (alloy::sol_types::sol_data::Array,); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::Vec< + ::RustType, + >, + ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -1143,24 +2065,24 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: arr1Call) -> Self { - (value._0,) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingOfSingleValueMappingsCall) -> Self { + (value.changes,) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for arr1Call { + impl ::core::convert::From> for changeMappingOfSingleValueMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } + Self { changes: tuple.0 } } } } { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type UnderlyingSolTuple<'a> = (); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); + type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -1172,28 +2094,30 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: arr1Return) -> Self { - (value._0,) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingOfSingleValueMappingsReturn) -> Self { + () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for arr1Return { + impl ::core::convert::From> for changeMappingOfSingleValueMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } + Self {} } } } #[automatically_derived] - impl alloy_sol_types::SolCall for arr1Call { - type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + impl alloy_sol_types::SolCall for changeMappingOfSingleValueMappingsCall { + type Parameters<'a> = + (alloy::sol_types::sol_data::Array,); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = arr1Return; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type Return = changeMappingOfSingleValueMappingsReturn; + type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "arr1(uint256)"; - const SELECTOR: [u8; 4] = [105u8, 135u8, 177u8, 251u8]; + const SIGNATURE: &'static str = + "changeMappingOfSingleValueMappings((uint256,uint256,uint256,uint8)[])"; + const SELECTOR: [u8; 4] = [46u8, 181u8, 207u8, 216u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1202,11 +2126,11 @@ pub mod Simple { } #[inline] fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize( - &self._0, - ), - ) + ( as alloy_sol_types::SolType>::tokenize( + &self.changes + ),) } #[inline] fn abi_decode_returns( @@ -1220,30 +2144,32 @@ pub mod Simple { } } }; - /**Function with signature `changeMapping((uint256,address,uint8)[])` and selector `0x0c1616c9`. + /**Function with signature `changeMappingOfStructMappings((uint256,uint256,uint256,uint128,uint128,uint8)[])` and selector `0xfb586c7d`. ```solidity - function changeMapping(MappingChange[] memory changes) external; + function changeMappingOfStructMappings(MappingOfStructMappingsChange[] memory changes) external; ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct changeMappingCall { - pub changes: - alloy::sol_types::private::Vec<::RustType>, + pub struct changeMappingOfStructMappingsCall { + pub changes: alloy::sol_types::private::Vec< + ::RustType, + >, } - ///Container type for the return parameters of the [`changeMapping((uint256,address,uint8)[])`](changeMappingCall) function. + ///Container type for the return parameters of the [`changeMappingOfStructMappings((uint256,uint256,uint256,uint128,uint128,uint8)[])`](changeMappingOfStructMappingsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct changeMappingReturn {} + pub struct changeMappingOfStructMappingsReturn {} #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Array,); + type UnderlyingSolTuple<'a> = + (alloy::sol_types::sol_data::Array,); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Vec< - ::RustType, + ::RustType, >, ); #[cfg(test)] @@ -1257,14 +2183,14 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: changeMappingCall) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingOfStructMappingsCall) -> Self { (value.changes,) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for changeMappingCall { + impl ::core::convert::From> for changeMappingOfStructMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { changes: tuple.0 } } @@ -1286,28 +2212,30 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: changeMappingReturn) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: changeMappingOfStructMappingsReturn) -> Self { () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for changeMappingReturn { + impl ::core::convert::From> for changeMappingOfStructMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } #[automatically_derived] - impl alloy_sol_types::SolCall for changeMappingCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Array,); + impl alloy_sol_types::SolCall for changeMappingOfStructMappingsCall { + type Parameters<'a> = + (alloy::sol_types::sol_data::Array,); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = changeMappingReturn; + type Return = changeMappingOfStructMappingsReturn; type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "changeMapping((uint256,address,uint8)[])"; - const SELECTOR: [u8; 4] = [12u8, 22u8, 22u8, 201u8]; + const SIGNATURE: &'static str = + "changeMappingOfStructMappings((uint256,uint256,uint256,uint128,uint128,uint8)[])"; + const SELECTOR: [u8; 4] = [251u8, 88u8, 108u8, 125u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1316,11 +2244,11 @@ pub mod Simple { } #[inline] fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.changes), - ) + ( as alloy_sol_types::SolType>::tokenize( + &self.changes + ),) } #[inline] fn abi_decode_returns( @@ -1472,7 +2400,125 @@ pub mod Simple { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); + type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: m1Call) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for m1Call { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: 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) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: m1Return) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for m1Return { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for m1Call { + type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = m1Return; + type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "m1(uint256)"; + const SELECTOR: [u8; 4] = [42u8, 228u8, 38u8, 134u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize( + &self._0, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `mappingOfSingleValueMappings(uint256,uint256)` and selector `0x96dc9a41`. + ```solidity + function mappingOfSingleValueMappings(uint256, uint256) external view returns (uint256); + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct mappingOfSingleValueMappingsCall { + pub _0: alloy::sol_types::private::U256, + pub _1: alloy::sol_types::private::U256, + } + ///Container type for the return parameters of the [`mappingOfSingleValueMappings(uint256,uint256)`](mappingOfSingleValueMappingsCall) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct mappingOfSingleValueMappingsReturn { + pub _0: alloy::sol_types::private::U256, + } + #[allow(non_camel_case_types, non_snake_case, clippy::style)] + const _: () = { + use alloy::sol_types as alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -1484,24 +2530,27 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: m1Call) -> Self { - (value._0,) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: mappingOfSingleValueMappingsCall) -> Self { + (value._0, value._1) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for m1Call { + impl ::core::convert::From> for mappingOfSingleValueMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } + Self { + _0: tuple.0, + _1: tuple.1, + } } } } { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,); + type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,); + type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -1513,28 +2562,31 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: m1Return) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: mappingOfSingleValueMappingsReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for m1Return { + impl ::core::convert::From> for mappingOfSingleValueMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] - impl alloy_sol_types::SolCall for m1Call { - type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); + impl alloy_sol_types::SolCall for mappingOfSingleValueMappingsCall { + type Parameters<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = m1Return; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,); + type Return = mappingOfSingleValueMappingsReturn; + type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "m1(uint256)"; - const SELECTOR: [u8; 4] = [42u8, 228u8, 38u8, 134u8]; + const SIGNATURE: &'static str = "mappingOfSingleValueMappings(uint256,uint256)"; + const SELECTOR: [u8; 4] = [150u8, 220u8, 154u8, 65u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1547,6 +2599,9 @@ pub mod Simple { as alloy_sol_types::SolType>::tokenize( &self._0, ), + as alloy_sol_types::SolType>::tokenize( + &self._1, + ), ) } #[inline] @@ -1561,20 +2616,20 @@ pub mod Simple { } } }; - /**Function with signature `mappingOfMappings(uint256,uint256)` and selector `0x0a4d04f7`. + /**Function with signature `mappingOfStructMappings(uint256,uint256)` and selector `0x85b6489f`. ```solidity - function mappingOfMappings(uint256, uint256) external view returns (uint256 field1, uint128 field2, uint128 field3); + function mappingOfStructMappings(uint256, uint256) external view returns (uint256 field1, uint128 field2, uint128 field3); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct mappingOfMappingsCall { + pub struct mappingOfStructMappingsCall { pub _0: alloy::sol_types::private::U256, pub _1: alloy::sol_types::private::U256, } - ///Container type for the return parameters of the [`mappingOfMappings(uint256,uint256)`](mappingOfMappingsCall) function. + ///Container type for the return parameters of the [`mappingOfStructMappings(uint256,uint256)`](mappingOfStructMappingsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct mappingOfMappingsReturn { + pub struct mappingOfStructMappingsReturn { pub field1: alloy::sol_types::private::U256, pub field2: u128, pub field3: u128, @@ -1604,14 +2659,14 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: mappingOfMappingsCall) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: mappingOfStructMappingsCall) -> Self { (value._0, value._1) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for mappingOfMappingsCall { + impl ::core::convert::From> for mappingOfStructMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0, @@ -1640,14 +2695,14 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: mappingOfMappingsReturn) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: mappingOfStructMappingsReturn) -> Self { (value.field1, value.field2, value.field3) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for mappingOfMappingsReturn { + impl ::core::convert::From> for mappingOfStructMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { field1: tuple.0, @@ -1658,21 +2713,21 @@ pub mod Simple { } } #[automatically_derived] - impl alloy_sol_types::SolCall for mappingOfMappingsCall { + impl alloy_sol_types::SolCall for mappingOfStructMappingsCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Uint<256>, alloy::sol_types::sol_data::Uint<256>, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = mappingOfMappingsReturn; + type Return = mappingOfStructMappingsReturn; type ReturnTuple<'a> = ( alloy::sol_types::sol_data::Uint<256>, alloy::sol_types::sol_data::Uint<128>, alloy::sol_types::sol_data::Uint<128>, ); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "mappingOfMappings(uint256,uint256)"; - const SELECTOR: [u8; 4] = [10u8, 77u8, 4u8, 247u8]; + const SIGNATURE: &'static str = "mappingOfStructMappings(uint256,uint256)"; + const SELECTOR: [u8; 4] = [133u8, 182u8, 72u8, 159u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1987,14 +3042,237 @@ pub mod Simple { } } #[automatically_derived] - impl alloy_sol_types::SolCall for s3Call { - type Parameters<'a> = (); + impl alloy_sol_types::SolCall for s3Call { + type Parameters<'a> = (); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = s3Return; + type ReturnTuple<'a> = (alloy::sol_types::sol_data::String,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "s3()"; + const SELECTOR: [u8; 4] = [165u8, 214u8, 102u8, 169u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `s4()` and selector `0xc8af3aa6`. + ```solidity + function s4() external view returns (address); + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct s4Call {} + ///Container type for the return parameters of the [`s4()`](s4Call) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct s4Return { + pub _0: alloy::sol_types::private::Address, + } + #[allow(non_camel_case_types, non_snake_case, 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) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: s4Call) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for s4Call { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + { + #[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) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: s4Return) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for s4Return { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for s4Call { + type Parameters<'a> = (); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = s4Return; + type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "s4()"; + const SELECTOR: [u8; 4] = [200u8, 175u8, 58u8, 166u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `setMapping(uint256,address)` and selector `0x1c134315`. + ```solidity + function setMapping(uint256 key, address value) external; + ```*/ + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct setMappingCall { + pub key: alloy::sol_types::private::U256, + pub value: alloy::sol_types::private::Address, + } + ///Container type for the return parameters of the [`setMapping(uint256,address)`](setMappingCall) function. + #[allow(non_camel_case_types, non_snake_case)] + #[derive(Clone)] + pub struct setMappingReturn {} + #[allow(non_camel_case_types, non_snake_case, clippy::style)] + const _: () = { + use alloy::sol_types as alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Address, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::U256, + alloy::sol_types::private::Address, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingCall) -> Self { + (value.key, value.value) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setMappingCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + key: tuple.0, + value: 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) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingReturn) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setMappingReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for setMappingCall { + type Parameters<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Address, + ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = s3Return; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::String,); + type Return = setMappingReturn; + type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "s3()"; - const SELECTOR: [u8; 4] = [165u8, 214u8, 102u8, 169u8]; + const SIGNATURE: &'static str = "setMapping(uint256,address)"; + const SELECTOR: [u8; 4] = [28u8, 19u8, 67u8, 21u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -2003,7 +3281,14 @@ pub mod Simple { } #[inline] fn tokenize(&self) -> Self::Token<'_> { - () + ( + as alloy_sol_types::SolType>::tokenize( + &self.key, + ), + ::tokenize( + &self.value, + ), + ) } #[inline] fn abi_decode_returns( @@ -2017,27 +3302,37 @@ pub mod Simple { } } }; - /**Function with signature `s4()` and selector `0xc8af3aa6`. + /**Function with signature `setMappingOfSingleValueMappings(uint256,uint256,uint256)` and selector `0x4cf5a94a`. ```solidity - function s4() external view returns (address); + function setMappingOfSingleValueMappings(uint256 outerKey, uint256 innerKey, uint256 value) external; ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct s4Call {} - ///Container type for the return parameters of the [`s4()`](s4Call) function. + pub struct setMappingOfSingleValueMappingsCall { + pub outerKey: alloy::sol_types::private::U256, + pub innerKey: alloy::sol_types::private::U256, + pub value: alloy::sol_types::private::U256, + } + ///Container type for the return parameters of the [`setMappingOfSingleValueMappings(uint256,uint256,uint256)`](setMappingOfSingleValueMappingsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct s4Return { - pub _0: alloy::sol_types::private::Address, - } + pub struct setMappingOfSingleValueMappingsReturn {} #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (); + type UnderlyingSolTuple<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + ); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (); + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -2049,24 +3344,28 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: s4Call) -> Self { - () + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingOfSingleValueMappingsCall) -> Self { + (value.outerKey, value.innerKey, value.value) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for s4Call { + impl ::core::convert::From> for setMappingOfSingleValueMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} + Self { + outerKey: tuple.0, + innerKey: tuple.1, + value: tuple.2, + } } } } { #[doc(hidden)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,); + type UnderlyingSolTuple<'a> = (); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,); + type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { @@ -2078,28 +3377,33 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: s4Return) -> Self { - (value._0,) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingOfSingleValueMappingsReturn) -> Self { + () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for s4Return { + impl ::core::convert::From> for setMappingOfSingleValueMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } + Self {} } } } #[automatically_derived] - impl alloy_sol_types::SolCall for s4Call { - type Parameters<'a> = (); + impl alloy_sol_types::SolCall for setMappingOfSingleValueMappingsCall { + type Parameters<'a> = ( + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = s4Return; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,); + type Return = setMappingOfSingleValueMappingsReturn; + type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "s4()"; - const SELECTOR: [u8; 4] = [200u8, 175u8, 58u8, 166u8]; + const SIGNATURE: &'static str = + "setMappingOfSingleValueMappings(uint256,uint256,uint256)"; + const SELECTOR: [u8; 4] = [76u8, 245u8, 169u8, 74u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -2108,7 +3412,17 @@ pub mod Simple { } #[inline] fn tokenize(&self) -> Self::Token<'_> { - () + ( + as alloy_sol_types::SolType>::tokenize( + &self.outerKey, + ), + as alloy_sol_types::SolType>::tokenize( + &self.innerKey, + ), + as alloy_sol_types::SolType>::tokenize( + &self.value, + ), + ) } #[inline] fn abi_decode_returns( @@ -2122,20 +3436,23 @@ pub mod Simple { } } }; - /**Function with signature `setMapping(uint256,address)` and selector `0x1c134315`. + /**Function with signature `setMappingOfStructMappings(uint256,uint256,uint256,uint128,uint128)` and selector `0xc6a7f0fe`. ```solidity - function setMapping(uint256 key, address value) external; + function setMappingOfStructMappings(uint256 outerKey, uint256 innerKey, uint256 field1, uint128 field2, uint128 field3) external; ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct setMappingCall { - pub key: alloy::sol_types::private::U256, - pub value: alloy::sol_types::private::Address, + pub struct setMappingOfStructMappingsCall { + pub outerKey: alloy::sol_types::private::U256, + pub innerKey: alloy::sol_types::private::U256, + pub field1: alloy::sol_types::private::U256, + pub field2: u128, + pub field3: u128, } - ///Container type for the return parameters of the [`setMapping(uint256,address)`](setMappingCall) function. + ///Container type for the return parameters of the [`setMappingOfStructMappings(uint256,uint256,uint256,uint128,uint128)`](setMappingOfStructMappingsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] - pub struct setMappingReturn {} + pub struct setMappingOfStructMappingsReturn {} #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; @@ -2143,12 +3460,18 @@ pub mod Simple { #[doc(hidden)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<128>, + alloy::sol_types::sol_data::Uint<128>, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::U256, - alloy::sol_types::private::Address, + alloy::sol_types::private::U256, + alloy::sol_types::private::U256, + u128, + u128, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] @@ -2161,18 +3484,27 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: setMappingCall) -> Self { - (value.key, value.value) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingOfStructMappingsCall) -> Self { + ( + value.outerKey, + value.innerKey, + value.field1, + value.field2, + value.field3, + ) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for setMappingCall { + impl ::core::convert::From> for setMappingOfStructMappingsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { - key: tuple.0, - value: tuple.1, + outerKey: tuple.0, + innerKey: tuple.1, + field1: tuple.2, + field2: tuple.3, + field3: tuple.4, } } } @@ -2193,31 +3525,35 @@ pub mod Simple { } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: setMappingReturn) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setMappingOfStructMappingsReturn) -> Self { () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for setMappingReturn { + impl ::core::convert::From> for setMappingOfStructMappingsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } #[automatically_derived] - impl alloy_sol_types::SolCall for setMappingCall { + impl alloy_sol_types::SolCall for setMappingOfStructMappingsCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<128>, + alloy::sol_types::sol_data::Uint<128>, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = setMappingReturn; + type Return = setMappingOfStructMappingsReturn; type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "setMapping(uint256,address)"; - const SELECTOR: [u8; 4] = [28u8, 19u8, 67u8, 21u8]; + const SIGNATURE: &'static str = + "setMappingOfStructMappings(uint256,uint256,uint256,uint128,uint128)"; + const SELECTOR: [u8; 4] = [198u8, 167u8, 240u8, 254u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -2228,10 +3564,19 @@ pub mod Simple { fn tokenize(&self) -> Self::Token<'_> { ( as alloy_sol_types::SolType>::tokenize( - &self.key, + &self.outerKey, ), - ::tokenize( - &self.value, + as alloy_sol_types::SolType>::tokenize( + &self.innerKey, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field1, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field2, + ), + as alloy_sol_types::SolType>::tokenize( + &self.field3, ), ) } @@ -3016,14 +4361,19 @@ pub mod Simple { addToArray(addToArrayCall), arr1(arr1Call), changeMapping(changeMappingCall), + changeMappingOfSingleValueMappings(changeMappingOfSingleValueMappingsCall), + changeMappingOfStructMappings(changeMappingOfStructMappingsCall), changeMappingStruct(changeMappingStructCall), m1(m1Call), - mappingOfMappings(mappingOfMappingsCall), + mappingOfSingleValueMappings(mappingOfSingleValueMappingsCall), + mappingOfStructMappings(mappingOfStructMappingsCall), s1(s1Call), s2(s2Call), s3(s3Call), s4(s4Call), setMapping(setMappingCall), + setMappingOfSingleValueMappings(setMappingOfSingleValueMappingsCall), + setMappingOfStructMappings(setMappingOfStructMappingsCall), setMappingStruct(setMappingStructCall), setS2(setS2Call), setSimpleStruct(setSimpleStructCall), @@ -3041,47 +4391,67 @@ pub mod Simple { /// Prefer using `SolInterface` methods instead. pub const SELECTORS: &'static [[u8; 4usize]] = &[ [2u8, 0u8, 34u8, 92u8], - [10u8, 77u8, 4u8, 247u8], [12u8, 22u8, 22u8, 201u8], [20u8, 23u8, 164u8, 240u8], [28u8, 19u8, 67u8, 21u8], [42u8, 228u8, 38u8, 134u8], + [46u8, 181u8, 207u8, 216u8], + [76u8, 245u8, 169u8, 74u8], [105u8, 135u8, 177u8, 251u8], [108u8, 192u8, 20u8, 222u8], [128u8, 38u8, 222u8, 49u8], + [133u8, 182u8, 72u8, 159u8], [136u8, 223u8, 221u8, 198u8], + [150u8, 220u8, 154u8, 65u8], [163u8, 20u8, 21u8, 15u8], [165u8, 214u8, 102u8, 169u8], + [198u8, 167u8, 240u8, 254u8], [199u8, 191u8, 77u8, 181u8], [200u8, 175u8, 58u8, 166u8], [209u8, 94u8, 200u8, 81u8], [234u8, 209u8, 132u8, 0u8], [242u8, 93u8, 84u8, 245u8], + [251u8, 88u8, 108u8, 125u8], ]; } #[automatically_derived] impl alloy_sol_types::SolInterface for SimpleCalls { const NAME: &'static str = "SimpleCalls"; const MIN_DATA_LENGTH: usize = 0usize; - const COUNT: usize = 17usize; + const COUNT: usize = 22usize; #[inline] fn selector(&self) -> [u8; 4] { match self { Self::addToArray(_) => ::SELECTOR, Self::arr1(_) => ::SELECTOR, Self::changeMapping(_) => ::SELECTOR, + Self::changeMappingOfSingleValueMappings(_) => { + ::SELECTOR + } + Self::changeMappingOfStructMappings(_) => { + ::SELECTOR + } Self::changeMappingStruct(_) => { ::SELECTOR } Self::m1(_) => ::SELECTOR, - Self::mappingOfMappings(_) => { - ::SELECTOR + Self::mappingOfSingleValueMappings(_) => { + ::SELECTOR + } + Self::mappingOfStructMappings(_) => { + ::SELECTOR } Self::s1(_) => ::SELECTOR, Self::s2(_) => ::SELECTOR, Self::s3(_) => ::SELECTOR, Self::s4(_) => ::SELECTOR, Self::setMapping(_) => ::SELECTOR, + Self::setMappingOfSingleValueMappings(_) => { + ::SELECTOR + } + Self::setMappingOfStructMappings(_) => { + ::SELECTOR + } Self::setMappingStruct(_) => { ::SELECTOR } @@ -3120,18 +4490,6 @@ pub mod Simple { } setSimples }, - { - fn mappingOfMappings( - data: &[u8], - validate: bool, - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, validate, - ) - .map(SimpleCalls::mappingOfMappings) - } - mappingOfMappings - }, { fn changeMapping( data: &[u8], @@ -3173,6 +4531,32 @@ pub mod Simple { } m1 }, + { + fn changeMappingOfSingleValueMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + validate, + ) + .map(SimpleCalls::changeMappingOfSingleValueMappings) + } + changeMappingOfSingleValueMappings + }, + { + fn setMappingOfSingleValueMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + validate, + ) + .map(SimpleCalls::setMappingOfSingleValueMappings) + } + setMappingOfSingleValueMappings + }, { fn arr1(data: &[u8], validate: bool) -> alloy_sol_types::Result { ::abi_decode_raw(data, validate) @@ -3199,6 +4583,18 @@ pub mod Simple { } setMappingStruct }, + { + fn mappingOfStructMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, validate, + ) + .map(SimpleCalls::mappingOfStructMappings) + } + mappingOfStructMappings + }, { fn structMapping( data: &[u8], @@ -3211,6 +4607,19 @@ pub mod Simple { } structMapping }, + { + fn mappingOfSingleValueMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + validate, + ) + .map(SimpleCalls::mappingOfSingleValueMappings) + } + mappingOfSingleValueMappings + }, { fn s2(data: &[u8], validate: bool) -> alloy_sol_types::Result { ::abi_decode_raw(data, validate) @@ -3225,6 +4634,19 @@ pub mod Simple { } s3 }, + { + fn setMappingOfStructMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + validate, + ) + .map(SimpleCalls::setMappingOfStructMappings) + } + setMappingOfStructMappings + }, { fn changeMappingStruct( data: &[u8], @@ -3273,6 +4695,19 @@ pub mod Simple { } setS2 }, + { + fn changeMappingOfStructMappings( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + validate, + ) + .map(SimpleCalls::changeMappingOfStructMappings) + } + changeMappingOfStructMappings + }, ]; let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { return Err(alloy_sol_types::Error::unknown_selector( @@ -3292,39 +4727,88 @@ pub mod Simple { ::abi_encoded_size(inner) } Self::changeMapping(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) + } + Self::changeMappingOfSingleValueMappings(inner) => { + ::abi_encoded_size( + inner, + ) + } + Self::changeMappingOfStructMappings(inner) => { + ::abi_encoded_size( + inner, + ) } Self::changeMappingStruct(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) + } + Self::m1(inner) => { + ::abi_encoded_size(inner) + } + Self::mappingOfSingleValueMappings(inner) => { + ::abi_encoded_size( + inner, + ) + } + Self::mappingOfStructMappings(inner) => { + ::abi_encoded_size( + inner, + ) + } + Self::s1(inner) => { + ::abi_encoded_size(inner) + } + Self::s2(inner) => { + ::abi_encoded_size(inner) + } + Self::s3(inner) => { + ::abi_encoded_size(inner) } - Self::m1(inner) => ::abi_encoded_size(inner), - Self::mappingOfMappings(inner) => { - ::abi_encoded_size(inner) + Self::s4(inner) => { + ::abi_encoded_size(inner) } - Self::s1(inner) => ::abi_encoded_size(inner), - Self::s2(inner) => ::abi_encoded_size(inner), - Self::s3(inner) => ::abi_encoded_size(inner), - Self::s4(inner) => ::abi_encoded_size(inner), Self::setMapping(inner) => { ::abi_encoded_size(inner) } + Self::setMappingOfSingleValueMappings(inner) => { + ::abi_encoded_size( + inner, + ) + } + Self::setMappingOfStructMappings(inner) => { + ::abi_encoded_size( + inner, + ) + } Self::setMappingStruct(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) } Self::setS2(inner) => { ::abi_encoded_size(inner) } Self::setSimpleStruct(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) } Self::setSimples(inner) => { ::abi_encoded_size(inner) } Self::simpleStruct(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) } Self::structMapping(inner) => { - ::abi_encoded_size(inner) + ::abi_encoded_size( + inner, + ) } } } @@ -3332,47 +4816,115 @@ pub mod Simple { fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { match self { Self::addToArray(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } Self::arr1(inner) => { ::abi_encode_raw(inner, out) } Self::changeMapping(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) + } + Self::changeMappingOfSingleValueMappings(inner) => { + ::abi_encode_raw( + inner, + out, + ) + } + Self::changeMappingOfStructMappings(inner) => { + ::abi_encode_raw( + inner, + out, + ) } Self::changeMappingStruct(inner) => { ::abi_encode_raw( - inner, out, + inner, + out, + ) + } + Self::m1(inner) => { + ::abi_encode_raw(inner, out) + } + Self::mappingOfSingleValueMappings(inner) => { + ::abi_encode_raw( + inner, + out, + ) + } + Self::mappingOfStructMappings(inner) => { + ::abi_encode_raw( + inner, + out, ) } - Self::m1(inner) => ::abi_encode_raw(inner, out), - Self::mappingOfMappings(inner) => { - ::abi_encode_raw(inner, out) + Self::s1(inner) => { + ::abi_encode_raw(inner, out) + } + Self::s2(inner) => { + ::abi_encode_raw(inner, out) + } + Self::s3(inner) => { + ::abi_encode_raw(inner, out) + } + Self::s4(inner) => { + ::abi_encode_raw(inner, out) } - Self::s1(inner) => ::abi_encode_raw(inner, out), - Self::s2(inner) => ::abi_encode_raw(inner, out), - Self::s3(inner) => ::abi_encode_raw(inner, out), - Self::s4(inner) => ::abi_encode_raw(inner, out), Self::setMapping(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) + } + Self::setMappingOfSingleValueMappings(inner) => { + ::abi_encode_raw( + inner, + out, + ) + } + Self::setMappingOfStructMappings(inner) => { + ::abi_encode_raw( + inner, + out, + ) } Self::setMappingStruct(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } Self::setS2(inner) => { ::abi_encode_raw(inner, out) } Self::setSimpleStruct(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } Self::setSimples(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } Self::simpleStruct(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } Self::structMapping(inner) => { - ::abi_encode_raw(inner, out) + ::abi_encode_raw( + inner, + out, + ) } } } @@ -3563,6 +5115,25 @@ pub mod Simple { ) -> alloy_contract::SolCallBuilder { self.call_builder(&changeMappingCall { changes }) } + ///Creates a new call builder for the [`changeMappingOfSingleValueMappings`] function. + pub fn changeMappingOfSingleValueMappings( + &self, + changes: alloy::sol_types::private::Vec< + ::RustType, + >, + ) -> alloy_contract::SolCallBuilder + { + self.call_builder(&changeMappingOfSingleValueMappingsCall { changes }) + } + ///Creates a new call builder for the [`changeMappingOfStructMappings`] function. + pub fn changeMappingOfStructMappings( + &self, + changes: alloy::sol_types::private::Vec< + ::RustType, + >, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&changeMappingOfStructMappingsCall { changes }) + } ///Creates a new call builder for the [`changeMappingStruct`] function. pub fn changeMappingStruct( &self, @@ -3579,13 +5150,21 @@ pub mod Simple { ) -> alloy_contract::SolCallBuilder { self.call_builder(&m1Call { _0 }) } - ///Creates a new call builder for the [`mappingOfMappings`] function. - pub fn mappingOfMappings( + ///Creates a new call builder for the [`mappingOfSingleValueMappings`] function. + pub fn mappingOfSingleValueMappings( + &self, + _0: alloy::sol_types::private::U256, + _1: alloy::sol_types::private::U256, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&mappingOfSingleValueMappingsCall { _0, _1 }) + } + ///Creates a new call builder for the [`mappingOfStructMappings`] function. + pub fn mappingOfStructMappings( &self, _0: alloy::sol_types::private::U256, _1: alloy::sol_types::private::U256, - ) -> alloy_contract::SolCallBuilder { - self.call_builder(&mappingOfMappingsCall { _0, _1 }) + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&mappingOfStructMappingsCall { _0, _1 }) } ///Creates a new call builder for the [`s1`] function. pub fn s1(&self) -> alloy_contract::SolCallBuilder { @@ -3611,6 +5190,36 @@ pub mod Simple { ) -> alloy_contract::SolCallBuilder { self.call_builder(&setMappingCall { key, value }) } + ///Creates a new call builder for the [`setMappingOfSingleValueMappings`] function. + pub fn setMappingOfSingleValueMappings( + &self, + outerKey: alloy::sol_types::private::U256, + innerKey: alloy::sol_types::private::U256, + value: alloy::sol_types::private::U256, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&setMappingOfSingleValueMappingsCall { + outerKey, + innerKey, + value, + }) + } + ///Creates a new call builder for the [`setMappingOfStructMappings`] function. + pub fn setMappingOfStructMappings( + &self, + outerKey: alloy::sol_types::private::U256, + innerKey: alloy::sol_types::private::U256, + field1: alloy::sol_types::private::U256, + field2: u128, + field3: u128, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&setMappingOfStructMappingsCall { + outerKey, + innerKey, + field1, + field2, + field3, + }) + } ///Creates a new call builder for the [`setMappingStruct`] function. pub fn setMappingStruct( &self, diff --git a/mp2-v1/tests/common/cases/contract.rs b/mp2-v1/tests/common/cases/contract.rs index c321e91b1..8ad16edbe 100644 --- a/mp2-v1/tests/common/cases/contract.rs +++ b/mp2-v1/tests/common/cases/contract.rs @@ -1,12 +1,14 @@ use super::{ - indexing::MappingUpdate, - storage_slot_value::{LargeStruct, StorageSlotValue}, + slot_info::{LargeStruct, MappingKey, MappingOfMappingsKey, StorageSlotValue}, table_source::DEFAULT_ADDRESS, }; use crate::common::{ bindings::simple::{ Simple, - Simple::{MappingChange, MappingOperation, MappingStructChange}, + Simple::{ + MappingChange, MappingOfSingleValueMappingsChange, MappingOfStructMappingsChange, + MappingOperation, MappingStructChange, + }, }, TestContext, }; @@ -121,7 +123,27 @@ impl ContractController for LargeStruct { } } -impl ContractController for Vec> { +#[derive(Clone, Debug)] +pub enum MappingUpdate { + // key and value + Insertion(K, V), + // key and value + Deletion(K, V), + // key, previous value and new value + Update(K, V, V), +} + +impl From<&MappingUpdate> for MappingOperation { + fn from(update: &MappingUpdate) -> Self { + Self::from(match update { + MappingUpdate::Deletion(_, _) => 0, + MappingUpdate::Update(_, _, _) => 1, + MappingUpdate::Insertion(_, _) => 2, + }) + } +} + +impl ContractController for Vec> { async fn current_values(_ctx: &TestContext, _contract: &Contract) -> Self { unimplemented!("Unimplemented for fetching the all mapping values") } @@ -178,7 +200,7 @@ impl ContractController for Vec> { } } -impl ContractController for Vec> { +impl ContractController for Vec> { async fn current_values(_ctx: &TestContext, _contract: &Contract) -> Self { unimplemented!("Unimplemented for fetching the all mapping values") } @@ -232,3 +254,142 @@ impl ContractController for Vec> { log::info!("Updated simple contract for mapping values of LargeStruct"); } } + +impl ContractController for Vec> { + async fn current_values(_ctx: &TestContext, _contract: &Contract) -> Self { + unimplemented!("Unimplemented for fetching the all mapping of mappings") + } + + async fn update_contract(&self, ctx: &TestContext, contract: &Contract) { + let provider = ProviderBuilder::new() + .with_recommended_fillers() + .wallet(ctx.wallet()) + .on_http(ctx.rpc_url.parse().unwrap()); + let contract = Simple::new(contract.address, &provider); + + let changes = self + .iter() + .map(|tuple| { + let operation: MappingOperation = tuple.into(); + let operation = operation.into(); + let (k, v) = match tuple { + MappingUpdate::Insertion(k, v) + | MappingUpdate::Deletion(k, v) + | MappingUpdate::Update(k, _, v) => (k, v), + }; + + MappingOfSingleValueMappingsChange { + operation, + outerKey: k.outer_key, + innerKey: k.inner_key, + value: *v, + } + }) + .collect_vec(); + + let call = contract.changeMappingOfSingleValueMappings(changes); + call.send().await.unwrap().watch().await.unwrap(); + // Sanity check + for update in self.iter() { + match update { + MappingUpdate::Insertion(k, v) => { + let res = contract + .mappingOfSingleValueMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + assert_eq!(&res._0, v, "Insertion is wrong on contract"); + } + MappingUpdate::Deletion(k, _) => { + let res = contract + .mappingOfSingleValueMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + assert_eq!(res._0, U256::ZERO, "Deletion is wrong on contract"); + } + MappingUpdate::Update(k, _, v) => { + let res = contract + .mappingOfSingleValueMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + assert_eq!(&res._0, v, "Update is wrong on contract"); + } + } + } + log::info!("Updated simple contract for mapping of single value mappings"); + } +} + +impl ContractController for Vec> { + async fn current_values(_ctx: &TestContext, _contract: &Contract) -> Self { + unimplemented!("Unimplemented for fetching the all mapping of mappings") + } + + async fn update_contract(&self, ctx: &TestContext, contract: &Contract) { + let provider = ProviderBuilder::new() + .with_recommended_fillers() + .wallet(ctx.wallet()) + .on_http(ctx.rpc_url.parse().unwrap()); + let contract = Simple::new(contract.address, &provider); + + let changes = self + .iter() + .map(|tuple| { + let operation: MappingOperation = tuple.into(); + let operation = operation.into(); + let (k, v) = match tuple { + MappingUpdate::Insertion(k, v) + | MappingUpdate::Deletion(k, v) + | MappingUpdate::Update(k, _, v) => (k, v), + }; + + MappingOfStructMappingsChange { + operation, + outerKey: k.outer_key, + innerKey: k.inner_key, + field1: v.field1, + field2: v.field2, + field3: v.field3, + } + }) + .collect_vec(); + + let call = contract.changeMappingOfStructMappings(changes); + call.send().await.unwrap().watch().await.unwrap(); + // Sanity check + for update in self.iter() { + match update { + MappingUpdate::Insertion(k, v) => { + let res = contract + .mappingOfStructMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + let res = LargeStruct::from(res); + assert_eq!(&res, v, "Insertion is wrong on contract"); + } + MappingUpdate::Deletion(k, _) => { + let res = contract + .mappingOfStructMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + let res = LargeStruct::from(res); + assert_eq!(res, LargeStruct::default(), "Deletion is wrong on contract"); + } + MappingUpdate::Update(k, _, v) => { + let res = contract + .mappingOfStructMappings(k.outer_key, k.inner_key) + .call() + .await + .unwrap(); + let res = LargeStruct::from(res); + assert_eq!(&res, v, "Update is wrong on contract"); + } + } + } + log::info!("Updated simple contract for mapping of LargeStruct mappings"); + } +} diff --git a/mp2-v1/tests/common/cases/indexing.rs b/mp2-v1/tests/common/cases/indexing.rs index 99e8e6176..9a8f1d7c8 100644 --- a/mp2-v1/tests/common/cases/indexing.rs +++ b/mp2-v1/tests/common/cases/indexing.rs @@ -14,18 +14,20 @@ use mp2_v1::{ ColumnID, }, values_extraction::{ - gadgets::column_info::ColumnInfo, identifier_block_column, identifier_for_value_column, + gadgets::column_info::ColumnInfo, identifier_block_column, + identifier_for_inner_mapping_key_column, identifier_for_outer_mapping_key_column, + identifier_for_value_column, }, }; +use plonky2::field::types::PrimeField64; use rand::{thread_rng, Rng}; use ryhope::storage::RoEpochKvStorage; use crate::common::{ - bindings::simple::Simple::MappingOperation, cases::{ contract::Contract, identifier_for_mapping_key_column, - storage_slot_value::LargeStruct, + slot_info::LargeStruct, table_source::{ LengthExtractionArgs, MappingExtractionArgs, MappingIndex, MergeSource, SingleExtractionArgs, @@ -41,7 +43,6 @@ use crate::common::{ }; use super::{ContractExtractionArgs, TableIndexing, TableSource}; -use alloy::primitives::U256; use mp2_common::{eth::StorageSlot, proof::ProofWithVK, types::HashOutput}; /// Test slots for single values extraction @@ -65,14 +66,22 @@ pub(crate) const SINGLE_STRUCT_SLOT: usize = 6; /// Test slot for mapping Struct extraction const MAPPING_STRUCT_SLOT: usize = 8; -/// Test slot for mapping of mappings extraction -const MAPPING_OF_MAPPINGS_SLOT: usize = 9; +/// Test slot for mapping of single value mappings extraction +pub(crate) const MAPPING_OF_SINGLE_VALUE_MAPPINGS_SLOT: u8 = 9; + +/// Test slot for mapping of struct mappings extraction +pub(crate) const MAPPING_OF_STRUCT_MAPPINGS_SLOT: u8 = 10; /// human friendly name about the column containing the block number pub(crate) const BLOCK_COLUMN_NAME: &str = "block_number"; pub(crate) const SINGLE_SECONDARY_COLUMN: &str = "single_secondary_column"; pub(crate) const MAPPING_KEY_COLUMN: &str = "mapping_key_column"; pub(crate) const MAPPING_VALUE_COLUMN: &str = "mapping_value_column"; +pub(crate) const MAPPING_OF_MAPPINGS_OUTER_KEY_COLUMN: &str = + "mapping_of_mappings_outer_key_column"; +pub(crate) const MAPPING_OF_MAPPINGS_INNER_KEY_COLUMN: &str = + "mapping_of_mappings_inner_key_column"; +pub(crate) const MAPPING_OF_MAPPINGS_VALUE_COLUMN: &str = "mapping_of_mappings_value_column"; /// Construct the all slot inputs for single value testing. fn single_value_slot_inputs() -> Vec { @@ -448,6 +457,130 @@ impl TableIndexing { )) } + pub(crate) async fn mapping_of_single_value_mappings_test_case( + ctx: &mut TestContext, + ) -> Result<(Self, Vec>)> { + // Deploy the simple contract. + let contract = Contract::deploy_simple_contract(ctx).await; + let contract_address = contract.address; + let chain_id = contract.chain_id; + + let slot_input = SlotInput::new(MAPPING_OF_SINGLE_VALUE_MAPPINGS_SLOT, 0, 256, 0); + let outer_key_id = identifier_for_outer_mapping_key_column( + MAPPING_OF_SINGLE_VALUE_MAPPINGS_SLOT, + &contract_address, + chain_id, + vec![], + ); + let inner_key_id = identifier_for_inner_mapping_key_column( + MAPPING_OF_SINGLE_VALUE_MAPPINGS_SLOT, + &contract_address, + chain_id, + vec![], + ); + let value_id = + identifier_for_value_column(&slot_input, &contract_address, chain_id, vec![]); + // Enable to test different indexes. + // let index = MappingIndex::Value(value_id); + // let index = MappingIndex::OuterKey(outer_key_id); + let index = MappingIndex::InnerKey(inner_key_id); + let args = MappingExtractionArgs::new( + MAPPING_OF_SINGLE_VALUE_MAPPINGS_SLOT, + index.clone(), + vec![slot_input.clone()], + ); + let mut source = TableSource::MappingOfSingleValueMappings(args); + let table_row_updates = source.init_contract_data(ctx, &contract).await; + + let table = build_mapping_of_mappings_table( + ctx, + &index, + outer_key_id, + inner_key_id, + vec![value_id], + vec![slot_input], + ) + .await; + let value_column = table.columns.rest[0].name.clone(); + + Ok(( + Self { + value_column, + contract_extraction: ContractExtractionArgs { + slot: StorageSlot::Simple(CONTRACT_SLOT), + }, + contract, + source, + table, + }, + table_row_updates, + )) + } + + pub(crate) async fn mapping_of_struct_mappings_test_case( + ctx: &mut TestContext, + ) -> Result<(Self, Vec>)> { + // Deploy the simple contract. + let contract = Contract::deploy_simple_contract(ctx).await; + let contract_address = contract.address; + let chain_id = contract.chain_id; + + let slot_inputs = LargeStruct::slot_inputs(MAPPING_OF_STRUCT_MAPPINGS_SLOT); + let outer_key_id = identifier_for_outer_mapping_key_column( + MAPPING_OF_STRUCT_MAPPINGS_SLOT, + &contract_address, + chain_id, + vec![], + ); + let inner_key_id = identifier_for_inner_mapping_key_column( + MAPPING_OF_STRUCT_MAPPINGS_SLOT, + &contract_address, + chain_id, + vec![], + ); + let value_ids = slot_inputs + .iter() + .map(|slot_input| { + identifier_for_value_column(slot_input, &contract_address, chain_id, vec![]) + }) + .collect_vec(); + // Enable to test different indexes. + // let index = MappingIndex::OuterKey(outer_key_id); + // let index = MappingIndex::InnerKey(inner_key_id); + let index = MappingIndex::Value(value_ids[1]); + let args = MappingExtractionArgs::new( + MAPPING_OF_STRUCT_MAPPINGS_SLOT, + index.clone(), + slot_inputs.clone(), + ); + let mut source = TableSource::MappingOfStructMappings(args); + let table_row_updates = source.init_contract_data(ctx, &contract).await; + + let table = build_mapping_of_mappings_table( + ctx, + &index, + outer_key_id, + inner_key_id, + value_ids, + slot_inputs, + ) + .await; + let value_column = table.columns.rest[0].name.clone(); + + Ok(( + Self { + value_column, + contract_extraction: ContractExtractionArgs { + slot: StorageSlot::Simple(CONTRACT_SLOT), + }, + contract, + source, + table, + }, + table_row_updates, + )) + } + pub async fn run( &mut self, ctx: &mut TestContext, @@ -622,7 +755,7 @@ impl TableIndexing { expected_metadata_hash, ) .await; - info!("Generated final IVC proof for block {}", current_block,); + info!("Generated final IVC proof for block {}", current_block); Ok(()) } @@ -823,24 +956,116 @@ async fn build_mapping_table( .await } -#[derive(Clone, Debug)] -pub enum MappingUpdate { - // key and value - Insertion(U256, V), - // key and value - Deletion(U256, V), - // key, previous value and new value - Update(U256, V, V), -} - -impl From<&MappingUpdate> for MappingOperation { - fn from(update: &MappingUpdate) -> Self { - Self::from(match update { - MappingUpdate::Deletion(_, _) => 0, - MappingUpdate::Update(_, _, _) => 1, - MappingUpdate::Insertion(_, _) => 2, +/// Build the mapping of mappings table. +async fn build_mapping_of_mappings_table( + ctx: &TestContext, + index: &MappingIndex, + outer_key_id: u64, + inner_key_id: u64, + value_ids: Vec, + slot_inputs: Vec, +) -> Table { + let mut rest_columns = value_ids + .into_iter() + .zip(slot_inputs.iter()) + .enumerate() + .map(|(i, (id, slot_input))| TableColumn { + name: format!("{MAPPING_OF_MAPPINGS_VALUE_COLUMN}_{i}"), + index: IndexType::None, + multiplier: false, + info: ColumnInfo::new_from_slot_input(id, slot_input), }) - } + .collect_vec(); + + let secondary_column = match index { + MappingIndex::OuterKey(_) => { + rest_columns.push(TableColumn { + name: MAPPING_OF_MAPPINGS_INNER_KEY_COLUMN.to_string(), + index: IndexType::None, + multiplier: false, + // The slot input is useless for the inner key column. + info: ColumnInfo::new_from_slot_input(inner_key_id, &slot_inputs[0]), + }); + + TableColumn { + name: MAPPING_OF_MAPPINGS_OUTER_KEY_COLUMN.to_string(), + index: IndexType::Secondary, + multiplier: false, + info: ColumnInfo::new_from_slot_input( + outer_key_id, + // The slot input is useless for the key column. + &slot_inputs[0], + ), + } + } + MappingIndex::InnerKey(_) => { + rest_columns.push(TableColumn { + name: MAPPING_OF_MAPPINGS_OUTER_KEY_COLUMN.to_string(), + index: IndexType::None, + multiplier: false, + // The slot input is useless for the inner key column. + info: ColumnInfo::new_from_slot_input(outer_key_id, &slot_inputs[0]), + }); + + TableColumn { + name: MAPPING_OF_MAPPINGS_INNER_KEY_COLUMN.to_string(), + index: IndexType::Secondary, + multiplier: false, + info: ColumnInfo::new_from_slot_input( + inner_key_id, + // The slot input is useless for the key column. + &slot_inputs[0], + ), + } + } + MappingIndex::Value(secondary_value_id) => { + let pos = rest_columns + .iter() + .position(|col| &col.info.identifier().to_canonical_u64() == secondary_value_id) + .unwrap(); + let mut secondary_column = rest_columns.remove(pos); + secondary_column.index = IndexType::Secondary; + let key_columns = [ + (outer_key_id, MAPPING_OF_MAPPINGS_OUTER_KEY_COLUMN), + (inner_key_id, MAPPING_OF_MAPPINGS_INNER_KEY_COLUMN), + ] + .map(|(id, name)| { + TableColumn { + name: name.to_string(), + index: IndexType::None, + multiplier: false, + // The slot input is useless for the inner key column. + info: ColumnInfo::new_from_slot_input(id, &slot_inputs[0]), + } + }); + rest_columns.extend(key_columns); + + secondary_column + } + _ => unreachable!(), + }; + + let columns = TableColumns { + primary: TableColumn { + name: BLOCK_COLUMN_NAME.to_string(), + index: IndexType::Primary, + multiplier: false, + // Only valid for the identifier of block column, others are dummy. + info: ColumnInfo::new(0, identifier_block_column(), 0, 0, 0, 0), + }, + secondary: secondary_column, + rest: rest_columns, + }; + debug!("MAPPING OF MAPPINGS ZK COLUMNS -> {:?}", columns); + let index_genesis_block = ctx.block_number().await; + let row_unique_id = TableRowUniqueID::MappingOfMappings(outer_key_id, inner_key_id); + Table::new( + index_genesis_block, + "mapping_of_mappings_table".to_string(), + columns, + row_unique_id, + ) + .await } #[derive(Clone, Debug)] diff --git a/mp2-v1/tests/common/cases/mod.rs b/mp2-v1/tests/common/cases/mod.rs index 30c3b1244..36e3e15ee 100644 --- a/mp2-v1/tests/common/cases/mod.rs +++ b/mp2-v1/tests/common/cases/mod.rs @@ -10,7 +10,7 @@ pub mod contract; pub mod indexing; pub mod planner; pub mod query; -pub mod storage_slot_value; +pub mod slot_info; pub mod table_source; /// Test case definition diff --git a/mp2-v1/tests/common/cases/slot_info.rs b/mp2-v1/tests/common/cases/slot_info.rs new file mode 100644 index 000000000..f4c051296 --- /dev/null +++ b/mp2-v1/tests/common/cases/slot_info.rs @@ -0,0 +1,296 @@ +//! Mapping key, storage value types and related functions for the storage slot + +use crate::common::bindings::simple::Simple::{ + mappingOfStructMappingsReturn, simpleStructReturn, structMappingReturn, +}; +use alloy::primitives::{Address, U256}; +use derive_more::Constructor; +use itertools::Itertools; +use log::warn; +use mp2_common::{ + eth::{StorageSlot, StorageSlotNode}, + types::MAPPING_LEAF_VALUE_LEN, +}; +use mp2_v1::api::{SlotInput, SlotInputs}; +use rand::{thread_rng, Rng}; +use serde::{Deserialize, Serialize}; +use std::{array, fmt::Debug}; + +/// Abstract for the mapping key of the storage slot. +/// It could be a normal mapping key, or a pair of keys which identifies the +/// mapping of mapppings key. +pub(crate) trait StorageSlotMappingKey: Clone + Debug + PartialOrd + Ord { + /// Generate a random key for testing. + fn sample_key() -> Self; + + /// Construct an SlotInputs enum. + fn slot_inputs(slot_inputs: Vec) -> SlotInputs; + + /// Convert into an Uint256 vector. + fn to_u256_vec(&self) -> Vec; + + /// Construct a storage slot for a mapping entry. + fn storage_slot(&self, slot: u8, evm_word: u32) -> StorageSlot; +} + +pub(crate) type MappingKey = U256; + +impl StorageSlotMappingKey for MappingKey { + fn sample_key() -> Self { + sample_u256() + } + fn slot_inputs(slot_inputs: Vec) -> SlotInputs { + SlotInputs::Mapping(slot_inputs) + } + fn to_u256_vec(&self) -> Vec { + vec![*self] + } + fn storage_slot(&self, slot: u8, evm_word: u32) -> StorageSlot { + let storage_slot = StorageSlot::Mapping(self.to_be_bytes_vec(), slot as usize); + if evm_word == 0 { + // We could construct the mapping slot for the EVM word of 0 directly even if the + // mapping value is a Struct, since the returned storage slot is only used to compute + // the slot location, and it's same with the Struct mapping and the EVM word of 0. + return storage_slot; + } + + // It's definitely a Struct if the EVM word is non zero. + StorageSlot::Node(StorageSlotNode::new_struct(storage_slot, evm_word)) + } +} + +#[derive( + Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Constructor, +)] +pub(crate) struct MappingOfMappingsKey { + pub(crate) outer_key: U256, + pub(crate) inner_key: U256, +} + +impl StorageSlotMappingKey for MappingOfMappingsKey { + fn sample_key() -> Self { + let rng = &mut thread_rng(); + let [outer_key, inner_key] = array::from_fn(|_| U256::from_limbs(rng.gen())); + Self::new(outer_key, inner_key) + } + fn slot_inputs(slot_inputs: Vec) -> SlotInputs { + SlotInputs::MappingOfMappings(slot_inputs) + } + fn to_u256_vec(&self) -> Vec { + vec![self.outer_key, self.inner_key] + } + fn storage_slot(&self, slot: u8, evm_word: u32) -> StorageSlot { + let storage_slot = { + let parent_slot = StorageSlot::Mapping(self.outer_key.to_be_bytes_vec(), slot as usize); + StorageSlot::Node( + StorageSlotNode::new_mapping(parent_slot, self.inner_key.to_be_bytes_vec()) + .unwrap(), + ) + }; + if evm_word == 0 { + // We could construct the mapping slot for the EVM word of 0 directly even if the + // mapping value is a Struct, since the returned storage slot is only used to compute + // the slot location, and it's same with the Struct mapping and the EVM word of 0. + return storage_slot; + } + + // It's definitely a Struct if the EVM word is non zero. + StorageSlot::Node(StorageSlotNode::new_struct(storage_slot, evm_word)) + } +} + +/// Abstract for the value saved in the storage slot. +/// It could be a single value as Uint256 or a Struct. +pub trait StorageSlotValue: Clone { + /// Generate a random value for testing. + fn sample_value() -> Self; + + /// Update the slot input specified field to a random value. + fn random_update(&mut self, slot_input_to_update: &SlotInput); + + /// Convert from an Uint256 vector. + fn from_u256_slice(u: &[U256]) -> Self; + + /// Convert into an Uint256 vector. + fn to_u256_vec(&self) -> Vec; +} + +impl StorageSlotValue for Address { + fn sample_value() -> Self { + Address::random() + } + fn random_update(&mut self, _: &SlotInput) { + loop { + let new_addr = Self::sample_value(); + if &new_addr != self { + *self = new_addr; + break; + } + warn!("Generated the same address"); + } + } + fn from_u256_slice(u: &[U256]) -> Self { + assert_eq!(u.len(), 1, "Must convert from one U256"); + + Address::from_slice(&u[0].to_be_bytes_trimmed_vec()) + } + fn to_u256_vec(&self) -> Vec { + vec![U256::from_be_slice(self.as_ref())] + } +} + +impl StorageSlotValue for U256 { + fn sample_value() -> Self { + sample_u256() + } + fn random_update(&mut self, _: &SlotInput) { + loop { + let new_value = Self::sample_value(); + if &new_value != self { + *self = new_value; + break; + } + warn!("Generated the same Uint256"); + } + } + fn from_u256_slice(u: &[U256]) -> Self { + assert_eq!(u.len(), 1, "Should be one U256"); + + u[0] + } + fn to_u256_vec(&self) -> Vec { + vec![*self] + } +} + +fn sample_u256() -> U256 { + let rng = &mut thread_rng(); + U256::from_limbs(rng.gen()) +} + +#[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] +pub struct LargeStruct { + pub(crate) field1: U256, + pub(crate) field2: u128, + pub(crate) field3: u128, +} + +impl StorageSlotValue for LargeStruct { + fn sample_value() -> Self { + let rng = &mut thread_rng(); + let field1 = U256::from_limbs(rng.gen()); + let [field2, field3] = array::from_fn(|_| rng.gen()); + + Self { + field1, + field2, + field3, + } + } + fn random_update(&mut self, slot_input_to_update: &SlotInput) { + let field_index = LargeStruct::slot_inputs(slot_input_to_update.slot()) + .iter() + .position(|slot_input| slot_input == slot_input_to_update) + .unwrap(); + let rng = &mut thread_rng(); + let diff = rng.gen_range(1..100); + if field_index == 0 { + self.field1 += U256::from(diff); + } else if field_index == 1 { + self.field2 += diff; + } else if field_index == 2 { + self.field3 += diff; + } else { + panic!("Wrong Struct field index"); + } + } + fn from_u256_slice(u: &[U256]) -> Self { + assert_eq!(u.len(), 3, "Must convert from three U256 for LargeStruct"); + + let field1 = u[0]; + let field2 = u[1].to(); + let field3 = u[2].to(); + + Self { + field1, + field2, + field3, + } + } + fn to_u256_vec(&self) -> Vec { + let [field2, field3] = [self.field2, self.field3].map(U256::from); + vec![self.field1, field2, field3] + } +} + +impl LargeStruct { + pub const FIELD_NUM: usize = 3; + + pub fn new(field1: U256, field2: u128, field3: u128) -> Self { + Self { + field1, + field2, + field3, + } + } + + pub fn slot_inputs(slot: u8) -> Vec { + vec![ + SlotInput::new(slot, 0, 256, 0), + // Big-endian layout + SlotInput::new(slot, 16, 128, 1), + SlotInput::new(slot, 0, 128, 1), + ] + } +} + +impl From for LargeStruct { + fn from(res: simpleStructReturn) -> Self { + Self { + field1: res.field1, + field2: res.field2, + field3: res.field3, + } + } +} + +impl From for LargeStruct { + fn from(res: structMappingReturn) -> Self { + Self { + field1: res.field1, + field2: res.field2, + field3: res.field3, + } + } +} + +impl From for LargeStruct { + fn from(res: mappingOfStructMappingsReturn) -> Self { + Self { + field1: res.field1, + field2: res.field2, + field3: res.field3, + } + } +} + +impl From<&[[u8; MAPPING_LEAF_VALUE_LEN]]> for LargeStruct { + fn from(fields: &[[u8; MAPPING_LEAF_VALUE_LEN]]) -> Self { + assert_eq!(fields.len(), Self::FIELD_NUM); + + let fields = fields + .iter() + .cloned() + .map(U256::from_be_bytes) + .collect_vec(); + + let field1 = fields[0]; + let field2 = fields[1].to(); + let field3 = fields[2].to(); + Self { + field1, + field2, + field3, + } + } +} diff --git a/mp2-v1/tests/common/cases/storage_slot_value.rs b/mp2-v1/tests/common/cases/storage_slot_value.rs deleted file mode 100644 index b7a9c0c6d..000000000 --- a/mp2-v1/tests/common/cases/storage_slot_value.rs +++ /dev/null @@ -1,197 +0,0 @@ -//! Value types and related functions saved in the storage slot - -use crate::common::bindings::simple::Simple::{simpleStructReturn, structMappingReturn}; -use alloy::primitives::{Address, U256}; -use itertools::Itertools; -use log::warn; -use mp2_common::{ - eth::{StorageSlot, StorageSlotNode}, - types::MAPPING_LEAF_VALUE_LEN, -}; -use mp2_v1::api::SlotInput; -use rand::{thread_rng, Rng}; -use std::{array, os::unix::thread}; - -/// Abstract for the value saved in the storage slot. -/// It could be a single value as Uint256 or a Struct. -pub trait StorageSlotValue: Clone { - /// Generate a random value for testing. - fn sample() -> Self; - - /// Update the slot input specified field to a random value. - fn random_update(&mut self, slot_input_to_update: &SlotInput); - - /// Convert from an Uint256 vector. - fn from_u256_slice(u: &[U256]) -> Self; - - /// Convert into an Uint256 vector. - fn to_u256_vec(&self) -> Vec; - - /// Construct a storage slot for a mapping entry. - fn mapping_storage_slot(slot: u8, evm_word: u32, mapping_key: Vec) -> StorageSlot; -} - -impl StorageSlotValue for Address { - fn sample() -> Self { - Address::random() - } - fn random_update(&mut self, _: &SlotInput) { - loop { - let new_addr = Self::sample(); - if &new_addr != self { - *self = new_addr; - break; - } - warn!("Generated the same address"); - } - } - fn from_u256_slice(u: &[U256]) -> Self { - assert_eq!(u.len(), 1, "Must convert from one U256"); - - Address::from_slice(&u[0].to_be_bytes_trimmed_vec()) - } - fn to_u256_vec(&self) -> Vec { - vec![U256::from_be_slice(self.as_ref())] - } - fn mapping_storage_slot(slot: u8, evm_word: u32, mapping_key: Vec) -> StorageSlot { - // It should be a mapping single value slot if the value is an Uint256. - assert_eq!(evm_word, 0); - - StorageSlot::Mapping(mapping_key, slot as usize) - } -} - -#[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] -pub struct LargeStruct { - pub(crate) field1: U256, - pub(crate) field2: u128, - pub(crate) field3: u128, -} - -impl StorageSlotValue for LargeStruct { - fn sample() -> Self { - let rng = &mut thread_rng(); - let field1 = U256::from_limbs(rng.gen()); - let [field2, field3] = array::from_fn(|_| rng.gen()); - - Self { - field1, - field2, - field3, - } - } - fn random_update(&mut self, slot_input_to_update: &SlotInput) { - let field_index = LargeStruct::slot_inputs(slot_input_to_update.slot()) - .iter() - .position(|slot_input| slot_input == slot_input_to_update) - .unwrap(); - let rng = &mut thread_rng(); - let diff = rng.gen_range(1..100); - if field_index == 0 { - self.field1 += U256::from(diff); - } else if field_index == 1 { - self.field2 += diff; - } else if field_index == 2 { - self.field3 += diff; - } else { - panic!("Wrong Struct field index"); - } - } - fn from_u256_slice(u: &[U256]) -> Self { - assert_eq!(u.len(), 3, "Must convert from three U256 for LargeStruct"); - - let field1 = u[0]; - let field2 = u[1].to(); - let field3 = u[2].to(); - - Self { - field1, - field2, - field3, - } - } - fn to_u256_vec(&self) -> Vec { - let [field2, field3] = [self.field2, self.field3].map(U256::from); - vec![self.field1, field2, field3] - } - fn mapping_storage_slot(slot: u8, evm_word: u32, mapping_key: Vec) -> StorageSlot { - // Check if the EVM word must be included. - assert!(Self::slot_inputs(slot) - .iter() - .any(|slot_input| slot_input.evm_word() == evm_word)); - - let parent_slot = StorageSlot::Mapping(mapping_key, slot as usize); - StorageSlot::Node(StorageSlotNode::new_struct(parent_slot, evm_word)) - } -} - -impl LargeStruct { - pub const FIELD_NUM: usize = 3; - - pub fn new(field1: U256, field2: u128, field3: u128) -> Self { - Self { - field1, - field2, - field3, - } - } - - pub fn to_bytes(&self) -> Vec { - self.field1 - .to_be_bytes::<{ U256::BYTES }>() - .into_iter() - .chain(self.field2.to_be_bytes()) - .chain(self.field3.to_be_bytes()) - .collect() - } - - pub fn slot_inputs(slot: u8) -> Vec { - vec![ - SlotInput::new(slot, 0, 256, 0), - // Big-endian layout - SlotInput::new(slot, 16, 128, 1), - SlotInput::new(slot, 0, 128, 1), - ] - } -} - -impl From for LargeStruct { - fn from(res: simpleStructReturn) -> Self { - Self { - field1: res.field1, - field2: res.field2, - field3: res.field3, - } - } -} - -impl From for LargeStruct { - fn from(res: structMappingReturn) -> Self { - Self { - field1: res.field1, - field2: res.field2, - field3: res.field3, - } - } -} - -impl From<&[[u8; MAPPING_LEAF_VALUE_LEN]]> for LargeStruct { - fn from(fields: &[[u8; MAPPING_LEAF_VALUE_LEN]]) -> Self { - assert_eq!(fields.len(), Self::FIELD_NUM); - - let fields = fields - .iter() - .cloned() - .map(U256::from_be_bytes) - .collect_vec(); - - let field1 = fields[0]; - let field2 = fields[1].to(); - let field3 = fields[2].to(); - Self { - field1, - field2, - field3, - } - } -} diff --git a/mp2-v1/tests/common/cases/table_source.rs b/mp2-v1/tests/common/cases/table_source.rs index 569f3a4ae..25e88464d 100644 --- a/mp2-v1/tests/common/cases/table_source.rs +++ b/mp2-v1/tests/common/cases/table_source.rs @@ -29,7 +29,8 @@ use mp2_v1::{ }, values_extraction::{ gadgets::{column_gadget::extract_value, column_info::ColumnInfo}, - identifier_for_mapping_key_column, identifier_for_value_column, StorageSlotInfo, + identifier_for_inner_mapping_key_column, identifier_for_mapping_key_column, + identifier_for_outer_mapping_key_column, identifier_for_value_column, StorageSlotInfo, }, }; use plonky2::field::types::PrimeField64; @@ -49,12 +50,13 @@ use crate::common::{ }; use super::{ - contract::{Contract, ContractController, SimpleSingleValues}, + contract::{Contract, ContractController, MappingUpdate, SimpleSingleValues}, indexing::{ - ChangeType, MappingUpdate, TableRowUpdate, TableRowValues, UpdateType, SINGLE_SLOTS, - SINGLE_STRUCT_SLOT, + ChangeType, TableRowUpdate, TableRowValues, UpdateType, SINGLE_SLOTS, SINGLE_STRUCT_SLOT, + }, + slot_info::{ + LargeStruct, MappingKey, MappingOfMappingsKey, StorageSlotMappingKey, StorageSlotValue, }, - storage_slot_value::{LargeStruct, StorageSlotValue}, }; /// Save the columns information of same slot and EVM word. @@ -101,13 +103,13 @@ pub enum MappingIndex { /// The key,value such that the combination is unique. This can be turned into a RowTreeKey. /// to store in the row tree. #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct UniqueMappingEntry { - key: U256, +pub struct UniqueMappingEntry { + key: K, value: V, } -impl From<(U256, V)> for UniqueMappingEntry { - fn from(pair: (U256, V)) -> Self { +impl From<(K, V)> for UniqueMappingEntry { + fn from(pair: (K, V)) -> Self { Self { key: pair.0, value: pair.1, @@ -115,8 +117,8 @@ impl From<(U256, V)> for UniqueMappingEntry { } } -impl UniqueMappingEntry { - pub fn new(key: U256, value: V) -> Self { +impl UniqueMappingEntry { + pub fn new(key: K, value: V) -> Self { Self { key, value } } pub fn to_update( @@ -151,15 +153,42 @@ impl UniqueMappingEntry { slot_inputs[1..] .iter() .for_each(|slot_input| assert_eq!(slot_input.slot(), slot)); - let key_cell = { - let key_id = identifier_for_mapping_key_column( - slot, - &contract.address, - contract.chain_id, - vec![], - ); + let [outer_key_cell, inner_key_cell] = match self.key.to_u256_vec().as_slice() { + [mapping_key] => { + let key_id = identifier_for_mapping_key_column( + slot, + &contract.address, + contract.chain_id, + vec![], + ); + + [Some(Cell::new(key_id, *mapping_key)), None] + } + [outer_key, inner_key] => { + let outer_key_cell = { + let id = identifier_for_outer_mapping_key_column( + slot, + &contract.address, + contract.chain_id, + vec![], + ); + + Cell::new(id, *outer_key) + }; + let inner_key_cell = { + let id = identifier_for_inner_mapping_key_column( + slot, + &contract.address, + contract.chain_id, + vec![], + ); + + Cell::new(id, *inner_key) + }; - Cell::new(key_id, self.key) + [Some(outer_key_cell), Some(inner_key_cell)] + } + _ => unreachable!(), }; let mut current_cells = slot_inputs .iter() @@ -177,7 +206,20 @@ impl UniqueMappingEntry { .collect_vec(); let secondary_cell = match index { - MappingIndex::OuterKey(_) | MappingIndex::InnerKey(_) => key_cell, + MappingIndex::OuterKey(_) => { + if let Some(cell) = inner_key_cell { + current_cells.push(cell); + } + + outer_key_cell.unwrap() + } + MappingIndex::InnerKey(_) => { + if let Some(cell) = outer_key_cell { + current_cells.push(cell); + } + + inner_key_cell.unwrap() + } MappingIndex::Value(secondary_value_id) => { let pos = current_cells .iter() @@ -185,7 +227,13 @@ impl UniqueMappingEntry { .unwrap(); let secondary_cell = current_cells.remove(pos); - current_cells.push(key_cell); + [outer_key_cell, inner_key_cell] + .into_iter() + .for_each(|cell| { + if let Some(cell) = cell { + current_cells.push(cell); + } + }); secondary_cell } @@ -210,9 +258,21 @@ impl UniqueMappingEntry { slot_inputs: &[SlotInput], ) -> RowTreeKey { let (row_key, rest) = match index { - MappingIndex::OuterKey(_) | MappingIndex::InnerKey(_) => { - // The mapping key is unique for rows. - (self.key, vec![]) + MappingIndex::OuterKey(_) => { + // The mapping keys are unique for rows. + let mapping_keys = self.key.to_u256_vec(); + let key = mapping_keys[0]; + let rest = mapping_keys.get(1).unwrap_or(&U256::ZERO).to_be_bytes_vec(); + + (key, rest) + } + MappingIndex::InnerKey(_) => { + // The mapping keys are unique for rows. + let mapping_keys = self.key.to_u256_vec(); + let key = mapping_keys[1]; + let rest = mapping_keys[0].to_be_bytes_vec(); + + (key, rest) } MappingIndex::Value(secondary_value_id) => { let pos = slot_inputs @@ -229,7 +289,14 @@ impl UniqueMappingEntry { let secondary_value = self.value.to_u256_vec().remove(pos); // The mapping key is unique for rows. - (secondary_value, self.key.to_be_bytes_vec()) + let rest = self + .key + .to_u256_vec() + .into_iter() + .flat_map(|u| u.to_be_bytes_vec()) + .collect_vec(); + + (secondary_value, rest) } MappingIndex::None => unreachable!(), }; @@ -246,12 +313,19 @@ pub(crate) enum TableSource { /// Test arguments for simple slots which stores both single values and Struct values Single(SingleExtractionArgs), /// Test arguments for mapping slots which stores single values - MappingValues(MappingExtractionArgs
, Option), + MappingValues( + MappingExtractionArgs, + Option, + ), /// Test arguments for mapping slots which stores the Struct values MappingStruct( - MappingExtractionArgs, + MappingExtractionArgs, Option, ), + /// Test arguments for mapping of mappings slot which stores single values + MappingOfSingleValueMappings(MappingExtractionArgs), + /// Test arguments for mapping of mappings slot which stores the Struct values + MappingOfStructMappings(MappingExtractionArgs), /// Test arguments for the merge source of both simple and mapping values Merge(MergeSource), } @@ -276,6 +350,14 @@ impl TableSource { args.generate_extraction_proof_inputs(ctx, contract, value_key) .await } + TableSource::MappingOfSingleValueMappings(ref args) => { + args.generate_extraction_proof_inputs(ctx, contract, value_key) + .await + } + TableSource::MappingOfStructMappings(ref args) => { + args.generate_extraction_proof_inputs(ctx, contract, value_key) + .await + } TableSource::Merge(ref args) => { args.generate_extraction_proof_inputs(ctx, contract, value_key) .await @@ -298,6 +380,12 @@ impl TableSource { TableSource::MappingStruct(ref mut args, _) => { args.init_contract_data(ctx, contract).await } + TableSource::MappingOfSingleValueMappings(ref mut args) => { + args.init_contract_data(ctx, contract).await + } + TableSource::MappingOfStructMappings(ref mut args) => { + args.init_contract_data(ctx, contract).await + } TableSource::Merge(ref mut args) => args.init_contract_data(ctx, contract).await, } } @@ -325,6 +413,14 @@ impl TableSource { args.random_contract_update(ctx, contract, change_type) .await } + TableSource::MappingOfSingleValueMappings(ref mut args) => { + args.random_contract_update(ctx, contract, change_type) + .await + } + TableSource::MappingOfStructMappings(ref mut args) => { + args.random_contract_update(ctx, contract, change_type) + .await + } TableSource::Merge(ref mut args) => { args.random_contract_update(ctx, contract, change_type) .await @@ -341,11 +437,14 @@ pub struct MergeSource { // Extending to full merge between any table is not far - it requires some quick changes in // circuit but quite a lot of changes in integrated test. pub(crate) single: SingleExtractionArgs, - pub(crate) mapping: MappingExtractionArgs, + pub(crate) mapping: MappingExtractionArgs, } impl MergeSource { - pub fn new(single: SingleExtractionArgs, mapping: MappingExtractionArgs) -> Self { + pub fn new( + single: SingleExtractionArgs, + mapping: MappingExtractionArgs, + ) -> Self { Self { single, mapping } } @@ -483,8 +582,8 @@ impl MergeSource { // we fetch the value of all mapping entries, and let mut all_updates = Vec::new(); for mk in &self.mapping.mapping_keys { - let current_value = self.mapping.query_value(ctx, contract, mk.clone()).await; - let current_key = U256::from_be_slice(mk); + let current_value = self.mapping.query_value(ctx, contract, mk).await; + let current_key = *mk; let entry = UniqueMappingEntry::new(current_key, current_value); // create one update for each update of the first table (note again there // should be only one update since it's single var) @@ -578,20 +677,12 @@ lazy_static! { pub fn rotate() -> usize { ROTATOR.fetch_add(1, std::sync::atomic::Ordering::Relaxed) % 2 } -pub fn next_mapping_key() -> U256 { - next_value() -} pub fn next_address() -> Address { let shift = SHIFT.fetch_add(1, std::sync::atomic::Ordering::Relaxed); let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(shift); let slice = rng.gen::<[u8; 20]>(); Address::from_slice(&slice) } -pub fn next_value() -> U256 { - let shift = SHIFT.fetch_add(1, std::sync::atomic::Ordering::Relaxed); - let bv: U256 = *BASE_VALUE; - bv + U256::from(shift) -} /// Extraction arguments for simple slots which stores both single values (Address or U256) and /// Struct values (LargeStruct for testing) @@ -891,7 +982,7 @@ impl SingleExtractionArgs { /// Mapping extraction arguments #[derive(Serialize, Deserialize, Debug, Hash, Eq, PartialEq, Clone)] -pub(crate) struct MappingExtractionArgs { +pub(crate) struct MappingExtractionArgs { /// Mapping slot number slot: u8, /// Mapping index type @@ -903,15 +994,16 @@ pub(crate) struct MappingExtractionArgs { /// need to know an existing key /// * doing the MPT proofs over, since this test doesn't implement the copy on write for MPT /// (yet), we're just recomputing all the proofs at every block and we need the keys for that. - mapping_keys: BTreeSet>, + mapping_keys: BTreeSet, /// Phantom - _phantom: PhantomData, + _phantom: PhantomData<(K, V)>, } -impl MappingExtractionArgs +impl MappingExtractionArgs where + K: StorageSlotMappingKey, V: StorageSlotValue, - Vec>: ContractController, + Vec>: ContractController, { pub fn new(slot: u8, index: MappingIndex, slot_inputs: Vec) -> Self { Self { @@ -932,14 +1024,10 @@ where ctx: &mut TestContext, contract: &Contract, ) -> Vec> { - let init_key_and_value: [_; 3] = array::from_fn(|_| (next_mapping_key(), V::sample())); + let init_key_and_value: [_; 3] = array::from_fn(|_| (K::sample_key(), V::sample_value())); // Save the mapping keys. - self.mapping_keys.extend( - init_key_and_value - .iter() - .map(|u| u.0.to_be_bytes_trimmed_vec()) - .collect_vec(), - ); + self.mapping_keys + .extend(init_key_and_value.iter().map(|u| u.0.clone()).collect_vec()); let updates = init_key_and_value .into_iter() .map(|(key, value)| MappingUpdate::Insertion(key, value)) @@ -979,32 +1067,38 @@ where // In the backend, we translate that in the "table world" to a deletion and an insertion. // Having such optimization could be done later on, need to properly evaluate the cost // of it. - let current_key = self.mapping_keys.first().unwrap().clone(); - let current_value = self.query_value(ctx, contract, current_key.clone()).await; - let current_key = U256::from_be_slice(¤t_key); - let new_key = next_mapping_key(); + let current_key = self.mapping_keys.first().unwrap(); + let current_value = self.query_value(ctx, contract, current_key).await; + let new_key = K::sample_key(); let updates = match c { ChangeType::Silent => vec![], ChangeType::Insertion => { - vec![MappingUpdate::Insertion(new_key, V::sample())] + vec![MappingUpdate::Insertion(new_key, V::sample_value())] } ChangeType::Deletion => { - vec![MappingUpdate::Deletion(current_key, current_value)] + vec![MappingUpdate::Deletion(current_key.clone(), current_value)] } ChangeType::Update(u) => { match u { UpdateType::Rest => { - let new_value = V::sample(); + let new_value = V::sample_value(); match self.index { MappingIndex::OuterKey(_) | MappingIndex::InnerKey(_) => { // we simply change the mapping value since the key is the secondary index - vec![MappingUpdate::Update(current_key, current_value, new_value)] + vec![MappingUpdate::Update( + current_key.clone(), + current_value, + new_value, + )] } MappingIndex::Value(_) => { // TRICKY: in this case, the mapping key must change. But from the // onchain perspective, it means a transfer mapping(old_key -> new_key,value) vec![ - MappingUpdate::Deletion(current_key, current_value.clone()), + MappingUpdate::Deletion( + current_key.clone(), + current_value.clone(), + ), MappingUpdate::Insertion(new_key, current_value), ] } @@ -1013,7 +1107,11 @@ where // not impacting the secondary index of the table since the mapping // doesn't contain the column which is the secondary index, in case // of the merge table case. - vec![MappingUpdate::Update(current_key, current_value, new_value)] + vec![MappingUpdate::Update( + current_key.clone(), + current_value, + new_value, + )] } } } @@ -1023,7 +1121,10 @@ where // TRICKY: if the mapping key changes, it's a deletion then // insertion from onchain perspective vec![ - MappingUpdate::Deletion(current_key, current_value.clone()), + MappingUpdate::Deletion( + current_key.clone(), + current_value.clone(), + ), // we insert the same value but with a new mapping key MappingUpdate::Insertion(new_key, current_value), ] @@ -1045,7 +1146,11 @@ where let mut new_value = current_value.clone(); new_value.random_update(slot_input_to_update); // if the value changes, it's a simple update in mapping - vec![MappingUpdate::Update(current_key, current_value, new_value)] + vec![MappingUpdate::Update( + current_key.clone(), + current_value, + new_value, + )] } MappingIndex::None => { // empty vec since this table has no secondary index so it should @@ -1060,14 +1165,13 @@ where // small iteration to always have a good updated list of mapping keys for update in &updates { match update { - MappingUpdate::Deletion(key, _) => { - info!("Removing key {} from mappping keys tracking", key); - let key_stored = key.to_be_bytes_trimmed_vec(); - self.mapping_keys.retain(|u| u != &key_stored); + MappingUpdate::Deletion(key_to_delete, _) => { + info!("Removing key {key_to_delete:?} from tracking mapping keys"); + self.mapping_keys.retain(|u| u != key_to_delete); } - MappingUpdate::Insertion(key, _) => { - info!("Inserting key {} to mappping keys tracking", key); - self.mapping_keys.insert(key.to_be_bytes_trimmed_vec()); + MappingUpdate::Insertion(key_to_insert, _) => { + info!("Inserting key {key_to_insert:?} to tracking mapping keys"); + self.mapping_keys.insert(key_to_insert.clone()); } // the mapping key doesn't change here so no need to update the list MappingUpdate::Update(_, _, _) => {} @@ -1127,7 +1231,7 @@ where } }; let metadata_hash = metadata_hash::( - SlotInputs::Mapping(self.slot_inputs.clone()), + K::slot_inputs(self.slot_inputs.clone()), &contract.address, contract.chain_id, vec![], @@ -1145,7 +1249,7 @@ where &self, block_number: BlockPrimaryIndex, contract: &Contract, - updates: &[MappingUpdate], + updates: &[MappingUpdate], ) -> Vec> { updates .iter() @@ -1153,7 +1257,7 @@ where match update { MappingUpdate::Insertion(key, value) => { // we transform the mapping entry into the "table notion" of row - let entry = UniqueMappingEntry::new(*key, value.clone()); + let entry = UniqueMappingEntry::new(key.clone(), value.clone()); let (cells, index) = entry.to_update( block_number, contract, @@ -1175,7 +1279,7 @@ where // * passing inside the deletion the value deleted as well, so we can // reconstruct the row key // * or have this extra list of mapping keys - let entry = UniqueMappingEntry::new(*key, value.clone()); + let entry = UniqueMappingEntry::new(key.clone(), value.clone()); vec![TableRowUpdate::Deletion(entry.to_row_key( contract, &self.index, @@ -1188,10 +1292,11 @@ where // row is uniquely identified by its pair (key,value) then if one of those // change, that means the row tree key needs to change as well, i.e. it's a // deletion and addition. - let previous_entry = UniqueMappingEntry::new(*key, old_value.clone()); + let previous_entry = + UniqueMappingEntry::new(key.clone(), old_value.clone()); let previous_row_key = previous_entry.to_row_key(contract, &self.index, &self.slot_inputs); - let new_entry = UniqueMappingEntry::new(*key, new_value.clone()); + let new_entry = UniqueMappingEntry::new(key.clone(), new_value.clone()); let (mut cells, mut secondary_index) = new_entry.to_update( block_number, @@ -1247,9 +1352,9 @@ where &self, evm_word: u32, table_info: Vec, - mapping_key: Vec, + mapping_key: &K, ) -> StorageSlotInfo { - let storage_slot = V::mapping_storage_slot(self.slot, evm_word, mapping_key); + let storage_slot = mapping_key.storage_slot(self.slot, evm_word); StorageSlotInfo::new(storage_slot, table_info) } @@ -1262,27 +1367,17 @@ where .iter() .cartesian_product(self.mapping_keys.iter()) .map(|(evm_word_col, mapping_key)| { - self.storage_slot_info( - evm_word_col.evm_word(), - table_info.clone(), - mapping_key.clone(), - ) + self.storage_slot_info(evm_word_col.evm_word(), table_info.clone(), mapping_key) }) .collect() } /// Query a storage slot value by a mapping key. - async fn query_value( - &self, - ctx: &mut TestContext, - contract: &Contract, - mapping_key: Vec, - ) -> V { + async fn query_value(&self, ctx: &mut TestContext, contract: &Contract, mapping_key: &K) -> V { let mut extracted_values = vec![]; let evm_word_cols = self.evm_word_column_info(contract); for evm_word_col in evm_word_cols { - let storage_slot = - V::mapping_storage_slot(self.slot, evm_word_col.evm_word(), mapping_key.clone()); + let storage_slot = mapping_key.storage_slot(self.slot, evm_word_col.evm_word()); let query = ProofQuery::new(contract.address, storage_slot); let value = ctx .query_mpt_proof(&query, BlockNumberOrTag::Number(ctx.block_number().await)) diff --git a/mp2-v1/tests/common/mod.rs b/mp2-v1/tests/common/mod.rs index 14620ddb0..dc2c05a6e 100644 --- a/mp2-v1/tests/common/mod.rs +++ b/mp2-v1/tests/common/mod.rs @@ -112,6 +112,24 @@ impl TableInfo { vec![], ) } + TableSource::MappingOfSingleValueMappings(args) => { + let slot_inputs = SlotInputs::MappingOfMappings(args.slot_inputs().to_vec()); + metadata_hash::( + slot_inputs, + &self.contract_address, + self.chain_id, + vec![], + ) + } + TableSource::MappingOfStructMappings(args) => { + let slot_inputs = SlotInputs::MappingOfMappings(args.slot_inputs().to_vec()); + metadata_hash::( + slot_inputs, + &self.contract_address, + self.chain_id, + vec![], + ) + } TableSource::Merge(source) => { let single = SlotInputs::Simple(source.single.slot_inputs.clone()); let mapping = SlotInputs::Mapping(source.mapping.slot_inputs().to_vec()); diff --git a/mp2-v1/tests/common/storage_trie.rs b/mp2-v1/tests/common/storage_trie.rs index 2b1ddab41..0eb4f7c31 100644 --- a/mp2-v1/tests/common/storage_trie.rs +++ b/mp2-v1/tests/common/storage_trie.rs @@ -232,6 +232,29 @@ impl TrieNode { slot_info.table_info().to_vec(), ), ), + StorageSlot::Node(StorageSlotNode::Mapping(parent, inner_mapping_key)) => { + match &**parent { + // Mapping of single value mappings + StorageSlot::Mapping(outer_mapping_key, slot) => ( + "indexing::extraction::mpt::leaf::mapping_of_single_value_mappings", + values_extraction::CircuitInput::new_mapping_of_mappings_leaf( + node.clone(), + *slot as u8, + outer_mapping_key.clone(), + inner_mapping_key.clone(), + slot_info + .outer_key_id(ctx.contract_address, ctx.chain_id, vec![]) + .unwrap(), + slot_info + .inner_key_id(ctx.contract_address, ctx.chain_id, vec![]) + .unwrap(), + slot_info.evm_word(), + slot_info.table_info().to_vec(), + ), + ), + _ => unreachable!(), + } + } StorageSlot::Node(StorageSlotNode::Struct(parent, _)) => match &**parent { // Simple Struct StorageSlot::Simple(slot) => ( @@ -257,11 +280,11 @@ impl TrieNode { slot_info.table_info().to_vec(), ), ), - // Mapping of mappings Struct + // Mapping of struct mappings StorageSlot::Node(StorageSlotNode::Mapping(grand, inner_mapping_key)) => { match &**grand { StorageSlot::Mapping(outer_mapping_key, slot) => ( - "indexing::extraction::mpt::leaf::mapping_of_mappings", + "indexing::extraction::mpt::leaf::mapping_of_struct_mappings", values_extraction::CircuitInput::new_mapping_of_mappings_leaf( node.clone(), *slot as u8, @@ -282,7 +305,6 @@ impl TrieNode { } _ => unreachable!(), }, - _ => unreachable!(), }; let input = CircuitInput::ValuesExtraction(input); diff --git a/mp2-v1/tests/integrated_tests.rs b/mp2-v1/tests/integrated_tests.rs index 98f4e565e..0757f1e04 100644 --- a/mp2-v1/tests/integrated_tests.rs +++ b/mp2-v1/tests/integrated_tests.rs @@ -115,6 +115,32 @@ async fn integrated_indexing() -> Result<()> { ]; mapping.run(&mut ctx, genesis, changes).await?; + let (mut mapping_of_single_value_mappings, genesis) = + TableIndexing::mapping_of_single_value_mappings_test_case(&mut ctx).await?; + let changes = vec![ + ChangeType::Insertion, + ChangeType::Update(UpdateType::Rest), + ChangeType::Update(UpdateType::SecondaryIndex), + ChangeType::Deletion, + ChangeType::Silent, + ]; + mapping_of_single_value_mappings + .run(&mut ctx, genesis, changes) + .await?; + + let (mut mapping_of_struct_mappings, genesis) = + TableIndexing::mapping_of_struct_mappings_test_case(&mut ctx).await?; + let changes = vec![ + ChangeType::Insertion, + ChangeType::Update(UpdateType::Rest), + ChangeType::Update(UpdateType::SecondaryIndex), + ChangeType::Deletion, + ChangeType::Silent, + ]; + mapping_of_struct_mappings + .run(&mut ctx, genesis, changes) + .await?; + let (mut merged, genesis) = TableIndexing::merge_table_test_case(&mut ctx).await?; let changes = vec![ ChangeType::Insertion, From 8fa830edd4cfaa362dc38ada973111eeac10dcb2 Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Fri, 13 Dec 2024 23:17:44 +0800 Subject: [PATCH 2/6] Comment out `test_pidgy_pinguin_mapping_slot` test case, and fix clippy. --- mp2-common/src/eth.rs | 66 ++++++++++++++++++++-------------------- mp2-common/src/utils.rs | 67 +---------------------------------------- 2 files changed, 35 insertions(+), 98 deletions(-) diff --git a/mp2-common/src/eth.rs b/mp2-common/src/eth.rs index dacbb634a..472686145 100644 --- a/mp2-common/src/eth.rs +++ b/mp2-common/src/eth.rs @@ -532,38 +532,40 @@ mod test { Ok(()) } - #[tokio::test] - async fn test_pidgy_pinguin_mapping_slot() -> Result<()> { - // first pinguin holder https://dune.com/queries/2450476/4027653 - // holder: 0x188b264aa1456b869c3a92eeed32117ebb835f47 - // NFT id https://opensea.io/assets/ethereum/0xbd3531da5cf5857e7cfaa92426877b022e612cf8/1116 - let mapping_value = - Address::from_str("0x188B264AA1456B869C3a92eeeD32117EbB835f47").unwrap(); - let nft_id: u32 = 1116; - let mapping_key = left_pad32(&nft_id.to_be_bytes()); - let url = get_mainnet_url(); - let provider = ProviderBuilder::new().on_http(url.parse().unwrap()); - - // extracting from - // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol - // assuming it's using ERC731Enumerable that inherits ERC721 - let mapping_slot = 2; - // pudgy pinguins - let pudgy_address = Address::from_str("0xBd3531dA5CF5857e7CfAA92426877b022e612cf8")?; - let query = ProofQuery::new_mapping_slot(pudgy_address, mapping_slot, mapping_key.to_vec()); - let res = query - .query_mpt_proof(&provider, BlockNumberOrTag::Latest) - .await?; - let raw_address = ProofQuery::verify_storage_proof(&res)?; - // the value is actually RLP encoded ! - let decoded_address: Vec = rlp::decode(&raw_address).unwrap(); - let leaf_node: Vec> = rlp::decode_list(res.storage_proof[0].proof.last().unwrap()); - println!("leaf_node[1].len() = {}", leaf_node[1].len()); - // this is read in the same order - let found_address = Address::from_slice(&decoded_address.into_iter().collect::>()); - assert_eq!(found_address, mapping_value); - Ok(()) - } + /* TODO: Need to update, since the mapping slot value is updated. + #[tokio::test] + async fn test_pidgy_pinguin_mapping_slot() -> Result<()> { + // first pinguin holder https://dune.com/queries/2450476/4027653 + // holder: 0x188b264aa1456b869c3a92eeed32117ebb835f47 + // NFT id https://opensea.io/assets/ethereum/0xbd3531da5cf5857e7cfaa92426877b022e612cf8/1116 + let mapping_value = + Address::from_str("0x188B264AA1456B869C3a92eeeD32117EbB835f47").unwrap(); + let nft_id: u32 = 1116; + let mapping_key = left_pad32(&nft_id.to_be_bytes()); + let url = get_mainnet_url(); + let provider = ProviderBuilder::new().on_http(url.parse().unwrap()); + + // extracting from + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol + // assuming it's using ERC731Enumerable that inherits ERC721 + let mapping_slot = 2; + // pudgy pinguins + let pudgy_address = Address::from_str("0xBd3531dA5CF5857e7CfAA92426877b022e612cf8")?; + let query = ProofQuery::new_mapping_slot(pudgy_address, mapping_slot, mapping_key.to_vec()); + let res = query + .query_mpt_proof(&provider, BlockNumberOrTag::Latest) + .await?; + let raw_address = ProofQuery::verify_storage_proof(&res)?; + // the value is actually RLP encoded ! + let decoded_address: Vec = rlp::decode(&raw_address).unwrap(); + let leaf_node: Vec> = rlp::decode_list(res.storage_proof[0].proof.last().unwrap()); + println!("leaf_node[1].len() = {}", leaf_node[1].len()); + // this is read in the same order + let found_address = Address::from_slice(&decoded_address.into_iter().collect::>()); + assert_eq!(found_address, mapping_value); + Ok(()) + } + */ #[tokio::test] async fn test_kashish_contract_proof_query() -> Result<()> { diff --git a/mp2-common/src/utils.rs b/mp2-common/src/utils.rs index db30d2ba4..6926d25c3 100644 --- a/mp2-common/src/utils.rs +++ b/mp2-common/src/utils.rs @@ -773,33 +773,9 @@ impl, const D: usize> SliceConnector for CircuitBui } } -/// Convert an Uint32 target to Uint8 targets. -pub(crate) fn unpack_u32_to_u8_targets, const D: usize>( - b: &mut CircuitBuilder, - u: Target, - endianness: Endianness, -) -> Vec { - let zero = b.zero(); - let mut bits = b.split_le(u, u32::BITS as usize); - match endianness { - Endianness::Big => bits.reverse(), - Endianness::Little => (), - }; - bits.chunks(8) - .map(|chunk| { - // let bits: Box> = match endianness { - let bits: Box> = match endianness { - Endianness::Big => Box::new(chunk.iter()), - Endianness::Little => Box::new(chunk.iter().rev()), - }; - bits.fold(zero, |acc, bit| b.mul_const_add(F::TWO, acc, bit.target)) - }) - .collect() -} - #[cfg(test)] mod test { - use super::{bits_to_num, unpack_u32_to_u8_targets, Packer, TargetsConnector, ToFields}; + use super::{bits_to_num, Packer, TargetsConnector, ToFields}; use crate::types::CBuilder; use crate::utils::{ greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, num_to_bits, @@ -1033,45 +1009,4 @@ mod test { let proof = data.prove(pw)?; data.verify(proof) } - - #[test] - fn test_unpack_u32_to_u8_targets() -> Result<()> { - let rng = &mut thread_rng(); - let u32_value: u32 = rng.gen(); - let big_endian_u8_values = u32_value.to_be_bytes().to_fields(); - let little_endian_u8_values = u32_value.to_le_bytes().to_fields(); - - let config = default_config(); - let mut builder = CBuilder::new(config); - let b = &mut builder; - - let [exp_big_endian_u8_targets, exp_little_endian_u8_targets] = - array::from_fn(|_| b.add_virtual_target_arr::<4>()); - - let u32_target = b.constant(F::from_canonical_u32(u32_value)); - let real_big_endian_u8_targets = unpack_u32_to_u8_targets(b, u32_target, Endianness::Big); - let real_little_endian_u8_targets = - unpack_u32_to_u8_targets(b, u32_target, Endianness::Little); - - b.connect_targets( - real_big_endian_u8_targets, - exp_big_endian_u8_targets.to_vec(), - ); - b.connect_targets( - real_little_endian_u8_targets, - exp_little_endian_u8_targets.to_vec(), - ); - - let data = builder.build::(); - let mut pw = PartialWitness::new(); - [ - (big_endian_u8_values, exp_big_endian_u8_targets), - (little_endian_u8_values, exp_little_endian_u8_targets), - ] - .into_iter() - .for_each(|(values, targets)| pw.set_target_arr(&targets, &values)); - - let proof = data.prove(pw)?; - data.verify(proof) - } } From 5719de93ae1d05c48780588783b02450e18656ac Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Fri, 13 Dec 2024 23:37:28 +0800 Subject: [PATCH 3/6] Fix `test_pidgy_pinguin_mapping_slot`. --- mp2-common/src/eth.rs | 66 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/mp2-common/src/eth.rs b/mp2-common/src/eth.rs index 472686145..21a0624d9 100644 --- a/mp2-common/src/eth.rs +++ b/mp2-common/src/eth.rs @@ -532,40 +532,38 @@ mod test { Ok(()) } - /* TODO: Need to update, since the mapping slot value is updated. - #[tokio::test] - async fn test_pidgy_pinguin_mapping_slot() -> Result<()> { - // first pinguin holder https://dune.com/queries/2450476/4027653 - // holder: 0x188b264aa1456b869c3a92eeed32117ebb835f47 - // NFT id https://opensea.io/assets/ethereum/0xbd3531da5cf5857e7cfaa92426877b022e612cf8/1116 - let mapping_value = - Address::from_str("0x188B264AA1456B869C3a92eeeD32117EbB835f47").unwrap(); - let nft_id: u32 = 1116; - let mapping_key = left_pad32(&nft_id.to_be_bytes()); - let url = get_mainnet_url(); - let provider = ProviderBuilder::new().on_http(url.parse().unwrap()); - - // extracting from - // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol - // assuming it's using ERC731Enumerable that inherits ERC721 - let mapping_slot = 2; - // pudgy pinguins - let pudgy_address = Address::from_str("0xBd3531dA5CF5857e7CfAA92426877b022e612cf8")?; - let query = ProofQuery::new_mapping_slot(pudgy_address, mapping_slot, mapping_key.to_vec()); - let res = query - .query_mpt_proof(&provider, BlockNumberOrTag::Latest) - .await?; - let raw_address = ProofQuery::verify_storage_proof(&res)?; - // the value is actually RLP encoded ! - let decoded_address: Vec = rlp::decode(&raw_address).unwrap(); - let leaf_node: Vec> = rlp::decode_list(res.storage_proof[0].proof.last().unwrap()); - println!("leaf_node[1].len() = {}", leaf_node[1].len()); - // this is read in the same order - let found_address = Address::from_slice(&decoded_address.into_iter().collect::>()); - assert_eq!(found_address, mapping_value); - Ok(()) - } - */ + #[tokio::test] + async fn test_pidgy_pinguin_mapping_slot() -> Result<()> { + // first pinguin holder https://dune.com/queries/2450476/4027653 + // holder: 0x188b264aa1456b869c3a92eeed32117ebb835f47 + // NFT id https://opensea.io/assets/ethereum/0xbd3531da5cf5857e7cfaa92426877b022e612cf8/1116 + let mapping_value = + Address::from_str("0x29469395eAf6f95920E59F858042f0e28D98a20B").unwrap(); + let nft_id: u32 = 1116; + let mapping_key = left_pad32(&nft_id.to_be_bytes()); + let url = get_mainnet_url(); + let provider = ProviderBuilder::new().on_http(url.parse().unwrap()); + + // extracting from + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol + // assuming it's using ERC731Enumerable that inherits ERC721 + let mapping_slot = 2; + // pudgy pinguins + let pudgy_address = Address::from_str("0xBd3531dA5CF5857e7CfAA92426877b022e612cf8")?; + let query = ProofQuery::new_mapping_slot(pudgy_address, mapping_slot, mapping_key.to_vec()); + let res = query + .query_mpt_proof(&provider, BlockNumberOrTag::Latest) + .await?; + let raw_address = ProofQuery::verify_storage_proof(&res)?; + // the value is actually RLP encoded ! + let decoded_address: Vec = rlp::decode(&raw_address).unwrap(); + let leaf_node: Vec> = rlp::decode_list(res.storage_proof[0].proof.last().unwrap()); + println!("leaf_node[1].len() = {}", leaf_node[1].len()); + // this is read in the same order + let found_address = Address::from_slice(&decoded_address.into_iter().collect::>()); + assert_eq!(found_address, mapping_value); + Ok(()) + } #[tokio::test] async fn test_kashish_contract_proof_query() -> Result<()> { From dd0348b29678a6fc117b40ec66b3e56458117956 Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Fri, 13 Dec 2024 23:38:03 +0800 Subject: [PATCH 4/6] Fix toolchain. --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index bf867e0ae..a7a456242 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly +nightly-2024-12-03 From 8bbe47163093ed0dd2ddde2ee49b2824c031ccd4 Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Sat, 14 Dec 2024 00:03:48 +0800 Subject: [PATCH 5/6] Fix lint. --- mp2-common/src/utils.rs | 6 ++--- mp2-v1/src/final_extraction/merge_circuit.rs | 2 +- mp2-v1/src/values_extraction/api.rs | 1 + mp2-v1/src/values_extraction/mod.rs | 1 + verifiable-db/src/block_tree/mod.rs | 6 ++--- verifiable-db/src/cells_tree/mod.rs | 2 +- verifiable-db/src/cells_tree/public_inputs.rs | 10 ++++---- verifiable-db/src/row_tree/public_inputs.rs | 10 ++++---- .../src/row_tree/secondary_index_cell.rs | 25 ++++++++----------- 9 files changed, 29 insertions(+), 34 deletions(-) diff --git a/mp2-common/src/utils.rs b/mp2-common/src/utils.rs index 6926d25c3..ae076e3d4 100644 --- a/mp2-common/src/utils.rs +++ b/mp2-common/src/utils.rs @@ -775,13 +775,12 @@ impl, const D: usize> SliceConnector for CircuitBui #[cfg(test)] mod test { - use super::{bits_to_num, Packer, TargetsConnector, ToFields}; - use crate::types::CBuilder; + use super::{bits_to_num, Packer, ToFields}; use crate::utils::{ greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, num_to_bits, Endianness, PackerTarget, }; - use crate::{default_config, C, D, F}; + use crate::{C, D, F}; use alloy::primitives::Address; use anyhow::Result; use plonky2::field::goldilocks_field::GoldilocksField; @@ -791,7 +790,6 @@ mod test { use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::CircuitConfig; use rand::{thread_rng, Rng, RngCore}; - use std::array; #[test] fn test_pack() { diff --git a/mp2-v1/src/final_extraction/merge_circuit.rs b/mp2-v1/src/final_extraction/merge_circuit.rs index 0c53276fb..01ede464a 100644 --- a/mp2-v1/src/final_extraction/merge_circuit.rs +++ b/mp2-v1/src/final_extraction/merge_circuit.rs @@ -152,7 +152,7 @@ mod test { C, D, F, }; use mp2_test::circuit::{run_circuit, UserCircuit}; - use plonky2::{field::types::Sample, iop::witness::WitnessWrite}; + use plonky2::iop::witness::WitnessWrite; use super::MergeTableWires; diff --git a/mp2-v1/src/values_extraction/api.rs b/mp2-v1/src/values_extraction/api.rs index a94bca80f..dc5b1e8c4 100644 --- a/mp2-v1/src/values_extraction/api.rs +++ b/mp2-v1/src/values_extraction/api.rs @@ -110,6 +110,7 @@ where /// Create a circuit input for proving a leaf MPT node of mappings where the /// value stored in a mapping entry is another mapping. + #[allow(clippy::too_many_arguments)] pub fn new_mapping_of_mappings_leaf( node: Vec, slot: u8, diff --git a/mp2-v1/src/values_extraction/mod.rs b/mp2-v1/src/values_extraction/mod.rs index fb80f4994..be0856d4d 100644 --- a/mp2-v1/src/values_extraction/mod.rs +++ b/mp2-v1/src/values_extraction/mod.rs @@ -464,6 +464,7 @@ pub fn compute_leaf_mapping_of_mappings_metadata_digest< } /// Compute the values digest for mapping of mappings leaf. +#[allow(clippy::too_many_arguments)] pub fn compute_leaf_mapping_of_mappings_values_digest( table_info: Vec, extracted_column_identifiers: &[u64], diff --git a/verifiable-db/src/block_tree/mod.rs b/verifiable-db/src/block_tree/mod.rs index 04b18927c..47c6a23aa 100644 --- a/verifiable-db/src/block_tree/mod.rs +++ b/verifiable-db/src/block_tree/mod.rs @@ -76,9 +76,9 @@ pub fn compute_final_digest( } /// Compute the final digest target. -pub(crate) fn compute_final_digest_target<'a, E>( +pub(crate) fn compute_final_digest_target( b: &mut CBuilder, - extraction_pi: &E::PI<'a>, + extraction_pi: &E::PI<'_>, rows_tree_pi: &row_tree::PublicInputs, ) -> CurveTarget where @@ -224,7 +224,7 @@ pub(crate) mod tests { rows_tree_pi: &'a [F], } - impl<'a> UserCircuit for TestFinalDigestCircuit<'a> { + impl UserCircuit for TestFinalDigestCircuit<'_> { // Extraction PI + rows tree PI type Wires = (Vec, Vec); diff --git a/verifiable-db/src/cells_tree/mod.rs b/verifiable-db/src/cells_tree/mod.rs index 867d9f018..bdb83311e 100644 --- a/verifiable-db/src/cells_tree/mod.rs +++ b/verifiable-db/src/cells_tree/mod.rs @@ -152,7 +152,7 @@ pub(crate) mod tests { child_values_digest: &'a SplitDigestPoint, } - impl<'a> UserCircuit for TestCellCircuit<'a> { + impl UserCircuit for TestCellCircuit<'_> { // Cell wire + child values digest + child metadata digest type Wires = (CellWire, SplitDigestTarget); diff --git a/verifiable-db/src/cells_tree/public_inputs.rs b/verifiable-db/src/cells_tree/public_inputs.rs index e39764f0e..189cf6e2b 100644 --- a/verifiable-db/src/cells_tree/public_inputs.rs +++ b/verifiable-db/src/cells_tree/public_inputs.rs @@ -141,7 +141,7 @@ impl<'a, T: Clone> PublicInputs<'a, T> { } } -impl<'a> PublicInputCommon for PublicInputs<'a, Target> { +impl PublicInputCommon for PublicInputs<'_, Target> { const RANGES: &'static [PublicInputRange] = &Self::PI_RANGES; fn register_args(&self, cb: &mut CBuilder) { @@ -153,7 +153,7 @@ impl<'a> PublicInputCommon for PublicInputs<'a, Target> { } } -impl<'a> PublicInputs<'a, Target> { +impl PublicInputs<'_, Target> { pub fn node_hash_target(&self) -> [Target; NUM_HASH_OUT_ELTS] { self.to_node_hash_raw().try_into().unwrap() } @@ -182,7 +182,7 @@ impl<'a> PublicInputs<'a, Target> { } } -impl<'a> PublicInputs<'a, F> { +impl PublicInputs<'_, F> { pub fn node_hash(&self) -> HashOut { HashOut::from_partial(self.to_node_hash_raw()) } @@ -230,7 +230,7 @@ pub(crate) mod tests { use rand::{thread_rng, Rng}; use std::slice; - impl<'a> PublicInputs<'a, F> { + impl PublicInputs<'_, F> { pub(crate) fn sample(is_multiplier: bool) -> Vec { let rng = &mut thread_rng(); @@ -261,7 +261,7 @@ pub(crate) mod tests { exp_pi: &'a [F], } - impl<'a> UserCircuit for TestPublicInputs<'a> { + impl UserCircuit for TestPublicInputs<'_> { type Wires = Vec; fn build(b: &mut CBuilder) -> Self::Wires { diff --git a/verifiable-db/src/row_tree/public_inputs.rs b/verifiable-db/src/row_tree/public_inputs.rs index 192f2fbf2..27cfe938b 100644 --- a/verifiable-db/src/row_tree/public_inputs.rs +++ b/verifiable-db/src/row_tree/public_inputs.rs @@ -155,7 +155,7 @@ impl<'a, T: Clone> PublicInputs<'a, T> { } } -impl<'a> PublicInputCommon for PublicInputs<'a, Target> { +impl PublicInputCommon for PublicInputs<'_, Target> { const RANGES: &'static [PublicInputRange] = &Self::PI_RANGES; fn register_args(&self, cb: &mut CBuilder) { @@ -168,7 +168,7 @@ impl<'a> PublicInputCommon for PublicInputs<'a, Target> { } } -impl<'a> PublicInputs<'a, Target> { +impl PublicInputs<'_, Target> { pub fn root_hash_target(&self) -> [Target; NUM_HASH_OUT_ELTS] { self.to_root_hash_raw().try_into().unwrap() } @@ -194,7 +194,7 @@ impl<'a> PublicInputs<'a, Target> { } } -impl<'a> PublicInputs<'a, F> { +impl PublicInputs<'_, F> { pub fn root_hash(&self) -> HashOut { HashOut::from_partial(self.h) } @@ -236,7 +236,7 @@ pub(crate) mod tests { use rand::{thread_rng, Rng}; use std::{array, slice}; - impl<'a> PublicInputs<'a, F> { + impl PublicInputs<'_, F> { pub(crate) fn sample( multiplier_digest: Point, min: usize, @@ -266,7 +266,7 @@ pub(crate) mod tests { exp_pi: &'a [F], } - impl<'a> UserCircuit for TestPublicInputs<'a> { + impl UserCircuit for TestPublicInputs<'_> { type Wires = Vec; fn build(b: &mut CBuilder) -> Self::Wires { diff --git a/verifiable-db/src/row_tree/secondary_index_cell.rs b/verifiable-db/src/row_tree/secondary_index_cell.rs index 5fb527edc..a029a5df7 100644 --- a/verifiable-db/src/row_tree/secondary_index_cell.rs +++ b/verifiable-db/src/row_tree/secondary_index_cell.rs @@ -2,27 +2,24 @@ use crate::cells_tree::{Cell, CellWire, PublicInputs as CellsPublicInputs}; use derive_more::Constructor; -use itertools::Itertools; use mp2_common::{ - poseidon::{hash_to_int_target, hash_to_int_value, H}, + poseidon::{hash_to_int_target, H}, serialization::{deserialize, serialize}, types::{CBuilder, CURVE_TARGET_LEN}, u256::UInt256Target, - utils::{FromFields, ToFields, ToTargets}, + utils::{FromFields, ToTargets}, F, }; use plonky2::{ - field::types::Field, hash::hash_types::{HashOut, HashOutTarget}, iop::{ target::Target, witness::{PartialWitness, WitnessWrite}, }, - plonk::config::Hasher, }; use plonky2_ecdsa::gadgets::nonnative::CircuitBuilderNonNative; use plonky2_ecgfp5::{ - curve::{curve::Point, scalar_field::Scalar}, + curve::curve::Point, gadgets::curve::{CircuitBuilderEcGFp5, CurveTarget}, }; use serde::{Deserialize, Serialize}; @@ -74,15 +71,13 @@ impl SecondaryIndexCell { pw.set_hash_target(wires.row_unique_data, self.row_unique_data); } - pub fn is_individual(&self) -> bool { - self.cell.is_individual() - } - - pub fn is_multiplier(&self) -> bool { - self.cell.is_multiplier() - } - + #[cfg(test)] pub(crate) fn digest(&self, cells_pi: &CellsPublicInputs) -> RowDigest { + use itertools::Itertools; + use mp2_common::{poseidon::hash_to_int_value, utils::ToFields, F}; + use plonky2::{field::types::Field, plonk::config::Hasher}; + use plonky2_ecgfp5::curve::scalar_field::Scalar; + let values_digests = self .cell .split_and_accumulate_values_digest(cells_pi.split_values_digest_point()); @@ -210,7 +205,7 @@ pub(crate) mod tests { cells_pi: &'a [F], } - impl<'a> UserCircuit for TestRowCircuit<'a> { + impl UserCircuit for TestRowCircuit<'_> { // Row wire + cells PI type Wires = (SecondaryIndexCellWire, Vec); From d981c7a40275fc77627c337081f826fd23839141 Mon Sep 17 00:00:00 2001 From: nicholas-mainardi Date: Fri, 24 Jan 2025 21:33:16 +0100 Subject: [PATCH 6/6] fmt --- mp2-v1/tests/integrated_tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mp2-v1/tests/integrated_tests.rs b/mp2-v1/tests/integrated_tests.rs index 910a3c3b6..058499e05 100644 --- a/mp2-v1/tests/integrated_tests.rs +++ b/mp2-v1/tests/integrated_tests.rs @@ -154,7 +154,10 @@ async fn integrated_indexing() -> Result<()> { // save columns information and table information in JSON so querying test can pick up write_table_info(MAPPING_TABLE_INFO_FILE, mapping.table_info())?; write_table_info(MERGE_TABLE_INFO_FILE, merged.table_info())?; - write_table_info(MAPPING_OF_MAPPING_TABLE_INFO_FILE, mapping_of_struct_mappings.table_info())?; + write_table_info( + MAPPING_OF_MAPPING_TABLE_INFO_FILE, + mapping_of_struct_mappings.table_info(), + )?; Ok(()) }