eth-erc721

ERC-721 'NFT' token interface with example developer badge token contract
Log | Files | Refs | LICENSE

commit 887b441f35c443f4d4df00b3d3a2df1f5205154f
parent 35461990d74229c28318600309aba22c3fba6340
Author: lash <dev@holbrook.no>
Date:   Sat,  4 Mar 2023 10:28:30 +0000

Factor out created at from mint height check

Diffstat:
Mpython/eth_badgetoken/data/BadgeToken.bin | 4++--
Mpython/eth_badgetoken/data/BadgeToken.json | 2+-
Mpython/eth_badgetoken/token.py | 6+++---
Mpython/eth_badgetoken/unittest/base.py | 1+
Apython/eth_badgetoken/unittest/interface.py | 23+++++++++++++++++++++++
Mpython/eth_erc721/unittest/base.py | 13-------------
Mpython/tests/test_app.py | 2+-
Msolidity/BadgeToken.sol | 12++++--------
8 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/python/eth_badgetoken/data/BadgeToken.bin b/python/eth_badgetoken/data/BadgeToken.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b50604051620031df380380620031df8339818101604052810190620000379190620002dd565b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600b9081620000c99190620005c8565b5081600c9081620000db9190620005c8565b50505050620006af565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014e8262000103565b810181811067ffffffffffffffff8211171562000170576200016f62000114565b5b80604052505050565b600062000185620000e5565b905062000193828262000143565b919050565b600067ffffffffffffffff821115620001b657620001b562000114565b5b620001c18262000103565b9050602081019050919050565b60005b83811015620001ee578082015181840152602081019050620001d1565b60008484015250505050565b6000620002116200020b8462000198565b62000179565b90508281526020810184848401111562000230576200022f620000fe565b5b6200023d848285620001ce565b509392505050565b600082601f8301126200025d576200025c620000f9565b5b81516200026f848260208601620001fa565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002a58262000278565b9050919050565b620002b78162000298565b8114620002c357600080fd5b50565b600081519050620002d781620002ac565b92915050565b600080600060608486031215620002f957620002f8620000ef565b5b600084015167ffffffffffffffff8111156200031a5762000319620000f4565b5b620003288682870162000245565b935050602084015167ffffffffffffffff8111156200034c576200034b620000f4565b5b6200035a8682870162000245565b92505060406200036d86828701620002c6565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620003ca57607f821691505b602082108103620003e057620003df62000382565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b6000600883026200044d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200040b565b6200045986836200040b565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620004a6620004a06200049a8462000471565b6200047b565b62000471565b9050919050565b6000819050919050565b620004c28362000485565b620004da620004d182620004ad565b8484546200041b565b825550505050565b600090565b620004f1620004e2565b620004fe818484620004b7565b505050565b5b8181101562000526576200051a600082620004e7565b60018101905062000504565b5050565b601f82111562000575576200053f81620003e6565b6200054a84620003fb565b810160208510156200055a578190505b620005726200056985620003fb565b83018262000503565b50505b505050565b60008160020a8304905092915050565b60006200059d600019846008026200057a565b1980831691505092915050565b6000620005b883836200058a565b9150826002028217905092915050565b620005d38262000377565b67ffffffffffffffff811115620005ef57620005ee62000114565b5b620005fb8254620003b1565b620006088282856200052a565b600060209050601f8311600181146200064057600084156200062b578287015190505b620006378582620005aa565b865550620006a7565b601f1984166200065086620003e6565b60005b828110156200067a5784890151825560018201915060208501945060208101905062000653565b868310156200069a578489015162000696601f8916826200058a565b8355505b6001600288020188555050505b505050505050565b612b2080620006bf6000396000f3fe60806040526004361061015d576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100d3578063c793c6c11161008c578063c793c6c11461047d578063c87b56dd146104ba578063c9796c39146104f7578063e985e9c514610534578063f1b0aa1514610571578063f2fde38b146105ae5761015d565b806370a082311461037a5780638da5cb5b146103b757806392088cf6146103e257806395d89b411461040d578063a22cb46514610438578063b88d4fde146104615761015d565b806323b872dd1161012557806323b872dd1461024e5780632f745c591461026a57806342842e0e146102a7578063449a52f8146102c35780634f6ccce7146103005780636352211e1461033d5761015d565b806301ffc9a71461016257806306fdde031461019f578063081812fc146101ca578063095ea7b31461020757806318160ddd14610223575b600080fd5b34801561016e57600080fd5b50610189600480360381019061018491906122d6565b6105eb565b604051610196919061231e565b60405180910390f35b3480156101ab57600080fd5b506101b46107e3565b6040516101c191906123c9565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec9190612421565b610871565b6040516101fe919061248f565b60405180910390f35b610221600480360381019061021c91906124d6565b6108ae565b005b34801561022f57600080fd5b506102386109ca565b6040516102459190612525565b60405180910390f35b61026860048036038101906102639190612540565b6109d7565b005b34801561027657600080fd5b50610291600480360381019061028c91906124d6565b610a46565b60405161029e9190612525565b60405180910390f35b6102c160048036038101906102bc9190612540565b610af7565b005b3480156102cf57600080fd5b506102ea60048036038101906102e591906124d6565b610b66565b6040516102f7919061231e565b60405180910390f35b34801561030c57600080fd5b5061032760048036038101906103229190612421565b610e40565b6040516103349190612525565b60405180910390f35b34801561034957600080fd5b50610364600480360381019061035f9190612421565b610e68565b604051610371919061248f565b60405180910390f35b34801561038657600080fd5b506103a1600480360381019061039c9190612593565b610ea5565b6040516103ae9190612525565b60405180910390f35b3480156103c357600080fd5b506103cc610eee565b6040516103d9919061248f565b60405180910390f35b3480156103ee57600080fd5b506103f7610f12565b604051610404919061248f565b60405180910390f35b34801561041957600080fd5b50610422610f38565b60405161042f91906123c9565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a91906125ec565b610fc6565b005b61047b60048036038101906104769190612761565b611268565b005b34801561048957600080fd5b506104a4600480360381019061049f9190612593565b61138c565b6040516104b19190612525565b60405180910390f35b3480156104c657600080fd5b506104e160048036038101906104dc9190612421565b6113a4565b6040516104ee91906123c9565b60405180910390f35b34801561050357600080fd5b5061051e6004803603810190610519919061281a565b6113ea565b60405161052b91906123c9565b60405180910390f35b34801561054057600080fd5b5061055b60048036038101906105569190612847565b611a05565b604051610568919061231e565b60405180910390f35b34801561057d57600080fd5b5061059860048036038101906105939190612421565b611a9d565b6040516105a59190612525565b60405180910390f35b3480156105ba57600080fd5b506105d560048036038101906105d09190612593565b611add565b6040516105e2919061231e565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361063f57600190506107de565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361069157600190506107de565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106e357600190506107de565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361073557600190506107de565b63f1b0aa157c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361078757600190506107de565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036107d957600190506107de565b600090505b919050565b600b80546107f0906128b6565b80601f016020809104026020016040519081016040528092919081815260200182805461081c906128b6565b80156108695780601f1061083e57610100808354040283529160200191610869565b820191906000526020600020905b81548152906001019060200180831161084c57829003601f168201915b505050505081565b60006008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461091957600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000600180549050905090565b60606109e584848484611cdd565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548210610a9357600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610ae457610ae36128e7565b5b9060005260206000200154905092915050565b6060610b0584848484611cdd565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc057600080fd5b600060036000848152602001908152602001600020541480610be757506000600180549050145b610bf057600080fd5b600080600180549050915083905060018190806001815401808255809150506001900390600052602060002001600090919091909150558160036000838152602001908152602001600020819055506002439080600181540180825580915050600190039060005260206000200160009091909190915055846004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360066000600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050815260200190815260200160002081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610dca90612945565b91905055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f886604051610e2c9190612525565b60405180910390a360019250505092915050565b600060018281548110610e5657610e556128e7565b5b90600052602060002001549050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c8054610f45906128b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610f71906128b6565b8015610fbe5780601f10610f9357610100808354040283529160200191610fbe565b820191906000526020600020905b815481529060010190602001808311610fa157829003601f168201915b505050505081565b80156110e757600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106457600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111ff565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361117f57600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161125c919061231e565b60405180910390a35050565b61127484848484611cdd565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e600a60008781526020019081526020016000206001600a600089815260200190815260200160002080549050611355919061298d565b81548110611366576113656128e7565b5b906000526020600020015460405161137e91906129d0565b60405180910390a450505050565b60076020528060005260406000206000915090505481565b60606113e360016003600085815260200190815260200160002054815481106113d0576113cf6128e7565b5b90600052602060002001546001026113ea565b9050919050565b606080600080604767ffffffffffffffff81111561140b5761140a612636565b5b6040519080825280601f01601f19166020018201604052801561143d5781602001600182028036833780820191505090505b5092507f730000000000000000000000000000000000000000000000000000000000000083600081518110611475576114746128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6800000000000000000000000000000000000000000000000000000000000000836001815181106114d9576114d86128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f61000000000000000000000000000000000000000000000000000000000000008360028151811061153d5761153c6128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3200000000000000000000000000000000000000000000000000000000000000836003815181106115a1576115a06128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f350000000000000000000000000000000000000000000000000000000000000083600481518110611605576116046128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f360000000000000000000000000000000000000000000000000000000000000083600581518110611669576116686128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a00000000000000000000000000000000000000000000000000000000000000836006815181106116cd576116cc6128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b60208110156119f957600460f0878360208110611723576117226128e7565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff1610156117fb5760308361179291906129f8565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106117c7576117c66128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061186d565b60578361180891906129f8565b7f01000000000000000000000000000000000000000000000000000000000000000284838151811061183d5761183c6128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868260208110611882576118816128e7565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611959576030836118e491906129f8565b7f010000000000000000000000000000000000000000000000000000000000000002846001846119149190612a2d565b81518110611925576119246128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506119d7565b60578361196691906129f8565b7f010000000000000000000000000000000000000000000000000000000000000002846001846119969190612a2d565b815181106119a7576119a66128e7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b6002826119e49190612a2d565b915080806119f190612945565b915050611703565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b6000806003600084815260200190815260200160002054905060028181548110611aca57611ac96128e7565b5b9060005260206000200154915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3857600080fd5b60606000606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611bea57602002820191906000526020600020905b815481526020019060010190808311611bd6575b5050505050905060005b8151811015611c3657611c238387848481518110611c1557611c146128e7565b5b602002602001015187611cdd565b8080611c2e90612945565b915050611bf4565b50846000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019350505050919050565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508473ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d8057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611eb4573373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611eaa57503373ffffffffffffffffffffffffffffffffffffffff16600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611eb357600080fd5b5b60006008600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050611f95919061298d565b81548110611fa657611fa56128e7565b5b9060005260206000200154600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600660008681526020019081526020016000205481548110612015576120146128e7565b5b9060005260206000200181905550600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061207390612a61565b9190505550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061212e90612945565b9190505550836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8251811015612262578281815181106121a4576121a36128e7565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600a60008681526020019081526020016000206020836122309190612ab9565b81548110612241576122406128e7565b5b9060005260206000200181905550808061225a90612945565b915050612188565b505050505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6122b38161227e565b81146122be57600080fd5b50565b6000813590506122d0816122aa565b92915050565b6000602082840312156122ec576122eb612274565b5b60006122fa848285016122c1565b91505092915050565b60008115159050919050565b61231881612303565b82525050565b6000602082019050612333600083018461230f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612373578082015181840152602081019050612358565b60008484015250505050565b6000601f19601f8301169050919050565b600061239b82612339565b6123a58185612344565b93506123b5818560208601612355565b6123be8161237f565b840191505092915050565b600060208201905081810360008301526123e38184612390565b905092915050565b6000819050919050565b6123fe816123eb565b811461240957600080fd5b50565b60008135905061241b816123f5565b92915050565b60006020828403121561243757612436612274565b5b60006124458482850161240c565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006124798261244e565b9050919050565b6124898161246e565b82525050565b60006020820190506124a46000830184612480565b92915050565b6124b38161246e565b81146124be57600080fd5b50565b6000813590506124d0816124aa565b92915050565b600080604083850312156124ed576124ec612274565b5b60006124fb858286016124c1565b925050602061250c8582860161240c565b9150509250929050565b61251f816123eb565b82525050565b600060208201905061253a6000830184612516565b92915050565b60008060006060848603121561255957612558612274565b5b6000612567868287016124c1565b9350506020612578868287016124c1565b92505060406125898682870161240c565b9150509250925092565b6000602082840312156125a9576125a8612274565b5b60006125b7848285016124c1565b91505092915050565b6125c981612303565b81146125d457600080fd5b50565b6000813590506125e6816125c0565b92915050565b6000806040838503121561260357612602612274565b5b6000612611858286016124c1565b9250506020612622858286016125d7565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61266e8261237f565b810181811067ffffffffffffffff8211171561268d5761268c612636565b5b80604052505050565b60006126a061226a565b90506126ac8282612665565b919050565b600067ffffffffffffffff8211156126cc576126cb612636565b5b6126d58261237f565b9050602081019050919050565b82818337600083830152505050565b60006127046126ff846126b1565b612696565b9050828152602081018484840111156127205761271f612631565b5b61272b8482856126e2565b509392505050565b600082601f8301126127485761274761262c565b5b81356127588482602086016126f1565b91505092915050565b6000806000806080858703121561277b5761277a612274565b5b6000612789878288016124c1565b945050602061279a878288016124c1565b93505060406127ab8782880161240c565b925050606085013567ffffffffffffffff8111156127cc576127cb612279565b5b6127d887828801612733565b91505092959194509250565b6000819050919050565b6127f7816127e4565b811461280257600080fd5b50565b600081359050612814816127ee565b92915050565b6000602082840312156128305761282f612274565b5b600061283e84828501612805565b91505092915050565b6000806040838503121561285e5761285d612274565b5b600061286c858286016124c1565b925050602061287d858286016124c1565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806128ce57607f821691505b6020821081036128e1576128e0612887565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612950826123eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361298257612981612916565b5b600182019050919050565b6000612998826123eb565b91506129a3836123eb565b92508282039050818111156129bb576129ba612916565b5b92915050565b6129ca816127e4565b82525050565b60006020820190506129e560008301846129c1565b92915050565b600060ff82169050919050565b6000612a03826129eb565b9150612a0e836129eb565b9250828201905060ff811115612a2757612a26612916565b5b92915050565b6000612a38826123eb565b9150612a43836123eb565b9250828201905080821115612a5b57612a5a612916565b5b92915050565b6000612a6c826123eb565b915060008203612a7f57612a7e612916565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612ac4826123eb565b9150612acf836123eb565b925082612adf57612ade612a8a565b5b82820690509291505056fea264697066735822122052d9117ce517b0e9bf4a2e91a2470251c8ba72fc4cee4546f3f7a9dce440ba6264736f6c63430008110033 -\ No newline at end of file +60806040523480156200001157600080fd5b506040516200307d3803806200307d833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600b90816200008891906200050c565b5080600c90816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612a7a80620006036000396000f3fe608060405260043610610152576000357c0100000000000000000000000000000000000000000000000000000000900480636352211e116100c8578063b88d4fde1161008c578063b88d4fde14610468578063c793c6c114610484578063c87b56dd146104c1578063c9796c39146104fe578063e985e9c51461053b578063f2fde38b1461057857610152565b80636352211e1461036f57806370a08231146103ac5780638da5cb5b146103e957806395d89b4114610414578063a22cb4651461043f57610152565b806323b872dd1161011a57806323b872dd146102435780632f745c591461025f57806342842e0e1461029c578063449a52f8146102b85780634f6ccce7146102f557806350a1676e1461033257610152565b806301ffc9a71461015757806306fdde0314610194578063081812fc146101bf578063095ea7b3146101fc57806318160ddd14610218575b600080fd5b34801561016357600080fd5b5061017e60048036038101906101799190612230565b6105b5565b60405161018b9190612278565b60405180910390f35b3480156101a057600080fd5b506101a96107ad565b6040516101b69190612323565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e1919061237b565b61083b565b6040516101f391906123e9565b60405180910390f35b61021660048036038101906102119190612430565b610878565b005b34801561022457600080fd5b5061022d610994565b60405161023a919061247f565b60405180910390f35b61025d6004803603810190610258919061249a565b6109a1565b005b34801561026b57600080fd5b5061028660048036038101906102819190612430565b610a10565b604051610293919061247f565b60405180910390f35b6102b660048036038101906102b1919061249a565b610ac1565b005b3480156102c457600080fd5b506102df60048036038101906102da9190612430565b610b30565b6040516102ec9190612278565b60405180910390f35b34801561030157600080fd5b5061031c6004803603810190610317919061237b565b610e0a565b604051610329919061247f565b60405180910390f35b34801561033e57600080fd5b506103596004803603810190610354919061237b565b610e32565b604051610366919061247f565b60405180910390f35b34801561037b57600080fd5b506103966004803603810190610391919061237b565b610e72565b6040516103a391906123e9565b60405180910390f35b3480156103b857600080fd5b506103d360048036038101906103ce91906124ed565b610eaf565b6040516103e0919061247f565b60405180910390f35b3480156103f557600080fd5b506103fe610ef8565b60405161040b91906123e9565b60405180910390f35b34801561042057600080fd5b50610429610f1c565b6040516104369190612323565b60405180910390f35b34801561044b57600080fd5b5061046660048036038101906104619190612546565b610faa565b005b610482600480360381019061047d91906126bb565b61124c565b005b34801561049057600080fd5b506104ab60048036038101906104a691906124ed565b611370565b6040516104b8919061247f565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e3919061237b565b611388565b6040516104f59190612323565b60405180910390f35b34801561050a57600080fd5b5061052560048036038101906105209190612774565b6113ce565b6040516105329190612323565b60405180910390f35b34801561054757600080fd5b50610562600480360381019061055d91906127a1565b6119e9565b60405161056f9190612278565b60405180910390f35b34801561058457600080fd5b5061059f600480360381019061059a91906124ed565b611a81565b6040516105ac9190612278565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361060957600190506107a8565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361065b57600190506107a8565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106ad57600190506107a8565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106ff57600190506107a8565b63f1b0aa157c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361075157600190506107a8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036107a357600190506107a8565b600090505b919050565b600b80546107ba90612810565b80601f01602080910402602001604051908101604052809291908181526020018280546107e690612810565b80156108335780601f1061080857610100808354040283529160200191610833565b820191906000526020600020905b81548152906001019060200180831161081657829003601f168201915b505050505081565b60006008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e357600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000600180549050905090565b60606109af84848484611c37565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548210610a5d57600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610aae57610aad612841565b5b9060005260206000200154905092915050565b6060610acf84848484611c37565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8a57600080fd5b600060036000848152602001908152602001600020541480610bb157506000600180549050145b610bba57600080fd5b600080600180549050915083905060018190806001815401808255809150506001900390600052602060002001600090919091909150558160036000838152602001908152602001600020819055506002439080600181540180825580915050600190039060005260206000200160009091909190915055846004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360066000600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050815260200190815260200160002081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610d949061289f565b91905055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f886604051610df6919061247f565b60405180910390a360019250505092915050565b600060018281548110610e2057610e1f612841565b5b90600052602060002001549050919050565b6000806003600084815260200190815260200160002054905060028181548110610e5f57610e5e612841565b5b9060005260206000200154915050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c8054610f2990612810565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5590612810565b8015610fa25780601f10610f7757610100808354040283529160200191610fa2565b820191906000526020600020905b815481529060010190602001808311610f8557829003601f168201915b505050505081565b80156110cb57600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461104857600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111e3565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361116357600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112409190612278565b60405180910390a35050565b61125884848484611c37565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e600a60008781526020019081526020016000206001600a60008981526020019081526020016000208054905061133991906128e7565b8154811061134a57611349612841565b5b9060005260206000200154604051611362919061292a565b60405180910390a450505050565b60076020528060005260406000206000915090505481565b60606113c760016003600085815260200190815260200160002054815481106113b4576113b3612841565b5b90600052602060002001546001026113ce565b9050919050565b606080600080604767ffffffffffffffff8111156113ef576113ee612590565b5b6040519080825280601f01601f1916602001820160405280156114215781602001600182028036833780820191505090505b5092507f73000000000000000000000000000000000000000000000000000000000000008360008151811061145957611458612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6800000000000000000000000000000000000000000000000000000000000000836001815181106114bd576114bc612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f61000000000000000000000000000000000000000000000000000000000000008360028151811061152157611520612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f32000000000000000000000000000000000000000000000000000000000000008360038151811061158557611584612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3500000000000000000000000000000000000000000000000000000000000000836004815181106115e9576115e8612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f36000000000000000000000000000000000000000000000000000000000000008360058151811061164d5761164c612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a00000000000000000000000000000000000000000000000000000000000000836006815181106116b1576116b0612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b60208110156119dd57600460f087836020811061170757611706612841565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff1610156117df576030836117769190612952565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106117ab576117aa612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611851565b6057836117ec9190612952565b7f01000000000000000000000000000000000000000000000000000000000000000284838151811061182157611820612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f86826020811061186657611865612841565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff16101561193d576030836118c89190612952565b7f010000000000000000000000000000000000000000000000000000000000000002846001846118f89190612987565b8151811061190957611908612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506119bb565b60578361194a9190612952565b7f0100000000000000000000000000000000000000000000000000000000000000028460018461197a9190612987565b8151811061198b5761198a612841565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b6002826119c89190612987565b915080806119d59061289f565b9150506116e7565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611adc57600080fd5b606060008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b8180549050811015611b9057611b7d8387848481548110611b6c57611b6b612841565b5b906000526020600020015487611c37565b8080611b889061289f565b915050611b48565b50846000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019350505050919050565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508473ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611cda57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611e0e573373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611e0457503373ffffffffffffffffffffffffffffffffffffffff16600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611e0d57600080fd5b5b60006008600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050611eef91906128e7565b81548110611f0057611eff612841565b5b9060005260206000200154600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600660008681526020019081526020016000205481548110611f6f57611f6e612841565b5b9060005260206000200181905550600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611fcd906129bb565b9190505550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906120889061289f565b9190505550836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b82518110156121bc578281815181106120fe576120fd612841565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600a600086815260200190815260200160002060208361218a9190612a13565b8154811061219b5761219a612841565b5b906000526020600020018190555080806121b49061289f565b9150506120e2565b505050505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61220d816121d8565b811461221857600080fd5b50565b60008135905061222a81612204565b92915050565b600060208284031215612246576122456121ce565b5b60006122548482850161221b565b91505092915050565b60008115159050919050565b6122728161225d565b82525050565b600060208201905061228d6000830184612269565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122cd5780820151818401526020810190506122b2565b60008484015250505050565b6000601f19601f8301169050919050565b60006122f582612293565b6122ff818561229e565b935061230f8185602086016122af565b612318816122d9565b840191505092915050565b6000602082019050818103600083015261233d81846122ea565b905092915050565b6000819050919050565b61235881612345565b811461236357600080fd5b50565b6000813590506123758161234f565b92915050565b600060208284031215612391576123906121ce565b5b600061239f84828501612366565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123d3826123a8565b9050919050565b6123e3816123c8565b82525050565b60006020820190506123fe60008301846123da565b92915050565b61240d816123c8565b811461241857600080fd5b50565b60008135905061242a81612404565b92915050565b60008060408385031215612447576124466121ce565b5b60006124558582860161241b565b925050602061246685828601612366565b9150509250929050565b61247981612345565b82525050565b60006020820190506124946000830184612470565b92915050565b6000806000606084860312156124b3576124b26121ce565b5b60006124c18682870161241b565b93505060206124d28682870161241b565b92505060406124e386828701612366565b9150509250925092565b600060208284031215612503576125026121ce565b5b60006125118482850161241b565b91505092915050565b6125238161225d565b811461252e57600080fd5b50565b6000813590506125408161251a565b92915050565b6000806040838503121561255d5761255c6121ce565b5b600061256b8582860161241b565b925050602061257c85828601612531565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125c8826122d9565b810181811067ffffffffffffffff821117156125e7576125e6612590565b5b80604052505050565b60006125fa6121c4565b905061260682826125bf565b919050565b600067ffffffffffffffff82111561262657612625612590565b5b61262f826122d9565b9050602081019050919050565b82818337600083830152505050565b600061265e6126598461260b565b6125f0565b90508281526020810184848401111561267a5761267961258b565b5b61268584828561263c565b509392505050565b600082601f8301126126a2576126a1612586565b5b81356126b284826020860161264b565b91505092915050565b600080600080608085870312156126d5576126d46121ce565b5b60006126e38782880161241b565b94505060206126f48782880161241b565b935050604061270587828801612366565b925050606085013567ffffffffffffffff811115612726576127256121d3565b5b6127328782880161268d565b91505092959194509250565b6000819050919050565b6127518161273e565b811461275c57600080fd5b50565b60008135905061276e81612748565b92915050565b60006020828403121561278a576127896121ce565b5b60006127988482850161275f565b91505092915050565b600080604083850312156127b8576127b76121ce565b5b60006127c68582860161241b565b92505060206127d78582860161241b565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061282857607f821691505b60208210810361283b5761283a6127e1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006128aa82612345565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036128dc576128db612870565b5b600182019050919050565b60006128f282612345565b91506128fd83612345565b925082820390508181111561291557612914612870565b5b92915050565b6129248161273e565b82525050565b600060208201905061293f600083018461291b565b92915050565b600060ff82169050919050565b600061295d82612945565b915061296883612945565b9250828201905060ff81111561298157612980612870565b5b92915050565b600061299282612345565b915061299d83612345565b92508282019050808211156129b5576129b4612870565b5b92915050565b60006129c682612345565b9150600082036129d9576129d8612870565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612a1e82612345565b9150612a2983612345565b925082612a3957612a386129e4565b5b82820690509291505056fea26469706673582212204305ff2a0513a86fec10bb960dc2604b256e38064f691660a31a3278d71f275c64736f6c63430008120033 +\ No newline at end of file diff --git a/python/eth_badgetoken/data/BadgeToken.json b/python/eth_badgetoken/data/BadgeToken.json @@ -1 +1 @@ -[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_declarator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"TransferWithData","type":"event"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"declarator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenOwnerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] +[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"TransferWithData","type":"event"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"createdAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenOwnerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/python/eth_badgetoken/token.py b/python/eth_badgetoken/token.py @@ -85,12 +85,12 @@ class BadgeToken(ERC721): return tx - def minted_at(self, contract_address, token_id, sender_address=ZERO_ADDRESS, id_generator=None): + def created_at(self, contract_address, token_id, sender_address=ZERO_ADDRESS, id_generator=None): j = JSONRPCRequest(id_generator) o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() - enc.method('mintedAt') + enc.method('createdAt') enc.typ(ABIContractType.UINT256) enc.uint256(token_id) data = add_0x(enc.get()) @@ -103,7 +103,7 @@ class BadgeToken(ERC721): @classmethod - def parse_minted_at(self, v): + def parse_created_at(self, v): return abi_decode_single(ABIContractType.UINT256, v) diff --git a/python/eth_badgetoken/unittest/base.py b/python/eth_badgetoken/unittest/base.py @@ -8,6 +8,7 @@ import logging from chainlib.eth.unittest.ethtester import EthTesterCase from chainlib.connection import RPCConnection from chainlib.eth.nonce import RPCNonceOracle +from chainlib.eth.block import block_latest from chainlib.eth.address import to_checksum_address from chainlib.eth.tx import ( receipt, diff --git a/python/eth_badgetoken/unittest/interface.py b/python/eth_badgetoken/unittest/interface.py @@ -0,0 +1,23 @@ +from chainlib.eth.block import block_latest + +# local imports +from eth_erc721.unittest.enum import TestInterface as TestInterfaceBase + + +class TestInterface(TestInterfaceBase): + + def test_minted_at(self): + o = block_latest() + r = self.rpc.do(o) + block_start = int(r) + + self.backend.mine_blocks(42) + + token_bytes = b'\xee' * 32 + token_id = int.from_bytes(token_bytes, byteorder='big') + c = self._mint(self.accounts[1], token_id) + + o = c.created_at(self.address, token_id, sender_address=self.accounts[0]) + r = self.rpc.do(o) + height = c.parse_created_at(r) + self.assertEqual(height, block_start + 42 + 1) diff --git a/python/eth_erc721/unittest/base.py b/python/eth_erc721/unittest/base.py @@ -6,7 +6,6 @@ from hexathon import strip_0x from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.tx import receipt from chainlib.eth.constant import ZERO_ADDRESS -from chainlib.eth.block import block_latest from chainlib.jsonrpc import JSONRPCException # local imports @@ -74,12 +73,6 @@ class TestInterface: self.assertEqual(strip_0x(self.accounts[4]), owner_address) def test_mint(self): - o = block_latest() - r = self.rpc.do(o) - block_start = int(r) - - self.backend.mine_blocks(42) - token_bytes = b'\xee' * 32 token_id = int.from_bytes(token_bytes, byteorder='big') c = self._mint(self.accounts[1], token_id) @@ -93,12 +86,6 @@ class TestInterface: supply = c.parse_total_supply(r) self.assertEqual(supply, 1) - o = c.minted_at(self.address, token_id, sender_address=self.accounts[0]) - r = self.rpc.do(o) - height = c.parse_minted_at(r) - - self.assertEqual(height, block_start + 42 + 1) - def test_approve(self): token_bytes = b'\xee' * 32 diff --git a/python/tests/test_app.py b/python/tests/test_app.py @@ -7,7 +7,7 @@ from eth_owned.unittest import TestInterface as TestInterfaceOwned # local imports from eth_badgetoken.unittest import TestBadgeToken -from eth_erc721.unittest.enum import TestInterface +from eth_badgetoken.unittest.interface import TestInterface logg = logging.getLogger() diff --git a/solidity/BadgeToken.sol b/solidity/BadgeToken.sol @@ -27,8 +27,6 @@ contract BadgeToken { // ERC-721 (Metadata - optional) string public symbol; - address public declarator; // Points to Declarator implementer - // ERC-721 event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); // ERC-721 @@ -44,14 +42,12 @@ contract BadgeToken { // Minter event Mint(address indexed _minter, address indexed _beneficiary, uint256 value); - constructor(string memory _name, string memory _symbol, address _declarator) { - declarator = _declarator; + constructor(string memory _name, string memory _symbol) { owner = msg.sender; name = _name; symbol = _symbol; } - // ERC-721 function balanceOf(address _owner) external view returns (uint256) { return tokenOwnerCount[_owner]; @@ -221,8 +217,8 @@ contract BadgeToken { return true; } - // FungibleMinter - function mintedAt(uint256 _tokenId) public view returns (uint256) { + // Chrono + function createdAt(uint256 _tokenId) public view returns (uint256) { uint256 _tokenIndex; _tokenIndex = tokenIndex[_tokenId]; @@ -236,7 +232,7 @@ contract BadgeToken { bytes memory zeroData; address previousOwner; - uint256[] memory currentTokenOwnerIndex; // investigate; if source is storage, which of memory or storage does a copy + uint256[] storage currentTokenOwnerIndex; previousOwner = owner; currentTokenOwnerIndex = tokenOwnerIndex[previousOwner];