commit ee2df333b0cc104d600cdda7334f6a75d0f29528
parent 26618b5ffd83a607b4b9775a7582f14d32079c12
Author: lash <dev@holbrook.no>
Date: Fri, 16 Dec 2022 20:31:11 +0000
Fix batchof cumulative count check
Diffstat:
4 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/python/eth_craft_nft/data/CraftNFT.bin b/python/eth_craft_nft/data/CraftNFT.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b506040516200273338038062002733833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b61213080620006036000396000f3fe608060405260043610610147576000357c0100000000000000000000000000000000000000000000000000000000900480636352211e116100c8578063a22cb4651161008c578063a22cb46514610469578063b88d4fde14610492578063b9adc41b146104ae578063bee2c0b5146104eb578063e985e9c514610528578063f9613ab21461056557610147565b80636352211e1461035c57806370a08231146103995780638da5cb5b146103d657806395d89b4114610401578063a06561aa1461042c57610147565b806342842e0e1161010f57806342842e0e1461024a5780634d03546a146102665780634f64b2be146102a3578063559f5dc9146102e057806357cbf6921461031f57610147565b806301ffc9a71461014c57806306fdde0314610189578063081812fc146101b457806323b872dd146101f157806324e0febc1461020d575b600080fd5b34801561015857600080fd5b50610173600480360381019061016e91906117a3565b6105a2565b60405161018091906117eb565b60405180910390f35b34801561019557600080fd5b5061019e6106f6565b6040516101ab9190611896565b60405180910390f35b3480156101c057600080fd5b506101db60048036038101906101d691906118ee565b610784565b6040516101e8919061195c565b60405180910390f35b61020b600480360381019061020691906119a3565b6107c1565b005b34801561021957600080fd5b50610234600480360381019061022f9190611a2c565b610830565b6040516102419190611a68565b60405180910390f35b610264600480360381019061025f91906119a3565b610848565b005b34801561027257600080fd5b5061028d60048036038101906102889190611ac1565b6108b7565b60405161029a91906117eb565b60405180910390f35b3480156102af57600080fd5b506102ca60048036038101906102c591906118ee565b610a69565b6040516102d79190611a68565b60405180910390f35b3480156102ec57600080fd5b5061030760048036038101906103029190611b01565b610a8d565b60405161031693929190611b6c565b60405180910390f35b34801561032b57600080fd5b5061034660048036038101906103419190611ba3565b610b01565b6040516103539190611a68565b60405180910390f35b34801561036857600080fd5b50610383600480360381019061037e91906118ee565b610b8a565b604051610390919061195c565b60405180910390f35b3480156103a557600080fd5b506103c060048036038101906103bb9190611be3565b610bc6565b6040516103cd9190611c1f565b60405180910390f35b3480156103e257600080fd5b506103eb610bcd565b6040516103f8919061195c565b60405180910390f35b34801561040d57600080fd5b50610416610bf1565b6040516104239190611896565b60405180910390f35b34801561043857600080fd5b50610453600480360381019061044e9190611c3a565b610c7f565b6040516104609190611a68565b60405180910390f35b34801561047557600080fd5b50610490600480360381019061048b9190611cb9565b610e85565b005b6104ac60048036038101906104a79190611e2e565b611127565b005b3480156104ba57600080fd5b506104d560048036038101906104d09190611a2c565b6111fe565b6040516104e291906117eb565b60405180910390f35b3480156104f757600080fd5b50610512600480360381019061050d9190611eb1565b611230565b60405161051f9190611f1d565b60405180910390f35b34801561053457600080fd5b5061054f600480360381019061054a9190611f38565b611303565b60405161055c91906117eb565b60405180910390f35b34801561057157600080fd5b5061058c60048036038101906105879190611a2c565b61139b565b6040516105999190611a68565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105f657600190506106f1565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361064857600190506106f1565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361069a57600190506106f1565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106ec57600190506106f1565b600090505b919050565b6006805461070390611fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461072f90611fa7565b801561077c5780601f106107515761010080835404028352916020019161077c565b820191906000526020600020905b81548152906001019060200180831161075f57829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60606107cf84848484611408565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b606061085684848484611408565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091257600080fd5b61091a611703565b6000600260008681526020019081526020016000208054905011156109945760006002600086815260200190815260200160002060008154811061096157610960611fd8565b5b9060005260206000200160000160019054906101000a900465ffffffffffff1665ffffffffffff161161099357600080fd5b5b82816020019065ffffffffffff16908165ffffffffffff168152505060026000858152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548165ffffffffffff021916908365ffffffffffff16021790555060408201518160000160076101000a81548165ffffffffffff021916908365ffffffffffff16021790555050505092915050565b60018181548110610a7957600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610aa957600080fd5b90600052602060002001600091509150508060000160009054906101000a900460ff16908060000160019054906101000a900465ffffffffffff16908060000160079054906101000a900465ffffffffffff16905083565b6000806000600102600360008681526020019081526020016000205414610b2757600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1690507f8000000000000000000000000000000000000000000000000000000000000000811790508060010260036000868152602001908152602001600020819055508391505092915050565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610bfe90611fa7565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2a90611fa7565b8015610c775780601f10610c4c57610100808354040283529160200191610c77565b820191906000526020600020905b815481529060010190602001808311610c5a57829003601f168201915b505050505081565b600080600080600260008881526020019081526020016000208681548110610caa57610ca9611fd8565b5b90600052602060002001905060008160000160019054906101000a900465ffffffffffff1665ffffffffffff16148015610d02575060008160000160019054906101000a900465ffffffffffff1665ffffffffffff16145b15610d1b57610d118786610b01565b9350505050610e7e565b8060000160019054906101000a900465ffffffffffff1665ffffffffffff168160000160079054906101000a900465ffffffffffff1665ffffffffffff1610610d6357600080fd5b65ffffffffffff876001900416915060c8829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508473ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000087600190041692506028869060020a02831792508060000160079054906101000a900465ffffffffffff1665ffffffffffff168317925081600102600360008560010281526020019081526020016000208190555060018160000160078282829054906101000a900465ffffffffffff16610e589190612036565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055505050505b9392505050565b8015610fa657600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2357600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110be565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361103e57600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161111b91906117eb565b60405180910390a35050565b61113384848484611408565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516111f09190611a68565b60405180910390a450505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000808290505b60026000868152602001908152602001600020805490508110156112d757836fffffffffffffffffffffffffffffffff1660026000878152602001908152602001600020828154811061128d5761128c611fd8565b5b9060005260206000200160000160019054906101000a900465ffffffffffff1665ffffffffffff1611156112c457809150506112fc565b80806112cf90612070565b915050611237565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b600080600360008481526020019081526020016000205490506113bd816111fe565b6113c657600080fd5b60a081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000060010283168117905080915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161145f9190611c1f565b602060405180830381865afa15801561147c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a091906120cd565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114da57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161461160e573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061160457503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61160d57600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061166b8385611672565b5050505050565b6000808360010290506003600082815260200190815260200160002054600190049150600082036116a257600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600060ff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6117808161174b565b811461178b57600080fd5b50565b60008135905061179d81611777565b92915050565b6000602082840312156117b9576117b8611741565b5b60006117c78482850161178e565b91505092915050565b60008115159050919050565b6117e5816117d0565b82525050565b600060208201905061180060008301846117dc565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611840578082015181840152602081019050611825565b60008484015250505050565b6000601f19601f8301169050919050565b600061186882611806565b6118728185611811565b9350611882818560208601611822565b61188b8161184c565b840191505092915050565b600060208201905081810360008301526118b0818461185d565b905092915050565b6000819050919050565b6118cb816118b8565b81146118d657600080fd5b50565b6000813590506118e8816118c2565b92915050565b60006020828403121561190457611903611741565b5b6000611912848285016118d9565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119468261191b565b9050919050565b6119568161193b565b82525050565b6000602082019050611971600083018461194d565b92915050565b6119808161193b565b811461198b57600080fd5b50565b60008135905061199d81611977565b92915050565b6000806000606084860312156119bc576119bb611741565b5b60006119ca8682870161198e565b93505060206119db8682870161198e565b92505060406119ec868287016118d9565b9150509250925092565b6000819050919050565b611a09816119f6565b8114611a1457600080fd5b50565b600081359050611a2681611a00565b92915050565b600060208284031215611a4257611a41611741565b5b6000611a5084828501611a17565b91505092915050565b611a62816119f6565b82525050565b6000602082019050611a7d6000830184611a59565b92915050565b600065ffffffffffff82169050919050565b611a9e81611a83565b8114611aa957600080fd5b50565b600081359050611abb81611a95565b92915050565b60008060408385031215611ad857611ad7611741565b5b6000611ae685828601611a17565b9250506020611af785828601611aac565b9150509250929050565b60008060408385031215611b1857611b17611741565b5b6000611b2685828601611a17565b9250506020611b37858286016118d9565b9150509250929050565b600060ff82169050919050565b611b5781611b41565b82525050565b611b6681611a83565b82525050565b6000606082019050611b816000830186611b4e565b611b8e6020830185611b5d565b611b9b6040830184611b5d565b949350505050565b60008060408385031215611bba57611bb9611741565b5b6000611bc885828601611a17565b9250506020611bd98582860161198e565b9150509250929050565b600060208284031215611bf957611bf8611741565b5b6000611c078482850161198e565b91505092915050565b611c19816118b8565b82525050565b6000602082019050611c346000830184611c10565b92915050565b600080600060608486031215611c5357611c52611741565b5b6000611c6186828701611a17565b9350506020611c72868287016118d9565b9250506040611c838682870161198e565b9150509250925092565b611c96816117d0565b8114611ca157600080fd5b50565b600081359050611cb381611c8d565b92915050565b60008060408385031215611cd057611ccf611741565b5b6000611cde8582860161198e565b9250506020611cef85828601611ca4565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611d3b8261184c565b810181811067ffffffffffffffff82111715611d5a57611d59611d03565b5b80604052505050565b6000611d6d611737565b9050611d798282611d32565b919050565b600067ffffffffffffffff821115611d9957611d98611d03565b5b611da28261184c565b9050602081019050919050565b82818337600083830152505050565b6000611dd1611dcc84611d7e565b611d63565b905082815260208101848484011115611ded57611dec611cfe565b5b611df8848285611daf565b509392505050565b600082601f830112611e1557611e14611cf9565b5b8135611e25848260208601611dbe565b91505092915050565b60008060008060808587031215611e4857611e47611741565b5b6000611e568782880161198e565b9450506020611e678782880161198e565b9350506040611e78878288016118d9565b925050606085013567ffffffffffffffff811115611e9957611e98611746565b5b611ea587828801611e00565b91505092959194509250565b600080600060608486031215611eca57611ec9611741565b5b6000611ed886828701611a17565b9350506020611ee9868287016118d9565b9250506040611efa868287016118d9565b9150509250925092565b6000819050919050565b611f1781611f04565b82525050565b6000602082019050611f326000830184611f0e565b92915050565b60008060408385031215611f4f57611f4e611741565b5b6000611f5d8582860161198e565b9250506020611f6e8582860161198e565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611fbf57607f821691505b602082108103611fd257611fd1611f78565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061204182611a83565b915061204c83611a83565b9250828201905065ffffffffffff81111561206a57612069612007565b5b92915050565b600061207b826118b8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120ad576120ac612007565b5b600182019050919050565b6000815190506120c781611977565b92915050565b6000602082840312156120e3576120e2611741565b5b60006120f1848285016120b8565b9150509291505056fea2646970667358221220ec1ffb70506a7ad118785abe9446feb1fa687f94705e74bb31570293793fca8064736f6c63430008110033
-\ No newline at end of file
+60806040523480156200001157600080fd5b506040516200284a3803806200284a833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b61224780620006036000396000f3fe608060405260043610610147576000357c0100000000000000000000000000000000000000000000000000000000900480636352211e116100c8578063a22cb4651161008c578063a22cb4651461046a578063b88d4fde14610493578063b9adc41b146104af578063bee2c0b5146104ec578063e985e9c514610529578063f9613ab21461056657610147565b80636352211e1461035d57806370a082311461039a5780638da5cb5b146103d757806395d89b4114610402578063a06561aa1461042d57610147565b806342842e0e1161010f57806342842e0e1461024a5780634d03546a146102665780634f64b2be146102a3578063559f5dc9146102e057806357cbf6921461032057610147565b806301ffc9a71461014c57806306fdde0314610189578063081812fc146101b457806323b872dd146101f157806324e0febc1461020d575b600080fd5b34801561015857600080fd5b50610173600480360381019061016e9190611878565b6105a3565b60405161018091906118c0565b60405180910390f35b34801561019557600080fd5b5061019e6106f7565b6040516101ab919061196b565b60405180910390f35b3480156101c057600080fd5b506101db60048036038101906101d691906119c3565b610785565b6040516101e89190611a31565b60405180910390f35b61020b60048036038101906102069190611a78565b6107c2565b005b34801561021957600080fd5b50610234600480360381019061022f9190611b01565b610831565b6040516102419190611b3d565b60405180910390f35b610264600480360381019061025f9190611a78565b610849565b005b34801561027257600080fd5b5061028d60048036038101906102889190611b96565b6108b8565b60405161029a91906118c0565b60405180910390f35b3480156102af57600080fd5b506102ca60048036038101906102c591906119c3565b610b17565b6040516102d79190611b3d565b60405180910390f35b3480156102ec57600080fd5b5061030760048036038101906103029190611bd6565b610b3b565b6040516103179493929190611c41565b60405180910390f35b34801561032c57600080fd5b5061034760048036038101906103429190611c86565b610bc7565b6040516103549190611b3d565b60405180910390f35b34801561036957600080fd5b50610384600480360381019061037f91906119c3565b610c50565b6040516103919190611a31565b60405180910390f35b3480156103a657600080fd5b506103c160048036038101906103bc9190611cc6565b610c8c565b6040516103ce9190611d02565b60405180910390f35b3480156103e357600080fd5b506103ec610c93565b6040516103f99190611a31565b60405180910390f35b34801561040e57600080fd5b50610417610cb7565b604051610424919061196b565b60405180910390f35b34801561043957600080fd5b50610454600480360381019061044f9190611d1d565b610d45565b6040516104619190611b3d565b60405180910390f35b34801561047657600080fd5b50610491600480360381019061048c9190611d9c565b610f4b565b005b6104ad60048036038101906104a89190611f11565b6111ed565b005b3480156104bb57600080fd5b506104d660048036038101906104d19190611b01565b6112c4565b6040516104e391906118c0565b60405180910390f35b3480156104f857600080fd5b50610513600480360381019061050e9190611f94565b6112f6565b6040516105209190612000565b60405180910390f35b34801561053557600080fd5b50610550600480360381019061054b919061201b565b6113c9565b60405161055d91906118c0565b60405180910390f35b34801561057257600080fd5b5061058d60048036038101906105889190611b01565b611461565b60405161059a9190611b3d565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105f757600190506106f2565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361064957600190506106f2565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361069b57600190506106f2565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106ed57600190506106f2565b600090505b919050565b600680546107049061208a565b80601f01602080910402602001604051908101604052809291908181526020018280546107309061208a565b801561077d5780601f106107525761010080835404028352916020019161077d565b820191906000526020600020905b81548152906001019060200180831161076057829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60606107d0848484846114ce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b6060610857848484846114ce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091657600080fd5b61091e6117c9565b6002600087815260200190815260200160002080549050925060008311156109ee57600060026000888152602001908152602001600020600081548110610968576109676120bb565b5b9060005260206000200160000160019054906101000a900465ffffffffffff1665ffffffffffff161161099a57600080fd5b600260008781526020019081526020016000206001846109ba9190612119565b815481106109cb576109ca6120bb565b5b9060005260206000200160000160079054906101000a900465ffffffffffff1691505b84816020019065ffffffffffff16908165ffffffffffff16815250508482610a16919061214d565b816040019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548165ffffffffffff021916908365ffffffffffff16021790555060408201518160000160076101000a81548165ffffffffffff021916908365ffffffffffff160217905550606082015181600001600d6101000a81548165ffffffffffff021916908365ffffffffffff160217905550505050505092915050565b60018181548110610b2757600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610b5757600080fd5b90600052602060002001600091509150508060000160009054906101000a900460ff16908060000160019054906101000a900465ffffffffffff16908060000160079054906101000a900465ffffffffffff169080600001600d9054906101000a900465ffffffffffff16905084565b6000806000600102600360008681526020019081526020016000205414610bed57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1690507f8000000000000000000000000000000000000000000000000000000000000000811790508060010260036000868152602001908152602001600020819055508391505092915050565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610cc49061208a565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf09061208a565b8015610d3d5780601f10610d1257610100808354040283529160200191610d3d565b820191906000526020600020905b815481529060010190602001808311610d2057829003601f168201915b505050505081565b600080600080600260008881526020019081526020016000208681548110610d7057610d6f6120bb565b5b90600052602060002001905060008160000160019054906101000a900465ffffffffffff1665ffffffffffff16148015610dc8575060008160000160019054906101000a900465ffffffffffff1665ffffffffffff16145b15610de157610dd78786610bc7565b9350505050610f44565b8060000160019054906101000a900465ffffffffffff1665ffffffffffff1681600001600d9054906101000a900465ffffffffffff1665ffffffffffff1610610e2957600080fd5b65ffffffffffff876001900416915060c8829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508473ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000087600190041692506028869060020a028317925080600001600d9054906101000a900465ffffffffffff1665ffffffffffff1683179250816001026003600085600102815260200190815260200160002081905550600181600001600d8282829054906101000a900465ffffffffffff16610f1e919061214d565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055505050505b9392505050565b801561106c57600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fe957600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611184565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361110457600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516111e191906118c0565b60405180910390a35050565b6111f9848484846114ce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516112b69190611b3d565b60405180910390a450505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000808290505b600260008681526020019081526020016000208054905081101561139d57836fffffffffffffffffffffffffffffffff16600260008781526020019081526020016000208281548110611353576113526120bb565b5b9060005260206000200160000160079054906101000a900465ffffffffffff1665ffffffffffff16111561138a57809150506113c2565b808061139590612187565b9150506112fd565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611483816112c4565b61148c57600080fd5b60a081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000060010283168117905080915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016115259190611d02565b602060405180830381865afa158015611542573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156691906121e4565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146115a057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146116d4573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806116ca57503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6116d357600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117318385611738565b5050505050565b60008083600102905060036000828152602001908152602001600020546001900491506000820361176857600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060800160405280600060ff168152602001600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61185581611820565b811461186057600080fd5b50565b6000813590506118728161184c565b92915050565b60006020828403121561188e5761188d611816565b5b600061189c84828501611863565b91505092915050565b60008115159050919050565b6118ba816118a5565b82525050565b60006020820190506118d560008301846118b1565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156119155780820151818401526020810190506118fa565b60008484015250505050565b6000601f19601f8301169050919050565b600061193d826118db565b61194781856118e6565b93506119578185602086016118f7565b61196081611921565b840191505092915050565b600060208201905081810360008301526119858184611932565b905092915050565b6000819050919050565b6119a08161198d565b81146119ab57600080fd5b50565b6000813590506119bd81611997565b92915050565b6000602082840312156119d9576119d8611816565b5b60006119e7848285016119ae565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a1b826119f0565b9050919050565b611a2b81611a10565b82525050565b6000602082019050611a466000830184611a22565b92915050565b611a5581611a10565b8114611a6057600080fd5b50565b600081359050611a7281611a4c565b92915050565b600080600060608486031215611a9157611a90611816565b5b6000611a9f86828701611a63565b9350506020611ab086828701611a63565b9250506040611ac1868287016119ae565b9150509250925092565b6000819050919050565b611ade81611acb565b8114611ae957600080fd5b50565b600081359050611afb81611ad5565b92915050565b600060208284031215611b1757611b16611816565b5b6000611b2584828501611aec565b91505092915050565b611b3781611acb565b82525050565b6000602082019050611b526000830184611b2e565b92915050565b600065ffffffffffff82169050919050565b611b7381611b58565b8114611b7e57600080fd5b50565b600081359050611b9081611b6a565b92915050565b60008060408385031215611bad57611bac611816565b5b6000611bbb85828601611aec565b9250506020611bcc85828601611b81565b9150509250929050565b60008060408385031215611bed57611bec611816565b5b6000611bfb85828601611aec565b9250506020611c0c858286016119ae565b9150509250929050565b600060ff82169050919050565b611c2c81611c16565b82525050565b611c3b81611b58565b82525050565b6000608082019050611c566000830187611c23565b611c636020830186611c32565b611c706040830185611c32565b611c7d6060830184611c32565b95945050505050565b60008060408385031215611c9d57611c9c611816565b5b6000611cab85828601611aec565b9250506020611cbc85828601611a63565b9150509250929050565b600060208284031215611cdc57611cdb611816565b5b6000611cea84828501611a63565b91505092915050565b611cfc8161198d565b82525050565b6000602082019050611d176000830184611cf3565b92915050565b600080600060608486031215611d3657611d35611816565b5b6000611d4486828701611aec565b9350506020611d55868287016119ae565b9250506040611d6686828701611a63565b9150509250925092565b611d79816118a5565b8114611d8457600080fd5b50565b600081359050611d9681611d70565b92915050565b60008060408385031215611db357611db2611816565b5b6000611dc185828601611a63565b9250506020611dd285828601611d87565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611e1e82611921565b810181811067ffffffffffffffff82111715611e3d57611e3c611de6565b5b80604052505050565b6000611e5061180c565b9050611e5c8282611e15565b919050565b600067ffffffffffffffff821115611e7c57611e7b611de6565b5b611e8582611921565b9050602081019050919050565b82818337600083830152505050565b6000611eb4611eaf84611e61565b611e46565b905082815260208101848484011115611ed057611ecf611de1565b5b611edb848285611e92565b509392505050565b600082601f830112611ef857611ef7611ddc565b5b8135611f08848260208601611ea1565b91505092915050565b60008060008060808587031215611f2b57611f2a611816565b5b6000611f3987828801611a63565b9450506020611f4a87828801611a63565b9350506040611f5b878288016119ae565b925050606085013567ffffffffffffffff811115611f7c57611f7b61181b565b5b611f8887828801611ee3565b91505092959194509250565b600080600060608486031215611fad57611fac611816565b5b6000611fbb86828701611aec565b9350506020611fcc868287016119ae565b9250506040611fdd868287016119ae565b9150509250925092565b6000819050919050565b611ffa81611fe7565b82525050565b60006020820190506120156000830184611ff1565b92915050565b6000806040838503121561203257612031611816565b5b600061204085828601611a63565b925050602061205185828601611a63565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806120a257607f821691505b6020821081036120b5576120b461205b565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006121248261198d565b915061212f8361198d565b9250828203905081811115612147576121466120ea565b5b92915050565b600061215882611b58565b915061216383611b58565b9250828201905065ffffffffffff811115612181576121806120ea565b5b92915050565b60006121928261198d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036121c4576121c36120ea565b5b600182019050919050565b6000815190506121de81611a4c565b92915050565b6000602082840312156121fa576121f9611816565b5b6000612208848285016121cf565b9150509291505056fea2646970667358221220a6276d6fde1858023f685db73f817a45cde05eb4e959bae96c34fdffebf3356364736f6c63430008110033
+\ No newline at end of file
diff --git a/python/eth_craft_nft/data/CraftNFT.json b/python/eth_craft_nft/data/CraftNFT.json
@@ -1 +1 @@
-[{"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":"_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":"bytes32","name":"content","type":"bytes32"},{"internalType":"uint48","name":"count","type":"uint48"}],"name":"allocate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_superIndex","type":"uint256"},{"internalType":"uint256","name":"_startAt","type":"uint256"}],"name":"batchOf","outputs":[{"internalType":"int256","name":"","type":"int256"}],"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":"bytes32","name":"_truncatedId","type":"bytes32"}],"name":"getDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_tokenContent","type":"bytes32"}],"name":"isActiveContent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_batch","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"mintFromBatchTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"mintTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"mintedToken","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"token","outputs":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"uint48","name":"count","type":"uint48"},{"internalType":"uint48","name":"cursor","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"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":"_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":"bytes32","name":"content","type":"bytes32"},{"internalType":"uint48","name":"count","type":"uint48"}],"name":"allocate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_superIndex","type":"uint256"},{"internalType":"uint256","name":"_startAt","type":"uint256"}],"name":"batchOf","outputs":[{"internalType":"int256","name":"","type":"int256"}],"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":"bytes32","name":"_truncatedId","type":"bytes32"}],"name":"getDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_tokenContent","type":"bytes32"}],"name":"isActiveContent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_batch","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"mintFromBatchTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"mintTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"mintedToken","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"token","outputs":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"uint48","name":"count","type":"uint48"},{"internalType":"uint48","name":"cumulativeCount","type":"uint48"},{"internalType":"uint48","name":"cursor","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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"}]
diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py
@@ -95,12 +95,12 @@ class Test(EthTesterCase):
batch = c.parse_batch_of(r)
self.assertEqual(batch, 1)
- o = c.batch_of(self.address, hash_of_foo, 19, sender_address=self.accounts[0])
+ o = c.batch_of(self.address, hash_of_foo, 29, sender_address=self.accounts[0])
r = self.rpc.do(o)
batch = c.parse_batch_of(r)
self.assertEqual(batch, 1)
- o = c.batch_of(self.address, hash_of_foo, 20, sender_address=self.accounts[0])
+ o = c.batch_of(self.address, hash_of_foo, 30, sender_address=self.accounts[0])
r = self.rpc.do(o)
with self.assertRaises(InvalidBatchError):
batch = c.parse_batch_of(r)
@@ -149,7 +149,7 @@ class Test(EthTesterCase):
self.rpc.do(o)
o = receipt(tx_hash_hex)
r = self.conn.do(o)
- self.assertEqual(r['status'], 1)
+ self.assertEqual(r['status'], 0)
(tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], hash_of_foo, 0, self.accounts[1])
self.rpc.do(o)
@@ -163,6 +163,12 @@ class Test(EthTesterCase):
r = self.conn.do(o)
self.assertEqual(r['status'], 0)
+ (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], hash_of_foo, 1, self.accounts[1])
+ self.rpc.do(o)
+ o = receipt(tx_hash_hex)
+ r = self.conn.do(o)
+ self.assertEqual(r['status'], 0)
+
(tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], hash_of_foo, 0, self.accounts[2])
self.rpc.do(o)
o = receipt(tx_hash_hex)
@@ -239,5 +245,30 @@ class Test(EthTesterCase):
self.assertTrue(is_same_address(owner[24:], self.accounts[2]))
+
+ def test_fill_batches(self):
+ nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
+ c = CraftNFT(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
+ (tx_hash_hex, o) = c.allocate(self.address, self.accounts[0], hash_of_foo, amount=6)
+ self.rpc.do(o)
+
+ (tx_hash_hex, o) = c.allocate(self.address, self.accounts[0], hash_of_foo, amount=8)
+ self.rpc.do(o)
+
+ (tx_hash_hex, o) = c.allocate(self.address, self.accounts[0], hash_of_foo, amount=4)
+ self.rpc.do(o)
+
+ for i in range(4+8+6):
+ o = c.batch_of(self.address, hash_of_foo, i, sender_address=self.accounts[0])
+ r = self.rpc.do(o)
+ batch = c.parse_batch_of(r)
+
+ c.mint_to(self.address, self.accounts[0], hash_of_foo, batch, self.accounts[(i%7)+1])
+ r = self.rpc.do(o)
+ o = receipt(tx_hash_hex)
+ r = self.conn.do(o)
+ self.assertEqual(r['status'], 1)
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/solidity/CraftNFT.sol b/solidity/CraftNFT.sol
@@ -6,6 +6,7 @@ contract CraftNFT {
struct tokenSpec {
uint8 v;
uint48 count;
+ uint48 cumulativeCount;
uint48 cursor;
}
address public owner;
@@ -54,20 +55,25 @@ contract CraftNFT {
// allocate a batch of tokens
function allocate(bytes32 content, uint48 count) public returns (bool) {
+ uint256 l;
+ uint48 _cumulativeCount;
require(msg.sender == owner);
tokenSpec memory _token;
- if (token[content].length > 0) {
+ l = token[content].length;
+ if (l > 0) {
require(token[content][0].count > 0);
+ _cumulativeCount = token[content][l-1].cumulativeCount;
}
_token.count = count;
+ _token.cumulativeCount = _cumulativeCount + count;
token[content].push(_token);
}
function batchOf(bytes32 _content, uint256 _superIndex, uint256 _startAt) public view returns(int256) {
for (uint256 i = _startAt; i < token[_content].length; i++) {
- if (token[_content][i].count > uint128(_superIndex)) {
+ if (token[_content][i].cumulativeCount > uint128(_superIndex)) {
return int256(i);
}
}