event-msg

Simple, embedded news post vehicle for EVM smart contracts
Log | Files | Refs

commit d5ae24541336ae1df5b2cafae582654a936d090f
parent aaf5821bd2bba6d427a2705d2a04e746404bb0c3
Author: lash <dev@holbrook.no>
Date:   Sun, 26 Mar 2023 11:38:50 +0100

Change to digest interface implementation

Diffstat:
A.gitignore | 4++++
Mpython/eth_event_msg/__init__.py | 23++++++++++++++++++++---
Mpython/eth_event_msg/data/Msg.bin | 4++--
Mpython/eth_event_msg/data/Msg.json | 2+-
Apython/eth_event_msg/data/Msg.metadata.json | 1+
Mpython/tests/test_basic.py | 2+-
Msolidity/Makefile | 6++++--
Msolidity/Msg.sol | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
8 files changed, 140 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,4 @@ +__pycache__ +*.pyc +build/ +dist/ diff --git a/python/eth_event_msg/__init__.py b/python/eth_event_msg/__init__.py @@ -103,12 +103,12 @@ class EventMsg(TxFactory): return self.call_noarg('getMsg', contract_address, sender_address=sender_address, id_generator=id_generator) - def to_hash(self, contract_address, v, sender_address=ZERO_ADDRESS, id_generator=None): + def encode_digest(self, contract_address, v, sender_address=ZERO_ADDRESS, id_generator=None): j = JSONRPCRequest(id_generator) o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() - enc.method('toHash') + enc.method('encodeDigest') enc.typ(ABIContractType.BYTES) enc.bytes(v) data = add_0x(enc.get()) @@ -125,7 +125,24 @@ class EventMsg(TxFactory): o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() - enc.method('toUri') + enc.method('toURI') + enc.typ(ABIContractType.BYTES) + enc.bytes(v) + data = add_0x(enc.get()) + tx = self.template(sender_address, contract_address) + tx = self.set_code(tx, data) + o['params'].append(self.normalize(tx)) + o['params'].append('latest') + o = j.finalize(o) + return o + + + def to_url(self, contract_address, v, sender_address=ZERO_ADDRESS, id_generator=None): + j = JSONRPCRequest(id_generator) + o = j.template() + o['method'] = 'eth_call' + enc = ABIContractEncoder() + enc.method('toURL') enc.typ(ABIContractType.BYTES) enc.bytes(v) data = add_0x(enc.get()) diff --git a/python/eth_event_msg/data/Msg.bin b/python/eth_event_msg/data/Msg.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5062000065602060126040518060400160405280600681526020017f7368613235360000000000000000000000000000000000000000000000000000815250620000e9640100000000026401000000009004565b6200008060126200040d640100000000026401000000009004565b602067ffffffffffffffff8111156200009e576200009d62000977565b5b6040519080825280601f01601f191660200182016040528015620000d15781602001600182028036833780820191505090505b5060029081620000e2919062000bf7565b506200119a565b6000600160ff16600354161462000137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200012e9062000d3f565b60405180910390fd5b606081905060108151111562000184576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200017b9062000db1565b60405180910390fd5b6200018e62000911565b6000600790505b60008160ff1610620001f2576000600882620001b2919062000e0f565b60ff1660ff9060020a029050600086821667ffffffffffffffff161115620001db5750620001f2565b8180620001e89062000e55565b9250505062000195565b60018162000201919062000e83565b826020019060ff16908160ff1681525050600881600762000223919062000ebf565b6200022f919062000e0f565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff168152505082620002bd9062000f4e565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6000600160ff1660035416146200045b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000452906200100e565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff16116200049357600080fd5b816001819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff811115620004cb57620004ca62000977565b5b6040519080825280601f01601f191660200182016040528015620004fe5781602001600182028036833780820191505090505b50600290816200050f919062000bf7565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c6200054a62000565640100000000026401000000009004565b604051620005599190620010bf565b60405180910390a15050565b606062000613600280546200057a90620009e0565b80601f0160208091040260200160405190810160405280929190818152602001828054620005a890620009e0565b8015620005f95780601f10620005cd57610100808354040283529160200191620005f9565b820191906000526020600020905b815481529060010190602001808311620005db57829003601f168201915b505050505062000618640100000000026401000000009004565b905090565b606060006060600080600154815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff1685516200066c9190620010e3565b620006789190620010e3565b67ffffffffffffffff81111562000694576200069362000977565b5b6040519080825280601f01601f191660200182016040528015620006c75781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff16811015620007a7578260000160139054906101000a900478010000000000000000000000000000000000000000000000000281600881106200072957620007286200111e565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000028282815181106200076257620007616200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200079e906200114d565b915050620006cd565b8260000160009054906101000a900460ff167f010000000000000000000000000000000000000000000000000000000000000002828281518110620007f157620007f06200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200082d906200114d565b91505060005b855181101562000905578581815181106200085357620008526200111e565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838284620008ac9190620010e3565b81518110620008c057620008bf6200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620008fc906200114d565b91505062000833565b50819350505050919050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620009f957607f821691505b60208210810362000a0f5762000a0e620009b1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b60006008830262000a7c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000a3a565b62000a88868362000a3a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000ad562000acf62000ac98462000aa0565b62000aaa565b62000aa0565b9050919050565b6000819050919050565b62000af18362000ab4565b62000b0962000b008262000adc565b84845462000a4a565b825550505050565b600090565b62000b2062000b11565b62000b2d81848462000ae6565b505050565b5b8181101562000b555762000b4960008262000b16565b60018101905062000b33565b5050565b601f82111562000ba45762000b6e8162000a15565b62000b798462000a2a565b8101602085101562000b89578190505b62000ba162000b988562000a2a565b83018262000b32565b50505b505050565b60008160020a8304905092915050565b600062000bcc6000198460080262000ba9565b1980831691505092915050565b600062000be7838362000bb9565b9150826002028217905092915050565b62000c0282620009a6565b67ffffffffffffffff81111562000c1e5762000c1d62000977565b5b62000c2a8254620009e0565b62000c3782828562000b59565b600060209050601f83116001811462000c6f576000841562000c5a578287015190505b62000c66858262000bd9565b86555062000cd6565b601f19841662000c7f8662000a15565b60005b8281101562000ca95784890151825560018201915060208501945060208101905062000c82565b8683101562000cc9578489015162000cc5601f89168262000bb9565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b600062000d2760128362000cde565b915062000d348262000cef565b602082019050919050565b6000602082019050818103600083015262000d5a8162000d18565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b600062000d9960138362000cde565b915062000da68262000d61565b602082019050919050565b6000602082019050818103600083015262000dcc8162000d8a565b9050919050565b600060ff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000e1c8262000dd3565b915062000e298362000dd3565b925082820262000e398162000dd3565b915080821462000e4e5762000e4d62000de0565b5b5092915050565b600062000e628262000dd3565b91506000820362000e785762000e7762000de0565b5b600182039050919050565b600062000e908262000dd3565b915062000e9d8362000dd3565b9250828201905060ff81111562000eb95762000eb862000de0565b5b92915050565b600062000ecc8262000dd3565b915062000ed98362000dd3565b9250828203905060ff81111562000ef55762000ef462000de0565b5b92915050565b6000819050602082019050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b600062000f45825162000f0b565b80915050919050565b600062000f5b82620009a6565b8262000f678462000efb565b905062000f748162000f37565b9250601082101562000fb75762000fb27fffffffffffffffffffffffffffffffff000000000000000000000000000000008360100360080262000a3a565b831692505b5050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b600062000ff6600e8362000cde565b9150620010038262000fbe565b602082019050919050565b60006020820190508181036000830152620010298162000fe7565b9050919050565b600082825260208201905092915050565b60005b838110156200106157808201518184015260208101905062001044565b60008484015250505050565b6000601f19601f8301169050919050565b60006200108b82620009a6565b62001097818562001030565b9350620010a981856020860162001041565b620010b4816200106d565b840191505092915050565b60006020820190508181036000830152620010db81846200107e565b905092915050565b6000620010f08262000aa0565b9150620010fd8362000aa0565b925082820190508082111562001118576200111762000de0565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006200115a8262000aa0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036200118f576200118e62000de0565b5b600182019050919050565b61210280620011aa6000396000f3fe608060405234801561001057600080fd5b50600436106100d1576000357c0100000000000000000000000000000000000000000000000000000000900480639a7c5e9f1161008e5780639a7c5e9f146101be578063ad0dec2f146101da578063b238d6031461020a578063b5fdeb231461023e578063c5bec6fc1461025c578063ccc094c21461028c576100d1565b806318cbbcfc146100d65780632c1758c1146100f457806331a5995d146101245780635344299a14610142578063779ab6671461015e57806386fe212d1461018e575b600080fd5b6100de6102a8565b6040516100eb919061138e565b60405180910390f35b61010e600480360381019061010991906113e9565b6102ad565b60405161011b9190611431565b60405180910390f35b61012c6102df565b604051610139919061138e565b60405180910390f35b61015c60048036038101906101579190611592565b6102e5565b005b61017860048036038101906101739190611592565b610370565b604051610185919061165a565b60405180910390f35b6101a860048036038101906101a391906113e9565b61061a565b6040516101b5919061138e565b60405180910390f35b6101d860048036038101906101d391906113e9565b610700565b005b6101f460048036038101906101ef9190611592565b61083b565b60405161020191906116d1565b60405180910390f35b610224600480360381019061021f91906113e9565b610b11565b604051610235959493929190611785565b60405180910390f35b610246610bb0565b60405161025391906116d1565b60405180910390f35b61027660048036038101906102719190611592565b610c4a565b60405161028391906116d1565b60405180910390f35b6102a660048036038101906102a191906118e5565b611003565b005b600381565b6000600382106102bc57600080fd5b600082036102d057600380541490506102da565b8160035483161490505b919050565b60035481565b6000806000600154815260200190815260200160002090508060000160009054906101000a900460ff1660ff1682511461031e57600080fd5b816002908161032d9190611b66565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c610357610bb0565b60405161036491906116d1565b60405180910390a15050565b60606000606080600061038286610c4a565b9150600080600154815260200190815260200160002093508360000160029054906101000a900460ff1660ff16905060018251826103c09190611c67565b6103ca9190611c67565b67ffffffffffffffff8111156103e3576103e2611467565b5b6040519080825280601f01601f1916602001820160405280156104155781602001600182028036833780820191505090505b50925060005b818110156104cf578460000160039054906101000a900470010000000000000000000000000000000002816010811061045757610456611c9b565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000284828151811061048d5761048c611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806104c790611cca565b91505061041b565b50603a7f01000000000000000000000000000000000000000000000000000000000000000283828151811061050757610506611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061054190611cca565b91505060005b825181101561060d5782818151811061056357610562611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028482846105ba9190611c67565b815181106105cb576105ca611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061060590611cca565b915050610547565b5082945050505050919050565b60006010821061065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065690611d5e565b60405180910390fd5b60006003548316146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d90611dca565b60405180910390fd5b81600360008282541792505081905550600380541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e6003546040516106ee919061138e565b60405180910390a26003549050919050565b6000600160ff16600354161461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074290611e36565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff161161078257600080fd5b816001819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff8111156107b7576107b6611467565b5b6040519080825280601f01601f1916602001820160405280156107e95781602001600182028036833780820191505090505b50600290816107f89190611b66565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c610822610bb0565b60405161082f91906116d1565b60405180910390a15050565b606060006060600080600154815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff16855161088d9190611c67565b6108979190611c67565b67ffffffffffffffff8111156108b0576108af611467565b5b6040519080825280601f01601f1916602001820160405280156108e25781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff168110156109b8578260000160139054906101000a900478010000000000000000000000000000000000000000000000000281600881106109405761093f611c9b565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811061097657610975611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806109b090611cca565b9150506108e8565b8260000160009054906101000a900460ff167f0100000000000000000000000000000000000000000000000000000000000000028282815181106109ff576109fe611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610a3990611cca565b91505060005b8551811015610b0557858181518110610a5b57610a5a611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838284610ab29190611c67565b81518110610ac357610ac2611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610afd90611cca565b915050610a3f565b50819350505050919050565b60006020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900470010000000000000000000000000000000002908060000160139054906101000a9004780100000000000000000000000000000000000000000000000002905085565b6060610c4560028054610bc290611983565b80601f0160208091040260200160405190810160405280929190818152602001828054610bee90611983565b8015610c3b5780601f10610c1057610100808354040283529160200191610c3b565b820191906000526020600020905b815481529060010190602001808311610c1e57829003601f168201915b505050505061083b565b905090565b60608060008060028551610c5e9190611e56565b67ffffffffffffffff811115610c7757610c76611467565b5b6040519080825280601f01601f191660200182016040528015610ca95781602001600182028036833780820191505090505b5092506000905060005b6020811015610ff757600460f0878381518110610cd357610cd2611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015610dd257603083610d699190611e98565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610d9e57610d9d611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610e44565b605783610ddf9190611e98565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610e1457610e13611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868281518110610e5957610e58611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015610f5757603083610ee29190611e98565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610f129190611c67565b81518110610f2357610f22611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610fd5565b605783610f649190611e98565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610f949190611c67565b81518110610fa557610fa4611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282610fe29190611c67565b91508080610fef90611cca565b915050610cb3565b50829350505050919050565b6000600160ff16600354161461104e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104590611f19565b60405180910390fd5b6060819050601081511115611098576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108f90611f85565b60405180910390fd5b6110a061130f565b6000600790505b60008160ff16106110fc5760006008826110c19190611fa5565b60ff1660ff9060020a029050600086821667ffffffffffffffff1611156110e857506110fc565b81806110f390611fe2565b925050506110a7565b6001816111099190611e98565b826020019060ff16908160ff16815250506008816007611129919061200b565b6111339190611fa5565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff1681525050826111bf90612065565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6000819050919050565b61138881611375565b82525050565b60006020820190506113a3600083018461137f565b92915050565b6000604051905090565b600080fd5b600080fd5b6113c681611375565b81146113d157600080fd5b50565b6000813590506113e3816113bd565b92915050565b6000602082840312156113ff576113fe6113b3565b5b600061140d848285016113d4565b91505092915050565b60008115159050919050565b61142b81611416565b82525050565b60006020820190506114466000830184611422565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61149f82611456565b810181811067ffffffffffffffff821117156114be576114bd611467565b5b80604052505050565b60006114d16113a9565b90506114dd8282611496565b919050565b600067ffffffffffffffff8211156114fd576114fc611467565b5b61150682611456565b9050602081019050919050565b82818337600083830152505050565b6000611535611530846114e2565b6114c7565b90508281526020810184848401111561155157611550611451565b5b61155c848285611513565b509392505050565b600082601f8301126115795761157861144c565b5b8135611589848260208601611522565b91505092915050565b6000602082840312156115a8576115a76113b3565b5b600082013567ffffffffffffffff8111156115c6576115c56113b8565b5b6115d284828501611564565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156116155780820151818401526020810190506115fa565b60008484015250505050565b600061162c826115db565b61163681856115e6565b93506116468185602086016115f7565b61164f81611456565b840191505092915050565b600060208201905081810360008301526116748184611621565b905092915050565b600081519050919050565b600082825260208201905092915050565b60006116a38261167c565b6116ad8185611687565b93506116bd8185602086016115f7565b6116c681611456565b840191505092915050565b600060208201905081810360008301526116eb8184611698565b905092915050565b600060ff82169050919050565b611709816116f3565b82525050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6117448161170f565b82525050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b61177f8161174a565b82525050565b600060a08201905061179a6000830188611700565b6117a76020830187611700565b6117b46040830186611700565b6117c1606083018561173b565b6117ce6080830184611776565b9695505050505050565b6117e1816116f3565b81146117ec57600080fd5b50565b6000813590506117fe816117d8565b92915050565b600067ffffffffffffffff82169050919050565b61182181611804565b811461182c57600080fd5b50565b60008135905061183e81611818565b92915050565b600067ffffffffffffffff82111561185f5761185e611467565b5b61186882611456565b9050602081019050919050565b600061188861188384611844565b6114c7565b9050828152602081018484840111156118a4576118a3611451565b5b6118af848285611513565b509392505050565b600082601f8301126118cc576118cb61144c565b5b81356118dc848260208601611875565b91505092915050565b6000806000606084860312156118fe576118fd6113b3565b5b600061190c868287016117ef565b935050602061191d8682870161182f565b925050604084013567ffffffffffffffff81111561193e5761193d6113b8565b5b61194a868287016118b7565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061199b57607f821691505b6020821081036119ae576119ad611954565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302611a197fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119d9565b611a2386836119d9565b95508019841693508086168417925050509392505050565b6000819050919050565b6000611a60611a5b611a5684611375565b611a3b565b611375565b9050919050565b6000819050919050565b611a7a83611a45565b611a8e611a8682611a67565b8484546119e9565b825550505050565b600090565b611aa3611a96565b611aae818484611a71565b505050565b5b81811015611ad257611ac7600082611a9b565b600181019050611ab4565b5050565b601f821115611b1757611ae8816119b4565b611af1846119c9565b81016020851015611b00578190505b611b14611b0c856119c9565b830182611ab3565b50505b505050565b60008160020a8304905092915050565b6000611b3d60001984600802611b1c565b1980831691505092915050565b6000611b568383611b2c565b9150826002028217905092915050565b611b6f8261167c565b67ffffffffffffffff811115611b8857611b87611467565b5b611b928254611983565b611b9d828285611ad6565b600060209050601f831160018114611bd05760008415611bbe578287015190505b611bc88582611b4a565b865550611c30565b601f198416611bde866119b4565b60005b82811015611c0657848901518255600182019150602085019450602081019050611be1565b86831015611c235784890151611c1f601f891682611b2c565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611c7282611375565b9150611c7d83611375565b9250828201905080821115611c9557611c94611c38565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611cd582611375565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d0757611d06611c38565b5b600182019050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b6000611d486011836115e6565b9150611d5382611d12565b602082019050919050565b60006020820190508181036000830152611d7781611d3b565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b6000611db46012836115e6565b9150611dbf82611d7e565b602082019050919050565b60006020820190508181036000830152611de381611da7565b9050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b6000611e20600e836115e6565b9150611e2b82611dea565b602082019050919050565b60006020820190508181036000830152611e4f81611e13565b9050919050565b6000611e6182611375565b9150611e6c83611375565b9250828202611e7a81611375565b91508282048414831517611e9157611e90611c38565b5b5092915050565b6000611ea3826116f3565b9150611eae836116f3565b9250828201905060ff811115611ec757611ec6611c38565b5b92915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b6000611f036012836115e6565b9150611f0e82611ecd565b602082019050919050565b60006020820190508181036000830152611f3281611ef6565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b6000611f6f6013836115e6565b9150611f7a82611f39565b602082019050919050565b60006020820190508181036000830152611f9e81611f62565b9050919050565b6000611fb0826116f3565b9150611fbb836116f3565b9250828202611fc9816116f3565b9150808214611fdb57611fda611c38565b5b5092915050565b6000611fed826116f3565b91506000820361200057611fff611c38565b5b600182039050919050565b6000612016826116f3565b9150612021836116f3565b9250828203905060ff81111561203a57612039611c38565b5b92915050565b6000819050602082019050919050565b600061205c825161170f565b80915050919050565b60006120708261167c565b8261207a84612040565b905061208581612050565b925060108210156120c5576120c07fffffffffffffffffffffffffffffffff00000000000000000000000000000000836010036008026119d9565b831692505b505091905056fea2646970667358221220906e4ff6a2af990af2e64f7b02bc54df4a073d9e2ad53885e1d78c0e72e6315d64736f6c63430008110033 -\ No newline at end of file +60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620000a5602060126040518060400160405280600681526020017f736861323536000000000000000000000000000000000000000000000000000081525062000170640100000000026401000000009004565b620000c0601262000495640100000000026401000000009004565b602067ffffffffffffffff811115620000de57620000dd62000a26565b5b6040519080825280601f01601f191660200182016040528015620001115781602001600182028036833780820191505090505b506003908162000122919062000ca6565b506040518060400160405280601181526020017f687474703a2f2f6c6f63616c686f73742f0000000000000000000000000000008152506004908162000169919062000d98565b506200133b565b6000600160ff166005541614620001be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001b59062000ee0565b60405180910390fd5b60608190506010815111156200020b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002029062000f52565b60405180910390fd5b62000215620009c0565b6000600790505b60008160ff16106200027957600060088262000239919062000fb0565b60ff1660ff9060020a029050600086821667ffffffffffffffff16111562000262575062000279565b81806200026f9062000ff6565b925050506200021c565b60018162000288919062001024565b826020019060ff16908160ff16815250506008816007620002aa919062001060565b620002b6919062000fb0565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff1681525050826200034490620010ef565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff168152505081600160008767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6000600160ff166005541614620004e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620004da90620011af565b60405180910390fd5b600060016000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff16116200051c57600080fd5b816002819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff81111562000554576200055362000a26565b5b6040519080825280601f01601f191660200182016040528015620005875781602001600182028036833780820191505090505b506003908162000598919062000ca6565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c620005d3620005ee640100000000026401000000009004565b604051620005e2919062001260565b60405180910390a15050565b60606200069c60038054620006039062000a8f565b80601f0160208091040260200160405190810160405280929190818152602001828054620006319062000a8f565b8015620006825780601f10620006565761010080835404028352916020019162000682565b820191906000526020600020905b8154815290600101906020018083116200066457829003601f168201915b5050505050620006a1640100000000026401000000009004565b905090565b6060620006c082600254620006c7640100000000026401000000009004565b9050919050565b6060600060606001600085815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff1686516200071a919062001284565b62000726919062001284565b67ffffffffffffffff81111562000742576200074162000a26565b5b6040519080825280601f01601f191660200182016040528015620007755781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff1681101562000855578260000160139054906101000a90047801000000000000000000000000000000000000000000000000028160088110620007d757620007d6620012bf565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811062000810576200080f620012bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200084c90620012ee565b9150506200077b565b8260000160009054906101000a900460ff167f0100000000000000000000000000000000000000000000000000000000000000028282815181106200089f576200089e620012bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620008db90620012ee565b91505060005b8651811015620009b357868181518110620009015762000900620012bf565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382846200095a919062001284565b815181106200096e576200096d620012bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620009aa90620012ee565b915050620008e1565b5081935050505092915050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168062000aa857607f821691505b60208210810362000abe5762000abd62000a60565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b60006008830262000b2b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000ae9565b62000b37868362000ae9565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000b8462000b7e62000b788462000b4f565b62000b59565b62000b4f565b9050919050565b6000819050919050565b62000ba08362000b63565b62000bb862000baf8262000b8b565b84845462000af9565b825550505050565b600090565b62000bcf62000bc0565b62000bdc81848462000b95565b505050565b5b8181101562000c045762000bf860008262000bc5565b60018101905062000be2565b5050565b601f82111562000c535762000c1d8162000ac4565b62000c288462000ad9565b8101602085101562000c38578190505b62000c5062000c478562000ad9565b83018262000be1565b50505b505050565b60008160020a8304905092915050565b600062000c7b6000198460080262000c58565b1980831691505092915050565b600062000c96838362000c68565b9150826002028217905092915050565b62000cb18262000a55565b67ffffffffffffffff81111562000ccd5762000ccc62000a26565b5b62000cd9825462000a8f565b62000ce682828562000c08565b600060209050601f83116001811462000d1e576000841562000d09578287015190505b62000d15858262000c88565b86555062000d85565b601f19841662000d2e8662000ac4565b60005b8281101562000d585784890151825560018201915060208501945060208101905062000d31565b8683101562000d78578489015162000d74601f89168262000c68565b8355505b6001600288020188555050505b505050505050565b600081519050919050565b62000da38262000d8d565b67ffffffffffffffff81111562000dbf5762000dbe62000a26565b5b62000dcb825462000a8f565b62000dd882828562000c08565b600060209050601f83116001811462000e10576000841562000dfb578287015190505b62000e07858262000c88565b86555062000e77565b601f19841662000e208662000ac4565b60005b8281101562000e4a5784890151825560018201915060208501945060208101905062000e23565b8683101562000e6a578489015162000e66601f89168262000c68565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b600062000ec860128362000e7f565b915062000ed58262000e90565b602082019050919050565b6000602082019050818103600083015262000efb8162000eb9565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b600062000f3a60138362000e7f565b915062000f478262000f02565b602082019050919050565b6000602082019050818103600083015262000f6d8162000f2b565b9050919050565b600060ff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000fbd8262000f74565b915062000fca8362000f74565b925082820262000fda8162000f74565b915080821462000fef5762000fee62000f81565b5b5092915050565b6000620010038262000f74565b91506000820362001019576200101862000f81565b5b600182039050919050565b6000620010318262000f74565b91506200103e8362000f74565b9250828201905060ff8111156200105a576200105962000f81565b5b92915050565b60006200106d8262000f74565b91506200107a8362000f74565b9250828203905060ff81111562001096576200109562000f81565b5b92915050565b6000819050602082019050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6000620010e68251620010ac565b80915050919050565b6000620010fc8262000a55565b8262001108846200109c565b90506200111581620010d8565b925060108210156200115857620011537fffffffffffffffffffffffffffffffff000000000000000000000000000000008360100360080262000ae9565b831692505b5050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b600062001197600e8362000e7f565b9150620011a4826200115f565b602082019050919050565b60006020820190508181036000830152620011ca8162001188565b9050919050565b600082825260208201905092915050565b60005b8381101562001202578082015181840152602081019050620011e5565b60008484015250505050565b6000601f19601f8301169050919050565b60006200122c8262000a55565b620012388185620011d1565b93506200124a818560208601620011e2565b62001255816200120e565b840191505092915050565b600060208201905081810360008301526200127c81846200121f565b905092915050565b6000620012918262000b4f565b91506200129e8362000b4f565b9250828201905080821115620012b957620012b862000f81565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000620012fb8262000b4f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362001330576200132f62000f81565b5b600182019050919050565b612d00806200134b6000396000f3fe608060405234801561001057600080fd5b506004361061013e576000357c01000000000000000000000000000000000000000000000000000000009004806386fe212d116100ca578063c43ead881161008e578063c43ead881461033b578063c5bec6fc1461036b578063c75ee4d21461039b578063ccc094c2146103cf578063cfc3b179146103eb5761013e565b806386fe212d146102955780638da5cb5b146102c55780639a7c5e9f146102e3578063a249e912146102ff578063b5fdeb231461031d5761013e565b806340c84b0e1161011157806340c84b0e146101df57806349f2553a146101fd5780635344299a146102195780636b9cb86a1461023557806386e90b59146102655761013e565b806301ffc9a71461014357806318cbbcfc146101735780631b2581991461019157806331a5995d146101c1575b600080fd5b61015d60048036038101906101589190611e25565b61041b565b60405161016a9190611e6d565b60405180910390f35b61017b6105c1565b6040516101889190611ea1565b60405180910390f35b6101ab60048036038101906101a69190611ee8565b6105c6565b6040516101b89190611e6d565b60405180910390f35b6101c961070c565b6040516101d69190611ea1565b60405180910390f35b6101e7610712565b6040516101f49190611fa5565b60405180910390f35b610217600480360381019061021291906120fc565b6107a0565b005b610233600480360381019061022e91906121e6565b610ab8565b005b61024f600480360381019061024a91906121e6565b610b44565b60405161025c9190612284565b60405180910390f35b61027f600480360381019061027a91906121e6565b610d5d565b60405161028c9190612284565b60405180910390f35b6102af60048036038101906102aa9190611ee8565b611008565b6040516102bc9190611ea1565b60405180910390f35b6102cd6110ef565b6040516102da91906122e7565b60405180910390f35b6102fd60048036038101906102f89190611ee8565b611113565b005b61030761124f565b6040516103149190611ea1565b60405180910390f35b610325611255565b6040516103329190611fa5565b60405180910390f35b610355600480360381019061035091906121e6565b6112ef565b6040516103629190611fa5565b60405180910390f35b610385600480360381019061038091906121e6565b611304565b6040516103929190611fa5565b60405180910390f35b6103b560048036038101906103b09190611ee8565b6116bd565b6040516103c6959493929190612394565b60405180910390f35b6103e960048036038101906103e49190612453565b61175c565b005b610405600480360381019061040091906124c2565b611a69565b6040516104129190611fa5565b60405180910390f35b600063982ab05d7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361046f57600190506105bc565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104c157600190506105bc565b63a30025957c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361051357600190506105bc565b63ed75b3337c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361056557600190506105bc565b630d7491f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105b757600190506105bc565b600090505b919050565b600381565b60006105d0611d53565b600160008481526020019081526020016000206040518060a00160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a9004700100000000000000000000000000000000026fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff191681526020016000820160139054906101000a900478010000000000000000000000000000000000000000000000000277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff19168152505090506000816000015160ff1611915050919050565b60055481565b6004805461071f9061254d565b80601f016020809104026020016040519081016040528092919081815260200182805461074b9061254d565b80156107985780601f1061076d57610100808354040283529160200191610798565b820191906000526020600020905b81548152906001019060200180831161077b57829003601f168201915b505050505081565b606060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107fd57600080fd5b82915081519050602f7f0100000000000000000000000000000000000000000000000000000000000000028260018361083691906125ad565b81518110610847576108466125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146108c75780806108c390612610565b9150505b8067ffffffffffffffff8111156108e1576108e0611fd1565b5b6040519080825280601f01601f1916602001820160405280156109135781602001600182028036833780820191505090505b5060049081610922919061280a565b5060005b8251811015610a1357828181518110610942576109416125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002600482815461099a9061254d565b81106109a9576109a86125e1565b5b8154600116156109c85790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f0100000000000000000000000000000000000000000000000000000000000000840402179055508080610a0b90612610565b915050610926565b5081518114610ab3577f2f00000000000000000000000000000000000000000000000000000000000000600483518154610a4c9061254d565b8110610a5b57610a5a6125e1565b5b815460011615610a7a5790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f0100000000000000000000000000000000000000000000000000000000000000840402179055505b505050565b600060016000600254815260200190815260200160002090508060000160009054906101000a900460ff1660ff16825114610af257600080fd5b8160039081610b01919061280a565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c610b2b611255565b604051610b389190611fa5565b60405180910390a15050565b60608060606000610b5485611304565b915060048054610b639061254d565b90509050808251610b7491906128dc565b67ffffffffffffffff811115610b8d57610b8c611fd1565b5b6040519080825280601f01601f191660200182016040528015610bbf5781602001600182028036833780820191505090505b50925060005b81811015610c84576004818154610bdb9061254d565b8110610bea57610be96125e1565b5b815460011615610c095790600052602060002090602091828204019190065b9054901a7f010000000000000000000000000000000000000000000000000000000000000002848281518110610c4257610c416125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610c7c90612610565b915050610bc5565b5060005b8251811015610d5157828181518110610ca457610ca36125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002848381518110610d0157610d006125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180610d3b90612610565b9250508080610d4990612610565b915050610c88565b50829350505050919050565b606060006060806000610d6f86611304565b915060016000600254815260200190815260200160002093508360000160029054906101000a900460ff1660ff1690506001825182610dae91906128dc565b610db891906128dc565b67ffffffffffffffff811115610dd157610dd0611fd1565b5b6040519080825280601f01601f191660200182016040528015610e035781602001600182028036833780820191505090505b50925060005b81811015610ebd578460000160039054906101000a9004700100000000000000000000000000000000028160108110610e4557610e446125e1565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002848281518110610e7b57610e7a6125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610eb590612610565b915050610e09565b50603a7f010000000000000000000000000000000000000000000000000000000000000002838281518110610ef557610ef46125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610f2f90612610565b91505060005b8251811015610ffb57828181518110610f5157610f506125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002848284610fa891906128dc565b81518110610fb957610fb86125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610ff390612610565b915050610f35565b5082945050505050919050565b60006010821061104d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110449061295c565b60405180910390fd5b6000600554831614611094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108b906129c8565b60405180910390fd5b8160056000828254179250508190555060036005541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e6005546040516110dd9190611ea1565b60405180910390a26005549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160ff16600554161461115e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115590612a34565b60405180910390fd5b600060016000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff161161119657600080fd5b816002819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff8111156111cb576111ca611fd1565b5b6040519080825280601f01601f1916602001820160405280156111fd5781602001600182028036833780820191505090505b506003908161120c919061280a565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c611236611255565b6040516112439190611fa5565b60405180910390a15050565b60025481565b60606112ea600380546112679061254d565b80601f01602080910402602001604051908101604052809291908181526020018280546112939061254d565b80156112e05780601f106112b5576101008083540402835291602001916112e0565b820191906000526020600020905b8154815290600101906020018083116112c357829003601f168201915b50505050506112ef565b905090565b60606112fd82600254611a7d565b9050919050565b606080600080600285516113189190612a54565b67ffffffffffffffff81111561133157611330611fd1565b5b6040519080825280601f01601f1916602001820160405280156113635781602001600182028036833780820191505090505b5092506000905060005b60208110156116b157600460f087838151811061138d5761138c6125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff16101561148c576030836114239190612a96565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611458576114576125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506114fe565b6057836114999190612a96565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106114ce576114cd6125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868281518110611513576115126125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff1610156116115760308361159c9190612a96565b7f010000000000000000000000000000000000000000000000000000000000000002846001846115cc91906128dc565b815181106115dd576115dc6125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061168f565b60578361161e9190612a96565b7f0100000000000000000000000000000000000000000000000000000000000000028460018461164e91906128dc565b8151811061165f5761165e6125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b60028261169c91906128dc565b915080806116a990612610565b91505061136d565b50829350505050919050565b60016020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900470010000000000000000000000000000000002908060000160139054906101000a9004780100000000000000000000000000000000000000000000000002905085565b6000600160ff1660055416146117a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179e90612b17565b60405180910390fd5b60608190506010815111156117f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e890612b83565b60405180910390fd5b6117f9611d53565b6000600790505b60008160ff161061185557600060088261181a9190612ba3565b60ff1660ff9060020a029050600086821667ffffffffffffffff1611156118415750611855565b818061184c90612be0565b92505050611800565b6001816118629190612a96565b826020019060ff16908160ff168152505060088160076118829190612c09565b61188c9190612ba3565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff16815250508261191890612c63565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff168152505081600160008767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6060611a758383611a7d565b905092915050565b6060600060606001600085815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff168651611ace91906128dc565b611ad891906128dc565b67ffffffffffffffff811115611af157611af0611fd1565b5b6040519080825280601f01601f191660200182016040528015611b235781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff16811015611bf9578260000160139054906101000a90047801000000000000000000000000000000000000000000000000028160088110611b8157611b806125e1565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110611bb757611bb66125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611bf190612610565b915050611b29565b8260000160009054906101000a900460ff167f010000000000000000000000000000000000000000000000000000000000000002828281518110611c4057611c3f6125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611c7a90612610565b91505060005b8651811015611d4657868181518110611c9c57611c9b6125e1565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838284611cf391906128dc565b81518110611d0457611d036125e1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611d3e90612610565b915050611c80565b5081935050505092915050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611e0281611dcd565b8114611e0d57600080fd5b50565b600081359050611e1f81611df9565b92915050565b600060208284031215611e3b57611e3a611dc3565b5b6000611e4984828501611e10565b91505092915050565b60008115159050919050565b611e6781611e52565b82525050565b6000602082019050611e826000830184611e5e565b92915050565b6000819050919050565b611e9b81611e88565b82525050565b6000602082019050611eb66000830184611e92565b92915050565b611ec581611e88565b8114611ed057600080fd5b50565b600081359050611ee281611ebc565b92915050565b600060208284031215611efe57611efd611dc3565b5b6000611f0c84828501611ed3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611f4f578082015181840152602081019050611f34565b60008484015250505050565b6000601f19601f8301169050919050565b6000611f7782611f15565b611f818185611f20565b9350611f91818560208601611f31565b611f9a81611f5b565b840191505092915050565b60006020820190508181036000830152611fbf8184611f6c565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61200982611f5b565b810181811067ffffffffffffffff8211171561202857612027611fd1565b5b80604052505050565b600061203b611db9565b90506120478282612000565b919050565b600067ffffffffffffffff82111561206757612066611fd1565b5b61207082611f5b565b9050602081019050919050565b82818337600083830152505050565b600061209f61209a8461204c565b612031565b9050828152602081018484840111156120bb576120ba611fcc565b5b6120c684828561207d565b509392505050565b600082601f8301126120e3576120e2611fc7565b5b81356120f384826020860161208c565b91505092915050565b60006020828403121561211257612111611dc3565b5b600082013567ffffffffffffffff8111156121305761212f611dc8565b5b61213c848285016120ce565b91505092915050565b600067ffffffffffffffff8211156121605761215f611fd1565b5b61216982611f5b565b9050602081019050919050565b600061218961218484612145565b612031565b9050828152602081018484840111156121a5576121a4611fcc565b5b6121b084828561207d565b509392505050565b600082601f8301126121cd576121cc611fc7565b5b81356121dd848260208601612176565b91505092915050565b6000602082840312156121fc576121fb611dc3565b5b600082013567ffffffffffffffff81111561221a57612219611dc8565b5b612226848285016121b8565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006122568261222f565b612260818561223a565b9350612270818560208601611f31565b61227981611f5b565b840191505092915050565b6000602082019050818103600083015261229e818461224b565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006122d1826122a6565b9050919050565b6122e1816122c6565b82525050565b60006020820190506122fc60008301846122d8565b92915050565b600060ff82169050919050565b61231881612302565b82525050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6123538161231e565b82525050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b61238e81612359565b82525050565b600060a0820190506123a9600083018861230f565b6123b6602083018761230f565b6123c3604083018661230f565b6123d0606083018561234a565b6123dd6080830184612385565b9695505050505050565b6123f081612302565b81146123fb57600080fd5b50565b60008135905061240d816123e7565b92915050565b600067ffffffffffffffff82169050919050565b61243081612413565b811461243b57600080fd5b50565b60008135905061244d81612427565b92915050565b60008060006060848603121561246c5761246b611dc3565b5b600061247a868287016123fe565b935050602061248b8682870161243e565b925050604084013567ffffffffffffffff8111156124ac576124ab611dc8565b5b6124b8868287016120ce565b9150509250925092565b600080604083850312156124d9576124d8611dc3565b5b600083013567ffffffffffffffff8111156124f7576124f6611dc8565b5b612503858286016121b8565b925050602061251485828601611ed3565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061256557607f821691505b6020821081036125785761257761251e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006125b882611e88565b91506125c383611e88565b92508282039050818111156125db576125da61257e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061261b82611e88565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361264d5761264c61257e565b5b600182019050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b6000600883026126bd7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261267d565b6126c7868361267d565b95508019841693508086168417925050509392505050565b6000819050919050565b60006127046126ff6126fa84611e88565b6126df565b611e88565b9050919050565b6000819050919050565b61271e836126e9565b61273261272a8261270b565b84845461268d565b825550505050565b600090565b61274761273a565b612752818484612715565b505050565b5b818110156127765761276b60008261273f565b600181019050612758565b5050565b601f8211156127bb5761278c81612658565b6127958461266d565b810160208510156127a4578190505b6127b86127b08561266d565b830182612757565b50505b505050565b60008160020a8304905092915050565b60006127e1600019846008026127c0565b1980831691505092915050565b60006127fa83836127d0565b9150826002028217905092915050565b61281382611f15565b67ffffffffffffffff81111561282c5761282b611fd1565b5b612836825461254d565b61284182828561277a565b600060209050601f8311600181146128745760008415612862578287015190505b61286c85826127ee565b8655506128d4565b601f19841661288286612658565b60005b828110156128aa57848901518255600182019150602085019450602081019050612885565b868310156128c757848901516128c3601f8916826127d0565b8355505b6001600288020188555050505b505050505050565b60006128e782611e88565b91506128f283611e88565b925082820190508082111561290a5761290961257e565b5b92915050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b600061294660118361223a565b915061295182612910565b602082019050919050565b6000602082019050818103600083015261297581612939565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b60006129b260128361223a565b91506129bd8261297c565b602082019050919050565b600060208201905081810360008301526129e1816129a5565b9050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b6000612a1e600e8361223a565b9150612a29826129e8565b602082019050919050565b60006020820190508181036000830152612a4d81612a11565b9050919050565b6000612a5f82611e88565b9150612a6a83611e88565b9250828202612a7881611e88565b91508282048414831517612a8f57612a8e61257e565b5b5092915050565b6000612aa182612302565b9150612aac83612302565b9250828201905060ff811115612ac557612ac461257e565b5b92915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b6000612b0160128361223a565b9150612b0c82612acb565b602082019050919050565b60006020820190508181036000830152612b3081612af4565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b6000612b6d60138361223a565b9150612b7882612b37565b602082019050919050565b60006020820190508181036000830152612b9c81612b60565b9050919050565b6000612bae82612302565b9150612bb983612302565b9250828202612bc781612302565b9150808214612bd957612bd861257e565b5b5092915050565b6000612beb82612302565b915060008203612bfe57612bfd61257e565b5b600182039050919050565b6000612c1482612302565b9150612c1f83612302565b9250828203905060ff811115612c3857612c3761257e565b5b92915050565b6000819050602082019050919050565b6000612c5a825161231e565b80915050919050565b6000612c6e82611f15565b82612c7884612c3e565b9050612c8381612c4e565b92506010821015612cc357612cbe7fffffffffffffffffffffffffffffffff000000000000000000000000000000008360100360080261267d565b831692505b505091905056fea26469706673582212206dff656bd8e0ad81763baabea52840f9ca18608f6d2cec60582d4031bfb698d164736f6c63430008120033 +\ No newline at end of file diff --git a/python/eth_event_msg/data/Msg.json b/python/eth_event_msg/data/Msg.json @@ -1 +1 @@ -[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"_multiHash","type":"bytes"}],"name":"Msg","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"_final","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_sealState","type":"uint256"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"uint8","name":"_length","type":"uint8"},{"internalType":"uint64","name":"_codecId","type":"uint64"},{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"addCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getMsg","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"isSealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"multiCodecs","outputs":[{"internalType":"uint8","name":"l","type":"uint8"},{"internalType":"uint8","name":"codecRLength","type":"uint8"},{"internalType":"uint8","name":"prefixRLength","type":"uint8"},{"internalType":"bytes16","name":"prefix","type":"bytes16"},{"internalType":"bytes8","name":"codec","type":"bytes8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"setMsg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"setMsgCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toHash","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"toHex","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}] +[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"_multiHash","type":"bytes"}],"name":"Msg","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"_final","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_sealState","type":"uint256"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"uint8","name":"_length","type":"uint8"},{"internalType":"uint64","name":"_codecId","type":"uint64"},{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"addCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"baseURL","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultDigestEncoding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"},{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMsg","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"haveDigestEncoding","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"multiCodec","outputs":[{"internalType":"uint8","name":"l","type":"uint8"},{"internalType":"uint8","name":"codecRLength","type":"uint8"},{"internalType":"uint8","name":"prefixRLength","type":"uint8"},{"internalType":"bytes16","name":"prefix","type":"bytes16"},{"internalType":"bytes8","name":"codec","type":"bytes8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_baseString","type":"string"}],"name":"setBaseURL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"setMsg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"setMsgCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"toHex","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}] diff --git a/python/eth_event_msg/data/Msg.metadata.json b/python/eth_event_msg/data/Msg.metadata.json @@ -0,0 +1 @@ +{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"_multiHash","type":"bytes"}],"name":"Msg","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"_final","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_sealState","type":"uint256"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"uint8","name":"_length","type":"uint8"},{"internalType":"uint64","name":"_codecId","type":"uint64"},{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"addCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"baseURL","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultDigestEncoding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"},{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMsg","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"haveDigestEncoding","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"multiCodec","outputs":[{"internalType":"uint8","name":"l","type":"uint8"},{"internalType":"uint8","name":"codecRLength","type":"uint8"},{"internalType":"uint8","name":"prefixRLength","type":"uint8"},{"internalType":"bytes16","name":"prefix","type":"bytes16"},{"internalType":"bytes8","name":"codec","type":"bytes8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_baseString","type":"string"}],"name":"setBaseURL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"setMsg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"setMsgCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"toHex","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"toURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"Msg.sol":"EventMsg"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Msg.sol":{"keccak256":"0x1e8dbea6a1a573176fb4419631fb56e37b53dca2c4de2eb97b527d65c408a601","license":"AGPL-3.0-or-later","urls":["bzz-raw://87e9c4af8b9cdd7fbd04b97f992b976ac31305ddffce23ead1a0826d60b12b1b","dweb:/ipfs/QmPTeNwUqLcEAW8v52LcsfByzcarkb21Z1tGhCv3p9ovAa"]}},"version":1} diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py @@ -43,7 +43,7 @@ class Test(EthTesterCase): def test_hash(self): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = EventMsg(self.chain_spec) - o = c.to_hash(self.address, hash_of_foo, sender_address=self.accounts[0]) + o = c.encode_digest(self.address, hash_of_foo, sender_address=self.accounts[0]) r = self.conn.do(o) mh = c.parse_to_hash(r) self.assertEqual(mh[:4], '1220') diff --git a/solidity/Makefile b/solidity/Makefile @@ -2,10 +2,12 @@ SOLC = /usr/bin/solc all: $(SOLC) --bin Msg.sol --evm-version byzantium | awk 'NR>3' > Msg.bin - truncate -s -1 Msg.bin $(SOLC) --abi Msg.sol --evm-version byzantium | awk 'NR>3' > Msg.json + $(SOLC) --metadata Msg.sol --evm-version byzantium | awk 'NR>3' > Msg.metadata.json + truncate -s -1 Msg.bin install-py: all - cp -v Msg*{json,bin} ../python/eth_event_msg/data/ + cp -v *.json ../python/eth_event_msg/data/ + cp -v *.bin ../python/eth_event_msg/data/ install: install-py diff --git a/solidity/Msg.sol b/solidity/Msg.sol @@ -1,10 +1,8 @@ -pragma solidity >=0.6.0; +pragma solidity >=0.8.0; -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: AGPL-3.0-or-later contract EventMsg { - - // Represents a multicodec item struct MultiHash { uint8 l; uint8 codecRLength; @@ -13,43 +11,54 @@ contract EventMsg { bytes8 codec; } + // Owner of contract + address public owner; + // All registered multicodecs - mapping (uint256 => MultiHash) public multiCodecs; + mapping (uint256 => MultiHash) public multiCodec; - // Currently used multicodec - uint256 msgCodec; + // Implements Digest + uint256 public defaultDigestEncoding; // Latest persisted message bytes currentMsg; - // Implements Sealer + // Editable base URI against which to look up token data by token id + bytes public baseURL; + + // Implements Seal uint256 public sealState; uint8 constant CODECLIST_STATE = 1; uint8 constant CODEC_STATE = 2; uint256 constant public maxSealState = 3; + // Implements Seal event SealStateChange(bool indexed _final, uint256 _sealState); + + // Implements Msg event Msg(bytes _multiHash); constructor() { + owner = msg.sender; addCodec(32, 0x12, "sha256"); setMsgCodec(0x12); currentMsg = new bytes(32); + baseURL = "http://localhost/"; } // Set the latest pesistent message on contract function setMsg(bytes memory _digest) public { MultiHash storage _hsh; - _hsh = multiCodecs[msgCodec]; + _hsh = multiCodec[defaultDigestEncoding]; require(_digest.length == _hsh.l); currentMsg = _digest; emit Msg(getMsg()); } - // Return a multihash of the latest persistent message + // Implements Msg function getMsg() public view returns(bytes memory) { - return toHash(currentMsg); + return encodeDigest(currentMsg); } // Add a multicodec that can later be set as current codec @@ -76,7 +85,7 @@ contract EventMsg { _hsh.prefix = bytes16(prefixBytes); _hsh.l = _length; - multiCodecs[uint256(_codecId)] = _hsh; + multiCodec[uint256(_codecId)] = _hsh; } // Set the current multicodec to use for multihash generation @@ -84,16 +93,16 @@ contract EventMsg { require(sealState & CODECLIST_STATE == 0, 'ERR_SEAL_CODEC'); MultiHash storage _hsh; - _hsh = multiCodecs[_codec]; + _hsh = multiCodec[_codec]; require(_hsh.l > 0); - msgCodec = _codec; + defaultDigestEncoding = _codec; currentMsg = new bytes(_hsh.l); emit Msg(getMsg()); } - // Implements Sealer + // Seal the given state function seal(uint256 _state) public returns(uint256) { require(_state < 16, 'ERR_INVALID_STATE'); require(_state & sealState == 0, 'ERR_ALREADY_LOCKED'); @@ -102,21 +111,12 @@ contract EventMsg { return uint256(sealState); } - // Implements Sealer - function isSealed(uint256 _state) public view returns(bool) { - require(_state < maxSealState); - if (_state == 0) { - return sealState == maxSealState; - } - return _state & sealState == _state; - } - // Generate a multihash from the given digest and current selected multicodec - function toHash(bytes memory _digest) public view returns(bytes memory) { + function toMultiHash(bytes memory _digest, uint256 _codec) private view returns(bytes memory) { MultiHash storage m; bytes memory r; - m = multiCodecs[msgCodec]; + m = multiCodec[_codec]; r = new bytes(_digest.length + m.l + m.codecRLength); uint256 i = 0; @@ -132,9 +132,26 @@ contract EventMsg { return r; } - // Generate a URI representing the digest and the string prefix representation - // of the currently selected multicodec - function toUri(bytes memory _digest) public view returns(string memory) { + // Implements Digest + function encodeDigest(bytes memory _digest) public view returns(bytes memory) { + return toMultiHash(_digest, defaultDigestEncoding); + } + + // Implements Digest + function encodeDigest(bytes memory _digest, uint256 _codec) public view returns(bytes memory) { + return toMultiHash(_digest, _codec); + } + + // Implements Digest + function haveDigestEncoding(uint256 _codec) public view returns(bool) { + MultiHash memory m; + + m = multiCodec[_codec]; + return m.l > 0; + } + + // Generate a URI representing the digest and the string prefix representation // of the currently selected multicodec + function toURI(bytes memory _digest) public view returns(string memory) { MultiHash storage m; bytes memory codecString; @@ -142,7 +159,7 @@ contract EventMsg { uint256 l; digestHex = toHex(_digest); - m = multiCodecs[msgCodec]; + m = multiCodec[defaultDigestEncoding]; l = m.prefixRLength; codecString = new bytes(l + digestHex.length + 1); for (uint256 i = 0; i < l; i++) { @@ -158,6 +175,46 @@ contract EventMsg { } + // Allow mutable explicit url base + function setBaseURL(string memory _baseString) public { + bytes memory _base; + uint256 l; + require(msg.sender == owner); + + _base = bytes(_baseString); + l = _base.length; + if (_base[l-1] != 0x2f) { + l++; + } + baseURL = new bytes(l); + for (uint256 i = 0; i < _base.length; i++) { + baseURL[i] = _base[i]; + } + if (l != _base.length) { + baseURL[_base.length] = "/"; + } + } + + function toURL(bytes memory _digest) public view returns(string memory) { + bytes memory out; + bytes memory _hexDigest; + uint256 c; + + _hexDigest = toHex(_digest); + + c = baseURL.length; + out = new bytes(_hexDigest.length + c); + + for (uint256 i = 0; i < c; i++) { + out[i] = baseURL[i]; + } + for (uint256 i = 0; i < _hexDigest.length; i++) { + out[c] = _hexDigest[i]; + c++; + } + return string(out); + } + // TODO: move to internal library method // bytes to hex conversion function toHex(bytes memory _data) public pure returns(bytes memory) { @@ -184,4 +241,24 @@ contract EventMsg { } return out; } + + // Implements ERC165 + function supportsInterface(bytes4 _interfaceID) public pure returns(bool) { + if (_interfaceID == 0x982ab05d) { // Digest + return true; + } + if (_interfaceID == 0x01ffc9a7) { // ERC165 + return true; + } + if (_interfaceID == 0xa3002595) { // Msg + return true; + } + if (_interfaceID == 0xed75b333) { // Locator + return true; + } + if (_interfaceID == 0x0d7491f8) { // Seal + return true; + } + return false; + } }