evm-booking

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit fcd4b2fc2dda891045bad607a2a9e0aa55071260
parent f9274f9e90b0f4d9f1dc236b88667751debbea34
Author: lash <dev@holbrook.no>
Date:   Fri,  9 Jun 2023 14:30:21 +0100

Add documentation

Diffstat:
M.gitignore | 1+
AMakefile | 14++++++++++++++
AREADME.md | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/texinfo/Makefile | 5+++++
Adoc/texinfo/contract.texi | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/texinfo/index.texi | 4++++
Adoc/texinfo/intro.texi | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Apython/Makefile | 2++
Mpython/evm_booking/booking.py | 20+++-----------------
Mpython/evm_booking/data/Booking.bin | 4++--
Mpython/evm_booking/data/Booking.metadata.json | 2+-
Mpython/setup.cfg | 7++++---
Mpython/tests/test_base.py | 19+++++++++++++++++++
13 files changed, 306 insertions(+), 23 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -4,3 +4,4 @@ build/ *.egg-info solidity/*.json solidity/*.bin +python/dist/ diff --git a/Makefile b/Makefile @@ -0,0 +1,14 @@ +all: solidity python + +solidity: + make -C solidity install + +doc: + make -C doc/texinfo + +readme: + make -C doc/texinfo readme + pandoc -f docbook -t gfm doc/texinfo/build/docbook.xml > README.md + +python: + make -C python diff --git a/README.md b/README.md @@ -0,0 +1,136 @@ +# evm-booking + +# Overview + +This EVM smart contract allows exchanging ERC20 tokens for generic +serial units. + +The primary use-case is time-slot booking. + +Unit ranges may also be reserved for collective use. In this case, token +holders must pledge a proportional amount of their holdings towards the +shared units. + +## Example + +Alice and Bob hold ‘`TIME`’ vouchers. + +Each ‘`TIME`’ voucher unit represents one hour of time with a really +comfortable hammock on the beach. + +Unfortunately, the beach is not accessible all the time, because local +technocrat authorities have decided to close the beach for the public +every day from 6pm to 6am on every weekday. + +Their trusted friend Trent publishes the ‘`evm-booking`’ contract, to +manage hammock time for the coming month. + +The month has 30 days. The period starts on a wednesday (6am) and ends +on a friday (6am). + +The period has 22 weekdays and 8 weekend days. This translates to +$22 * 12) + (8 * 24) = 264 + 192 = 456$ hours of available hammock time. + +456.00 ‘`TIME`’ vouchers are minted (two decimal places). + +Since Alice paid more for the hammock, she gets 60% of the time. Thus +Alice has 273.6 and Bob has 182.4. + +### Collective use + +Alice and Bob decide that they will rent the hammock out on weekends +through Trent, and share in the proceeds. The rest of the time, they can +reserve hammock time for themselves, or sell hammock time on to others. + +Trent reserves 192 hours in the contract for collective use, and Alice +and Bob has to pledge $192 * 60% = 115.2$ and $192 * 0.4 = 76.8$ +vouchers respectively to cover that use. + +Trent will be selling hammock time for Generic Fiat Currency (GFC), and +will get 30% off the top for the bother. + +### Individual use + +Alice spends a total of 100 hours on the hammock. Her remaining 15.2 +hours are unused, during which time the hammock is very lonely. + +Bob sells 10 hours of hammock use to each Carol and Dave, and uses every +bit of remaining time himself. + +Dave is too busy for hammocking. He spends 2 hours and sells 8 remaining +hours to Frank. + +### Fruits of use + +Trent was able to cash in a tidy 200 GFC for the time. He takes 60 GFC +for himself. According to their shares, Alice gets 84 GFC and Bob gets +56 GFC. + +# Smart contract + +When the smart contract is published, it is bound to: + +- The ERC20 token that will be used to spend serial units. + +- The amount of serial units. + +- Timestamp until when serial units can be reserved and spent. + +The supply of the ERC20 token will be read and stored, and used to +calculate shares for collective use. + +**The supply of the ERC20 token must not change after binding it to the +contract**. + +## Interface + +The contract interface consists of three main methods. + +`consume` +Will spend serial units in the contract, and invoke `ERC20.transferFrom` +to cover those units. + +`share` +Reserve serial units for collective use. Requires all token holders to +collectively deposit a corresponding share of the total supply. + +`deposit(For)` +Manually synchronise deposits to cover the time currently reserved for +collective use. + +## Expiration + +After expiration, the shares of the collective use are considered +finalized, and can be read out from the contract. + +## Raw output + +The `raw` method returns the bit field representing the state of +individual serial slots. + +### Example + +Let the total of time slots be 50. + +Slots (inclusive, zero-indexed) 13-30 have been *spent* (`consume`) and +249-255 have been *reserved* (`share`). + +Calling `raw(11, 257)` will yield a virtual bit field (lowest index +left) as follows: + + 00111111 11111111 11110000 00000000 (bytes 0-4) + [...] + 00000000 00000011 11111000 00000000 (bytes 28-31) + 0 (bit 257) + +The ABI encoded return value will be, grouped by word: + + 0000000000000000000000000000000000000000000000000000000000000020 + 0000000000000000000000000000000000000000000000000000000000000021 + 008f300000000000000000000000000000000000000000ffffffffffffffff3f + 0000000000000000000000000000000000000000000000000000000000000000 + +The bit field is read word for word, then byte-for-byte from right to +left. + +Note how it merges both the *spent* and *reserved* slots. diff --git a/doc/texinfo/Makefile b/doc/texinfo/Makefile @@ -0,0 +1,5 @@ +all: + makeinfo --html -o build index.texi + +readme: + makeinfo --docbook --no-split -o build/docbook.xml index.texi diff --git a/doc/texinfo/contract.texi b/doc/texinfo/contract.texi @@ -0,0 +1,66 @@ +@chapter Smart contract + +When the smart contract is published, it is bound to: + +@itemize +@item The ERC20 token that will be used to spend serial units. +@item The amount of serial units. +@item Timestamp until when serial units can be reserved and spent. +@end itemize + +The supply of the ERC20 token will be read and stored, and used to calculate shares for collective use. + +@strong{The supply of the ERC20 token must not change after binding it to the contract}. + + +@section Interface + +The contract interface consists of three main methods. + +@table @code +@item consume +Will spend serial units in the contract, and invoke @code{ERC20.transferFrom} to cover those units. +@item share +Reserve serial units for collective use. Requires all token holders to collectively deposit a corresponding share of the total supply. +@item deposit(For) +Manually synchronise deposits to cover the time currently reserved for collective use. +@end table + + +@section Expiration + +After expiration, the shares of the collective use are considered finalized, and can be read out from the contract. + + +@section Raw output + +The @code{raw} method returns the bit field representing the state of individual serial slots. + + +@subsection Example + +Let the total of time slots be 50. + +Slots (inclusive, zero-indexed) 13-30 have been @emph{spent} (@code{consume}) and 249-255 have been @emph{reserved} (@code{share}). + +Calling @code{raw(11, 257)} will yield a virtual bit field (lowest index left) as follows: + +@verbatim +00111111 11111111 11110000 00000000 (bytes 0-4) +[...] +00000000 00000011 11111000 00000000 (bytes 28-31) +0 (bit 257) +@end verbatim + +The ABI encoded return value will be, grouped by word: + +@verbatim +0000000000000000000000000000000000000000000000000000000000000020 +0000000000000000000000000000000000000000000000000000000000000021 +008f300000000000000000000000000000000000000000ffffffffffffffff3f +0000000000000000000000000000000000000000000000000000000000000000 +@end verbatim + +The bit field is read word for word, then byte-for-byte from right to left. + +Note how it merges both the @emph{spent} and @emph{reserved} slots. diff --git a/doc/texinfo/index.texi b/doc/texinfo/index.texi @@ -0,0 +1,4 @@ +@top evm-booking + +@include intro.texi +@include contract.texi diff --git a/doc/texinfo/intro.texi b/doc/texinfo/intro.texi @@ -0,0 +1,49 @@ +@chapter Overview + +This EVM smart contract allows exchanging ERC20 tokens for generic serial units. + +The primary use-case is time-slot booking. + +Unit ranges may also be reserved for collective use. In this case, token holders must pledge a proportional amount of their holdings towards the shared units. + + +@section Example + +Alice and Bob hold @samp{TIME} vouchers. + +Each @samp{TIME} voucher unit represents one hour of time with a really comfortable hammock on the beach. + +Unfortunately, the beach is not accessible all the time, because local technocrat authorities have decided to close the beach for the public every day from 6pm to 6am on every weekday. + +Their trusted friend Trent publishes the @samp{evm-booking} contract, to manage hammock time for the coming month. + +The month has 30 days. The period starts on a wednesday (6am) and ends on a friday (6am). + +The period has 22 weekdays and 8 weekend days. This translates to @math{22 * 12) + (8 * 24) = 264 + 192 = 456} hours of available hammock time. + +456.00 @samp{TIME} vouchers are minted (two decimal places). + +Since Alice paid more for the hammock, she gets 60% of the time. Thus Alice has 273.6 and Bob has 182.4. + + +@subsection Collective use + +Alice and Bob decide that they will rent the hammock out on weekends through Trent, and share in the proceeds. The rest of the time, they can reserve hammock time for themselves, or sell hammock time on to others. + +Trent reserves 192 hours in the contract for collective use, and Alice and Bob has to pledge @math{192 * 60% = 115.2} and @math{192 * 0.4 = 76.8} vouchers respectively to cover that use. + +Trent will be selling hammock time for @dfn{Generic Fiat Currency (GFC)}, and will get 30% off the top for the bother. + + +@subsection Individual use + +Alice spends a total of 100 hours on the hammock. Her remaining 15.2 hours are unused, during which time the hammock is very lonely. + +Bob sells 10 hours of hammock use to each Carol and Dave, and uses every bit of remaining time himself. + +Dave is too busy for hammocking. He spends 2 hours and sells 8 remaining hours to Frank. + + +@subsection Fruits of use + +Trent was able to cash in a tidy 200 GFC for the time. He takes 60 GFC for himself. According to their shares, Alice gets 84 GFC and Bob gets 56 GFC. diff --git a/python/Makefile b/python/Makefile @@ -0,0 +1,2 @@ +all: + python setup.py sdist diff --git a/python/evm_booking/booking.py b/python/evm_booking/booking.py @@ -24,6 +24,8 @@ from hexathon import ( strip_0x, ) from chainlib.eth.cli.encode import CLIEncoder +from eth_writer import EthWriter +from eth_expire import EthExpire # local imports from evm_booking.data import data_dir @@ -32,7 +34,7 @@ logg = logging.getLogger() -class Booking(TxFactory): +class Booking(EthWriter, EthExpire): __abi = None __bytecode = None @@ -155,22 +157,6 @@ class Booking(TxFactory): return o - def expires(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None, height=BlockSpec.LATEST): - j = JSONRPCRequest(id_generator) - o = j.template() - o['method'] = 'eth_call' - enc = ABIContractEncoder() - enc.method('expires') - data = add_0x(enc.get()) - tx = self.template(sender_address, contract_address) - tx = self.set_code(tx, data) - o['params'].append(self.normalize(tx)) - height = to_blockheight_param(height) - o['params'].append(height) - o = j.finalize(o) - return o - - @classmethod def parse_raw(self, v): v = strip_0x(v) diff --git a/python/evm_booking/data/Booking.bin b/python/evm_booking/data/Booking.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5060405162003746380380620037468339818101604052810190620000379190620005a7565b60008211801562000058575070010000000000000000000000000000000082105b6200009a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000919062000664565b60405180910390fd5b428111620000df576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000d690620006d6565b60405180910390fd5b620000e9620004e0565b6200010383620002dc640100000000026401000000009004565b90506001816000600281106200011e576200011d620006f8565b5b60200201516200012f919062000756565b67ffffffffffffffff8111156200014b576200014a62000791565b5b6040519080825280601f01601f1916602001820160405280156200017e5781602001600182028036833780820191505090505b50600290816200018f919062000a07565b50600181600060028110620001a957620001a8620006f8565b5b6020020151620001ba919062000756565b67ffffffffffffffff811115620001d657620001d562000791565b5b6040519080825280601f01601f191660200182016040528015620002095781602001600182028036833780820191505090505b50600390816200021a919062000a07565b508260048190555060045460058190555083600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620002856200035d640100000000026401000000009004565b600681905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a819055505050505062000cfe565b620002e6620004e0565b6000620002f2620004e0565b60088462000301919062000b27565b915081816000600281106200031b576200031a620006f8565b5b60200201818152505060088462000333919062000b9b565b816001600281106200034a5762000349620006f8565b5b6020020181815250508092505050919050565b60008060606000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f18160ddd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516200042f919062000c41565b6000604051808303816000865af19150503d80600081146200046e576040519150601f19603f3d011682016040523d82523d6000602084013e62000473565b606091505b50809350819450505082620004bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620004b69062000caa565b60405180910390fd5b81806020019051810190620004d5919062000ccc565b905080935050505090565b6040518060400160405280600290602082028036833780820191505090505090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005348262000507565b9050919050565b620005468162000527565b81146200055257600080fd5b50565b60008151905062000566816200053b565b92915050565b6000819050919050565b62000581816200056c565b81146200058d57600080fd5b50565b600081519050620005a18162000576565b92915050565b600080600060608486031215620005c357620005c262000502565b5b6000620005d38682870162000555565b9350506020620005e68682870162000590565b9250506040620005f98682870162000590565b9150509250925092565b600082825260208201905092915050565b7f4552525f4e4f4e53454e53450000000000000000000000000000000000000000600082015250565b60006200064c600c8362000603565b9150620006598262000614565b602082019050919050565b600060208201905081810360008301526200067f816200063d565b9050919050565b7f4552525f50415354000000000000000000000000000000000000000000000000600082015250565b6000620006be60088362000603565b9150620006cb8262000686565b602082019050919050565b60006020820190508181036000830152620006f181620006af565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000763826200056c565b915062000770836200056c565b92508282019050808211156200078b576200078a62000727565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200081357607f821691505b602082108103620008295762000828620007cb565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620008967fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000854565b620008a2868362000854565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620008e5620008df620008d9846200056c565b620008ba565b6200056c565b9050919050565b6000819050919050565b6200090183620008c4565b620009196200091082620008ec565b84845462000864565b825550505050565b600090565b6200093062000921565b6200093d818484620008f6565b505050565b5b8181101562000965576200095960008262000926565b60018101905062000943565b5050565b601f821115620009b4576200097e816200082f565b620009898462000844565b8101602085101562000999578190505b620009b1620009a88562000844565b83018262000942565b50505b505050565b60008160020a8304905092915050565b6000620009dc60001984600802620009b9565b1980831691505092915050565b6000620009f78383620009c9565b9150826002028217905092915050565b62000a1282620007c0565b67ffffffffffffffff81111562000a2e5762000a2d62000791565b5b62000a3a8254620007fa565b62000a4782828562000969565b600060209050601f83116001811462000a7f576000841562000a6a578287015190505b62000a768582620009e9565b86555062000ae6565b601f19841662000a8f866200082f565b60005b8281101562000ab95784890151825560018201915060208501945060208101905062000a92565b8683101562000ad9578489015162000ad5601f891682620009c9565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600062000b348262000aee565b915062000b418362000aee565b92508262000b545762000b5362000af8565b5b600160000383147f80000000000000000000000000000000000000000000000000000000000000008314161562000b905762000b8f62000727565b5b828205905092915050565b600062000ba8826200056c565b915062000bb5836200056c565b92508262000bc85762000bc762000af8565b5b828206905092915050565b600081905092915050565b60005b8381101562000bfe57808201518184015260208101905062000be1565b60008484015250505050565b600062000c1782620007c0565b62000c23818562000bd3565b935062000c3581856020860162000bde565b80840191505092915050565b600062000c4f828462000c0a565b915081905092915050565b7f4552525f544f4b454e0000000000000000000000000000000000000000000000600082015250565b600062000c9260098362000603565b915062000c9f8262000c5a565b602082019050919050565b6000602082019050818103600083015262000cc58162000c83565b9050919050565b60006020828403121562000ce55762000ce462000502565b5b600062000cf58482850162000590565b91505092915050565b612a388062000d0e6000396000f3fe608060405234801561001057600080fd5b5060043610610154576000357c0100000000000000000000000000000000000000000000000000000000900480635cfc1a51116100d5578063aa67c91911610099578063aa67c91914610399578063b1cb0db3146103c9578063d0e30db0146103e7578063da2824a814610405578063de34d54414610435578063fc0c546a1461046557610154565b80635cfc1a51146102f15780635f408c041461030f5780637f03864b1461032d57806386fe212d1461034b5780638da5cb5b1461037b57610154565b80632c1758c11161011c5780632c1758c1146102255780632d1a72671461025557806331a5995d146102735780634eeea7ad146102915780635356dddc146102c157610154565b806301ffc9a71461015957806304bc34e21461018957806318160ddd146101b957806318cbbcfc146101d75780632b29ba23146101f5575b600080fd5b610173600480360381019061016e9190611c9a565b610483565b6040516101809190611ce2565b60405180910390f35b6101a3600480360381019061019e9190611d33565b6105d7565b6040516101b09190611e03565b60405180910390f35b6101c161084f565b6040516101ce9190611e34565b60405180910390f35b6101df610855565b6040516101ec9190611e34565b60405180910390f35b61020f600480360381019061020a9190611ead565b61085a565b60405161021c9190611ce2565b60405180910390f35b61023f600480360381019061023a9190611eda565b610906565b60405161024c9190611ce2565b60405180910390f35b61025d610939565b60405161026a9190611e34565b60405180910390f35b61027b61093f565b6040516102889190611e34565b60405180910390f35b6102ab60048036038101906102a69190611d33565b610945565b6040516102b89190611ce2565b60405180910390f35b6102db60048036038101906102d69190611ead565b610b5e565b6040516102e89190611ce2565b60405180910390f35b6102f9610cd2565b6040516103069190611e34565b60405180910390f35b610317610cd8565b6040516103249190611f23565b60405180910390f35b610335610d76565b6040516103429190611e34565b60405180910390f35b61036560048036038101906103609190611eda565b610d7c565b6040516103729190611e34565b60405180910390f35b610383610e6f565b6040516103909190611f4d565b60405180910390f35b6103b360048036038101906103ae9190611ead565b610e93565b6040516103c09190611f81565b60405180910390f35b6103d161121f565b6040516103de9190611e34565b60405180910390f35b6103ef611225565b6040516103fc9190611f81565b60405180910390f35b61041f600480360381019061041a9190611ead565b611235565b60405161042c9190611ce2565b60405180910390f35b61044f600480360381019061044a9190611d33565b611373565b60405161045c9190611ce2565b60405180910390f35b61046d611448565b60405161047a9190611f4d565b60405180910390f35b6000630d7491f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104d757600190506105d2565b63abe1f1f57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361052957600190506105d2565b63841a0e947c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361057b57600190506105d2565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105cd57600190506105d2565b600090505b919050565b6060806105e2611c1b565b600080600087036105ff5760086004546105fc9190611ffa565b96505b600060088761060e919061202b565b1461064e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610645906120b9565b60405180910390fd5b6106578661146e565b92508260006002811061066d5761066c6120d9565b5b602002015191506008876106819190611ffa565b9050600183600160028110610699576106986120d9565b5b602002015160ff1611156106b7576001816106b49190612108565b90505b8067ffffffffffffffff8111156106d1576106d061213c565b5b6040519080825280601f01601f1916602001820160405280156107035781602001600182028036833780820191505090505b50935060005b81811015610841576003838261071f9190612108565b815461072a9061219a565b8110610739576107386120d9565b5b8154600116156107585790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000026002848361078c9190612108565b81546107979061219a565b81106107a6576107a56120d9565b5b8154600116156107c55790600052602060002090602091828204019190065b9054901a7f010000000000000000000000000000000000000000000000000000000000000002178582815181106107ff576107fe6120d9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610839906121cb565b915050610709565b508394505050505092915050565b60055481565b600381565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806108ff575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b60006003821061091557600080fd5b6000820361092a576003600c54149050610934565b81600c5483161490505b919050565b60065481565b600c5481565b60008060606000610954610cd8565b50600b60009054906101000a900460ff16156109765760009350505050610b58565b8461097f6114e1565b6109899190612213565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163330836040516024016109d9939291906122b4565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610a639190612327565b6000604051808303816000865af19150503d8060008114610aa0576040519150601f19603f3d011682016040523d82523d6000602084013e610aa5565b606091505b50809350819450505082610aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae59061238a565b60405180910390fd5b81806020019051810190610b0291906123d6565b925082610b44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3b9061244f565b60405180910390fd5b610b5086866000611591565b600193505050505b92915050565b6000610b6d600160ff16610906565b15610bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba4906124bb565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c3257508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6890612527565b60405180910390fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60045481565b600080600a5403610cec5760009050610d73565b600b60009054906101000a900460ff1615610d0a5760019050610d73565b600a544210610d6e576001600b60006101000a81548160ff0219169083151502179055507ff80dbaea4785589e52984ca36a31de106adc77759539a5c7d92883bf49692fe942604051610d5d9190611e34565b60405180910390a160029050610d73565b600090505b90565b60075481565b600060016003610d8c9190612108565b8210610dcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc490612593565b60405180910390fd5b6000600c54831614610e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0b906125ff565b60405180910390fd5b81600c600082825417925050819055506003600c541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e600c54604051610e5d9190611e34565b60405180910390a2600c549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060006060600080610ea8610cd8565b50600b60009054906101000a900460ff1615610ece57600097505050505050505061121a565b610ed66114e1565b955085600754610ee69190612213565b9650600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548703610f3e57600097505050505050505061121a565b600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487610f89919061261f565b9450600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115610fdd57889150309050611012565b3091508890507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8561100f9190612662565b94505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828287604051602401611060939291906126da565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516110ea9190612327565b6000604051808303816000865af19150503d8060008114611127576040519150601f19603f3d011682016040523d82523d6000602084013e61112c565b606091505b50809450819550505083611175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116c9061238a565b60405180910390fd5b8280602001905181019061118991906123d6565b9350836111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c29061244f565b60405180910390fd5b86600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550849750505050505050505b919050565b600a5481565b600061123033610e93565b905090565b6000611244600160ff16610906565b15611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b906124bb565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130990612527565b60405180910390fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000611382600260ff16610906565b156113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b9906124bb565b60405180910390fd5b6113cb3361085a565b61140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190612527565b60405180910390fd5b611412610cd8565b50600b60009054906101000a900460ff16156114315760009050611442565b61143d83836001611591565b600190505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611476611c1b565b6000611480611c1b565b60088461148d9190612711565b915081816000600281106114a4576114a36120d9565b5b6020020181815250506008846114ba919061202b565b816001600281106114ce576114cd6120d9565b5b6020020181815250508092505050919050565b60008060006114ee611985565b91506006548214611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152b906127c7565b60405180910390fd5b600554821015611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090612833565b60405180910390fd5b600554826115879190611ffa565b9050809250505090565b600082116115d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cb9061289f565b60405180910390fd5b6115dc611c1b565b6000806115e88661146e565b9250826000600281106115fe576115fd6120d9565b5b6020020151915082600160028110611619576116186120d9565b5b602002015160ff1660019060020a02905060005b8581101561197c5760006004541161167a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116719061290b565b60405180910390fd5b6116848383611aff565b6116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90612977565b60405180910390fd5b8415611803578160038481546116d89061219a565b81106116e7576116e66120d9565b5b8154600116156117065790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004177f01000000000000000000000000000000000000000000000000000000000000000260038481546117809061219a565b811061178f5761178e6120d9565b5b8154600116156117ae5790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f010000000000000000000000000000000000000000000000000000000000000084040217905550600760008154809291906117f9906121cb565b9190505550611921565b8160028481546118129061219a565b8110611821576118206120d9565b5b8154600116156118405790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004177f01000000000000000000000000000000000000000000000000000000000000000260028481546118ba9061219a565b81106118c9576118c86120d9565b5b8154600116156118e85790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f0100000000000000000000000000000000000000000000000000000000000000840402179055505b60808260ff1603611943578280611937906121cb565b93505060019150611951565b60018260ff169060020a0291505b6004600081548092919061196490612997565b91905055508080611974906121cb565b91505061162d565b50505050505050565b60008060606000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f18160ddd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611a559190612327565b6000604051808303816000865af19150503d8060008114611a92576040519150601f19603f3d011682016040523d82523d6000602084013e611a97565b606091505b50809350819450505082611ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad79061238a565b60405180910390fd5b81806020019051810190611af491906129d5565b905080935050505090565b600080826003858154611b119061219a565b8110611b2057611b1f6120d9565b5b815460011615611b3f5790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090046002868154611b969061219a565b8110611ba557611ba46120d9565b5b815460011615611bc45790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004171660ff1614905092915050565b6040518060400160405280600290602082028036833780820191505090505090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c7781611c42565b8114611c8257600080fd5b50565b600081359050611c9481611c6e565b92915050565b600060208284031215611cb057611caf611c3d565b5b6000611cbe84828501611c85565b91505092915050565b60008115159050919050565b611cdc81611cc7565b82525050565b6000602082019050611cf76000830184611cd3565b92915050565b6000819050919050565b611d1081611cfd565b8114611d1b57600080fd5b50565b600081359050611d2d81611d07565b92915050565b60008060408385031215611d4a57611d49611c3d565b5b6000611d5885828601611d1e565b9250506020611d6985828601611d1e565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611dad578082015181840152602081019050611d92565b60008484015250505050565b6000601f19601f8301169050919050565b6000611dd582611d73565b611ddf8185611d7e565b9350611def818560208601611d8f565b611df881611db9565b840191505092915050565b60006020820190508181036000830152611e1d8184611dca565b905092915050565b611e2e81611cfd565b82525050565b6000602082019050611e496000830184611e25565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e7a82611e4f565b9050919050565b611e8a81611e6f565b8114611e9557600080fd5b50565b600081359050611ea781611e81565b92915050565b600060208284031215611ec357611ec2611c3d565b5b6000611ed184828501611e98565b91505092915050565b600060208284031215611ef057611eef611c3d565b5b6000611efe84828501611d1e565b91505092915050565b600060ff82169050919050565b611f1d81611f07565b82525050565b6000602082019050611f386000830184611f14565b92915050565b611f4781611e6f565b82525050565b6000602082019050611f626000830184611f3e565b92915050565b6000819050919050565b611f7b81611f68565b82525050565b6000602082019050611f966000830184611f72565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061200582611cfd565b915061201083611cfd565b9250826120205761201f611f9c565b5b828204905092915050565b600061203682611cfd565b915061204183611cfd565b92508261205157612050611f9c565b5b828206905092915050565b600082825260208201905092915050565b7f4552525f424f554e444152590000000000000000000000000000000000000000600082015250565b60006120a3600c8361205c565b91506120ae8261206d565b602082019050919050565b600060208201905081810360008301526120d281612096565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061211382611cfd565b915061211e83611cfd565b925082820190508082111561213657612135611fcb565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806121b257607f821691505b6020821081036121c5576121c461216b565b5b50919050565b60006121d682611cfd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361220857612207611fcb565b5b600182019050919050565b600061221e82611cfd565b915061222983611cfd565b925082820261223781611cfd565b9150828204841483151761224e5761224d611fcb565b5b5092915050565b6000819050919050565b600061227a61227561227084611e4f565b612255565b611e4f565b9050919050565b600061228c8261225f565b9050919050565b600061229e82612281565b9050919050565b6122ae81612293565b82525050565b60006060820190506122c96000830186611f3e565b6122d660208301856122a5565b6122e36040830184611e25565b949350505050565b600081905092915050565b600061230182611d73565b61230b81856122eb565b935061231b818560208601611d8f565b80840191505092915050565b600061233382846122f6565b915081905092915050565b7f4552525f544f4b454e0000000000000000000000000000000000000000000000600082015250565b600061237460098361205c565b915061237f8261233e565b602082019050919050565b600060208201905081810360008301526123a381612367565b9050919050565b6123b381611cc7565b81146123be57600080fd5b50565b6000815190506123d0816123aa565b92915050565b6000602082840312156123ec576123eb611c3d565b5b60006123fa848285016123c1565b91505092915050565b7f4552525f5452414e534645520000000000000000000000000000000000000000600082015250565b6000612439600c8361205c565b915061244482612403565b602082019050919050565b600060208201905081810360008301526124688161242c565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b60006124a5600a8361205c565b91506124b08261246f565b602082019050919050565b600060208201905081810360008301526124d481612498565b9050919050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b600061251160078361205c565b915061251c826124db565b602082019050919050565b6000602082019050818103600083015261254081612504565b9050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b600061257d60118361205c565b915061258882612547565b602082019050919050565b600060208201905081810360008301526125ac81612570565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b60006125e960128361205c565b91506125f4826125b3565b602082019050919050565b60006020820190508181036000830152612618816125dc565b9050919050565b600061262a82611f68565b915061263583611f68565b925082820390508181126000841216828213600085121516171561265c5761265b611fcb565b5b92915050565b600061266d82611f68565b915061267883611f68565b925082820261268681611f68565b91507f800000000000000000000000000000000000000000000000000000000000000084146000841216156126be576126bd611fcb565b5b82820584148315176126d3576126d2611fcb565b5b5092915050565b60006060820190506126ef6000830186611f3e565b6126fc6020830185611f3e565b6127096040830184611e25565b949350505050565b600061271c82611f68565b915061272783611f68565b92508261273757612736611f9c565b5b600160000383147f8000000000000000000000000000000000000000000000000000000000000000831416156127705761276f611fcb565b5b828205905092915050565b7f4552525f535550504c595f4348414e4745440000000000000000000000000000600082015250565b60006127b160128361205c565b91506127bc8261277b565b602082019050919050565b600060208201905081810360008301526127e0816127a4565b9050919050565b7f4552525f535550504c595f554e444552464c4f57000000000000000000000000600082015250565b600061281d60148361205c565b9150612828826127e7565b602082019050919050565b6000602082019050818103600083015261284c81612810565b9050919050565b7f4552525f5a45524f434f554e5400000000000000000000000000000000000000600082015250565b6000612889600d8361205c565b915061289482612853565b602082019050919050565b600060208201905081810360008301526128b88161287c565b9050919050565b7f4552525f43415041434954590000000000000000000000000000000000000000600082015250565b60006128f5600c8361205c565b9150612900826128bf565b602082019050919050565b60006020820190508181036000830152612924816128e8565b9050919050565b7f4552525f434f4c4c4953494f4e00000000000000000000000000000000000000600082015250565b6000612961600d8361205c565b915061296c8261292b565b602082019050919050565b6000602082019050818103600083015261299081612954565b9050919050565b60006129a282611cfd565b9150600082036129b5576129b4611fcb565b5b600182039050919050565b6000815190506129cf81611d07565b92915050565b6000602082840312156129eb576129ea611c3d565b5b60006129f9848285016129c0565b9150509291505056fea2646970667358221220da7fb883e1467cf1f3e38e8260da87f90c2a67006535bb5ba05d4389194d1daf64736f6c63430008130033 -\ No newline at end of file +60806040523480156200001157600080fd5b5060405162003746380380620037468339818101604052810190620000379190620005a7565b60008211801562000058575070010000000000000000000000000000000082105b6200009a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000919062000664565b60405180910390fd5b428111620000df576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000d690620006d6565b60405180910390fd5b620000e9620004e0565b6200010383620002dc640100000000026401000000009004565b90506001816000600281106200011e576200011d620006f8565b5b60200201516200012f919062000756565b67ffffffffffffffff8111156200014b576200014a62000791565b5b6040519080825280601f01601f1916602001820160405280156200017e5781602001600182028036833780820191505090505b50600290816200018f919062000a07565b50600181600060028110620001a957620001a8620006f8565b5b6020020151620001ba919062000756565b67ffffffffffffffff811115620001d657620001d562000791565b5b6040519080825280601f01601f191660200182016040528015620002095781602001600182028036833780820191505090505b50600390816200021a919062000a07565b508260048190555060045460058190555083600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620002856200035d640100000000026401000000009004565b600681905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a819055505050505062000cfe565b620002e6620004e0565b6000620002f2620004e0565b60088462000301919062000b27565b915081816000600281106200031b576200031a620006f8565b5b60200201818152505060088462000333919062000b9b565b816001600281106200034a5762000349620006f8565b5b6020020181815250508092505050919050565b60008060606000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f18160ddd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516200042f919062000c41565b6000604051808303816000865af19150503d80600081146200046e576040519150601f19603f3d011682016040523d82523d6000602084013e62000473565b606091505b50809350819450505082620004bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620004b69062000caa565b60405180910390fd5b81806020019051810190620004d5919062000ccc565b905080935050505090565b6040518060400160405280600290602082028036833780820191505090505090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005348262000507565b9050919050565b620005468162000527565b81146200055257600080fd5b50565b60008151905062000566816200053b565b92915050565b6000819050919050565b62000581816200056c565b81146200058d57600080fd5b50565b600081519050620005a18162000576565b92915050565b600080600060608486031215620005c357620005c262000502565b5b6000620005d38682870162000555565b9350506020620005e68682870162000590565b9250506040620005f98682870162000590565b9150509250925092565b600082825260208201905092915050565b7f4552525f4e4f4e53454e53450000000000000000000000000000000000000000600082015250565b60006200064c600c8362000603565b9150620006598262000614565b602082019050919050565b600060208201905081810360008301526200067f816200063d565b9050919050565b7f4552525f50415354000000000000000000000000000000000000000000000000600082015250565b6000620006be60088362000603565b9150620006cb8262000686565b602082019050919050565b60006020820190508181036000830152620006f181620006af565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000763826200056c565b915062000770836200056c565b92508282019050808211156200078b576200078a62000727565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200081357607f821691505b602082108103620008295762000828620007cb565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620008967fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000854565b620008a2868362000854565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620008e5620008df620008d9846200056c565b620008ba565b6200056c565b9050919050565b6000819050919050565b6200090183620008c4565b620009196200091082620008ec565b84845462000864565b825550505050565b600090565b6200093062000921565b6200093d818484620008f6565b505050565b5b8181101562000965576200095960008262000926565b60018101905062000943565b5050565b601f821115620009b4576200097e816200082f565b620009898462000844565b8101602085101562000999578190505b620009b1620009a88562000844565b83018262000942565b50505b505050565b60008160020a8304905092915050565b6000620009dc60001984600802620009b9565b1980831691505092915050565b6000620009f78383620009c9565b9150826002028217905092915050565b62000a1282620007c0565b67ffffffffffffffff81111562000a2e5762000a2d62000791565b5b62000a3a8254620007fa565b62000a4782828562000969565b600060209050601f83116001811462000a7f576000841562000a6a578287015190505b62000a768582620009e9565b86555062000ae6565b601f19841662000a8f866200082f565b60005b8281101562000ab95784890151825560018201915060208501945060208101905062000a92565b8683101562000ad9578489015162000ad5601f891682620009c9565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600062000b348262000aee565b915062000b418362000aee565b92508262000b545762000b5362000af8565b5b600160000383147f80000000000000000000000000000000000000000000000000000000000000008314161562000b905762000b8f62000727565b5b828205905092915050565b600062000ba8826200056c565b915062000bb5836200056c565b92508262000bc85762000bc762000af8565b5b828206905092915050565b600081905092915050565b60005b8381101562000bfe57808201518184015260208101905062000be1565b60008484015250505050565b600062000c1782620007c0565b62000c23818562000bd3565b935062000c3581856020860162000bde565b80840191505092915050565b600062000c4f828462000c0a565b915081905092915050565b7f4552525f544f4b454e0000000000000000000000000000000000000000000000600082015250565b600062000c9260098362000603565b915062000c9f8262000c5a565b602082019050919050565b6000602082019050818103600083015262000cc58162000c83565b9050919050565b60006020828403121562000ce55762000ce462000502565b5b600062000cf58482850162000590565b91505092915050565b612a388062000d0e6000396000f3fe608060405234801561001057600080fd5b5060043610610154576000357c0100000000000000000000000000000000000000000000000000000000900480635cfc1a51116100d5578063aa67c91911610099578063aa67c91914610399578063b1cb0db3146103c9578063d0e30db0146103e7578063da2824a814610405578063de34d54414610435578063fc0c546a1461046557610154565b80635cfc1a51146102f15780635f408c041461030f5780637f03864b1461032d57806386fe212d1461034b5780638da5cb5b1461037b57610154565b80632c1758c11161011c5780632c1758c1146102255780632d1a72671461025557806331a5995d146102735780634eeea7ad146102915780635356dddc146102c157610154565b806301ffc9a71461015957806304bc34e21461018957806318160ddd146101b957806318cbbcfc146101d75780632b29ba23146101f5575b600080fd5b610173600480360381019061016e9190611c9a565b610483565b6040516101809190611ce2565b60405180910390f35b6101a3600480360381019061019e9190611d33565b6105d7565b6040516101b09190611e03565b60405180910390f35b6101c161084f565b6040516101ce9190611e34565b60405180910390f35b6101df610855565b6040516101ec9190611e34565b60405180910390f35b61020f600480360381019061020a9190611ead565b61085a565b60405161021c9190611ce2565b60405180910390f35b61023f600480360381019061023a9190611eda565b610906565b60405161024c9190611ce2565b60405180910390f35b61025d610939565b60405161026a9190611e34565b60405180910390f35b61027b61093f565b6040516102889190611e34565b60405180910390f35b6102ab60048036038101906102a69190611d33565b610945565b6040516102b89190611ce2565b60405180910390f35b6102db60048036038101906102d69190611ead565b610b5e565b6040516102e89190611ce2565b60405180910390f35b6102f9610cd2565b6040516103069190611e34565b60405180910390f35b610317610cd8565b6040516103249190611f23565b60405180910390f35b610335610d76565b6040516103429190611e34565b60405180910390f35b61036560048036038101906103609190611eda565b610d7c565b6040516103729190611e34565b60405180910390f35b610383610e6f565b6040516103909190611f4d565b60405180910390f35b6103b360048036038101906103ae9190611ead565b610e93565b6040516103c09190611f81565b60405180910390f35b6103d161121f565b6040516103de9190611e34565b60405180910390f35b6103ef611225565b6040516103fc9190611f81565b60405180910390f35b61041f600480360381019061041a9190611ead565b611235565b60405161042c9190611ce2565b60405180910390f35b61044f600480360381019061044a9190611d33565b611373565b60405161045c9190611ce2565b60405180910390f35b61046d611448565b60405161047a9190611f4d565b60405180910390f35b6000630d7491f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104d757600190506105d2565b63abe1f1f57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361052957600190506105d2565b63841a0e947c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361057b57600190506105d2565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105cd57600190506105d2565b600090505b919050565b6060806105e2611c1b565b600080600087036105ff5760086004546105fc9190611ffa565b96505b600060088761060e919061202b565b1461064e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610645906120b9565b60405180910390fd5b6106578661146e565b92508260006002811061066d5761066c6120d9565b5b602002015191506008876106819190611ffa565b9050600183600160028110610699576106986120d9565b5b602002015160ff1611156106b7576001816106b49190612108565b90505b8067ffffffffffffffff8111156106d1576106d061213c565b5b6040519080825280601f01601f1916602001820160405280156107035781602001600182028036833780820191505090505b50935060005b81811015610841576003838261071f9190612108565b815461072a9061219a565b8110610739576107386120d9565b5b8154600116156107585790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000026002848361078c9190612108565b81546107979061219a565b81106107a6576107a56120d9565b5b8154600116156107c55790600052602060002090602091828204019190065b9054901a7f010000000000000000000000000000000000000000000000000000000000000002178582815181106107ff576107fe6120d9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610839906121cb565b915050610709565b508394505050505092915050565b60055481565b600381565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806108ff575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b60006003821061091557600080fd5b6000820361092a576003600c54149050610934565b81600c5483161490505b919050565b60065481565b600c5481565b60008060606000610954610cd8565b50600b60009054906101000a900460ff16156109765760009350505050610b58565b8461097f6114e1565b6109899190612213565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163330836040516024016109d9939291906122b4565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610a639190612327565b6000604051808303816000865af19150503d8060008114610aa0576040519150601f19603f3d011682016040523d82523d6000602084013e610aa5565b606091505b50809350819450505082610aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae59061238a565b60405180910390fd5b81806020019051810190610b0291906123d6565b925082610b44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3b9061244f565b60405180910390fd5b610b5086866000611591565b600193505050505b92915050565b6000610b6d600160ff16610906565b15610bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba4906124bb565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c3257508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6890612527565b60405180910390fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60045481565b600080600a5403610cec5760009050610d73565b600b60009054906101000a900460ff1615610d0a5760019050610d73565b600a544210610d6e576001600b60006101000a81548160ff0219169083151502179055507ff80dbaea4785589e52984ca36a31de106adc77759539a5c7d92883bf49692fe942604051610d5d9190611e34565b60405180910390a160029050610d73565b600090505b90565b60075481565b600060016003610d8c9190612108565b8210610dcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc490612593565b60405180910390fd5b6000600c54831614610e14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0b906125ff565b60405180910390fd5b81600c600082825417925050819055506003600c541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e600c54604051610e5d9190611e34565b60405180910390a2600c549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060006060600080610ea8610cd8565b50600b60009054906101000a900460ff1615610ece57600097505050505050505061121a565b610ed66114e1565b955085600754610ee69190612213565b9650600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548703610f3e57600097505050505050505061121a565b600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487610f89919061261f565b9450600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115610fdd57889150309050611012565b3091508890507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8561100f9190612662565b94505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828287604051602401611060939291906126da565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516110ea9190612327565b6000604051808303816000865af19150503d8060008114611127576040519150601f19603f3d011682016040523d82523d6000602084013e61112c565b606091505b50809450819550505083611175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116c9061238a565b60405180910390fd5b8280602001905181019061118991906123d6565b9350836111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c29061244f565b60405180910390fd5b86600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550849750505050505050505b919050565b600a5481565b600061123033610e93565b905090565b6000611244600160ff16610906565b15611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b906124bb565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130990612527565b60405180910390fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000611382600260ff16610906565b156113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b9906124bb565b60405180910390fd5b6113cb3361085a565b61140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190612527565b60405180910390fd5b611412610cd8565b50600b60009054906101000a900460ff16156114315760009050611442565b61143d83836001611591565b600190505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611476611c1b565b6000611480611c1b565b60088461148d9190612711565b915081816000600281106114a4576114a36120d9565b5b6020020181815250506008846114ba919061202b565b816001600281106114ce576114cd6120d9565b5b6020020181815250508092505050919050565b60008060006114ee611985565b91506006548214611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152b906127c7565b60405180910390fd5b600554821015611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090612833565b60405180910390fd5b600554826115879190611ffa565b9050809250505090565b600082116115d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cb9061289f565b60405180910390fd5b6115dc611c1b565b6000806115e88661146e565b9250826000600281106115fe576115fd6120d9565b5b6020020151915082600160028110611619576116186120d9565b5b602002015160ff1660019060020a02905060005b8581101561197c5760006004541161167a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116719061290b565b60405180910390fd5b6116848383611aff565b6116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90612977565b60405180910390fd5b8415611803578160038481546116d89061219a565b81106116e7576116e66120d9565b5b8154600116156117065790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004177f01000000000000000000000000000000000000000000000000000000000000000260038481546117809061219a565b811061178f5761178e6120d9565b5b8154600116156117ae5790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f010000000000000000000000000000000000000000000000000000000000000084040217905550600760008154809291906117f9906121cb565b9190505550611921565b8160028481546118129061219a565b8110611821576118206120d9565b5b8154600116156118405790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004177f01000000000000000000000000000000000000000000000000000000000000000260028481546118ba9061219a565b81106118c9576118c86120d9565b5b8154600116156118e85790600052602060002090602091828204019190065b601f036101000a81548160ff021916907f0100000000000000000000000000000000000000000000000000000000000000840402179055505b60808260ff1603611943578280611937906121cb565b93505060019150611951565b60018260ff169060020a0291505b6004600081548092919061196490612997565b91905055508080611974906121cb565b91505061162d565b50505050505050565b60008060606000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f18160ddd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611a559190612327565b6000604051808303816000865af19150503d8060008114611a92576040519150601f19603f3d011682016040523d82523d6000602084013e611a97565b606091505b50809350819450505082611ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad79061238a565b60405180910390fd5b81806020019051810190611af491906129d5565b905080935050505090565b600080826003858154611b119061219a565b8110611b2057611b1f6120d9565b5b815460011615611b3f5790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090046002868154611b969061219a565b8110611ba557611ba46120d9565b5b815460011615611bc45790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004171660ff1614905092915050565b6040518060400160405280600290602082028036833780820191505090505090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c7781611c42565b8114611c8257600080fd5b50565b600081359050611c9481611c6e565b92915050565b600060208284031215611cb057611caf611c3d565b5b6000611cbe84828501611c85565b91505092915050565b60008115159050919050565b611cdc81611cc7565b82525050565b6000602082019050611cf76000830184611cd3565b92915050565b6000819050919050565b611d1081611cfd565b8114611d1b57600080fd5b50565b600081359050611d2d81611d07565b92915050565b60008060408385031215611d4a57611d49611c3d565b5b6000611d5885828601611d1e565b9250506020611d6985828601611d1e565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611dad578082015181840152602081019050611d92565b60008484015250505050565b6000601f19601f8301169050919050565b6000611dd582611d73565b611ddf8185611d7e565b9350611def818560208601611d8f565b611df881611db9565b840191505092915050565b60006020820190508181036000830152611e1d8184611dca565b905092915050565b611e2e81611cfd565b82525050565b6000602082019050611e496000830184611e25565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e7a82611e4f565b9050919050565b611e8a81611e6f565b8114611e9557600080fd5b50565b600081359050611ea781611e81565b92915050565b600060208284031215611ec357611ec2611c3d565b5b6000611ed184828501611e98565b91505092915050565b600060208284031215611ef057611eef611c3d565b5b6000611efe84828501611d1e565b91505092915050565b600060ff82169050919050565b611f1d81611f07565b82525050565b6000602082019050611f386000830184611f14565b92915050565b611f4781611e6f565b82525050565b6000602082019050611f626000830184611f3e565b92915050565b6000819050919050565b611f7b81611f68565b82525050565b6000602082019050611f966000830184611f72565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061200582611cfd565b915061201083611cfd565b9250826120205761201f611f9c565b5b828204905092915050565b600061203682611cfd565b915061204183611cfd565b92508261205157612050611f9c565b5b828206905092915050565b600082825260208201905092915050565b7f4552525f424f554e444152590000000000000000000000000000000000000000600082015250565b60006120a3600c8361205c565b91506120ae8261206d565b602082019050919050565b600060208201905081810360008301526120d281612096565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061211382611cfd565b915061211e83611cfd565b925082820190508082111561213657612135611fcb565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806121b257607f821691505b6020821081036121c5576121c461216b565b5b50919050565b60006121d682611cfd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361220857612207611fcb565b5b600182019050919050565b600061221e82611cfd565b915061222983611cfd565b925082820261223781611cfd565b9150828204841483151761224e5761224d611fcb565b5b5092915050565b6000819050919050565b600061227a61227561227084611e4f565b612255565b611e4f565b9050919050565b600061228c8261225f565b9050919050565b600061229e82612281565b9050919050565b6122ae81612293565b82525050565b60006060820190506122c96000830186611f3e565b6122d660208301856122a5565b6122e36040830184611e25565b949350505050565b600081905092915050565b600061230182611d73565b61230b81856122eb565b935061231b818560208601611d8f565b80840191505092915050565b600061233382846122f6565b915081905092915050565b7f4552525f544f4b454e0000000000000000000000000000000000000000000000600082015250565b600061237460098361205c565b915061237f8261233e565b602082019050919050565b600060208201905081810360008301526123a381612367565b9050919050565b6123b381611cc7565b81146123be57600080fd5b50565b6000815190506123d0816123aa565b92915050565b6000602082840312156123ec576123eb611c3d565b5b60006123fa848285016123c1565b91505092915050565b7f4552525f5452414e534645520000000000000000000000000000000000000000600082015250565b6000612439600c8361205c565b915061244482612403565b602082019050919050565b600060208201905081810360008301526124688161242c565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b60006124a5600a8361205c565b91506124b08261246f565b602082019050919050565b600060208201905081810360008301526124d481612498565b9050919050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b600061251160078361205c565b915061251c826124db565b602082019050919050565b6000602082019050818103600083015261254081612504565b9050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b600061257d60118361205c565b915061258882612547565b602082019050919050565b600060208201905081810360008301526125ac81612570565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b60006125e960128361205c565b91506125f4826125b3565b602082019050919050565b60006020820190508181036000830152612618816125dc565b9050919050565b600061262a82611f68565b915061263583611f68565b925082820390508181126000841216828213600085121516171561265c5761265b611fcb565b5b92915050565b600061266d82611f68565b915061267883611f68565b925082820261268681611f68565b91507f800000000000000000000000000000000000000000000000000000000000000084146000841216156126be576126bd611fcb565b5b82820584148315176126d3576126d2611fcb565b5b5092915050565b60006060820190506126ef6000830186611f3e565b6126fc6020830185611f3e565b6127096040830184611e25565b949350505050565b600061271c82611f68565b915061272783611f68565b92508261273757612736611f9c565b5b600160000383147f8000000000000000000000000000000000000000000000000000000000000000831416156127705761276f611fcb565b5b828205905092915050565b7f4552525f535550504c595f4348414e4745440000000000000000000000000000600082015250565b60006127b160128361205c565b91506127bc8261277b565b602082019050919050565b600060208201905081810360008301526127e0816127a4565b9050919050565b7f4552525f535550504c595f554e444552464c4f57000000000000000000000000600082015250565b600061281d60148361205c565b9150612828826127e7565b602082019050919050565b6000602082019050818103600083015261284c81612810565b9050919050565b7f4552525f5a45524f434f554e5400000000000000000000000000000000000000600082015250565b6000612889600d8361205c565b915061289482612853565b602082019050919050565b600060208201905081810360008301526128b88161287c565b9050919050565b7f4552525f43415041434954590000000000000000000000000000000000000000600082015250565b60006128f5600c8361205c565b9150612900826128bf565b602082019050919050565b60006020820190508181036000830152612924816128e8565b9050919050565b7f4552525f434f4c4c4953494f4e00000000000000000000000000000000000000600082015250565b6000612961600d8361205c565b915061296c8261292b565b602082019050919050565b6000602082019050818103600083015261299081612954565b9050919050565b60006129a282611cfd565b9150600082036129b5576129b4611fcb565b5b600182039050919050565b6000815190506129cf81611d07565b92915050565b6000602082840312156129eb576129ea611c3d565b5b60006129f9848285016129c0565b9150509291505056fea2646970667358221220e181614e439407050f16dfe48daf8f4fb918de089bc7c11369a9636c7517e7bc64736f6c63430008130033 +\ No newline at end of file diff --git a/python/evm_booking/data/Booking.metadata.json b/python/evm_booking/data/Booking.metadata.json @@ -1 +1 @@ -{"compiler":{"version":"0.8.19+commit.7dd6d404"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_resolution","type":"uint256"},{"internalType":"uint256","name":"_expireTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"Expired","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":"address","name":"_writer","type":"address"}],"name":"addWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"applyExpiry","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"capacity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"consume","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"}],"name":"depositFor","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expires","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"isSealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"isWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"originalTokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"_offset","type":"uint256"}],"name":"raw","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"removeWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"share","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"Booking.sol":"ERC20Book"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Booking.sol":{"keccak256":"0xf99cfe71be0ba289f74023a43a1b948eaabb5c76107db6f72d1e31824825796b","license":"AGPL-3.0-or-later","urls":["bzz-raw://93aeb3b5fd54b5c7afd4452ee1096b40ad769150a2e954b2d4de94daab7c8614","dweb:/ipfs/QmcAtG9oAq7cBPwp6KjXheSGKA9NS7CyjfXZgHtPfjAyiq"]}},"version":1} +{"compiler":{"version":"0.8.19+commit.7dd6d404"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_resolution","type":"uint256"},{"internalType":"uint256","name":"_expireTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"Expired","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":"address","name":"_writer","type":"address"}],"name":"addWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"applyExpiry","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"capacity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"consume","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"}],"name":"depositFor","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expires","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"isSealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"isWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"originalTokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"},{"internalType":"uint256","name":"_offset","type":"uint256"}],"name":"raw","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"removeWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"share","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"Booking.sol":"ERC20Book"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Booking.sol":{"keccak256":"0xc71f3dbad87382584a5bee2cea29ad94302390fc6d1116aab14dc8db646cfdcb","license":"AGPL-3.0-or-later","urls":["bzz-raw://ddae5a15fbc30d9d7b768a0deecee195609c14416a9cfaca66e4fa8a65362dd4","dweb:/ipfs/QmfRTMG6f3LEWSVMjC223tT6bTCdN5rgUGFZ6zPL6uMFN5"]}},"version":1} diff --git a/python/setup.cfg b/python/setup.cfg @@ -26,10 +26,11 @@ licence_files = [options] include_package_data = True -python_requires = >= 3.7 +python_requires = >= 3.8 packages = - craft_nft - craft_nft.runnable + evm_booking + evm_booking.unittest + evm_booking.data #[options.entry_points] #console_scripts = diff --git a/python/tests/test_base.py b/python/tests/test_base.py @@ -93,6 +93,19 @@ class TestBookingBase(TestBooking): r = self.rpc.do(o) self.assertEqual(r['status'], 1) + (tx_hash_hex,o ) = c.add_writer(self.address, self.accounts[0], self.alice) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + nonce_oracle = RPCNonceOracle(self.alice, conn=self.rpc) + c = Booking(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.share(self.address, self.alice, 133, 7) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) def test_deposit_excess(self): nonce_oracle = RPCNonceOracle(self.accounts[0], conn=self.rpc) @@ -180,6 +193,12 @@ class TestBookingBase(TestBooking): def test_expire(self): + c = Booking(self.chain_spec) + o = c.expires(self.address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + expire_timestamp = int(self.booking_expire.timestamp()) + self.assertEqual(int(r, 16), expire_timestamp) + nonce_oracle = RPCNonceOracle(self.accounts[0], conn=self.rpc) c = ERC20(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) (tx_hash_hex, o) = c.approve(self.token_address, self.accounts[0], self.address, self.initial_supply)