craft-nft

A standalone NFT implementation for real-world arts and crafts assets
Log | Files | Refs | README

commit 08f2de4ef465bcdf7ed9d8f388d2cf8197cdbc13
parent b4bf1132d829001419a30bccaaf85e1b465a5554
Author: lash <dev@holbrook.no>
Date:   Fri, 16 Dec 2022 22:09:18 +0000

Add multi test

Diffstat:
Mpython/eth_craft_nft/data/CraftNFT.bin | 4++--
Mpython/tests/test_basic.py | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
Msolidity/CraftNFT.sol | 7+++++++
3 files changed, 102 insertions(+), 6 deletions(-)

diff --git a/python/eth_craft_nft/data/CraftNFT.bin b/python/eth_craft_nft/data/CraftNFT.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b506040516200309838038062003098833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612a9580620006036000396000f3fe608060405260043610610152576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063b88d4fde1161008c578063b88d4fde1461049d578063bee2c0b5146104b9578063c87b56dd146104f6578063c9796c3914610533578063e985e9c514610570578063f9613ab2146105ad57610152565b806370a08231146103a45780638da5cb5b146103e157806395d89b411461040c578063a22cb46514610437578063adf288df1461046057610152565b806325cbaa181161011a57806325cbaa181461025557806342842e0e146102925780634d03546a146102ae5780634f64b2be146102eb578063559f5dc9146103285780636352211e1461036757610152565b806301ffc9a71461015757806306fdde0314610194578063081812fc146101bf57806323b872dd146101fc57806324e0febc14610218575b600080fd5b34801561016357600080fd5b5061017e60048036038101906101799190612038565b6105ea565b60405161018b9190612080565b60405180910390f35b3480156101a057600080fd5b506101a9610790565b6040516101b6919061212b565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190612183565b61081e565b6040516101f391906121f1565b60405180910390f35b61021660048036038101906102119190612238565b61085b565b005b34801561022457600080fd5b5061023f600480360381019061023a91906122c1565b6108ca565b60405161024c91906122fd565b60405180910390f35b34801561026157600080fd5b5061027c60048036038101906102779190612318565b6108e2565b60405161028991906122fd565b60405180910390f35b6102ac60048036038101906102a79190612238565b610b11565b005b3480156102ba57600080fd5b506102d560048036038101906102d091906123a9565b610b80565b6040516102e29190612080565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d9190612183565b610dbe565b60405161031f91906122fd565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a91906123e9565b610de2565b60405161035e93929190612438565b60405180910390f35b34801561037357600080fd5b5061038e60048036038101906103899190612183565b610e5b565b60405161039b91906121f1565b60405180910390f35b3480156103b057600080fd5b506103cb60048036038101906103c6919061246f565b610e97565b6040516103d891906124ab565b60405180910390f35b3480156103ed57600080fd5b506103f6610e9e565b60405161040391906121f1565b60405180910390f35b34801561041857600080fd5b50610421610ec2565b60405161042e919061212b565b60405180910390f35b34801561044357600080fd5b5061045e600480360381019061045991906124f2565b610f50565b005b34801561046c57600080fd5b5061048760048036038101906104829190612532565b6111f2565b60405161049491906122fd565b60405180910390f35b6104b760048036038101906104b291906126a7565b61127b565b005b3480156104c557600080fd5b506104e060048036038101906104db919061272a565b611352565b6040516104ed9190612796565b60405180910390f35b34801561050257600080fd5b5061051d60048036038101906105189190612183565b611425565b60405161052a919061212b565b60405180910390f35b34801561053f57600080fd5b5061055a600480360381019061055591906122c1565b6114d5565b604051610567919061212b565b60405180910390f35b34801561057c57600080fd5b50610597600480360381019061059291906127b1565b611af0565b6040516105a49190612080565b60405180910390f35b3480156105b957600080fd5b506105d460048036038101906105cf91906122c1565b611b88565b6040516105e191906122fd565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361063e576001905061078b565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610690576001905061078b565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106e2576001905061078b565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610734576001905061078b565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610786576001905061078b565b600090505b919050565b6006805461079d90612820565b80601f01602080910402602001604051908101604052809291908181526020018280546107c990612820565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606061086984848484611c34565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b60008060008060026000878152602001908152602001600020858154811061090d5761090c612851565b5b906000526020600020019050600085148015610947575060008160000160009054906101000a900465ffffffffffff1665ffffffffffff16145b156109a857600181600001600c8282829054906101000a900465ffffffffffff1661097291906128af565b92506101000a81548165ffffffffffff021916908365ffffffffffff16021790555061099e87876111f2565b9350505050610b0a565b8060000160009054906101000a900465ffffffffffff1665ffffffffffff1681600001600c9054906101000a900465ffffffffffff1665ffffffffffff16106109f057600080fd5b64ffffffffff866001900416915060d0829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508673ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000086600190041692506014859060020a028317925080600001600c9054906101000a900465ffffffffffff1665ffffffffffff1683179250600181600001600c8282829054906101000a900465ffffffffffff16610ac691906128af565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160010260036000856001028152602001908152602001600020819055505050505b9392505050565b6060610b1f84848484611c34565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bde57600080fd5b610be6611f93565b600260008781526020019081526020016000208054905092506000831115610cb657600060026000888152602001908152602001600020600081548110610c3057610c2f612851565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff1611610c6257600080fd5b60026000878152602001908152602001600020600184610c8291906128e9565b81548110610c9357610c92612851565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1691505b84816000019065ffffffffffff16908165ffffffffffff16815250508482610cde91906128af565b816020019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550505050505092915050565b60018181548110610dce57600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610dfe57600080fd5b90600052602060002001600091509150508060000160009054906101000a900465ffffffffffff16908060000160069054906101000a900465ffffffffffff169080600001600c9054906101000a900465ffffffffffff16905083565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610ecf90612820565b80601f0160208091040260200160405190810160405280929190818152602001828054610efb90612820565b8015610f485780601f10610f1d57610100808354040283529160200191610f48565b820191906000526020600020905b815481529060010190602001808311610f2b57829003601f168201915b505050505081565b801561107157600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fee57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611189565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361110957600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516111e69190612080565b60405180910390a35050565b600080600060010260036000858152602001908152602001600020541461121857600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1690507fc000000000000000000000000000000000000000000000000000000000000000811790508060010260036000858152602001908152602001600020819055508291505092915050565b61128784848484611c34565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e600060010260405161134491906122fd565b60405180910390a450505050565b6000808290505b60026000868152602001908152602001600020805490508110156113f957836fffffffffffffffffffffffffffffffff166002600087815260200190815260200160002082815481106113af576113ae612851565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1665ffffffffffff1611156113e6578091505061141e565b80806113f19061291d565b915050611359565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b606060003073ffffffffffffffffffffffffffffffffffffffff1663f9613ab2846001026040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161148191906122fd565b602060405180830381865afa15801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c2919061297a565b90506114cd816114d5565b915050919050565b606080600080604767ffffffffffffffff8111156114f6576114f561257c565b5b6040519080825280601f01601f1916602001820160405280156115285781602001600182028036833780820191505090505b5092507f7300000000000000000000000000000000000000000000000000000000000000836000815181106115605761155f612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6800000000000000000000000000000000000000000000000000000000000000836001815181106115c4576115c3612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f61000000000000000000000000000000000000000000000000000000000000008360028151811061162857611627612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f32000000000000000000000000000000000000000000000000000000000000008360038151811061168c5761168b612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3500000000000000000000000000000000000000000000000000000000000000836004815181106116f0576116ef612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f36000000000000000000000000000000000000000000000000000000000000008360058151811061175457611753612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a00000000000000000000000000000000000000000000000000000000000000836006815181106117b8576117b7612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611ae457600460f087836020811061180e5761180d612851565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff1610156118e65760308361187d91906129b4565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106118b2576118b1612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611958565b6057836118f391906129b4565b7f01000000000000000000000000000000000000000000000000000000000000000284838151811061192857611927612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f86826020811061196d5761196c612851565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611a44576030836119cf91906129b4565b7f010000000000000000000000000000000000000000000000000000000000000002846001846119ff91906129e9565b81518110611a1057611a0f612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611ac2565b605783611a5191906129b4565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611a8191906129e9565b81518110611a9257611a91612851565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611acf91906129e9565b91508080611adc9061291d565b9150506117ee565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611baa81611e9e565b611bb357600080fd5b611bbc81611ed0565b15611bca5782915050611c2f565b7effffffffff00000000000000000000000000000000000000000000000000006001028116905060d081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600102831681179050809150505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611c8b91906124ab565b602060405180830381865afa158015611ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc9190612a32565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611d0657600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611e3a573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611e3057503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611e3957600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611e978385611f02565b5050505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000807f4000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b600080836001029050600360008281526020019081526020016000205460019004915060008203611f3257600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61201581611fe0565b811461202057600080fd5b50565b6000813590506120328161200c565b92915050565b60006020828403121561204e5761204d611fd6565b5b600061205c84828501612023565b91505092915050565b60008115159050919050565b61207a81612065565b82525050565b60006020820190506120956000830184612071565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120d55780820151818401526020810190506120ba565b60008484015250505050565b6000601f19601f8301169050919050565b60006120fd8261209b565b61210781856120a6565b93506121178185602086016120b7565b612120816120e1565b840191505092915050565b6000602082019050818103600083015261214581846120f2565b905092915050565b6000819050919050565b6121608161214d565b811461216b57600080fd5b50565b60008135905061217d81612157565b92915050565b60006020828403121561219957612198611fd6565b5b60006121a78482850161216e565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121db826121b0565b9050919050565b6121eb816121d0565b82525050565b600060208201905061220660008301846121e2565b92915050565b612215816121d0565b811461222057600080fd5b50565b6000813590506122328161220c565b92915050565b60008060006060848603121561225157612250611fd6565b5b600061225f86828701612223565b935050602061227086828701612223565b92505060406122818682870161216e565b9150509250925092565b6000819050919050565b61229e8161228b565b81146122a957600080fd5b50565b6000813590506122bb81612295565b92915050565b6000602082840312156122d7576122d6611fd6565b5b60006122e5848285016122ac565b91505092915050565b6122f78161228b565b82525050565b600060208201905061231260008301846122ee565b92915050565b60008060006060848603121561233157612330611fd6565b5b600061233f86828701612223565b9350506020612350868287016122ac565b92505060406123618682870161216e565b9150509250925092565b600065ffffffffffff82169050919050565b6123868161236b565b811461239157600080fd5b50565b6000813590506123a38161237d565b92915050565b600080604083850312156123c0576123bf611fd6565b5b60006123ce858286016122ac565b92505060206123df85828601612394565b9150509250929050565b60008060408385031215612400576123ff611fd6565b5b600061240e858286016122ac565b925050602061241f8582860161216e565b9150509250929050565b6124328161236b565b82525050565b600060608201905061244d6000830186612429565b61245a6020830185612429565b6124676040830184612429565b949350505050565b60006020828403121561248557612484611fd6565b5b600061249384828501612223565b91505092915050565b6124a58161214d565b82525050565b60006020820190506124c0600083018461249c565b92915050565b6124cf81612065565b81146124da57600080fd5b50565b6000813590506124ec816124c6565b92915050565b6000806040838503121561250957612508611fd6565b5b600061251785828601612223565b9250506020612528858286016124dd565b9150509250929050565b6000806040838503121561254957612548611fd6565b5b600061255785828601612223565b9250506020612568858286016122ac565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125b4826120e1565b810181811067ffffffffffffffff821117156125d3576125d261257c565b5b80604052505050565b60006125e6611fcc565b90506125f282826125ab565b919050565b600067ffffffffffffffff8211156126125761261161257c565b5b61261b826120e1565b9050602081019050919050565b82818337600083830152505050565b600061264a612645846125f7565b6125dc565b90508281526020810184848401111561266657612665612577565b5b612671848285612628565b509392505050565b600082601f83011261268e5761268d612572565b5b813561269e848260208601612637565b91505092915050565b600080600080608085870312156126c1576126c0611fd6565b5b60006126cf87828801612223565b94505060206126e087828801612223565b93505060406126f18782880161216e565b925050606085013567ffffffffffffffff81111561271257612711611fdb565b5b61271e87828801612679565b91505092959194509250565b60008060006060848603121561274357612742611fd6565b5b6000612751868287016122ac565b93505060206127628682870161216e565b92505060406127738682870161216e565b9150509250925092565b6000819050919050565b6127908161277d565b82525050565b60006020820190506127ab6000830184612787565b92915050565b600080604083850312156127c8576127c7611fd6565b5b60006127d685828601612223565b92505060206127e785828601612223565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061283857607f821691505b60208210810361284b5761284a6127f1565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006128ba8261236b565b91506128c58361236b565b9250828201905065ffffffffffff8111156128e3576128e2612880565b5b92915050565b60006128f48261214d565b91506128ff8361214d565b925082820390508181111561291757612916612880565b5b92915050565b60006129288261214d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361295a57612959612880565b5b600182019050919050565b60008151905061297481612295565b92915050565b6000602082840312156129905761298f611fd6565b5b600061299e84828501612965565b91505092915050565b600060ff82169050919050565b60006129bf826129a7565b91506129ca836129a7565b9250828201905060ff8111156129e3576129e2612880565b5b92915050565b60006129f48261214d565b91506129ff8361214d565b9250828201905080821115612a1757612a16612880565b5b92915050565b600081519050612a2c8161220c565b92915050565b600060208284031215612a4857612a47611fd6565b5b6000612a5684828501612a1d565b9150509291505056fea2646970667358221220864133f500ab4d9c75ce5c8b482d64744a21d2c81982fc7b1665a1a51a1d089764736f6c63430008110033 -\ No newline at end of file +60806040523480156200001157600080fd5b506040516200311838038062003118833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612b1580620006036000396000f3fe608060405260043610610152576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063b88d4fde1161008c578063b88d4fde1461049d578063bee2c0b5146104b9578063c87b56dd146104f6578063c9796c3914610533578063e985e9c514610570578063f9613ab2146105ad57610152565b806370a08231146103a45780638da5cb5b146103e157806395d89b411461040c578063a22cb46514610437578063adf288df1461046057610152565b806325cbaa181161011a57806325cbaa181461025557806342842e0e146102925780634d03546a146102ae5780634f64b2be146102eb578063559f5dc9146103285780636352211e1461036757610152565b806301ffc9a71461015757806306fdde0314610194578063081812fc146101bf57806323b872dd146101fc57806324e0febc14610218575b600080fd5b34801561016357600080fd5b5061017e600480360381019061017991906120b8565b6105ea565b60405161018b9190612100565b60405180910390f35b3480156101a057600080fd5b506101a9610790565b6040516101b691906121ab565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190612203565b61081e565b6040516101f39190612271565b60405180910390f35b610216600480360381019061021191906122b8565b61085b565b005b34801561022457600080fd5b5061023f600480360381019061023a9190612341565b6108ca565b60405161024c919061237d565b60405180910390f35b34801561026157600080fd5b5061027c60048036038101906102779190612398565b6108e2565b604051610289919061237d565b60405180910390f35b6102ac60048036038101906102a791906122b8565b610b11565b005b3480156102ba57600080fd5b506102d560048036038101906102d09190612429565b610b80565b6040516102e29190612100565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d9190612203565b610dbe565b60405161031f919061237d565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a9190612469565b610de2565b60405161035e939291906124b8565b60405180910390f35b34801561037357600080fd5b5061038e60048036038101906103899190612203565b610e5b565b60405161039b9190612271565b60405180910390f35b3480156103b057600080fd5b506103cb60048036038101906103c691906124ef565b610e97565b6040516103d8919061252b565b60405180910390f35b3480156103ed57600080fd5b506103f6610e9e565b6040516104039190612271565b60405180910390f35b34801561041857600080fd5b50610421610ec2565b60405161042e91906121ab565b60405180910390f35b34801561044357600080fd5b5061045e60048036038101906104599190612572565b610f50565b005b34801561046c57600080fd5b50610487600480360381019061048291906125b2565b6111f2565b604051610494919061237d565b60405180910390f35b6104b760048036038101906104b29190612727565b6112fb565b005b3480156104c557600080fd5b506104e060048036038101906104db91906127aa565b6113d2565b6040516104ed9190612816565b60405180910390f35b34801561050257600080fd5b5061051d60048036038101906105189190612203565b6114a5565b60405161052a91906121ab565b60405180910390f35b34801561053f57600080fd5b5061055a60048036038101906105559190612341565b611555565b60405161056791906121ab565b60405180910390f35b34801561057c57600080fd5b5061059760048036038101906105929190612831565b611b70565b6040516105a49190612100565b60405180910390f35b3480156105b957600080fd5b506105d460048036038101906105cf9190612341565b611c08565b6040516105e1919061237d565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361063e576001905061078b565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610690576001905061078b565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106e2576001905061078b565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610734576001905061078b565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610786576001905061078b565b600090505b919050565b6006805461079d906128a0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c9906128a0565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606061086984848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b60008060008060026000878152602001908152602001600020858154811061090d5761090c6128d1565b5b906000526020600020019050600085148015610947575060008160000160009054906101000a900465ffffffffffff1665ffffffffffff16145b156109a857600181600001600c8282829054906101000a900465ffffffffffff16610972919061292f565b92506101000a81548165ffffffffffff021916908365ffffffffffff16021790555061099e87876111f2565b9350505050610b0a565b8060000160009054906101000a900465ffffffffffff1665ffffffffffff1681600001600c9054906101000a900465ffffffffffff1665ffffffffffff16106109f057600080fd5b64ffffffffff866001900416915060d0829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508673ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000086600190041692506014859060020a028317925080600001600c9054906101000a900465ffffffffffff1665ffffffffffff1683179250600181600001600c8282829054906101000a900465ffffffffffff16610ac6919061292f565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160010260036000856001028152602001908152602001600020819055505050505b9392505050565b6060610b1f84848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bde57600080fd5b610be6612013565b600260008781526020019081526020016000208054905092506000831115610cb657600060026000888152602001908152602001600020600081548110610c3057610c2f6128d1565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff1611610c6257600080fd5b60026000878152602001908152602001600020600184610c829190612969565b81548110610c9357610c926128d1565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1691505b84816000019065ffffffffffff16908165ffffffffffff16815250508482610cde919061292f565b816020019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550505050505092915050565b60018181548110610dce57600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610dfe57600080fd5b90600052602060002001600091509150508060000160009054906101000a900465ffffffffffff16908060000160069054906101000a900465ffffffffffff169080600001600c9054906101000a900465ffffffffffff16905083565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610ecf906128a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610efb906128a0565b8015610f485780601f10610f1d57610100808354040283529160200191610f48565b820191906000526020600020905b815481529060010190602001808311610f2b57829003601f168201915b505050505081565b801561107157600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fee57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611189565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361110957600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516111e69190612100565b60405180910390a35050565b6000806000600160026000868152602001908152602001600020805490501461121a57600080fd5b600060026000868152602001908152602001600020600081548110611242576112416128d1565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff161461127457600080fd5b600060010260036000868152602001908152602001600020541461129757600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1691507fc00000000000000000000000000000000000000000000000000000000000000082179150816001026003600086815260200190815260200160002081905550839250505092915050565b61130784848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516113c4919061237d565b60405180910390a450505050565b6000808290505b600260008681526020019081526020016000208054905081101561147957836fffffffffffffffffffffffffffffffff1660026000878152602001908152602001600020828154811061142f5761142e6128d1565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1665ffffffffffff161115611466578091505061149e565b80806114719061299d565b9150506113d9565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b606060003073ffffffffffffffffffffffffffffffffffffffff1663f9613ab2846001026040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611501919061237d565b602060405180830381865afa15801561151e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154291906129fa565b905061154d81611555565b915050919050565b606080600080604767ffffffffffffffff811115611576576115756125fc565b5b6040519080825280601f01601f1916602001820160405280156115a85781602001600182028036833780820191505090505b5092507f7300000000000000000000000000000000000000000000000000000000000000836000815181106115e0576115df6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f680000000000000000000000000000000000000000000000000000000000000083600181518110611644576116436128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6100000000000000000000000000000000000000000000000000000000000000836002815181106116a8576116a76128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f32000000000000000000000000000000000000000000000000000000000000008360038151811061170c5761170b6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3500000000000000000000000000000000000000000000000000000000000000836004815181106117705761176f6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106117d4576117d36128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a0000000000000000000000000000000000000000000000000000000000000083600681518110611838576118376128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611b6457600460f087836020811061188e5761188d6128d1565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015611966576030836118fd9190612a34565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611932576119316128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506119d8565b6057836119739190612a34565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106119a8576119a76128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f8682602081106119ed576119ec6128d1565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611ac457603083611a4f9190612a34565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611a7f9190612a69565b81518110611a9057611a8f6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b42565b605783611ad19190612a34565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611b019190612a69565b81518110611b1257611b116128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611b4f9190612a69565b91508080611b5c9061299d565b91505061186e565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611c2a81611f1e565b611c3357600080fd5b611c3c81611f50565b15611c4a5782915050611caf565b7effffffffff00000000000000000000000000000000000000000000000000006001028116905060d081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600102831681179050809150505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611d0b919061252b565b602060405180830381865afa158015611d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4c9190612ab2565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611d8657600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611eba573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611eb057503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611eb957600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611f178385611f82565b5050505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000807f4000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b600080836001029050600360008281526020019081526020016000205460019004915060008203611fb257600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61209581612060565b81146120a057600080fd5b50565b6000813590506120b28161208c565b92915050565b6000602082840312156120ce576120cd612056565b5b60006120dc848285016120a3565b91505092915050565b60008115159050919050565b6120fa816120e5565b82525050565b600060208201905061211560008301846120f1565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561215557808201518184015260208101905061213a565b60008484015250505050565b6000601f19601f8301169050919050565b600061217d8261211b565b6121878185612126565b9350612197818560208601612137565b6121a081612161565b840191505092915050565b600060208201905081810360008301526121c58184612172565b905092915050565b6000819050919050565b6121e0816121cd565b81146121eb57600080fd5b50565b6000813590506121fd816121d7565b92915050565b60006020828403121561221957612218612056565b5b6000612227848285016121ee565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061225b82612230565b9050919050565b61226b81612250565b82525050565b60006020820190506122866000830184612262565b92915050565b61229581612250565b81146122a057600080fd5b50565b6000813590506122b28161228c565b92915050565b6000806000606084860312156122d1576122d0612056565b5b60006122df868287016122a3565b93505060206122f0868287016122a3565b9250506040612301868287016121ee565b9150509250925092565b6000819050919050565b61231e8161230b565b811461232957600080fd5b50565b60008135905061233b81612315565b92915050565b60006020828403121561235757612356612056565b5b60006123658482850161232c565b91505092915050565b6123778161230b565b82525050565b6000602082019050612392600083018461236e565b92915050565b6000806000606084860312156123b1576123b0612056565b5b60006123bf868287016122a3565b93505060206123d08682870161232c565b92505060406123e1868287016121ee565b9150509250925092565b600065ffffffffffff82169050919050565b612406816123eb565b811461241157600080fd5b50565b600081359050612423816123fd565b92915050565b600080604083850312156124405761243f612056565b5b600061244e8582860161232c565b925050602061245f85828601612414565b9150509250929050565b600080604083850312156124805761247f612056565b5b600061248e8582860161232c565b925050602061249f858286016121ee565b9150509250929050565b6124b2816123eb565b82525050565b60006060820190506124cd60008301866124a9565b6124da60208301856124a9565b6124e760408301846124a9565b949350505050565b60006020828403121561250557612504612056565b5b6000612513848285016122a3565b91505092915050565b612525816121cd565b82525050565b6000602082019050612540600083018461251c565b92915050565b61254f816120e5565b811461255a57600080fd5b50565b60008135905061256c81612546565b92915050565b6000806040838503121561258957612588612056565b5b6000612597858286016122a3565b92505060206125a88582860161255d565b9150509250929050565b600080604083850312156125c9576125c8612056565b5b60006125d7858286016122a3565b92505060206125e88582860161232c565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61263482612161565b810181811067ffffffffffffffff82111715612653576126526125fc565b5b80604052505050565b600061266661204c565b9050612672828261262b565b919050565b600067ffffffffffffffff821115612692576126916125fc565b5b61269b82612161565b9050602081019050919050565b82818337600083830152505050565b60006126ca6126c584612677565b61265c565b9050828152602081018484840111156126e6576126e56125f7565b5b6126f18482856126a8565b509392505050565b600082601f83011261270e5761270d6125f2565b5b813561271e8482602086016126b7565b91505092915050565b6000806000806080858703121561274157612740612056565b5b600061274f878288016122a3565b9450506020612760878288016122a3565b9350506040612771878288016121ee565b925050606085013567ffffffffffffffff8111156127925761279161205b565b5b61279e878288016126f9565b91505092959194509250565b6000806000606084860312156127c3576127c2612056565b5b60006127d18682870161232c565b93505060206127e2868287016121ee565b92505060406127f3868287016121ee565b9150509250925092565b6000819050919050565b612810816127fd565b82525050565b600060208201905061282b6000830184612807565b92915050565b6000806040838503121561284857612847612056565b5b6000612856858286016122a3565b9250506020612867858286016122a3565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806128b857607f821691505b6020821081036128cb576128ca612871565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061293a826123eb565b9150612945836123eb565b9250828201905065ffffffffffff81111561296357612962612900565b5b92915050565b6000612974826121cd565b915061297f836121cd565b925082820390508181111561299757612996612900565b5b92915050565b60006129a8826121cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036129da576129d9612900565b5b600182019050919050565b6000815190506129f481612315565b92915050565b600060208284031215612a1057612a0f612056565b5b6000612a1e848285016129e5565b91505092915050565b600060ff82169050919050565b6000612a3f82612a27565b9150612a4a83612a27565b9250828201905060ff811115612a6357612a62612900565b5b92915050565b6000612a74826121cd565b9150612a7f836121cd565b9250828201905080821115612a9757612a96612900565b5b92915050565b600081519050612aac8161228c565b92915050565b600060208284031215612ac857612ac7612056565b5b6000612ad684828501612a9d565b9150509291505056fea2646970667358221220d829eb2f2fd260add84dee28f547d8e2c6e954b3dbfd88c3b2f5b65daaccd51364736f6c63430008110033 +\ No newline at end of file diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py @@ -25,6 +25,9 @@ from hexathon import ( add_0x, strip_0x, ) +from chainlib.eth.tx import TxFormat +from chainlib.eth.contract import ABIContractEncoder +from chainlib.eth.contract import ABIContractType # local imports @@ -37,6 +40,7 @@ logg = logging.getLogger() testdir = os.path.dirname(__file__) hash_of_foo = '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae' +hash_of_bar = 'fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9' class Test(EthTesterCase): @@ -211,6 +215,7 @@ class Test(EthTesterCase): def test_mint_to_batch(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=10) self.rpc.do(o) @@ -245,6 +250,37 @@ class Test(EthTesterCase): self.assertTrue(is_same_address(owner[24:], self.accounts[2])) + def test_mint_to_dup(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=10) + self.rpc.do(o) + + (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], hash_of_foo, 0) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + enc = ABIContractEncoder() + enc.method('mintTo') + enc.typ(ABIContractType.ADDRESS) + enc.typ(ABIContractType.BYTES32) + enc.typ(ABIContractType.UINT256) + enc.address(self.accounts[1]) + enc.bytes32(hash_of_foo) + enc.uint256(0) + data = enc.get() + tx = c.template(self.accounts[0], self.address, use_nonce=True) + tx = c.set_code(tx, data) + (tx_hash_hex, o) = c.finalize(tx, TxFormat.JSONRPC) + r = self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 0) + + def test_transfer(self): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = CraftNFT(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) @@ -338,9 +374,6 @@ class Test(EthTesterCase): self.rpc.do(o) expected_id = hash_of_foo[:64-10] + '0000000000' - o = c.get_token_raw(self.address, expected_id, sender_address=self.accounts[0]) - r = self.rpc.do(o) - o = c.get_digest(self.address, expected_id, sender_address=self.accounts[0]) r = self.rpc.do(o) self.assertEqual(strip_0x(r), hash_of_foo) @@ -387,7 +420,63 @@ class Test(EthTesterCase): uri = c.parse_token_uri(r) self.assertEqual('sha256:' + hash_of_foo, uri) - + + + def test_multi(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=2) + self.rpc.do(o) + + (tx_hash_hex, o) = c.allocate(self.address, self.accounts[0], hash_of_foo, amount=3) + self.rpc.do(o) + + (tx_hash_hex, o) = c.allocate(self.address, self.accounts[0], hash_of_bar) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], hash_of_bar, 0) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], hash_of_foo, 0) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], hash_of_bar, 0) + 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], self.accounts[1], hash_of_foo, 0) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash_hex, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], hash_of_foo, 0) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.conn.do(o) + self.assertEqual(r['status'], 0) + + expected_id = hash_of_foo[:64-10] + '0000000000' + o = c.get_digest(self.address, expected_id, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(strip_0x(r), hash_of_foo) + + o = c.get_digest(self.address, hash_of_bar, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(strip_0x(r), hash_of_bar) + if __name__ == '__main__': unittest.main() diff --git a/solidity/CraftNFT.sol b/solidity/CraftNFT.sol @@ -90,7 +90,14 @@ contract CraftNFT { function mintTo(address _recipient, bytes32 _content) public returns (bytes32) { uint256 right; + uint256 first; + + require(token[_content].length == 1); + require(token[_content][0].count == 0); require(mintedToken[_content] == bytes32(0x00)); + + //first &= 0xffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000; + //require(mintedToken[bytes32(first)] == bytes32(0x00)); right = uint160(_recipient); right |= (3 << 254);