commit 2d68d177b264a321919a0e8992b2317857999751
parent 65b9bea9297baf3fd05619afd2ec7d2b9e6880bd
Author: lash <dev@holbrook.no>
Date: Sat, 17 Dec 2022 18:02:06 +0000
Loads of ui stuff, add deploy python script
Diffstat:
14 files changed, 420 insertions(+), 17 deletions(-)
diff --git a/js/contract/CraftNFT.bin b/js/contract/CraftNFT.bin
@@ -0,0 +1 @@
+60806040523480156200001157600080fd5b506040516200323238038062003232833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612c2f80620006036000396000f3fe60806040526004361061015d576000357c0100000000000000000000000000000000000000000000000000000000900480636352211e116100d3578063b88d4fde1161008c578063b88d4fde146104d3578063bee2c0b5146104ef578063c87b56dd1461052c578063c9796c3914610569578063e985e9c5146105a6578063f9613ab2146105e35761015d565b80636352211e1461039d57806370a08231146103da5780638da5cb5b1461041757806395d89b4114610442578063a22cb4651461046d578063adf288df146104965761015d565b806324e0febc1161012557806324e0febc1461024e57806325cbaa181461028b57806342842e0e146102c85780634d03546a146102e45780634f64b2be14610321578063559f5dc91461035e5761015d565b806301ffc9a71461016257806306fdde031461019f578063081812fc146101ca57806318160ddd1461020757806323b872dd14610232575b600080fd5b34801561016e57600080fd5b50610189600480360381019061018491906121d2565b610620565b604051610196919061221a565b60405180910390f35b3480156101ab57600080fd5b506101b46107c6565b6040516101c191906122c5565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec919061231d565b610854565b6040516101fe919061238b565b60405180910390f35b34801561021357600080fd5b5061021c610891565b60405161022991906123b5565b60405180910390f35b61024c600480360381019061024791906123fc565b61089b565b005b34801561025a57600080fd5b5061027560048036038101906102709190612485565b61090a565b60405161028291906124c1565b60405180910390f35b34801561029757600080fd5b506102b260048036038101906102ad91906124dc565b610922565b6040516102bf91906124c1565b60405180910390f35b6102e260048036038101906102dd91906123fc565b610ba9565b005b3480156102f057600080fd5b5061030b6004803603810190610306919061256d565b610c18565b604051610318919061221a565b60405180910390f35b34801561032d57600080fd5b506103486004803603810190610343919061231d565b610e7f565b60405161035591906124c1565b60405180910390f35b34801561036a57600080fd5b50610385600480360381019061038091906125ad565b610ea3565b604051610394939291906125fc565b60405180910390f35b3480156103a957600080fd5b506103c460048036038101906103bf919061231d565b610f1c565b6040516103d1919061238b565b60405180910390f35b3480156103e657600080fd5b5061040160048036038101906103fc9190612633565b610f58565b60405161040e91906123b5565b60405180910390f35b34801561042357600080fd5b5061042c610f5f565b604051610439919061238b565b60405180910390f35b34801561044e57600080fd5b50610457610f83565b60405161046491906122c5565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f919061268c565b611011565b005b3480156104a257600080fd5b506104bd60048036038101906104b891906126cc565b6112b3565b6040516104ca91906124c1565b60405180910390f35b6104ed60048036038101906104e89190612841565b611415565b005b3480156104fb57600080fd5b50610516600480360381019061051191906128c4565b6114ec565b6040516105239190612930565b60405180910390f35b34801561053857600080fd5b50610553600480360381019061054e919061231d565b6115bf565b60405161056091906122c5565b60405180910390f35b34801561057557600080fd5b50610590600480360381019061058b9190612485565b61166f565b60405161059d91906122c5565b60405180910390f35b3480156105b257600080fd5b506105cd60048036038101906105c8919061294b565b611c8a565b6040516105da919061221a565b60405180910390f35b3480156105ef57600080fd5b5061060a60048036038101906106059190612485565b611d22565b60405161061791906124c1565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361067457600190506107c1565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106c657600190506107c1565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361071857600190506107c1565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361076a57600190506107c1565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036107bc57600190506107c1565b600090505b919050565b600680546107d3906129ba565b80601f01602080910402602001604051908101604052809291908181526020018280546107ff906129ba565b801561084c5780601f106108215761010080835404028352916020019161084c565b820191906000526020600020905b81548152906001019060200180831161082f57829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600854905090565b60606108a984848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b60008060008060026000878152602001908152602001600020858154811061094d5761094c6129eb565b5b906000526020600020019050600085148015610987575060008160000160009054906101000a900465ffffffffffff1665ffffffffffff16145b156109e857600181600001600c8282829054906101000a900465ffffffffffff166109b29190612a49565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055506109de87876112b3565b9350505050610ba2565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a4057600080fd5b8060000160009054906101000a900465ffffffffffff1665ffffffffffff1681600001600c9054906101000a900465ffffffffffff1665ffffffffffff1610610a8857600080fd5b64ffffffffff866001900416915060d0829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508673ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000086600190041692506014859060020a028317925080600001600c9054906101000a900465ffffffffffff1665ffffffffffff1683179250600181600001600c8282829054906101000a900465ffffffffffff16610b5e9190612a49565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160010260036000856001028152602001908152602001600020819055505050505b9392505050565b6060610bb784848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c7657600080fd5b610c7e61212d565b600260008781526020019081526020016000208054905092506000831115610d4e57600060026000888152602001908152602001600020600081548110610cc857610cc76129eb565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff1611610cfa57600080fd5b60026000878152602001908152602001600020600184610d1a9190612a83565b81548110610d2b57610d2a6129eb565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1691505b84816000019065ffffffffffff16908165ffffffffffff16815250508482610d769190612a49565b816020019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff1602179055505050600186908060018154018082558091505060019003906000526020600020016000909190919091505550505092915050565b60018181548110610e8f57600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610ebf57600080fd5b90600052602060002001600091509150508060000160009054906101000a900465ffffffffffff16908060000160069054906101000a900465ffffffffffff169080600001600c9054906101000a900465ffffffffffff16905083565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610f90906129ba565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbc906129ba565b80156110095780601f10610fde57610100808354040283529160200191611009565b820191906000526020600020905b815481529060010190602001808311610fec57829003601f168201915b505050505081565b801561113257600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110af57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061124a565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036111ca57600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112a7919061221a565b60405180910390a35050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461131157600080fd5b600160026000868152602001908152602001600020805490501461133457600080fd5b60006002600086815260200190815260200160002060008154811061135c5761135b6129eb565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff161461138e57600080fd5b60006001026003600086815260200190815260200160002054146113b157600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1691507fc00000000000000000000000000000000000000000000000000000000000000082179150816001026003600086815260200190815260200160002081905550839250505092915050565b61142184848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516114de91906124c1565b60405180910390a450505050565b6000808290505b600260008681526020019081526020016000208054905081101561159357836fffffffffffffffffffffffffffffffff16600260008781526020019081526020016000208281548110611549576115486129eb565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1665ffffffffffff16111561158057809150506115b8565b808061158b90612ab7565b9150506114f3565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b606060003073ffffffffffffffffffffffffffffffffffffffff1663f9613ab2846001026040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161161b91906124c1565b602060405180830381865afa158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c9190612b14565b90506116678161166f565b915050919050565b606080600080604767ffffffffffffffff8111156116905761168f612716565b5b6040519080825280601f01601f1916602001820160405280156116c25781602001600182028036833780820191505090505b5092507f7300000000000000000000000000000000000000000000000000000000000000836000815181106116fa576116f96129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f68000000000000000000000000000000000000000000000000000000000000008360018151811061175e5761175d6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6100000000000000000000000000000000000000000000000000000000000000836002815181106117c2576117c16129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f320000000000000000000000000000000000000000000000000000000000000083600381518110611826576118256129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f35000000000000000000000000000000000000000000000000000000000000008360048151811061188a576118896129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106118ee576118ed6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a0000000000000000000000000000000000000000000000000000000000000083600681518110611952576119516129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611c7e57600460f08783602081106119a8576119a76129eb565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015611a8057603083611a179190612b4e565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611a4c57611a4b6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611af2565b605783611a8d9190612b4e565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611ac257611ac16129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868260208110611b0757611b066129eb565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611bde57603083611b699190612b4e565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611b999190612b83565b81518110611baa57611ba96129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611c5c565b605783611beb9190612b4e565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611c1b9190612b83565b81518110611c2c57611c2b6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611c699190612b83565b91508080611c7690612ab7565b915050611988565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611d4481612038565b611d4d57600080fd5b611d568161206a565b15611d645782915050611dc9565b7effffffffff00000000000000000000000000000000000000000000000000006001028116905060d081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600102831681179050809150505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611e2591906123b5565b602060405180830381865afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e669190612bcc565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611ea057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611fd4573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611fca57503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611fd357600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612031838561209c565b5050505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000807f4000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000808360010290506003600082815260200190815260200160002054600190049150600082036120cc57600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6121af8161217a565b81146121ba57600080fd5b50565b6000813590506121cc816121a6565b92915050565b6000602082840312156121e8576121e7612170565b5b60006121f6848285016121bd565b91505092915050565b60008115159050919050565b612214816121ff565b82525050565b600060208201905061222f600083018461220b565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561226f578082015181840152602081019050612254565b60008484015250505050565b6000601f19601f8301169050919050565b600061229782612235565b6122a18185612240565b93506122b1818560208601612251565b6122ba8161227b565b840191505092915050565b600060208201905081810360008301526122df818461228c565b905092915050565b6000819050919050565b6122fa816122e7565b811461230557600080fd5b50565b600081359050612317816122f1565b92915050565b60006020828403121561233357612332612170565b5b600061234184828501612308565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123758261234a565b9050919050565b6123858161236a565b82525050565b60006020820190506123a0600083018461237c565b92915050565b6123af816122e7565b82525050565b60006020820190506123ca60008301846123a6565b92915050565b6123d98161236a565b81146123e457600080fd5b50565b6000813590506123f6816123d0565b92915050565b60008060006060848603121561241557612414612170565b5b6000612423868287016123e7565b9350506020612434868287016123e7565b925050604061244586828701612308565b9150509250925092565b6000819050919050565b6124628161244f565b811461246d57600080fd5b50565b60008135905061247f81612459565b92915050565b60006020828403121561249b5761249a612170565b5b60006124a984828501612470565b91505092915050565b6124bb8161244f565b82525050565b60006020820190506124d660008301846124b2565b92915050565b6000806000606084860312156124f5576124f4612170565b5b6000612503868287016123e7565b935050602061251486828701612470565b925050604061252586828701612308565b9150509250925092565b600065ffffffffffff82169050919050565b61254a8161252f565b811461255557600080fd5b50565b60008135905061256781612541565b92915050565b6000806040838503121561258457612583612170565b5b600061259285828601612470565b92505060206125a385828601612558565b9150509250929050565b600080604083850312156125c4576125c3612170565b5b60006125d285828601612470565b92505060206125e385828601612308565b9150509250929050565b6125f68161252f565b82525050565b600060608201905061261160008301866125ed565b61261e60208301856125ed565b61262b60408301846125ed565b949350505050565b60006020828403121561264957612648612170565b5b6000612657848285016123e7565b91505092915050565b612669816121ff565b811461267457600080fd5b50565b60008135905061268681612660565b92915050565b600080604083850312156126a3576126a2612170565b5b60006126b1858286016123e7565b92505060206126c285828601612677565b9150509250929050565b600080604083850312156126e3576126e2612170565b5b60006126f1858286016123e7565b925050602061270285828601612470565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274e8261227b565b810181811067ffffffffffffffff8211171561276d5761276c612716565b5b80604052505050565b6000612780612166565b905061278c8282612745565b919050565b600067ffffffffffffffff8211156127ac576127ab612716565b5b6127b58261227b565b9050602081019050919050565b82818337600083830152505050565b60006127e46127df84612791565b612776565b905082815260208101848484011115612800576127ff612711565b5b61280b8482856127c2565b509392505050565b600082601f8301126128285761282761270c565b5b81356128388482602086016127d1565b91505092915050565b6000806000806080858703121561285b5761285a612170565b5b6000612869878288016123e7565b945050602061287a878288016123e7565b935050604061288b87828801612308565b925050606085013567ffffffffffffffff8111156128ac576128ab612175565b5b6128b887828801612813565b91505092959194509250565b6000806000606084860312156128dd576128dc612170565b5b60006128eb86828701612470565b93505060206128fc86828701612308565b925050604061290d86828701612308565b9150509250925092565b6000819050919050565b61292a81612917565b82525050565b60006020820190506129456000830184612921565b92915050565b6000806040838503121561296257612961612170565b5b6000612970858286016123e7565b9250506020612981858286016123e7565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806129d257607f821691505b6020821081036129e5576129e461298b565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a548261252f565b9150612a5f8361252f565b9250828201905065ffffffffffff811115612a7d57612a7c612a1a565b5b92915050565b6000612a8e826122e7565b9150612a99836122e7565b9250828203905081811115612ab157612ab0612a1a565b5b92915050565b6000612ac2826122e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612af457612af3612a1a565b5b600182019050919050565b600081519050612b0e81612459565b92915050565b600060208284031215612b2a57612b29612170565b5b6000612b3884828501612aff565b91505092915050565b600060ff82169050919050565b6000612b5982612b41565b9150612b6483612b41565b9250828201905060ff811115612b7d57612b7c612a1a565b5b92915050565b6000612b8e826122e7565b9150612b99836122e7565b9250828201905080821115612bb157612bb0612a1a565b5b92915050565b600081519050612bc6816123d0565b92915050565b600060208284031215612be257612be1612170565b5b6000612bf084828501612bb7565b9150509291505056fea2646970667358221220616703ca0b9a7a2c34d80d5970395c4799bbbd57fb29aa781c8b4c20882e1bab64736f6c63430008110033
+\ No newline at end of file
diff --git a/js/contract/CraftNFT.json b/js/contract/CraftNFT.json
@@ -0,0 +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":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_batch","type":"uint256"}],"name":"mintFromBatchTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"}],"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":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"token","outputs":[{"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":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"}]
diff --git a/js/index.html b/js/index.html
@@ -0,0 +1,56 @@
+<html>
+ <head>
+ <title>Manual test of web3, metamask</title>
+ <script src="node_modules/jssha/dist/sha256.js"></script>
+ <script src="dist/craft_nft.js"></script>
+ <script src="manual_test_browser.js"></script>
+ <script src="src/common.js"></script>
+ <script src="src/wala.js"></script>
+<style type='text/css'>
+#detail {
+ visibility: hidden;
+}
+a {
+ text-decoration: underline;
+ color: #0000ff;
+}
+
+a:hover {
+ cursor: pointer;
+}
+</style>
+ </head>
+ <body>
+ <dl id=data">
+ <dt>account</dt>
+ <dd id="data_account"></dd>
+ <dt>contract</dt>
+ <dd id="data_contract"></dd>
+ </dl>
+ <div id="interactive">
+ <form id="panel" action="#" onSubmit="return false;">
+ <input type="text" id="panel_title" name="title" />
+ <label for="panel_title">Title</label>
+ <input type="text" id="panel_description" name="description" />
+ <label for="panel_description">Description</label>
+ <input type="text" id="panel_amount" name="amount" />
+ <label for="panel_amount">Batch size (0 or empty for unique work)</label>
+ <button id="panel_submit">create</button>
+ </form>
+ </div>
+ <div id="detail">
+ <a id="back_link" onClick="listTokens();">back</a>
+ <dl>
+ <dt>token id</dt>
+ <dd id="token_id"></dd>
+ <dt>name</dt>
+ <dd id="token_name"></dd>
+ <dt>description</dt>
+ <dd id="token_description"></dd>
+ </dl>
+ </div>
+ <h2>Tokens</h2>
+
+ <ul id="token_list"></ul>
+ </body>
+</html>
diff --git a/js/manual_test_browser.js b/js/manual_test_browser.js
@@ -1,7 +1,86 @@
-window.addEventListener('load', () => {
- alive();
+window.addEventListener('token', (e) => {
+ const li = document.createElement('li');
+ const a = document.createElement('a');
+ a.setAttribute('onClick', 'viewToken("' + e.detail.tokenId + '")');
+ li.id = 'token_' + e.detail.tokenId;
+ a.textContent = e.detail.tokenId;
+ li.appendChild(a);
+ document.getElementById('token_list').appendChild(li);
});
-async function alive() {
- console.debug('g', await window.craftnft.web3.eth.getGasPrice());
-};
+
+async function generatePayload() {
+ let tokenData = {
+ name: undefined,
+ description: undefined,
+ amount: 0,
+ parent_nft: undefined,
+ };
+
+ const amount = document.getElementById('panel_amount').value;
+ tokenData.amount = parseInt(amount, 10);
+ if (isNaN(tokenData.amount)) {
+ throw 'amount must be numeric';
+ }
+ tokenData.name = document.getElementById('panel_title').value;
+ tokenData.description = document.getElementById('panel_description').value;
+ const s = JSON.stringify(tokenData);
+
+ const sha_raw = new jsSHA("SHA-256", "TEXT", { encoding: "UTF8" });
+ sha_raw.update(s);
+ const digest = sha_raw.getHash("HEX");
+
+ let r = await session.contentGateway.put(s);
+ if (r != digest) {
+ throw 'digest mismatch (' + r + ' != ' + digest + ')';
+ }
+
+ const tokenRequestEvent = new CustomEvent('tokenRequest', {
+ detail: {
+ digest: digest,
+ tokenData: tokenData,
+ },
+ bubbles: true,
+ cancelable: true,
+ composed: false,
+ });
+ window.dispatchEvent(tokenRequestEvent);
+}
+
+async function viewToken(tokenId) {
+ const r = await session.contentGateway.get(tokenId);
+ const tokenData = JSON.parse(r);
+
+ document.getElementById('token_id').innerHTML = tokenId;
+ document.getElementById('token_name').innerHTML = tokenData.name;
+ document.getElementById('token_description').innerHTML = tokenData.description;
+ document.getElementById('interactive').style.visibility = 'hidden';
+ document.getElementById('detail').style.visibility = 'visible';
+}
+
+async function listTokens() {
+ document.getElementById('interactive').style.visibility = 'visible';
+ document.getElementById('detail').style.visibility = 'hidden';
+}
+
+function run(w3, generated_session) {
+ session = generated_session;
+ session.contentGateway = new Wala('http://localhost:8001');
+ document.getElementById('data_account').innerHTML = session.account;
+ document.getElementById('data_contract').innerHTML = session.contractAddress;
+ document.getElementById('panel_submit').addEventListener('click', generatePayload);
+ window.craftnft.getTokens(w3, session, (tokenId) => {
+ if (tokenId.substring(0, 2) == '0x') {
+ tokenId = tokenId.substring(2);
+ }
+ const tokenEvent = new CustomEvent('token', {
+ detail: {
+ tokenId: tokenId,
+ },
+ bubbles: true,
+ cancelable: true,
+ composed: false,
+ });
+ window.dispatchEvent(tokenEvent);
+ });
+}
diff --git a/js/package.json b/js/package.json
@@ -3,7 +3,8 @@
"version": "0.0.1",
"dependencies": {
"web3": "~1.8.1",
- "@metamask/sdk": "~0.1.0"
+ "@metamask/sdk": "~0.1.0",
+ "jssha": "~3.2.0"
},
"scripts": {
"build": "browserify src/engine.js -s craftnft -p esmify -o dist/craft_nft.js"
diff --git a/js/src/common.js b/js/src/common.js
@@ -0,0 +1,38 @@
+var session = {
+ account: undefined,
+ contractAddress: undefined,
+ contract: undefined,
+ name: undefined,
+ symbol: undefined,
+};
+
+
+window.addEventListener('load', async () => {
+ const provider = window.craftnft.loadProvider();
+ const conn = window.craftnft.loadConn(provider);
+
+ let config = undefined;
+ let rs = await fetch('settings.json');
+ if (rs.ok) {
+ config = await rs.json();
+ }
+
+ let abi = undefined;
+ let bin = undefined;
+ rs = await fetch('contract/CraftNFT.json');
+ if (rs.ok) {
+ abi = await rs.json();
+ }
+ rs = await fetch('contract/CraftNFT.bin');
+ if (rs.ok) {
+ bin = await rs.text();
+ }
+ config.abi = abi
+ config.bin = bin
+
+ window.craftnft.startSession(conn, config, session, run);
+});
+
+window.addEventListener('tokenRequest', async(e) => {
+ window.craftnft.allocateToken(session, e.detail.digest, e.detail.amount);
+});
diff --git a/js/src/engine.js b/js/src/engine.js
@@ -1,11 +1,60 @@
const Web3 = require('web3');
import MetaMaskSDK from '@metamask/sdk';
-const mm = new MetaMaskSDK({injectProvider: false});
-const w3_provider = mm.getProvider();
-w3_provider.request({method: 'eth_requestAccounts'});
-const w3 = new Web3(w3_provider);
+function loadProvider() {
+ const mm = new MetaMaskSDK({injectProvider: false});
+ const w3_provider = mm.getProvider();
+ w3_provider.request({method: 'eth_requestAccounts'});
+ return w3_provider;
+}
+
+function loadConn(provider) {
+ const w3 = new Web3(provider);
+ return w3;
+}
+
+function loadContract(w3, config) {
+ const contract = new w3.eth.Contract(config.abi, config.contract);
+ return contract;
+}
+
+async function startSession(w3, config, session, runner) {
+ const acc = await w3.eth.getAccounts();
+ session.account = acc[0];
+ session.contractAddress = config.contract;
+ session.contract = loadContract(w3, config);
+ session.name = await session.contract.methods.name().call({from: session.account});
+ session.symbol = await session.contract.methods.symbol().call({from: session.account});
+ console.debug('session', session);
+ runner(w3, session);
+}
+
+async function getTokens(w3, session, callback) {
+ let i = 0;
+ while (true) {
+ let token = undefined;
+ try {
+ token = await session.contract.methods.tokens(i).call({from: session.account});
+ callback(token);
+ } catch(e) {
+ break;
+ };
+ console.debug('found token', token);
+ i++;
+ }
+}
+
+async function allocateToken(session, tokenId, amount) {
+ session.contract.methods.allocate('0x' + tokenId, amount).send({
+ from: session.account,
+ value: 0,
+ });
+}
module.exports = {
- web3: w3,
+ loadProvider: loadProvider,
+ loadConn: loadConn,
+ startSession: startSession,
+ getTokens: getTokens,
+ allocateToken: allocateToken,
};
diff --git a/js/src/wala.js b/js/src/wala.js
@@ -0,0 +1,22 @@
+function Wala(url) {
+ this.url = url;
+}
+
+Wala.prototype.put = async function(v) {
+ let r = await fetch(this.url, {
+ method: 'put',
+ body: v,
+ });
+ if (!r.ok) {
+ throw ('failed put');
+ }
+ return r.text();
+}
+
+Wala.prototype.get = async function(k) {
+ let r = await fetch(this.url + '/' + k);
+ if (!r.ok) {
+ throw ('failed get');
+ }
+ return r.text();
+}
diff --git a/python/eth_craft_nft/data/CraftNFT.bin b/python/eth_craft_nft/data/CraftNFT.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b506040516200311838038062003118833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612b1580620006036000396000f3fe608060405260043610610152576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063b88d4fde1161008c578063b88d4fde1461049d578063bee2c0b5146104b9578063c87b56dd146104f6578063c9796c3914610533578063e985e9c514610570578063f9613ab2146105ad57610152565b806370a08231146103a45780638da5cb5b146103e157806395d89b411461040c578063a22cb46514610437578063adf288df1461046057610152565b806325cbaa181161011a57806325cbaa181461025557806342842e0e146102925780634d03546a146102ae5780634f64b2be146102eb578063559f5dc9146103285780636352211e1461036757610152565b806301ffc9a71461015757806306fdde0314610194578063081812fc146101bf57806323b872dd146101fc57806324e0febc14610218575b600080fd5b34801561016357600080fd5b5061017e600480360381019061017991906120b8565b6105ea565b60405161018b9190612100565b60405180910390f35b3480156101a057600080fd5b506101a9610790565b6040516101b691906121ab565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190612203565b61081e565b6040516101f39190612271565b60405180910390f35b610216600480360381019061021191906122b8565b61085b565b005b34801561022457600080fd5b5061023f600480360381019061023a9190612341565b6108ca565b60405161024c919061237d565b60405180910390f35b34801561026157600080fd5b5061027c60048036038101906102779190612398565b6108e2565b604051610289919061237d565b60405180910390f35b6102ac60048036038101906102a791906122b8565b610b11565b005b3480156102ba57600080fd5b506102d560048036038101906102d09190612429565b610b80565b6040516102e29190612100565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d9190612203565b610dbe565b60405161031f919061237d565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a9190612469565b610de2565b60405161035e939291906124b8565b60405180910390f35b34801561037357600080fd5b5061038e60048036038101906103899190612203565b610e5b565b60405161039b9190612271565b60405180910390f35b3480156103b057600080fd5b506103cb60048036038101906103c691906124ef565b610e97565b6040516103d8919061252b565b60405180910390f35b3480156103ed57600080fd5b506103f6610e9e565b6040516104039190612271565b60405180910390f35b34801561041857600080fd5b50610421610ec2565b60405161042e91906121ab565b60405180910390f35b34801561044357600080fd5b5061045e60048036038101906104599190612572565b610f50565b005b34801561046c57600080fd5b50610487600480360381019061048291906125b2565b6111f2565b604051610494919061237d565b60405180910390f35b6104b760048036038101906104b29190612727565b6112fb565b005b3480156104c557600080fd5b506104e060048036038101906104db91906127aa565b6113d2565b6040516104ed9190612816565b60405180910390f35b34801561050257600080fd5b5061051d60048036038101906105189190612203565b6114a5565b60405161052a91906121ab565b60405180910390f35b34801561053f57600080fd5b5061055a60048036038101906105559190612341565b611555565b60405161056791906121ab565b60405180910390f35b34801561057c57600080fd5b5061059760048036038101906105929190612831565b611b70565b6040516105a49190612100565b60405180910390f35b3480156105b957600080fd5b506105d460048036038101906105cf9190612341565b611c08565b6040516105e1919061237d565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361063e576001905061078b565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610690576001905061078b565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106e2576001905061078b565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610734576001905061078b565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610786576001905061078b565b600090505b919050565b6006805461079d906128a0565b80601f01602080910402602001604051908101604052809291908181526020018280546107c9906128a0565b80156108165780601f106107eb57610100808354040283529160200191610816565b820191906000526020600020905b8154815290600101906020018083116107f957829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606061086984848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b60008060008060026000878152602001908152602001600020858154811061090d5761090c6128d1565b5b906000526020600020019050600085148015610947575060008160000160009054906101000a900465ffffffffffff1665ffffffffffff16145b156109a857600181600001600c8282829054906101000a900465ffffffffffff16610972919061292f565b92506101000a81548165ffffffffffff021916908365ffffffffffff16021790555061099e87876111f2565b9350505050610b0a565b8060000160009054906101000a900465ffffffffffff1665ffffffffffff1681600001600c9054906101000a900465ffffffffffff1665ffffffffffff16106109f057600080fd5b64ffffffffff866001900416915060d0829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508673ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000086600190041692506014859060020a028317925080600001600c9054906101000a900465ffffffffffff1665ffffffffffff1683179250600181600001600c8282829054906101000a900465ffffffffffff16610ac6919061292f565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160010260036000856001028152602001908152602001600020819055505050505b9392505050565b6060610b1f84848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bde57600080fd5b610be6612013565b600260008781526020019081526020016000208054905092506000831115610cb657600060026000888152602001908152602001600020600081548110610c3057610c2f6128d1565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff1611610c6257600080fd5b60026000878152602001908152602001600020600184610c829190612969565b81548110610c9357610c926128d1565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1691505b84816000019065ffffffffffff16908165ffffffffffff16815250508482610cde919061292f565b816020019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff160217905550505050505092915050565b60018181548110610dce57600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610dfe57600080fd5b90600052602060002001600091509150508060000160009054906101000a900465ffffffffffff16908060000160069054906101000a900465ffffffffffff169080600001600c9054906101000a900465ffffffffffff16905083565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610ecf906128a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610efb906128a0565b8015610f485780601f10610f1d57610100808354040283529160200191610f48565b820191906000526020600020905b815481529060010190602001808311610f2b57829003601f168201915b505050505081565b801561107157600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fee57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611189565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361110957600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516111e69190612100565b60405180910390a35050565b6000806000600160026000868152602001908152602001600020805490501461121a57600080fd5b600060026000868152602001908152602001600020600081548110611242576112416128d1565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff161461127457600080fd5b600060010260036000868152602001908152602001600020541461129757600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1691507fc00000000000000000000000000000000000000000000000000000000000000082179150816001026003600086815260200190815260200160002081905550839250505092915050565b61130784848484611cb4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516113c4919061237d565b60405180910390a450505050565b6000808290505b600260008681526020019081526020016000208054905081101561147957836fffffffffffffffffffffffffffffffff1660026000878152602001908152602001600020828154811061142f5761142e6128d1565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1665ffffffffffff161115611466578091505061149e565b80806114719061299d565b9150506113d9565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b606060003073ffffffffffffffffffffffffffffffffffffffff1663f9613ab2846001026040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611501919061237d565b602060405180830381865afa15801561151e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154291906129fa565b905061154d81611555565b915050919050565b606080600080604767ffffffffffffffff811115611576576115756125fc565b5b6040519080825280601f01601f1916602001820160405280156115a85781602001600182028036833780820191505090505b5092507f7300000000000000000000000000000000000000000000000000000000000000836000815181106115e0576115df6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f680000000000000000000000000000000000000000000000000000000000000083600181518110611644576116436128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6100000000000000000000000000000000000000000000000000000000000000836002815181106116a8576116a76128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f32000000000000000000000000000000000000000000000000000000000000008360038151811061170c5761170b6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3500000000000000000000000000000000000000000000000000000000000000836004815181106117705761176f6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106117d4576117d36128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a0000000000000000000000000000000000000000000000000000000000000083600681518110611838576118376128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611b6457600460f087836020811061188e5761188d6128d1565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015611966576030836118fd9190612a34565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611932576119316128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506119d8565b6057836119739190612a34565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106119a8576119a76128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f8682602081106119ed576119ec6128d1565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611ac457603083611a4f9190612a34565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611a7f9190612a69565b81518110611a9057611a8f6128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b42565b605783611ad19190612a34565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611b019190612a69565b81518110611b1257611b116128d1565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611b4f9190612a69565b91508080611b5c9061299d565b91505061186e565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611c2a81611f1e565b611c3357600080fd5b611c3c81611f50565b15611c4a5782915050611caf565b7effffffffff00000000000000000000000000000000000000000000000000006001028116905060d081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600102831681179050809150505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611d0b919061252b565b602060405180830381865afa158015611d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4c9190612ab2565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611d8657600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611eba573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611eb057503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611eb957600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611f178385611f82565b5050505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000807f4000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b600080836001029050600360008281526020019081526020016000205460019004915060008203611fb257600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61209581612060565b81146120a057600080fd5b50565b6000813590506120b28161208c565b92915050565b6000602082840312156120ce576120cd612056565b5b60006120dc848285016120a3565b91505092915050565b60008115159050919050565b6120fa816120e5565b82525050565b600060208201905061211560008301846120f1565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561215557808201518184015260208101905061213a565b60008484015250505050565b6000601f19601f8301169050919050565b600061217d8261211b565b6121878185612126565b9350612197818560208601612137565b6121a081612161565b840191505092915050565b600060208201905081810360008301526121c58184612172565b905092915050565b6000819050919050565b6121e0816121cd565b81146121eb57600080fd5b50565b6000813590506121fd816121d7565b92915050565b60006020828403121561221957612218612056565b5b6000612227848285016121ee565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061225b82612230565b9050919050565b61226b81612250565b82525050565b60006020820190506122866000830184612262565b92915050565b61229581612250565b81146122a057600080fd5b50565b6000813590506122b28161228c565b92915050565b6000806000606084860312156122d1576122d0612056565b5b60006122df868287016122a3565b93505060206122f0868287016122a3565b9250506040612301868287016121ee565b9150509250925092565b6000819050919050565b61231e8161230b565b811461232957600080fd5b50565b60008135905061233b81612315565b92915050565b60006020828403121561235757612356612056565b5b60006123658482850161232c565b91505092915050565b6123778161230b565b82525050565b6000602082019050612392600083018461236e565b92915050565b6000806000606084860312156123b1576123b0612056565b5b60006123bf868287016122a3565b93505060206123d08682870161232c565b92505060406123e1868287016121ee565b9150509250925092565b600065ffffffffffff82169050919050565b612406816123eb565b811461241157600080fd5b50565b600081359050612423816123fd565b92915050565b600080604083850312156124405761243f612056565b5b600061244e8582860161232c565b925050602061245f85828601612414565b9150509250929050565b600080604083850312156124805761247f612056565b5b600061248e8582860161232c565b925050602061249f858286016121ee565b9150509250929050565b6124b2816123eb565b82525050565b60006060820190506124cd60008301866124a9565b6124da60208301856124a9565b6124e760408301846124a9565b949350505050565b60006020828403121561250557612504612056565b5b6000612513848285016122a3565b91505092915050565b612525816121cd565b82525050565b6000602082019050612540600083018461251c565b92915050565b61254f816120e5565b811461255a57600080fd5b50565b60008135905061256c81612546565b92915050565b6000806040838503121561258957612588612056565b5b6000612597858286016122a3565b92505060206125a88582860161255d565b9150509250929050565b600080604083850312156125c9576125c8612056565b5b60006125d7858286016122a3565b92505060206125e88582860161232c565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61263482612161565b810181811067ffffffffffffffff82111715612653576126526125fc565b5b80604052505050565b600061266661204c565b9050612672828261262b565b919050565b600067ffffffffffffffff821115612692576126916125fc565b5b61269b82612161565b9050602081019050919050565b82818337600083830152505050565b60006126ca6126c584612677565b61265c565b9050828152602081018484840111156126e6576126e56125f7565b5b6126f18482856126a8565b509392505050565b600082601f83011261270e5761270d6125f2565b5b813561271e8482602086016126b7565b91505092915050565b6000806000806080858703121561274157612740612056565b5b600061274f878288016122a3565b9450506020612760878288016122a3565b9350506040612771878288016121ee565b925050606085013567ffffffffffffffff8111156127925761279161205b565b5b61279e878288016126f9565b91505092959194509250565b6000806000606084860312156127c3576127c2612056565b5b60006127d18682870161232c565b93505060206127e2868287016121ee565b92505060406127f3868287016121ee565b9150509250925092565b6000819050919050565b612810816127fd565b82525050565b600060208201905061282b6000830184612807565b92915050565b6000806040838503121561284857612847612056565b5b6000612856858286016122a3565b9250506020612867858286016122a3565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806128b857607f821691505b6020821081036128cb576128ca612871565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061293a826123eb565b9150612945836123eb565b9250828201905065ffffffffffff81111561296357612962612900565b5b92915050565b6000612974826121cd565b915061297f836121cd565b925082820390508181111561299757612996612900565b5b92915050565b60006129a8826121cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036129da576129d9612900565b5b600182019050919050565b6000815190506129f481612315565b92915050565b600060208284031215612a1057612a0f612056565b5b6000612a1e848285016129e5565b91505092915050565b600060ff82169050919050565b6000612a3f82612a27565b9150612a4a83612a27565b9250828201905060ff811115612a6357612a62612900565b5b92915050565b6000612a74826121cd565b9150612a7f836121cd565b9250828201905080821115612a9757612a96612900565b5b92915050565b600081519050612aac8161228c565b92915050565b600060208284031215612ac857612ac7612056565b5b6000612ad684828501612a9d565b9150509291505056fea2646970667358221220d829eb2f2fd260add84dee28f547d8e2c6e954b3dbfd88c3b2f5b65daaccd51364736f6c63430008110033
-\ No newline at end of file
+60806040523480156200001157600080fd5b506040516200323238038062003232833981810160405281019062000037919062000236565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600690816200008891906200050c565b5080600790816200009a91906200050c565b505050620005f3565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200010c82620000c1565b810181811067ffffffffffffffff821117156200012e576200012d620000d2565b5b80604052505050565b600062000143620000a3565b905062000151828262000101565b919050565b600067ffffffffffffffff821115620001745762000173620000d2565b5b6200017f82620000c1565b9050602081019050919050565b60005b83811015620001ac5780820151818401526020810190506200018f565b60008484015250505050565b6000620001cf620001c98462000156565b62000137565b905082815260208101848484011115620001ee57620001ed620000bc565b5b620001fb8482856200018c565b509392505050565b600082601f8301126200021b576200021a620000b7565b5b81516200022d848260208601620001b8565b91505092915050565b6000806040838503121562000250576200024f620000ad565b5b600083015167ffffffffffffffff811115620002715762000270620000b2565b5b6200027f8582860162000203565b925050602083015167ffffffffffffffff811115620002a357620002a2620000b2565b5b620002b18582860162000203565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200030e57607f821691505b602082108103620003245762000323620002c6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620003917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200034f565b6200039d86836200034f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003ea620003e4620003de84620003b5565b620003bf565b620003b5565b9050919050565b6000819050919050565b6200040683620003c9565b6200041e6200041582620003f1565b8484546200035f565b825550505050565b600090565b6200043562000426565b62000442818484620003fb565b505050565b5b818110156200046a576200045e6000826200042b565b60018101905062000448565b5050565b601f821115620004b95762000483816200032a565b6200048e846200033f565b810160208510156200049e578190505b620004b6620004ad856200033f565b83018262000447565b50505b505050565b60008160020a8304905092915050565b6000620004e160001984600802620004be565b1980831691505092915050565b6000620004fc8383620004ce565b9150826002028217905092915050565b6200051782620002bb565b67ffffffffffffffff811115620005335762000532620000d2565b5b6200053f8254620002f5565b6200054c8282856200046e565b600060209050601f8311600181146200058457600084156200056f578287015190505b6200057b8582620004ee565b865550620005eb565b601f19841662000594866200032a565b60005b82811015620005be5784890151825560018201915060208501945060208101905062000597565b86831015620005de5784890151620005da601f891682620004ce565b8355505b6001600288020188555050505b505050505050565b612c2f80620006036000396000f3fe60806040526004361061015d576000357c0100000000000000000000000000000000000000000000000000000000900480636352211e116100d3578063b88d4fde1161008c578063b88d4fde146104d3578063bee2c0b5146104ef578063c87b56dd1461052c578063c9796c3914610569578063e985e9c5146105a6578063f9613ab2146105e35761015d565b80636352211e1461039d57806370a08231146103da5780638da5cb5b1461041757806395d89b4114610442578063a22cb4651461046d578063adf288df146104965761015d565b806324e0febc1161012557806324e0febc1461024e57806325cbaa181461028b57806342842e0e146102c85780634d03546a146102e45780634f64b2be14610321578063559f5dc91461035e5761015d565b806301ffc9a71461016257806306fdde031461019f578063081812fc146101ca57806318160ddd1461020757806323b872dd14610232575b600080fd5b34801561016e57600080fd5b50610189600480360381019061018491906121d2565b610620565b604051610196919061221a565b60405180910390f35b3480156101ab57600080fd5b506101b46107c6565b6040516101c191906122c5565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec919061231d565b610854565b6040516101fe919061238b565b60405180910390f35b34801561021357600080fd5b5061021c610891565b60405161022991906123b5565b60405180910390f35b61024c600480360381019061024791906123fc565b61089b565b005b34801561025a57600080fd5b5061027560048036038101906102709190612485565b61090a565b60405161028291906124c1565b60405180910390f35b34801561029757600080fd5b506102b260048036038101906102ad91906124dc565b610922565b6040516102bf91906124c1565b60405180910390f35b6102e260048036038101906102dd91906123fc565b610ba9565b005b3480156102f057600080fd5b5061030b6004803603810190610306919061256d565b610c18565b604051610318919061221a565b60405180910390f35b34801561032d57600080fd5b506103486004803603810190610343919061231d565b610e7f565b60405161035591906124c1565b60405180910390f35b34801561036a57600080fd5b50610385600480360381019061038091906125ad565b610ea3565b604051610394939291906125fc565b60405180910390f35b3480156103a957600080fd5b506103c460048036038101906103bf919061231d565b610f1c565b6040516103d1919061238b565b60405180910390f35b3480156103e657600080fd5b5061040160048036038101906103fc9190612633565b610f58565b60405161040e91906123b5565b60405180910390f35b34801561042357600080fd5b5061042c610f5f565b604051610439919061238b565b60405180910390f35b34801561044e57600080fd5b50610457610f83565b60405161046491906122c5565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f919061268c565b611011565b005b3480156104a257600080fd5b506104bd60048036038101906104b891906126cc565b6112b3565b6040516104ca91906124c1565b60405180910390f35b6104ed60048036038101906104e89190612841565b611415565b005b3480156104fb57600080fd5b50610516600480360381019061051191906128c4565b6114ec565b6040516105239190612930565b60405180910390f35b34801561053857600080fd5b50610553600480360381019061054e919061231d565b6115bf565b60405161056091906122c5565b60405180910390f35b34801561057557600080fd5b50610590600480360381019061058b9190612485565b61166f565b60405161059d91906122c5565b60405180910390f35b3480156105b257600080fd5b506105cd60048036038101906105c8919061294b565b611c8a565b6040516105da919061221a565b60405180910390f35b3480156105ef57600080fd5b5061060a60048036038101906106059190612485565b611d22565b60405161061791906124c1565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361067457600190506107c1565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036106c657600190506107c1565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361071857600190506107c1565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361076a57600190506107c1565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036107bc57600190506107c1565b600090505b919050565b600680546107d3906129ba565b80601f01602080910402602001604051908101604052809291908181526020018280546107ff906129ba565b801561084c5780601f106108215761010080835404028352916020019161084c565b820191906000526020600020905b81548152906001019060200180831161082f57829003601f168201915b505050505081565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600854905090565b60606108a984848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60036020528060005260406000206000915090505481565b60008060008060026000878152602001908152602001600020858154811061094d5761094c6129eb565b5b906000526020600020019050600085148015610987575060008160000160009054906101000a900465ffffffffffff1665ffffffffffff16145b156109e857600181600001600c8282829054906101000a900465ffffffffffff166109b29190612a49565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055506109de87876112b3565b9350505050610ba2565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a4057600080fd5b8060000160009054906101000a900465ffffffffffff1665ffffffffffff1681600001600c9054906101000a900465ffffffffffff1665ffffffffffff1610610a8857600080fd5b64ffffffffff866001900416915060d0829060020a0291507f8000000000000000000000000000000000000000000000000000000000000000821791508673ffffffffffffffffffffffffffffffffffffffff16821791507fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000086600190041692506014859060020a028317925080600001600c9054906101000a900465ffffffffffff1665ffffffffffff1683179250600181600001600c8282829054906101000a900465ffffffffffff16610b5e9190612a49565b92506101000a81548165ffffffffffff021916908365ffffffffffff1602179055508160010260036000856001028152602001908152602001600020819055505050505b9392505050565b6060610bb784848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c7657600080fd5b610c7e61212d565b600260008781526020019081526020016000208054905092506000831115610d4e57600060026000888152602001908152602001600020600081548110610cc857610cc76129eb565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff1611610cfa57600080fd5b60026000878152602001908152602001600020600184610d1a9190612a83565b81548110610d2b57610d2a6129eb565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1691505b84816000019065ffffffffffff16908165ffffffffffff16815250508482610d769190612a49565b816020019065ffffffffffff16908165ffffffffffff168152505060026000878152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060208201518160000160066101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001600c6101000a81548165ffffffffffff021916908365ffffffffffff1602179055505050600186908060018154018082558091505060019003906000526020600020016000909190919091505550505092915050565b60018181548110610e8f57600080fd5b906000526020600020016000915090505481565b60026020528160005260406000208181548110610ebf57600080fd5b90600052602060002001600091509150508060000160009054906101000a900465ffffffffffff16908060000160069054906101000a900465ffffffffffff169080600001600c9054906101000a900465ffffffffffff16905083565b600080600360008460010281526020019081526020016000205490506060819060020a026c010000000000000000000000009004915050919050565b6000919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054610f90906129ba565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbc906129ba565b80156110095780601f10610fde57610100808354040283529160200191611009565b820191906000526020600020905b815481529060010190602001808311610fec57829003601f168201915b505050505081565b801561113257600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110af57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061124a565b600073ffffffffffffffffffffffffffffffffffffffff16600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036111ca57600080fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112a7919061221a565b60405180910390a35050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461131157600080fd5b600160026000868152602001908152602001600020805490501461133457600080fd5b60006002600086815260200190815260200160002060008154811061135c5761135b6129eb565b5b9060005260206000200160000160009054906101000a900465ffffffffffff1665ffffffffffff161461138e57600080fd5b60006001026003600086815260200190815260200160002054146113b157600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1691507fc00000000000000000000000000000000000000000000000000000000000000082179150816001026003600086815260200190815260200160002081905550839250505092915050565b61142184848484611dce565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e60006001026040516114de91906124c1565b60405180910390a450505050565b6000808290505b600260008681526020019081526020016000208054905081101561159357836fffffffffffffffffffffffffffffffff16600260008781526020019081526020016000208281548110611549576115486129eb565b5b9060005260206000200160000160069054906101000a900465ffffffffffff1665ffffffffffff16111561158057809150506115b8565b808061158b90612ab7565b9150506114f3565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90505b9392505050565b606060003073ffffffffffffffffffffffffffffffffffffffff1663f9613ab2846001026040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161161b91906124c1565b602060405180830381865afa158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c9190612b14565b90506116678161166f565b915050919050565b606080600080604767ffffffffffffffff8111156116905761168f612716565b5b6040519080825280601f01601f1916602001820160405280156116c25781602001600182028036833780820191505090505b5092507f7300000000000000000000000000000000000000000000000000000000000000836000815181106116fa576116f96129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f68000000000000000000000000000000000000000000000000000000000000008360018151811061175e5761175d6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6100000000000000000000000000000000000000000000000000000000000000836002815181106117c2576117c16129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f320000000000000000000000000000000000000000000000000000000000000083600381518110611826576118256129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f35000000000000000000000000000000000000000000000000000000000000008360048151811061188a576118896129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106118ee576118ed6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a0000000000000000000000000000000000000000000000000000000000000083600681518110611952576119516129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611c7e57600460f08783602081106119a8576119a76129eb565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015611a8057603083611a179190612b4e565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611a4c57611a4b6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611af2565b605783611a8d9190612b4e565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611ac257611ac16129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868260208110611b0757611b066129eb565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611bde57603083611b699190612b4e565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611b999190612b83565b81518110611baa57611ba96129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611c5c565b605783611beb9190612b4e565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611c1b9190612b83565b81518110611c2c57611c2b6129eb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611c699190612b83565b91508080611c7690612ab7565b915050611988565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008060036000848152602001908152602001600020549050611d4481612038565b611d4d57600080fd5b611d568161206a565b15611d645782915050611dc9565b7effffffffff00000000000000000000000000000000000000000000000000006001028116905060d081908060020a820491505090507fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600102831681179050809150505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611e2591906123b5565b602060405180830381865afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e669190612bcc565b90508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611ea057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611fd4573373ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611fca57503373ffffffffffffffffffffffffffffffffffffffff16600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611fd357600080fd5b5b60006004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612031838561209c565b5050505050565b6000807f8000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000807f4000000000000000000000000000000000000000000000000000000000000000836001900416119050919050565b6000808360010290506003600082815260200190815260200160002054600190049150600082036120cc57600080fd5b7fffffffffffffffffffffffff0000000000000000000000000000000000000000821691508273ffffffffffffffffffffffffffffffffffffffff168217915081600102600360008381526020019081526020016000208190555050505050565b6040518060600160405280600065ffffffffffff168152602001600065ffffffffffff168152602001600065ffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6121af8161217a565b81146121ba57600080fd5b50565b6000813590506121cc816121a6565b92915050565b6000602082840312156121e8576121e7612170565b5b60006121f6848285016121bd565b91505092915050565b60008115159050919050565b612214816121ff565b82525050565b600060208201905061222f600083018461220b565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561226f578082015181840152602081019050612254565b60008484015250505050565b6000601f19601f8301169050919050565b600061229782612235565b6122a18185612240565b93506122b1818560208601612251565b6122ba8161227b565b840191505092915050565b600060208201905081810360008301526122df818461228c565b905092915050565b6000819050919050565b6122fa816122e7565b811461230557600080fd5b50565b600081359050612317816122f1565b92915050565b60006020828403121561233357612332612170565b5b600061234184828501612308565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123758261234a565b9050919050565b6123858161236a565b82525050565b60006020820190506123a0600083018461237c565b92915050565b6123af816122e7565b82525050565b60006020820190506123ca60008301846123a6565b92915050565b6123d98161236a565b81146123e457600080fd5b50565b6000813590506123f6816123d0565b92915050565b60008060006060848603121561241557612414612170565b5b6000612423868287016123e7565b9350506020612434868287016123e7565b925050604061244586828701612308565b9150509250925092565b6000819050919050565b6124628161244f565b811461246d57600080fd5b50565b60008135905061247f81612459565b92915050565b60006020828403121561249b5761249a612170565b5b60006124a984828501612470565b91505092915050565b6124bb8161244f565b82525050565b60006020820190506124d660008301846124b2565b92915050565b6000806000606084860312156124f5576124f4612170565b5b6000612503868287016123e7565b935050602061251486828701612470565b925050604061252586828701612308565b9150509250925092565b600065ffffffffffff82169050919050565b61254a8161252f565b811461255557600080fd5b50565b60008135905061256781612541565b92915050565b6000806040838503121561258457612583612170565b5b600061259285828601612470565b92505060206125a385828601612558565b9150509250929050565b600080604083850312156125c4576125c3612170565b5b60006125d285828601612470565b92505060206125e385828601612308565b9150509250929050565b6125f68161252f565b82525050565b600060608201905061261160008301866125ed565b61261e60208301856125ed565b61262b60408301846125ed565b949350505050565b60006020828403121561264957612648612170565b5b6000612657848285016123e7565b91505092915050565b612669816121ff565b811461267457600080fd5b50565b60008135905061268681612660565b92915050565b600080604083850312156126a3576126a2612170565b5b60006126b1858286016123e7565b92505060206126c285828601612677565b9150509250929050565b600080604083850312156126e3576126e2612170565b5b60006126f1858286016123e7565b925050602061270285828601612470565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61274e8261227b565b810181811067ffffffffffffffff8211171561276d5761276c612716565b5b80604052505050565b6000612780612166565b905061278c8282612745565b919050565b600067ffffffffffffffff8211156127ac576127ab612716565b5b6127b58261227b565b9050602081019050919050565b82818337600083830152505050565b60006127e46127df84612791565b612776565b905082815260208101848484011115612800576127ff612711565b5b61280b8482856127c2565b509392505050565b600082601f8301126128285761282761270c565b5b81356128388482602086016127d1565b91505092915050565b6000806000806080858703121561285b5761285a612170565b5b6000612869878288016123e7565b945050602061287a878288016123e7565b935050604061288b87828801612308565b925050606085013567ffffffffffffffff8111156128ac576128ab612175565b5b6128b887828801612813565b91505092959194509250565b6000806000606084860312156128dd576128dc612170565b5b60006128eb86828701612470565b93505060206128fc86828701612308565b925050604061290d86828701612308565b9150509250925092565b6000819050919050565b61292a81612917565b82525050565b60006020820190506129456000830184612921565b92915050565b6000806040838503121561296257612961612170565b5b6000612970858286016123e7565b9250506020612981858286016123e7565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806129d257607f821691505b6020821081036129e5576129e461298b565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a548261252f565b9150612a5f8361252f565b9250828201905065ffffffffffff811115612a7d57612a7c612a1a565b5b92915050565b6000612a8e826122e7565b9150612a99836122e7565b9250828203905081811115612ab157612ab0612a1a565b5b92915050565b6000612ac2826122e7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612af457612af3612a1a565b5b600182019050919050565b600081519050612b0e81612459565b92915050565b600060208284031215612b2a57612b29612170565b5b6000612b3884828501612aff565b91505092915050565b600060ff82169050919050565b6000612b5982612b41565b9150612b6483612b41565b9250828201905060ff811115612b7d57612b7c612a1a565b5b92915050565b6000612b8e826122e7565b9150612b99836122e7565b9250828201905080821115612bb157612bb0612a1a565b5b92915050565b600081519050612bc6816123d0565b92915050565b600060208284031215612be257612be1612170565b5b6000612bf084828501612bb7565b9150509291505056fea2646970667358221220616703ca0b9a7a2c34d80d5970395c4799bbbd57fb29aa781c8b4c20882e1bab64736f6c63430008110033
+\ 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":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_batch","type":"uint256"}],"name":"mintFromBatchTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"}],"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":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"token","outputs":[{"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":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"},{"internalType":"uint256","name":"_batch","type":"uint256"}],"name":"mintFromBatchTo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"_content","type":"bytes32"}],"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":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"token","outputs":[{"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":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"}]
diff --git a/python/eth_craft_nft/runnable/deploy.py b/python/eth_craft_nft/runnable/deploy.py
@@ -0,0 +1,127 @@
+"""Deploys badge NFT
+
+.. moduleauthor:: Louis Holbrook <dev@holbrook.no>
+.. pgp:: 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
+
+"""
+
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# standard imports
+import sys
+import os
+import json
+import argparse
+import logging
+import time
+from enum import Enum
+
+# external imports
+import chainlib.eth.cli
+from chainlib.chain import ChainSpec
+from chainlib.eth.constant import ZERO_ADDRESS
+from chainlib.settings import ChainSettings
+from chainlib.eth.settings import process_settings
+from chainlib.eth.cli.arg import Arg
+from chainlib.eth.cli.arg import ArgFlag
+from chainlib.eth.cli.arg import process_args
+from chainlib.eth.cli.log import process_log
+from chainlib.eth.cli.config import Config
+from chainlib.eth.cli.config import process_config
+
+# local imports
+from eth_craft_nft import CraftNFT
+
+logg = logging.getLogger()
+
+
+def process_config_local(config, arg, args, flags):
+ config.add(args.name, '_TOKEN_NAME', False)
+ config.add(args.symbol, '_TOKEN_SYMBOL', False)
+ return config
+
+
+arg_flags = ArgFlag()
+arg = Arg(arg_flags)
+flags = arg_flags.STD_WRITE | arg_flags.WALLET | arg_flags.CREATE | arg_flags.VALUE | arg_flags.TAB
+
+argparser = chainlib.eth.cli.ArgumentParser()
+argparser.add_argument('--name', type=str, required=True, help='Token name')
+argparser.add_argument('--symbol', type=str, required=True, help='Token symbol')
+argparser = process_args(argparser, arg, flags)
+args = argparser.parse_args(sys.argv[1:])
+
+logg = process_log(args, logg)
+
+config = Config()
+config = process_config(config, arg, args, flags)
+config = process_config_local(config, arg, args, flags)
+logg.debug('config loaded:\n{}'.format(config))
+
+settings = ChainSettings()
+settings = process_settings(settings, config)
+logg.debug('settings loaded:\n{}'.format(settings))
+
+
+#arg_flags = chainlib.eth.cli.argflag_std_write
+#argparser = chainlib.eth.cli.ArgumentParser(arg_flags)
+#argparser.add_argument('--name', dest='token_name', type=str, help='Token name')
+#argparser.add_argument('--symbol', dest='token_symbol', type=str, help='Token symbol')
+#args = argparser.parse_args()
+#
+#extra_args = {
+# 'token_name': None,
+# 'token_symbol': None,
+# }
+#config = chainlib.eth.cli.Config.from_args(args, arg_flags, extra_args=extra_args, default_fee_limit=CraftNFT.gas())
+
+#wallet = chainlib.eth.cli.Wallet()
+#wallet.from_config(config)
+
+#rpc = chainlib.eth.cli.Rpc(wallet=wallet)
+#conn = rpc.connect_by_config(config)
+
+#chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
+
+
+def main():
+ #signer = rpc.get_signer()
+ #signer_address = rpc.get_sender_address()
+
+ token_name = config.get('_TOKEN_NAME')
+ token_symbol = config.get('_TOKEN_SYMBOL')
+ conn = settings.get('CONN')
+
+# gas_oracle = rpc.get_gas_oracle()
+# nonce_oracle = rpc.get_nonce_oracle()
+
+ c = CraftNFT(
+ settings.get('CHAIN_SPEC'),
+ signer=settings.get('SIGNER'),
+ gas_oracle=settings.get('FEE_ORACLE'),
+ nonce_oracle=settings.get('NONCE_ORACLE')
+ )
+
+ (tx_hash_hex, o) = c.constructor(
+ settings.get('SENDER_ADDRESS'),
+ token_name,
+ token_symbol,
+ )
+ if config.get('_RPC_SEND'):
+ conn.do(o)
+ if config.true('_WAIT'):
+ r = conn.wait(tx_hash_hex)
+ if r['status'] == 0:
+ sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you')
+ sys.exit(1)
+ # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase)
+ address = r['contractAddress']
+
+ print(address)
+ else:
+ print(tx_hash_hex)
+ else:
+ print(o)
+
+if __name__ == '__main__':
+ main()
diff --git a/python/run_tests.sh b/python/run_tests.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -a
+set -e
+set -x
+default_pythonpath=$PYTHONPATH:.
+export PYTHONPATH=${default_pythonpath:-.}
+>&2 echo using pythonpath $PYTHONPATH
+for f in `ls tests/*.py`; do
+ python $f
+done
+set +x
+set +e
+set +a
diff --git a/solidity/CraftNFT.sol b/solidity/CraftNFT.sol
@@ -21,6 +21,7 @@ contract CraftNFT {
// ERC-721 (Metadata - optional)
string public symbol;
+ uint256 supply;
// ERC-721
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
@@ -77,6 +78,7 @@ contract CraftNFT {
_token.count = count;
_token.cumulativeCount = _cumulativeCount + count;
token[content].push(_token);
+ tokens.push(content);
}
function batchOf(bytes32 _content, uint256 _superIndex, uint256 _startAt) public view returns(int256) {
@@ -92,6 +94,7 @@ contract CraftNFT {
uint256 right;
uint256 first;
+ require(msg.sender == owner);
require(token[_content].length == 1);
require(token[_content][0].count == 0);
require(mintedToken[_content] == bytes32(0x00));
@@ -103,7 +106,7 @@ contract CraftNFT {
return _content;
}
- function setOwner(uint256 _tokenId, address _newOwner) private {
+ function setTokenOwner(uint256 _tokenId, address _newOwner) private {
uint256 _data;
bytes32 _k;
@@ -127,6 +130,7 @@ contract CraftNFT {
spec.cursor += 1;
return mintTo(_recipient, _content);
}
+ require(msg.sender == owner);
require(spec.cursor < spec.count);
right = uint256(_content) & ((1 << 40) - 1);
@@ -189,7 +193,7 @@ contract CraftNFT {
}
tokenAllowance[_tokenId] = address(0);
- setOwner(_tokenId, _to);
+ setTokenOwner(_tokenId, _to);
}
// ERC-721
@@ -278,4 +282,8 @@ contract CraftNFT {
}
return false;
}
+
+ function totalSupply() public view returns(uint256) {
+ return supply;
+ }
}
diff --git a/solidity/Makefile b/solidity/Makefile
@@ -5,5 +5,11 @@ all:
truncate -s -1 CraftNFT.bin
$(SOLC) --abi CraftNFT.sol --evm-version byzantium | awk 'NR>3' > CraftNFT.json
-install: all
+install-py: all
cp -v CraftNFT*{json,bin} ../python/eth_craft_nft/data/
+
+install-js: all
+ cp -v CraftNFT*{json,bin} ../js/contract/
+
+install: install-js install-py
+