diff --git a/sol/ics23.sol b/sol/ics23.sol index 448e91c4..9c27921b 100644 --- a/sol/ics23.sol +++ b/sol/ics23.sol @@ -2,7 +2,12 @@ pragma solidity ^0.5.3; pragma experimental ABIEncoderV2; +// Current solidity ICS23 implementation only supports Existence +// NonExistence is planned to be supported, Batch and Compressed are not + contract ICS23 { + // Data structures and helper functions + enum HashOp{NO_HASH, SHA256, SHA512, KECCAK, RIPEMD160, BITCOIN} enum LengthOp{NO_PREFIX, VAR_PROTO, VAR_RLP, FIXED32_BIG, FIXED32_LITTLE, FIXED64_BIG, FIXED64_LITTLE, REQUIRE_32_BYTES, REQUIRE_64_BYTES} @@ -160,4 +165,11 @@ contract ICS23 { } return true; } + + // ICS23 interface implementation + + // verifyMembership is synonym for verifyExistence + function verifyMembership(LeafOp memory spec, bytes memory root, ExistenceProof memory proof, bytes memory key, bytes memory value) public pure returns (bool) { + return verifyExistence(proof, spec, root, key, value); + } } diff --git a/sol/ics23_contract.go b/sol/ics23_contract.go index 7b01b8fb..1d8ba8c5 100644 --- a/sol/ics23_contract.go +++ b/sol/ics23_contract.go @@ -28,7 +28,7 @@ var ( ) // ICS23ABI is the input ABI used to generate the binding from. -const ICS23ABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"preimage\",\"type\":\"bytes\"}],\"name\":\"doHashOrNoop\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"spec\",\"type\":\"tuple\"},{\"name\":\"root\",\"type\":\"bytes\"},{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"verifyExistence\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"op\",\"type\":\"tuple\"},{\"name\":\"child\",\"type\":\"bytes\"}],\"name\":\"applyInner\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"bz1\",\"type\":\"bytes\"},{\"name\":\"bz2\",\"type\":\"bytes\"}],\"name\":\"equalBytes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"doLength\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"calculate\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"s\",\"type\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"hasprefix\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"preimage\",\"type\":\"bytes\"}],\"name\":\"doHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"spec\",\"type\":\"tuple\"}],\"name\":\"checkAgainstSpec\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"op\",\"type\":\"tuple\"},{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"applyLeaf\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"hashop\",\"type\":\"uint8\"},{\"name\":\"lengthop\",\"type\":\"uint8\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"prepareLeafData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]" +const ICS23ABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"preimage\",\"type\":\"bytes\"}],\"name\":\"doHashOrNoop\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"spec\",\"type\":\"tuple\"},{\"name\":\"root\",\"type\":\"bytes\"},{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"verifyExistence\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"op\",\"type\":\"tuple\"},{\"name\":\"child\",\"type\":\"bytes\"}],\"name\":\"applyInner\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"bz1\",\"type\":\"bytes\"},{\"name\":\"bz2\",\"type\":\"bytes\"}],\"name\":\"equalBytes\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"doLength\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"calculate\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"s\",\"type\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"hasprefix\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"spec\",\"type\":\"tuple\"},{\"name\":\"root\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"},{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"verifyMembership\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"op\",\"type\":\"uint8\"},{\"name\":\"preimage\",\"type\":\"bytes\"}],\"name\":\"doHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"leaf\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\"}],\"name\":\"path\",\"type\":\"tuple[]\"}],\"name\":\"proof\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"spec\",\"type\":\"tuple\"}],\"name\":\"checkAgainstSpec\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"name\":\"hash\",\"type\":\"uint8\"},{\"name\":\"prehash_key\",\"type\":\"uint8\"},{\"name\":\"prehash_value\",\"type\":\"uint8\"},{\"name\":\"len\",\"type\":\"uint8\"},{\"name\":\"prefix\",\"type\":\"bytes\"}],\"name\":\"op\",\"type\":\"tuple\"},{\"name\":\"key\",\"type\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"applyLeaf\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"hashop\",\"type\":\"uint8\"},{\"name\":\"lengthop\",\"type\":\"uint8\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"prepareLeafData\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]" // ICS23FuncSigs maps the 4-byte function signature to its string representation. var ICS23FuncSigs = map[string]string{ @@ -43,10 +43,11 @@ var ICS23FuncSigs = map[string]string{ "901d0e15": "hasprefix(bytes,bytes)", "fd29e20a": "prepareLeafData(uint8,uint8,bytes)", "2e3098a9": "verifyExistence((bytes,bytes,(uint8,uint8,uint8,uint8,bytes),(uint8,bytes,bytes)[]),(uint8,uint8,uint8,uint8,bytes),bytes,bytes,bytes)", + "a04f1008": "verifyMembership((uint8,uint8,uint8,uint8,bytes),bytes,(bytes,bytes,(uint8,uint8,uint8,uint8,bytes),(uint8,bytes,bytes)[]),bytes,bytes)", } // ICS23Bin is the compiled bytecode used for deploying new contracts. -var ICS23Bin = "0x60016080818152600060a081905260c083905260e083905261016060405261012083815261014082815261010091909152815460ff1916841762ffff001916620100001763ff0000001916630100000017825591929091620000639190816200007a565b5050503480156200007357600080fd5b506200011f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000bd57805160ff1916838001178555620000ed565b82800160010185558215620000ed579182015b82811115620000ed578251825591602001919060010190620000d0565b50620000fb929150620000ff565b5090565b6200011c91905b80821115620000fb576000815560010162000106565b90565b6111bf806200012f6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637e1fd3bc116100715780637e1fd3bc14610130578063901d0e1514610143578063d48f1e4f14610156578063f10e9a9c14610169578063f6747d821461017c578063fd29e20a1461018f576100a9565b806303801174146100ae5780632e3098a9146100d75780633d4a397d146100f75780634cac70ff1461010a57806367bb8e811461011d575b600080fd5b6100c16100bc366004610b82565b6101a2565b6040516100ce9190611024565b60405180910390f35b6100ea6100e5366004610cb5565b6101d2565b6040516100ce9190611016565b6100c1610105366004610d9c565b61022b565b6100ea610118366004610b1b565b610282565b6100c161012b366004610c05565b6102fe565b6100c161013e366004610c24565b6103f1565b6100ea610151366004610b1b565b61044f565b6100c1610164366004610b82565b6104af565b6100ea610177366004610c58565b610668565b6100c161018a366004610dd1565b61078a565b6100c161019d366004610ba1565b610819565b606060008360058111156101b257fe5b14156101bf5750806101cc565b6101c983836104af565b90505b92915050565b60006101de8686610668565b80156101f357506101f3838760000151610282565b80156102085750610208828760200151610282565b8015610221575061022161021b876103f1565b85610282565b9695505050505050565b606081516000141561023c57600080fd5b6060836020015183856040015160405160200161025b93929190610fa1565b604051602081830303815290604052905061027a8460000151826104af565b949350505050565b60008151835114610295575060006101cc565b60005b83518110156102f4578281815181106102ad57fe5b602001015160f81c60f81b6001600160f81b0319168482815181106102ce57fe5b01602001516001600160f81b031916146102ec5760009150506101cc565b600101610298565b5060019392505050565b6060600083600881111561030e57fe5b141561031b5750806101cc565b600183600881111561032957fe5b1415610385578151608081106103725780607f16608017600782901c9150818460405160200161035b93929190610fea565b6040516020818303038152906040529150506101cc565b808360405160200161035b929190610fce565b600783600881111561039357fe5b14156103ae5781516020146103a757600080fd5b50806101cc565b60088360088111156103bc57fe5b14156103d05781516040146103a757600080fd5b60405162461bcd60e51b81526004016103e890611035565b60405180910390fd5b60608061040b83604001518460000151856020015161078a565b905060005b8360600151518110156104485761043e8460600151828151811061043057fe5b60200260200101518361022b565b9150600101610410565b5092915050565b6000805b82518110156102f45782818151811061046857fe5b602001015160f81c60f81b6001600160f81b03191684828151811061048957fe5b01602001516001600160f81b031916146104a75760009150506101cc565b600101610453565b606060038360058111156104bf57fe5b14156104f35781805190602001206040516020016104dd9190610f79565b60405160208183030381529060405290506101cc565b600183600581111561050157fe5b1415610567576002826040516105179190610f8e565b602060405180830381855afa158015610534573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506105579190810190610afd565b6040516020016104dd9190610f79565b600483600581111561057557fe5b14156105c05760038260405161058b9190610f8e565b602060405180830381855afa1580156105a8573d6000803e3d6000fd5b505060405180516104dd925060601b90602001610f64565b60058360058111156105ce57fe5b14156106505760036002836040516105e69190610f8e565b602060405180830381855afa158015610603573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506106269190810190610afd565b6040516020016106369190610f79565b60408051601f198184030181529082905261058b91610f8e565b60405162461bcd60e51b81526004016103e890611045565b8051600090600581111561067857fe5b604084015151600581111561068957fe5b1480156106b75750816020015160058111156106a157fe5b83604001516020015160058111156106b557fe5b145b80156106e45750816040015160058111156106ce57fe5b83604001516040015160058111156106e257fe5b145b80156107115750816060015160088111156106fb57fe5b836040015160600151600881111561070f57fe5b145b801561072e575061072e836040015160800151836080015161044f565b61073a575060006101cc565b60005b8360600151518110156102f4576107738460600151828151811061075d57fe5b602002602001015160200151846080015161044f565b156107825760009150506101cc565b60010161073d565b606082516000141561079b57600080fd5b81516107a657600080fd5b60606107bb8560200151866060015186610819565b905060606107d28660400151876060015186610819565b90506060866080015183836040516020016107ef93929190610fa1565b604051602081830303815290604052905061080e8760000151826104af565b979650505050505050565b60608061082685846101a2565b9050606061022185836102fe565b600082601f83011261084557600080fd5b81356108586108538261107b565b611055565b81815260209384019390925082018360005b83811015610896578135860161088088826109da565b845250602092830192919091019060010161086a565b5050505092915050565b80516101cc8161114b565b600082601f8301126108bc57600080fd5b81356108ca6108538261109b565b915080825260208301602083018583830111156108e657600080fd5b6108f18382846110f4565b50505092915050565b80356101cc81611162565b80356101cc8161116f565b60006080828403121561092257600080fd5b61092c6080611055565b905081356001600160401b0381111561094457600080fd5b610950848285016108ab565b82525060208201356001600160401b0381111561096c57600080fd5b610978848285016108ab565b60208301525060408201356001600160401b0381111561099757600080fd5b6109a384828501610a63565b60408301525060608201356001600160401b038111156109c257600080fd5b6109ce84828501610834565b60608301525092915050565b6000606082840312156109ec57600080fd5b6109f66060611055565b90506000610a0484846108fa565b82525060208201356001600160401b03811115610a2057600080fd5b610a2c848285016108ab565b60208301525060408201356001600160401b03811115610a4b57600080fd5b610a57848285016108ab565b60408301525092915050565b600060a08284031215610a7557600080fd5b610a7f60a0611055565b90506000610a8d84846108fa565b8252506020610a9e848483016108fa565b6020830152506040610ab2848285016108fa565b6040830152506060610ac684828501610905565b60608301525060808201356001600160401b03811115610ae557600080fd5b610af1848285016108ab565b60808301525092915050565b600060208284031215610b0f57600080fd5b600061027a84846108a0565b60008060408385031215610b2e57600080fd5b82356001600160401b03811115610b4457600080fd5b610b50858286016108ab565b92505060208301356001600160401b03811115610b6c57600080fd5b610b78858286016108ab565b9150509250929050565b60008060408385031215610b9557600080fd5b6000610b5085856108fa565b600080600060608486031215610bb657600080fd5b6000610bc286866108fa565b9350506020610bd386828701610905565b92505060408401356001600160401b03811115610bef57600080fd5b610bfb868287016108ab565b9150509250925092565b60008060408385031215610c1857600080fd5b6000610b508585610905565b600060208284031215610c3657600080fd5b81356001600160401b03811115610c4c57600080fd5b61027a84828501610910565b60008060408385031215610c6b57600080fd5b82356001600160401b03811115610c8157600080fd5b610c8d85828601610910565b92505060208301356001600160401b03811115610ca957600080fd5b610b7885828601610a63565b600080600080600060a08688031215610ccd57600080fd5b85356001600160401b03811115610ce357600080fd5b610cef88828901610910565b95505060208601356001600160401b03811115610d0b57600080fd5b610d1788828901610a63565b94505060408601356001600160401b03811115610d3357600080fd5b610d3f888289016108ab565b93505060608601356001600160401b03811115610d5b57600080fd5b610d67888289016108ab565b92505060808601356001600160401b03811115610d8357600080fd5b610d8f888289016108ab565b9150509295509295909350565b60008060408385031215610daf57600080fd5b82356001600160401b03811115610dc557600080fd5b610b50858286016109da565b600080600060608486031215610de657600080fd5b83356001600160401b03811115610dfc57600080fd5b610e0886828701610a63565b93505060208401356001600160401b03811115610e2457600080fd5b610bd3868287016108ab565b610e39816110d4565b82525050565b610e39610e4b826110d9565b6110eb565b610e39610e4b826110eb565b6000610e67826110c2565b610e7181856110c6565b9350610e81818560208601611100565b610e8a8161113b565b9093019392505050565b6000610e9f826110c2565b610ea981856110cf565b9350610eb9818560208601611100565b9290920192915050565b6000610ed06027836110c6565b7f696e76616c6964206f7220756e737570706f72746564206c656e677468206f7081526632b930ba34b7b760c91b602082015260400192915050565b6000610f196025836110c6565b7f696e76616c6964206f7220756e737570706f727465642068617368206f70657281526430ba34b7b760d91b602082015260400192915050565b610e39610f5f826110ee565b611130565b6000610f708284610e3f565b50601401919050565b6000610f858284610e50565b50602001919050565b6000610f9a8284610e94565b9392505050565b6000610fad8286610e94565b9150610fb98285610e94565b9150610fc58284610e94565b95945050505050565b6000610fda8285610f53565b60018201915061027a8284610e94565b6000610ff68286610f53565b6001820191506110068285610f53565b600182019150610fc58284610e94565b602081016101cc8284610e30565b602080825281016101c98184610e5c565b602080825281016101cc81610ec3565b602080825281016101cc81610f0c565b6040518181016001600160401b038111828210171561107357600080fd5b604052919050565b60006001600160401b0382111561109157600080fd5b5060209081020190565b60006001600160401b038211156110b157600080fd5b506020601f91909101601f19160190565b5190565b90815260200190565b919050565b151590565b6bffffffffffffffffffffffff191690565b90565b60ff1690565b82818337506000910152565b60005b8381101561111b578181015183820152602001611103565b8381111561112a576000848401525b50505050565b60006101cc82611145565b601f01601f191690565b60f81b90565b611154816110eb565b811461115f57600080fd5b50565b6006811061115f57600080fd5b6009811061115f57600080fdfea365627a7a7230582081c7271a2c9df296c011171cf29e0f68b9a046fb3a8fb80c1eca748d141b7e596c6578706572696d656e74616cf564736f6c63430005090040" +var ICS23Bin = "0x60016080818152600060a081905260c083905260e083905261016060405261012083815261014082815261010091909152815460ff1916841762ffff001916620100001763ff0000001916630100000017825591929091620000639190816200007a565b5050503480156200007357600080fd5b506200011f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000bd57805160ff1916838001178555620000ed565b82800160010185558215620000ed579182015b82811115620000ed578251825591602001919060010190620000d0565b50620000fb929150620000ff565b5090565b6200011c91905b80821115620000fb576000815560010162000106565b90565b611276806200012f6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063901d0e1511610071578063901d0e151461014e578063a04f100814610161578063d48f1e4f14610174578063f10e9a9c14610187578063f6747d821461019a578063fd29e20a146101ad576100b4565b806303801174146100b95780632e3098a9146100e25780633d4a397d146101025780634cac70ff1461011557806367bb8e81146101285780637e1fd3bc1461013b575b600080fd5b6100cc6100c7366004610baf565b6101c0565b6040516100d991906110db565b60405180910390f35b6100f56100f0366004610ce2565b6101f0565b6040516100d991906110cd565b6100cc610110366004610dc9565b610249565b6100f5610123366004610b48565b6102a0565b6100cc610136366004610c32565b61031c565b6100cc610149366004610c51565b61040f565b6100f561015c366004610b48565b61046d565b6100f561016f366004610e5d565b6104cd565b6100cc610182366004610baf565b6104dc565b6100f5610195366004610c85565b610695565b6100cc6101a8366004610dfe565b6107b7565b6100cc6101bb366004610bce565b610846565b606060008360058111156101d057fe5b14156101dd5750806101ea565b6101e783836104dc565b90505b92915050565b60006101fc8686610695565b801561021157506102118387600001516102a0565b801561022657506102268287602001516102a0565b801561023f575061023f6102398761040f565b856102a0565b9695505050505050565b606081516000141561025a57600080fd5b6060836020015183856040015160405160200161027993929190611058565b60405160208183030381529060405290506102988460000151826104dc565b949350505050565b600081518351146102b3575060006101ea565b60005b8351811015610312578281815181106102cb57fe5b602001015160f81c60f81b6001600160f81b0319168482815181106102ec57fe5b01602001516001600160f81b0319161461030a5760009150506101ea565b6001016102b6565b5060019392505050565b6060600083600881111561032c57fe5b14156103395750806101ea565b600183600881111561034757fe5b14156103a3578151608081106103905780607f16608017600782901c91508184604051602001610379939291906110a1565b6040516020818303038152906040529150506101ea565b8083604051602001610379929190611085565b60078360088111156103b157fe5b14156103cc5781516020146103c557600080fd5b50806101ea565b60088360088111156103da57fe5b14156103ee5781516040146103c557600080fd5b60405162461bcd60e51b8152600401610406906110ec565b60405180910390fd5b6060806104298360400151846000015185602001516107b7565b905060005b8360600151518110156104665761045c8460600151828151811061044e57fe5b602002602001015183610249565b915060010161042e565b5092915050565b6000805b82518110156103125782818151811061048657fe5b602001015160f81c60f81b6001600160f81b0319168482815181106104a757fe5b01602001516001600160f81b031916146104c55760009150506101ea565b600101610471565b600061023f84878786866101f0565b606060038360058111156104ec57fe5b141561052057818051906020012060405160200161050a9190611030565b60405160208183030381529060405290506101ea565b600183600581111561052e57fe5b1415610594576002826040516105449190611045565b602060405180830381855afa158015610561573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506105849190810190610b2a565b60405160200161050a9190611030565b60048360058111156105a257fe5b14156105ed576003826040516105b89190611045565b602060405180830381855afa1580156105d5573d6000803e3d6000fd5b5050604051805161050a925060601b9060200161101b565b60058360058111156105fb57fe5b141561067d5760036002836040516106139190611045565b602060405180830381855afa158015610630573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506106539190810190610b2a565b6040516020016106639190611030565b60408051601f19818403018152908290526105b891611045565b60405162461bcd60e51b8152600401610406906110fc565b805160009060058111156106a557fe5b60408401515160058111156106b657fe5b1480156106e45750816020015160058111156106ce57fe5b83604001516020015160058111156106e257fe5b145b80156107115750816040015160058111156106fb57fe5b836040015160400151600581111561070f57fe5b145b801561073e57508160600151600881111561072857fe5b836040015160600151600881111561073c57fe5b145b801561075b575061075b836040015160800151836080015161046d565b610767575060006101ea565b60005b836060015151811015610312576107a08460600151828151811061078a57fe5b602002602001015160200151846080015161046d565b156107af5760009150506101ea565b60010161076a565b60608251600014156107c857600080fd5b81516107d357600080fd5b60606107e88560200151866060015186610846565b905060606107ff8660400151876060015186610846565b905060608660800151838360405160200161081c93929190611058565b604051602081830303815290604052905061083b8760000151826104dc565b979650505050505050565b60608061085385846101c0565b9050606061023f858361031c565b600082601f83011261087257600080fd5b813561088561088082611132565b61110c565b81815260209384019390925082018360005b838110156108c357813586016108ad8882610a07565b8452506020928301929190910190600101610897565b5050505092915050565b80516101ea81611202565b600082601f8301126108e957600080fd5b81356108f761088082611152565b9150808252602083016020830185838301111561091357600080fd5b61091e8382846111ab565b50505092915050565b80356101ea81611219565b80356101ea81611226565b60006080828403121561094f57600080fd5b610959608061110c565b905081356001600160401b0381111561097157600080fd5b61097d848285016108d8565b82525060208201356001600160401b0381111561099957600080fd5b6109a5848285016108d8565b60208301525060408201356001600160401b038111156109c457600080fd5b6109d084828501610a90565b60408301525060608201356001600160401b038111156109ef57600080fd5b6109fb84828501610861565b60608301525092915050565b600060608284031215610a1957600080fd5b610a23606061110c565b90506000610a318484610927565b82525060208201356001600160401b03811115610a4d57600080fd5b610a59848285016108d8565b60208301525060408201356001600160401b03811115610a7857600080fd5b610a84848285016108d8565b60408301525092915050565b600060a08284031215610aa257600080fd5b610aac60a061110c565b90506000610aba8484610927565b8252506020610acb84848301610927565b6020830152506040610adf84828501610927565b6040830152506060610af384828501610932565b60608301525060808201356001600160401b03811115610b1257600080fd5b610b1e848285016108d8565b60808301525092915050565b600060208284031215610b3c57600080fd5b600061029884846108cd565b60008060408385031215610b5b57600080fd5b82356001600160401b03811115610b7157600080fd5b610b7d858286016108d8565b92505060208301356001600160401b03811115610b9957600080fd5b610ba5858286016108d8565b9150509250929050565b60008060408385031215610bc257600080fd5b6000610b7d8585610927565b600080600060608486031215610be357600080fd5b6000610bef8686610927565b9350506020610c0086828701610932565b92505060408401356001600160401b03811115610c1c57600080fd5b610c28868287016108d8565b9150509250925092565b60008060408385031215610c4557600080fd5b6000610b7d8585610932565b600060208284031215610c6357600080fd5b81356001600160401b03811115610c7957600080fd5b6102988482850161093d565b60008060408385031215610c9857600080fd5b82356001600160401b03811115610cae57600080fd5b610cba8582860161093d565b92505060208301356001600160401b03811115610cd657600080fd5b610ba585828601610a90565b600080600080600060a08688031215610cfa57600080fd5b85356001600160401b03811115610d1057600080fd5b610d1c8882890161093d565b95505060208601356001600160401b03811115610d3857600080fd5b610d4488828901610a90565b94505060408601356001600160401b03811115610d6057600080fd5b610d6c888289016108d8565b93505060608601356001600160401b03811115610d8857600080fd5b610d94888289016108d8565b92505060808601356001600160401b03811115610db057600080fd5b610dbc888289016108d8565b9150509295509295909350565b60008060408385031215610ddc57600080fd5b82356001600160401b03811115610df257600080fd5b610b7d85828601610a07565b600080600060608486031215610e1357600080fd5b83356001600160401b03811115610e2957600080fd5b610e3586828701610a90565b93505060208401356001600160401b03811115610e5157600080fd5b610c00868287016108d8565b600080600080600060a08688031215610e7557600080fd5b85356001600160401b03811115610e8b57600080fd5b610e9788828901610a90565b95505060208601356001600160401b03811115610eb357600080fd5b610ebf888289016108d8565b94505060408601356001600160401b03811115610edb57600080fd5b610d6c8882890161093d565b610ef08161118b565b82525050565b610ef0610f0282611190565b6111a2565b610ef0610f02826111a2565b6000610f1e82611179565b610f28818561117d565b9350610f388185602086016111b7565b610f41816111f2565b9093019392505050565b6000610f5682611179565b610f608185611186565b9350610f708185602086016111b7565b9290920192915050565b6000610f8760278361117d565b7f696e76616c6964206f7220756e737570706f72746564206c656e677468206f7081526632b930ba34b7b760c91b602082015260400192915050565b6000610fd060258361117d565b7f696e76616c6964206f7220756e737570706f727465642068617368206f70657281526430ba34b7b760d91b602082015260400192915050565b610ef0611016826111a5565b6111e7565b60006110278284610ef6565b50601401919050565b600061103c8284610f07565b50602001919050565b60006110518284610f4b565b9392505050565b60006110648286610f4b565b91506110708285610f4b565b915061107c8284610f4b565b95945050505050565b6000611091828561100a565b6001820191506102988284610f4b565b60006110ad828661100a565b6001820191506110bd828561100a565b60018201915061107c8284610f4b565b602081016101ea8284610ee7565b602080825281016101e78184610f13565b602080825281016101ea81610f7a565b602080825281016101ea81610fc3565b6040518181016001600160401b038111828210171561112a57600080fd5b604052919050565b60006001600160401b0382111561114857600080fd5b5060209081020190565b60006001600160401b0382111561116857600080fd5b506020601f91909101601f19160190565b5190565b90815260200190565b919050565b151590565b6bffffffffffffffffffffffff191690565b90565b60ff1690565b82818337506000910152565b60005b838110156111d25781810151838201526020016111ba565b838111156111e1576000848401525b50505050565b60006101ea826111fc565b601f01601f191690565b60f81b90565b61120b816111a2565b811461121657600080fd5b50565b6006811061121657600080fd5b6009811061121657600080fdfea365627a7a7230582021e845f87264315bcfe13337b935b2d08290e3ad34917bca35059566373a87896c6578706572696d656e74616cf564736f6c63430005090040" // DeployICS23 deploys a new Ethereum contract, binding an instance of ICS23 to it. func DeployICS23(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ICS23, error) { @@ -513,3 +514,29 @@ func (_ICS23 *ICS23Session) VerifyExistence(proof Struct2, spec Struct0, root [] func (_ICS23 *ICS23CallerSession) VerifyExistence(proof Struct2, spec Struct0, root []byte, key []byte, value []byte) (bool, error) { return _ICS23.Contract.VerifyExistence(&_ICS23.CallOpts, proof, spec, root, key, value) } + +// VerifyMembership is a free data retrieval call binding the contract method 0xa04f1008. +// +// Solidity: function verifyMembership(Struct0 spec, bytes root, Struct2 proof, bytes key, bytes value) constant returns(bool) +func (_ICS23 *ICS23Caller) VerifyMembership(opts *bind.CallOpts, spec Struct0, root []byte, proof Struct2, key []byte, value []byte) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _ICS23.contract.Call(opts, out, "verifyMembership", spec, root, proof, key, value) + return *ret0, err +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xa04f1008. +// +// Solidity: function verifyMembership(Struct0 spec, bytes root, Struct2 proof, bytes key, bytes value) constant returns(bool) +func (_ICS23 *ICS23Session) VerifyMembership(spec Struct0, root []byte, proof Struct2, key []byte, value []byte) (bool, error) { + return _ICS23.Contract.VerifyMembership(&_ICS23.CallOpts, spec, root, proof, key, value) +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xa04f1008. +// +// Solidity: function verifyMembership(Struct0 spec, bytes root, Struct2 proof, bytes key, bytes value) constant returns(bool) +func (_ICS23 *ICS23CallerSession) VerifyMembership(spec Struct0, root []byte, proof Struct2, key []byte, value []byte) (bool, error) { + return _ICS23.Contract.VerifyMembership(&_ICS23.CallOpts, spec, root, proof, key, value) +}