commit 1b84f463a193786ce430759969096daff64f25d6
parent facb527d70efd21ea9c65974f5f0c9b61f5b2800
Author: nolash <dev@holbrook.no>
Date: Sun, 24 Oct 2021 15:50:35 +0200
Rehabilitate tests
Diffstat:
10 files changed, 112 insertions(+), 186 deletions(-)
diff --git a/python/MANIFEST.in b/python/MANIFEST.in
@@ -0,0 +1 @@
+include eth_badgetoken/data/* *requirements.txt
diff --git a/python/eth_badgetoken/data/BadgeToken.bin b/python/eth_badgetoken/data/BadgeToken.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b50604051620032963803806200329683398181016040528101906200003791906200022c565b82600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600b9080519060200190620000d0929190620000f3565b5080600c9080519060200190620000e9929190620000f3565b5050505062000472565b82805462000101906200037d565b90600052602060002090601f01602090048101928262000125576000855562000171565b82601f106200014057805160ff191683800117855562000171565b8280016001018555821562000171579182015b828111156200017057825182559160200191906001019062000153565b5b50905062000180919062000184565b5090565b5b808211156200019f57600081600090555060010162000185565b5090565b6000620001ba620001b484620002dd565b620002b4565b905082815260208101848484011115620001d357600080fd5b620001e084828562000347565b509392505050565b600081519050620001f98162000458565b92915050565b600082601f8301126200021157600080fd5b815162000223848260208601620001a3565b91505092915050565b6000806000606084860312156200024257600080fd5b60006200025286828701620001e8565b935050602084015167ffffffffffffffff8111156200027057600080fd5b6200027e86828701620001ff565b925050604084015167ffffffffffffffff8111156200029c57600080fd5b620002aa86828701620001ff565b9150509250925092565b6000620002c0620002d3565b9050620002ce8282620003b3565b919050565b6000604051905090565b600067ffffffffffffffff821115620002fb57620002fa62000418565b5b620003068262000447565b9050602081019050919050565b6000620003208262000327565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60005b83811015620003675780820151818401526020810190506200034a565b8381111562000377576000848401525b50505050565b600060028204905060018216806200039657607f821691505b60208210811415620003ad57620003ac620003e9565b5b50919050565b620003be8262000447565b810181811067ffffffffffffffff82111715620003e057620003df62000418565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b620004638162000313565b81146200046f57600080fd5b50565b612e1480620004826000396000f3fe608060405260043610610152576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063b88d4fde1161008c578063b88d4fde14610456578063c87b56dd14610472578063c9796c39146104af578063e985e9c5146104ec578063f1b0aa1514610529578063f2fde38b1461056657610152565b806370a082311461036f5780638da5cb5b146103ac57806392088cf6146103d757806395d89b4114610402578063a22cb4651461042d57610152565b806323b872dd1161011a57806323b872dd146102435780632f745c591461025f57806342842e0e1461029c578063449a52f8146102b85780634f6ccce7146102f55780636352211e1461033257610152565b806301ffc9a71461015757806306fdde0314610194578063081812fc146101bf578063095ea7b3146101fc57806318160ddd14610218575b600080fd5b34801561016357600080fd5b5061017e60048036038101906101799190612842565b6105a3565b60405161018b9190612924565b60405180910390f35b3480156101a057600080fd5b506101a96107a1565b6040516101b6919061295a565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e1919061286b565b61082f565b6040516101f39190612909565b60405180910390f35b610216600480360381019061021191906127dd565b61086c565b005b34801561022457600080fd5b5061022d610988565b60405161023a919061297c565b60405180910390f35b61025d600480360381019061025891906126d7565b610995565b005b34801561026b57600080fd5b50610286600480360381019061028191906127dd565b610a04565b604051610293919061297c565b60405180910390f35b6102b660048036038101906102b191906126d7565b610adb565b005b3480156102c457600080fd5b506102df60048036038101906102da91906127dd565b610b4a565b6040516102ec9190612924565b60405180910390f35b34801561030157600080fd5b5061031c6004803603810190610317919061286b565b610e24565b604051610329919061297c565b60405180910390f35b34801561033e57600080fd5b506103596004803603810190610354919061286b565b610e72565b6040516103669190612909565b60405180910390f35b34801561037b57600080fd5b5061039660048036038101906103919190612672565b610eaf565b6040516103a3919061297c565b60405180910390f35b3480156103b857600080fd5b506103c1610ef8565b6040516103ce9190612909565b60405180910390f35b3480156103e357600080fd5b506103ec610f1c565b6040516103f99190612909565b60405180910390f35b34801561040e57600080fd5b50610417610f42565b604051610424919061295a565b60405180910390f35b34801561043957600080fd5b50610454600480360381019061044f91906127a1565b610fd0565b005b610470600480360381019061046b9190612726565b611273565b005b34801561047e57600080fd5b506104996004803603810190610494919061286b565b6113bd565b6040516104a6919061295a565b60405180910390f35b3480156104bb57600080fd5b506104d660048036038101906104d19190612819565b611429565b6040516104e3919061295a565b60405180910390f35b3480156104f857600080fd5b50610513600480360381019061050e919061269b565b611c58565b6040516105209190612924565b60405180910390f35b34801561053557600080fd5b50610550600480360381019061054b919061286b565b611cf0565b60405161055d919061297c565b60405180910390f35b34801561057257600080fd5b5061058d60048036038101906105889190612672565b611d56565b60405161059a9190612924565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156105f8576001905061079c565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561064b576001905061079c565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561069e576001905061079c565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156106f1576001905061079c565b63f1b0aa157c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610744576001905061079c565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610797576001905061079c565b600090505b919050565b600b80546107ae90612bc1565b80601f01602080910402602001604051908101604052809291908181526020018280546107da90612bc1565b80156108275780601f106107fc57610100808354040283529160200191610827565b820191906000526020600020905b81548152906001019060200180831161080a57829003601f168201915b505050505081565b60006008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d757600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000600180549050905090565b60606109a384848484611f7c565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548210610a5157600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610ac8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6060610ae984848484611f7c565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ba457600080fd5b600060036000848152602001908152602001600020541480610bcb57506000600180549050145b610bd457600080fd5b600080600180549050915083905060018190806001815401808255809150506001900390600052602060002001600090919091909150558160036000838152602001908152602001600020819055506002439080600181540180825580915050600190039060005260206000200160009091909190915055846004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360066000600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050815260200190815260200160002081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610dae90612c24565b91905055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f886604051610e10919061297c565b60405180910390a360019250505092915050565b600060018281548110610e60577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c8054610f4f90612bc1565b80601f0160208091040260200160405190810160405280929190818152602001828054610f7b90612bc1565b8015610fc85780601f10610f9d57610100808354040283529160200191610fc8565b820191906000526020600020905b815481529060010190602001808311610fab57829003601f168201915b505050505081565b80156110f157600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106e57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061120a565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561118a57600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112679190612924565b60405180910390a35050565b61127f84848484611f7c565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e600a60008781526020019081526020016000206001600a6000898152602001908152602001600020805490506113609190612a96565b81548110611397577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546040516113af919061293f565b60405180910390a450505050565b6060611422600160036000858152602001908152602001600020548154811061140f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154600102611429565b9050919050565b606080600080604767ffffffffffffffff811115611470577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156114a25781602001600182028036833780820191505090505b5092507f730000000000000000000000000000000000000000000000000000000000000083600081518110611500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f68000000000000000000000000000000000000000000000000000000000000008360018151811061158a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f610000000000000000000000000000000000000000000000000000000000000083600281518110611614577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f32000000000000000000000000000000000000000000000000000000000000008360038151811061169e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f350000000000000000000000000000000000000000000000000000000000000083600481518110611728577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106117b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a000000000000000000000000000000000000000000000000000000000000008360068151811061183c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611c4c57600460f08783602081106118b8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff1610156119b6576030836119279190612a5f565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611982577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611a4e565b6057836119c39190612a5f565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110611a1e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868260208110611a89577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611b8657603083611aeb9190612a5f565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611b1b9190612a09565b81518110611b52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611c2a565b605783611b939190612a5f565b7f01000000000000000000000000000000000000000000000000000000000000000284600184611bc39190612a09565b81518110611bfa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282611c379190612a09565b91508080611c4490612c24565b915050611872565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b6000806003600084815260200190815260200160002054905060028181548110611d43577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611db157600080fd5b60606000606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611e6357602002820191906000526020600020905b815481526020019060010190808311611e4f575b5050505050905060005b8151811015611ed557611ec28387848481518110611eb4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015187611f7c565b8080611ecd90612c24565b915050611e6d565b50846000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019350505050919050565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508473ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461201f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614612153573373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061214957503373ffffffffffffffffffffffffffffffffffffffff16600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61215257600080fd5b5b60006008600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506122349190612a96565b8154811061226b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600660008681526020019081526020016000205481548110612300577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061235e90612b97565b9190505550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061241990612c24565b9190505550836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8251811015612599578281815181106124b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600a60008681526020019081526020016000206020836125419190612c6d565b81548110612578577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550808061259190612c24565b915050612473565b505050505050565b60006125b46125af846129bc565b612997565b9050828152602081018484840111156125cc57600080fd5b6125d7848285612b55565b509392505050565b6000813590506125ee81612d6b565b92915050565b60008135905061260381612d82565b92915050565b60008135905061261881612d99565b92915050565b60008135905061262d81612db0565b92915050565b600082601f83011261264457600080fd5b81356126548482602086016125a1565b91505092915050565b60008135905061266c81612dc7565b92915050565b60006020828403121561268457600080fd5b6000612692848285016125df565b91505092915050565b600080604083850312156126ae57600080fd5b60006126bc858286016125df565b92505060206126cd858286016125df565b9150509250929050565b6000806000606084860312156126ec57600080fd5b60006126fa868287016125df565b935050602061270b868287016125df565b925050604061271c8682870161265d565b9150509250925092565b6000806000806080858703121561273c57600080fd5b600061274a878288016125df565b945050602061275b878288016125df565b935050604061276c8782880161265d565b925050606085013567ffffffffffffffff81111561278957600080fd5b61279587828801612633565b91505092959194509250565b600080604083850312156127b457600080fd5b60006127c2858286016125df565b92505060206127d3858286016125f4565b9150509250929050565b600080604083850312156127f057600080fd5b60006127fe858286016125df565b925050602061280f8582860161265d565b9150509250929050565b60006020828403121561282b57600080fd5b600061283984828501612609565b91505092915050565b60006020828403121561285457600080fd5b60006128628482850161261e565b91505092915050565b60006020828403121561287d57600080fd5b600061288b8482850161265d565b91505092915050565b61289d81612aca565b82525050565b6128ac81612adc565b82525050565b6128bb81612ae8565b82525050565b60006128cc826129ed565b6128d681856129f8565b93506128e6818560208601612b64565b6128ef81612d5a565b840191505092915050565b61290381612b3e565b82525050565b600060208201905061291e6000830184612894565b92915050565b600060208201905061293960008301846128a3565b92915050565b600060208201905061295460008301846128b2565b92915050565b6000602082019050818103600083015261297481846128c1565b905092915050565b600060208201905061299160008301846128fa565b92915050565b60006129a16129b2565b90506129ad8282612bf3565b919050565b6000604051905090565b600067ffffffffffffffff8211156129d7576129d6612d2b565b5b6129e082612d5a565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000612a1482612b3e565b9150612a1f83612b3e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a5457612a53612c9e565b5b828201905092915050565b6000612a6a82612b48565b9150612a7583612b48565b92508260ff03821115612a8b57612a8a612c9e565b5b828201905092915050565b6000612aa182612b3e565b9150612aac83612b3e565b925082821015612abf57612abe612c9e565b5b828203905092915050565b6000612ad582612b1e565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015612b82578082015181840152602081019050612b67565b83811115612b91576000848401525b50505050565b6000612ba282612b3e565b91506000821415612bb657612bb5612c9e565b5b600182039050919050565b60006002820490506001821680612bd957607f821691505b60208210811415612bed57612bec612cfc565b5b50919050565b612bfc82612d5a565b810181811067ffffffffffffffff82111715612c1b57612c1a612d2b565b5b80604052505050565b6000612c2f82612b3e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612c6257612c61612c9e565b5b600182019050919050565b6000612c7882612b3e565b9150612c8383612b3e565b925082612c9357612c92612ccd565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b612d7481612aca565b8114612d7f57600080fd5b50565b612d8b81612adc565b8114612d9657600080fd5b50565b612da281612ae8565b8114612dad57600080fd5b50565b612db981612af2565b8114612dc457600080fd5b50565b612dd081612b3e565b8114612ddb57600080fd5b5056fea2646970667358221220e36021cf090ccd1c0b566add7a32411adad2f4ac59b97c5ebadbb9821e31623064736f6c63430008030033
-\ No newline at end of file
+60806040523480156200001157600080fd5b506040516200300b3803806200300b833981810160405281019062000037919062000238565b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600b9080519060200190620000d0929190620000f3565b5081600c9080519060200190620000e9929190620000f3565b50505050620004a4565b82805462000101906200039b565b90600052602060002090601f01602090048101928262000125576000855562000171565b82601f106200014057805160ff191683800117855562000171565b8280016001018555821562000171579182015b828111156200017057825182559160200191906001019062000153565b5b50905062000180919062000184565b5090565b5b808211156200019f57600081600090555060010162000185565b5090565b6000620001ba620001b484620002fb565b620002d2565b905082815260208101848484011115620001d957620001d86200046a565b5b620001e684828562000365565b509392505050565b600081519050620001ff816200048a565b92915050565b600082601f8301126200021d576200021c62000465565b5b81516200022f848260208601620001a3565b91505092915050565b60008060006060848603121562000254576200025362000474565b5b600084015167ffffffffffffffff8111156200027557620002746200046f565b5b620002838682870162000205565b935050602084015167ffffffffffffffff811115620002a757620002a66200046f565b5b620002b58682870162000205565b9250506040620002c886828701620001ee565b9150509250925092565b6000620002de620002f1565b9050620002ec8282620003d1565b919050565b6000604051905090565b600067ffffffffffffffff82111562000319576200031862000436565b5b620003248262000479565b9050602081019050919050565b60006200033e8262000345565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60005b838110156200038557808201518184015260208101905062000368565b8381111562000395576000848401525b50505050565b60006002820490506001821680620003b457607f821691505b60208210811415620003cb57620003ca62000407565b5b50919050565b620003dc8262000479565b810181811067ffffffffffffffff82111715620003fe57620003fd62000436565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b620004958162000331565b8114620004a157600080fd5b50565b612b5780620004b46000396000f3fe60806040526004361061015d576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100d3578063c793c6c11161008c578063c793c6c11461047d578063c87b56dd146104ba578063c9796c39146104f7578063e985e9c514610534578063f1b0aa1514610571578063f2fde38b146105ae5761015d565b806370a082311461037a5780638da5cb5b146103b757806392088cf6146103e257806395d89b411461040d578063a22cb46514610438578063b88d4fde146104615761015d565b806323b872dd1161012557806323b872dd1461024e5780632f745c591461026a57806342842e0e146102a7578063449a52f8146102c35780634f6ccce7146103005780636352211e1461033d5761015d565b806301ffc9a71461016257806306fdde031461019f578063081812fc146101ca578063095ea7b31461020757806318160ddd14610223575b600080fd5b34801561016e57600080fd5b506101896004803603810190610184919061253a565b6105eb565b6040516101969190612624565b60405180910390f35b3480156101ab57600080fd5b506101b46107e9565b6040516101c1919061265a565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec9190612567565b610877565b6040516101fe9190612609565b60405180910390f35b610221600480360381019061021c91906124cd565b6108b4565b005b34801561022f57600080fd5b506102386109d0565b604051610245919061267c565b60405180910390f35b610268600480360381019061026391906123b7565b6109dd565b005b34801561027657600080fd5b50610291600480360381019061028c91906124cd565b610a4c565b60405161029e919061267c565b60405180910390f35b6102c160048036038101906102bc91906123b7565b610afd565b005b3480156102cf57600080fd5b506102ea60048036038101906102e591906124cd565b610b6c565b6040516102f79190612624565b60405180910390f35b34801561030c57600080fd5b5061032760048036038101906103229190612567565b610e46565b604051610334919061267c565b60405180910390f35b34801561034957600080fd5b50610364600480360381019061035f9190612567565b610e6e565b6040516103719190612609565b60405180910390f35b34801561038657600080fd5b506103a1600480360381019061039c919061234a565b610eab565b6040516103ae919061267c565b60405180910390f35b3480156103c357600080fd5b506103cc610ef4565b6040516103d99190612609565b60405180910390f35b3480156103ee57600080fd5b506103f7610f18565b6040516104049190612609565b60405180910390f35b34801561041957600080fd5b50610422610f3e565b60405161042f919061265a565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a919061248d565b610fcc565b005b61047b6004803603810190610476919061240a565b61126f565b005b34801561048957600080fd5b506104a4600480360381019061049f919061234a565b611393565b6040516104b1919061267c565b60405180910390f35b3480156104c657600080fd5b506104e160048036038101906104dc9190612567565b6113ab565b6040516104ee919061265a565b60405180910390f35b34801561050357600080fd5b5061051e6004803603810190610519919061250d565b6113f1565b60405161052b919061265a565b60405180910390f35b34801561054057600080fd5b5061055b60048036038101906105569190612377565b611a0c565b6040516105689190612624565b60405180910390f35b34801561057d57600080fd5b5061059860048036038101906105939190612567565b611aa4565b6040516105a5919061267c565b60405180910390f35b3480156105ba57600080fd5b506105d560048036038101906105d0919061234a565b611ae4565b6040516105e29190612624565b60405180910390f35b60006380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561064057600190506107e4565b635b5e139f7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561069357600190506107e4565b63780e9d637c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156106e657600190506107e4565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561073957600190506107e4565b63f1b0aa157c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561078c57600190506107e4565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156107df57600190506107e4565b600090505b919050565b600b80546107f6906128c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610822906128c1565b801561086f5780601f106108445761010080835404028352916020019161086f565b820191906000526020600020905b81548152906001019060200180831161085257829003601f168201915b505050505081565b60006008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff166004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461091f57600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000600180549050905090565b60606109eb84848484611ce4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548210610a9957600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610aea57610ae9612a2b565b5b9060005260206000200154905092915050565b6060610b0b84848484611ce4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc657600080fd5b600060036000848152602001908152602001600020541480610bed57506000600180549050145b610bf657600080fd5b600080600180549050915083905060018190806001815401808255809150506001900390600052602060002001600090919091909150558160036000838152602001908152602001600020819055506002439080600181540180825580915050600190039060005260206000200160009091909190915055846004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360066000600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050815260200190815260200160002081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610dd090612924565b91905055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f886604051610e32919061267c565b60405180910390a360019250505092915050565b600060018281548110610e5c57610e5b612a2b565b5b90600052602060002001549050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c8054610f4b906128c1565b80601f0160208091040260200160405190810160405280929190818152602001828054610f77906128c1565b8015610fc45780601f10610f9957610100808354040283529160200191610fc4565b820191906000526020600020905b815481529060010190602001808311610fa757829003601f168201915b505050505081565b80156110ed57600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106a57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611206565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561118657600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112639190612624565b60405180910390a35050565b61127b84848484611ce4565b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75c9e114f073c346aac7d1d7e9a3c3c14edabcdd27de07d1d9e425f45d318c5e600a60008781526020019081526020016000206001600a60008981526020019081526020016000208054905061135c9190612796565b8154811061136d5761136c612a2b565b5b9060005260206000200154604051611385919061263f565b60405180910390a450505050565b60076020528060005260406000206000915090505481565b60606113ea60016003600085815260200190815260200160002054815481106113d7576113d6612a2b565b5b90600052602060002001546001026113f1565b9050919050565b606080600080604767ffffffffffffffff81111561141257611411612a5a565b5b6040519080825280601f01601f1916602001820160405280156114445781602001600182028036833780820191505090505b5092507f73000000000000000000000000000000000000000000000000000000000000008360008151811061147c5761147b612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f6800000000000000000000000000000000000000000000000000000000000000836001815181106114e0576114df612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f61000000000000000000000000000000000000000000000000000000000000008360028151811061154457611543612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3200000000000000000000000000000000000000000000000000000000000000836003815181106115a8576115a7612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f35000000000000000000000000000000000000000000000000000000000000008360048151811061160c5761160b612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3600000000000000000000000000000000000000000000000000000000000000836005815181106116705761166f612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f3a00000000000000000000000000000000000000000000000000000000000000836006815181106116d4576116d3612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506007905060005b6020811015611a0057600460f087836020811061172a57611729612a2b565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff16101561180257603083611799919061275f565b7f0100000000000000000000000000000000000000000000000000000000000000028483815181106117ce576117cd612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611874565b60578361180f919061275f565b7f01000000000000000000000000000000000000000000000000000000000000000284838151811061184457611843612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f86826020811061188957611888612a2b565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015611960576030836118eb919061275f565b7f0100000000000000000000000000000000000000000000000000000000000000028460018461191b9190612709565b8151811061192c5761192b612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506119de565b60578361196d919061275f565b7f0100000000000000000000000000000000000000000000000000000000000000028460018461199d9190612709565b815181106119ae576119ad612a2b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b6002826119eb9190612709565b915080806119f890612924565b91505061170a565b50829350505050919050565b60008173ffffffffffffffffffffffffffffffffffffffff16600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b6000806003600084815260200190815260200160002054905060028181548110611ad157611ad0612a2b565b5b9060005260206000200154915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3f57600080fd5b60606000606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611bf157602002820191906000526020600020905b815481526020019060010190808311611bdd575b5050505050905060005b8151811015611c3d57611c2a8387848481518110611c1c57611c1b612a2b565b5b602002602001015187611ce4565b8080611c3590612924565b915050611bfb565b50846000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019350505050919050565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508473ffffffffffffffffffffffffffffffffffffffff166004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d8757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611ebb573373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611eb157503373ffffffffffffffffffffffffffffffffffffffff16600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b611eba57600080fd5b5b60006008600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050611f9c9190612796565b81548110611fad57611fac612a2b565b5b9060005260206000200154600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060066000868152602001908152602001600020548154811061201c5761201b612a2b565b5b9060005260206000200181905550600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061207a90612897565b9190505550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061213590612924565b9190505550836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8251811015612269578281815181106121ab576121aa612a2b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600a6000868152602001908152602001600020602083612237919061296d565b8154811061224857612247612a2b565b5b9060005260206000200181905550808061226190612924565b91505061218f565b505050505050565b600061228461227f846126bc565b612697565b9050828152602081018484840111156122a05761229f612a8e565b5b6122ab848285612855565b509392505050565b6000813590506122c281612aae565b92915050565b6000813590506122d781612ac5565b92915050565b6000813590506122ec81612adc565b92915050565b60008135905061230181612af3565b92915050565b600082601f83011261231c5761231b612a89565b5b813561232c848260208601612271565b91505092915050565b60008135905061234481612b0a565b92915050565b6000602082840312156123605761235f612a98565b5b600061236e848285016122b3565b91505092915050565b6000806040838503121561238e5761238d612a98565b5b600061239c858286016122b3565b92505060206123ad858286016122b3565b9150509250929050565b6000806000606084860312156123d0576123cf612a98565b5b60006123de868287016122b3565b93505060206123ef868287016122b3565b925050604061240086828701612335565b9150509250925092565b6000806000806080858703121561242457612423612a98565b5b6000612432878288016122b3565b9450506020612443878288016122b3565b935050604061245487828801612335565b925050606085013567ffffffffffffffff81111561247557612474612a93565b5b61248187828801612307565b91505092959194509250565b600080604083850312156124a4576124a3612a98565b5b60006124b2858286016122b3565b92505060206124c3858286016122c8565b9150509250929050565b600080604083850312156124e4576124e3612a98565b5b60006124f2858286016122b3565b925050602061250385828601612335565b9150509250929050565b60006020828403121561252357612522612a98565b5b6000612531848285016122dd565b91505092915050565b6000602082840312156125505761254f612a98565b5b600061255e848285016122f2565b91505092915050565b60006020828403121561257d5761257c612a98565b5b600061258b84828501612335565b91505092915050565b61259d816127ca565b82525050565b6125ac816127dc565b82525050565b6125bb816127e8565b82525050565b60006125cc826126ed565b6125d681856126f8565b93506125e6818560208601612864565b6125ef81612a9d565b840191505092915050565b6126038161283e565b82525050565b600060208201905061261e6000830184612594565b92915050565b600060208201905061263960008301846125a3565b92915050565b600060208201905061265460008301846125b2565b92915050565b6000602082019050818103600083015261267481846125c1565b905092915050565b600060208201905061269160008301846125fa565b92915050565b60006126a16126b2565b90506126ad82826128f3565b919050565b6000604051905090565b600067ffffffffffffffff8211156126d7576126d6612a5a565b5b6126e082612a9d565b9050602081019050919050565b600081519050919050565b600082825260208201905092915050565b60006127148261283e565b915061271f8361283e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127545761275361299e565b5b828201905092915050565b600061276a82612848565b915061277583612848565b92508260ff0382111561278b5761278a61299e565b5b828201905092915050565b60006127a18261283e565b91506127ac8361283e565b9250828210156127bf576127be61299e565b5b828203905092915050565b60006127d58261281e565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015612882578082015181840152602081019050612867565b83811115612891576000848401525b50505050565b60006128a28261283e565b915060008214156128b6576128b561299e565b5b600182039050919050565b600060028204905060018216806128d957607f821691505b602082108114156128ed576128ec6129fc565b5b50919050565b6128fc82612a9d565b810181811067ffffffffffffffff8211171561291b5761291a612a5a565b5b80604052505050565b600061292f8261283e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129625761296161299e565b5b600182019050919050565b60006129788261283e565b91506129838361283e565b925082612993576129926129cd565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b612ab7816127ca565b8114612ac257600080fd5b50565b612ace816127dc565b8114612ad957600080fd5b50565b612ae5816127e8565b8114612af057600080fd5b50565b612afc816127f2565b8114612b0757600080fd5b50565b612b138161283e565b8114612b1e57600080fd5b5056fea26469706673582212204c1d8c1fd199ba9efdfd279fed72405482e47256d1a2a2d85e40c52655e3afc864736f6c63430008060033
+\ No newline at end of file
diff --git a/python/eth_badgetoken/data/BadgeToken.json b/python/eth_badgetoken/data/BadgeToken.json
@@ -1 +1 @@
-[{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"TransferWithData","type":"event"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"declarator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
+[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_declarator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"TransferWithData","type":"event"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"declarator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenOwnerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
diff --git a/python/eth_badgetoken/runnable/deploy.py b/python/eth_badgetoken/runnable/deploy.py
@@ -17,17 +17,8 @@ import time
from enum import Enum
# external imports
-from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
-from crypto_dev_signer.keystore.dict import DictKeystore
+import chainlib.eth.cli
from chainlib.chain import ChainSpec
-from chainlib.eth.nonce import (
- RPCNonceOracle,
- OverrideNonceOracle,
- )
-from chainlib.eth.gas import (
- RPCGasOracle,
- OverrideGasOracle,
- )
from chainlib.eth.connection import EthHTTPConnection
from chainlib.eth.tx import receipt
from chainlib.eth.constant import ZERO_ADDRESS
@@ -38,83 +29,46 @@ from eth_badgetoken import BadgeToken
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
-script_dir = os.path.dirname(__file__)
-data_dir = os.path.join(script_dir, '..', 'data')
-
-
-argparser = argparse.ArgumentParser()
-argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
-argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
-argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
-argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
-argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
-argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration')
-argparser.add_argument('--name', default='Giftable Token', type=str, help='Token name')
-argparser.add_argument('--symbol', default='GFT', type=str, help='Token symbol')
-argparser.add_argument('--declarator-address', dest='declarator_address', type=str, default=ZERO_ADDRESS, help='Token decimals')
-argparser.add_argument('-d', action='store_true', help='Dump RPC calls to terminal and do not send')
-argparser.add_argument('--gas-price', type=int, dest='gas_price', help='Override gas price')
-argparser.add_argument('--nonce', type=int, help='Override transaction nonce')
-argparser.add_argument('-v', action='store_true', help='Be verbose')
-argparser.add_argument('-vv', action='store_true', help='Be more verbose')
+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')
+argparser.add_argument('--declarator', dest='token_declarator', default=ZERO_ADDRESS, type=str, help='Address declarator contract')
args = argparser.parse_args()
-if args.vv:
- logg.setLevel(logging.DEBUG)
-elif args.v:
- logg.setLevel(logging.INFO)
+extra_args = {
+ 'token_name': None,
+ 'token_symbol': None,
+ 'token_declarator': None,
+ }
+config = chainlib.eth.cli.Config.from_args(args, arg_flags, extra_args=extra_args, default_fee_limit=BadgeToken.gas())
-block_all = args.ww
-block_last = args.w or block_all
+wallet = chainlib.eth.cli.Wallet()
+wallet.from_config(config)
-passphrase_env = 'ETH_PASSPHRASE'
-if args.env_prefix != None:
- passphrase_env = args.env_prefix + '_' + passphrase_env
-passphrase = os.environ.get(passphrase_env)
-if passphrase == None:
- logg.warning('no passphrase given')
- passphrase=''
+rpc = chainlib.eth.cli.Rpc(wallet=wallet)
+conn = rpc.connect_by_config(config)
-signer_address = None
-keystore = DictKeystore()
-if args.y != None:
- logg.debug('loading keystore file {}'.format(args.y))
- signer_address = keystore.import_keystore_file(args.y, password=passphrase)
- logg.debug('now have key for signer address {}'.format(signer_address))
-signer = EIP155Signer(keystore)
+chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
-chain_spec = ChainSpec.from_chain_str(args.i)
-rpc = EthHTTPConnection(args.p)
-nonce_oracle = None
-if args.nonce != None:
- nonce_oracle = OverrideNonceOracle(signer_address, args.nonce)
-else:
- nonce_oracle = RPCNonceOracle(signer_address, rpc)
-
-gas_oracle = None
-if args.gas_price !=None:
- gas_oracle = OverrideGasOracle(price=args.gas_price, conn=rpc, code_callback=BadgeToken.gas)
-else:
- gas_oracle = RPCGasOracle(rpc, code_callback=BadgeToken.gas)
-
-dummy = args.d
+def main():
+ signer = rpc.get_signer()
+ signer_address = rpc.get_sender_address()
-token_name = args.name
-token_symbol = args.symbol
-token_declarator = args.declarator_address
+ token_name = config.get('_TOKEN_NAME')
+ token_symbol = config.get('_TOKEN_SYMBOL')
+ token_declarator = config.get('_TOKEN_DECLARATOR')
+ gas_oracle = rpc.get_gas_oracle()
+ nonce_oracle = rpc.get_nonce_oracle()
-def main():
c = BadgeToken(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
- (tx_hash_hex, o) = c.constructor(signer_address, token_declarator, token_name, token_symbol)
- if dummy:
- print(tx_hash_hex)
- print(o)
- else:
- rpc.do(o)
- if block_last:
- r = rpc.wait(tx_hash_hex)
+ (tx_hash_hex, o) = c.constructor(signer_address, token_name, token_symbol, token_declarator)
+ if config.get('_RPC_SEND'):
+ conn.do(o)
+ if config.get('_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)
@@ -124,7 +78,8 @@ def main():
print(address)
else:
print(tx_hash_hex)
-
+ else:
+ print(o)
if __name__ == '__main__':
main()
diff --git a/python/eth_badgetoken/runnable/mint.py b/python/eth_badgetoken/runnable/mint.py
@@ -15,21 +15,16 @@ import argparse
import logging
import time
-# third-party imports
-from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
-from crypto_dev_signer.keystore.dict import DictKeystore
+# external imports
+import chainlib.eth.cli
from chainlib.eth.tx import receipt
from chainlib.chain import ChainSpec
-from chainlib.eth.nonce import (
- RPCNonceOracle,
- OverrideNonceOracle,
- )
-from chainlib.eth.gas import (
- RPCGasOracle,
- OverrideGasOracle,
- )
from chainlib.eth.connection import EthHTTPConnection
-from hexathon import strip_0x
+from chainlib.eth.address import to_checksum_address
+from hexathon import (
+ strip_0x,
+ add_0x,
+ )
# local imports
from eth_badgetoken import BadgeToken
@@ -40,92 +35,64 @@ logg = logging.getLogger()
script_dir = os.path.dirname(__file__)
data_dir = os.path.join(script_dir, '..', 'data')
-argparser = argparse.ArgumentParser()
-argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
-argparser.add_argument('-e', action='store_true', help='Treat all transactions as essential')
-argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
-argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
-argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
-argparser.add_argument('-a', '--token-address', required='True', dest='a', type=str, help='Giftable token address')
-argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
-argparser.add_argument('-v', action='store_true', help='Be verbose')
-argparser.add_argument('-vv', action='store_true', help='Be more verbose')
-argparser.add_argument('-d', action='store_true', help='Dump RPC calls to terminal and do not send')
-argparser.add_argument('--gas-price', type=int, dest='gas_price', help='Override gas price')
-argparser.add_argument('--nonce', type=int, help='Override transaction nonce')
-argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration')
-argparser.add_argument('--recipient', type=str, help='Recipient account address. If not set, tokens will be gifted to the keystore account')
-argparser.add_argument('token_id', type=str, help='32 bytes digest to use as token id')
+arg_flags = chainlib.eth.cli.argflag_std_write | chainlib.eth.cli.Flag.EXEC | chainlib.eth.cli.Flag.WALLET
+argparser = chainlib.eth.cli.ArgumentParser(arg_flags)
+argparser.add_positional('token_id', type=str, help='32 bytes digest to use as token id')
args = argparser.parse_args()
+extra_args = {
+ 'token_id': None,
+ }
+config = chainlib.eth.cli.Config.from_args(args, arg_flags, extra_args=extra_args, default_fee_limit=BadgeToken.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'))
+
+token_id_bytes = bytes.fromhex(strip_0x(config.get('_TOKEN_ID')))
+if len(token_id_bytes) != 32:
+ raise ValueError('token id must be 32 bytes')
+token_id = int.from_bytes(token_id_bytes, byteorder='big')
-if args.vv:
- logg.setLevel(logging.DEBUG)
-elif args.v:
- logg.setLevel(logging.INFO)
-
-block_all = args.ww
-block_last = args.w or block_all
-
-passphrase_env = 'ETH_PASSPHRASE'
-if args.env_prefix != None:
- passphrase_env = args.env_prefix + '_' + passphrase_env
-passphrase = os.environ.get(passphrase_env)
-if passphrase == None:
- logg.warning('no passphrase given')
- passphrase=''
-
-signer_address = None
-keystore = DictKeystore()
-if args.y != None:
- logg.debug('loading keystore file {}'.format(args.y))
- signer_address = keystore.import_keystore_file(args.y, password=passphrase)
- logg.debug('now have key for signer address {}'.format(signer_address))
-signer = EIP155Signer(keystore)
-
-chain_spec = ChainSpec.from_chain_str(args.i)
-
-rpc = EthHTTPConnection(args.p)
-nonce_oracle = None
-if args.nonce != None:
- nonce_oracle = OverrideNonceOracle(signer_address, args.nonce)
-else:
- nonce_oracle = RPCNonceOracle(signer_address, rpc)
-
-gas_oracle = None
-if args.gas_price !=None:
- gas_oracle = OverrideGasOracle(price=args.gas_price, conn=rpc, code_callback=BadgeToken.gas)
-else:
- gas_oracle = RPCGasOracle(rpc, code_callback=BadgeToken.gas)
-
-dummy = args.d
-
-token_address = args.a
-recipient_address = args.recipient
-if recipient_address == None:
- recipient_address = signer_address
-token_bytes = bytes.fromhex(strip_0x(args.token_id))
-if len(token_bytes) != 32:
- raise ValueError('token_id must be a 32 byte hex string')
-
-token_id = int.from_bytes(token_bytes, byteorder='big')
def main():
+ signer = rpc.get_signer()
+ signer_address = rpc.get_sender_address()
+
+ gas_oracle = rpc.get_gas_oracle()
+ nonce_oracle = rpc.get_nonce_oracle()
+
c = BadgeToken(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
+
+ recipient_address_input = config.get('_RECIPIENT')
+ if recipient_address_input == None:
+ recipient_address_input = signer_address
+
+ recipient_address = add_0x(to_checksum_address(recipient_address_input))
+ if not config.true('_UNSAFE') and recipient_address != add_0x(recipient_address_input):
+ raise ValueError('invalid checksum address for recipient')
+
+ token_address = add_0x(to_checksum_address(config.get('_EXEC_ADDRESS')))
+ if not config.true('_UNSAFE') and token_address != add_0x(config.get('_EXEC_ADDRESS')):
+ raise ValueError('invalid checksum address for contract')
+
(tx_hash_hex, o) = c.mint_to(token_address, signer_address, recipient_address, token_id)
- if dummy:
- print(tx_hash_hex)
- print(o)
- else:
- rpc.do(o)
- if block_last:
- r = rpc.wait(tx_hash_hex)
+ if config.get('_RPC_SEND'):
+ conn.do(o)
+ if config.get('_WAIT'):
+ r = conn.wait(tx_hash_hex)
if r['status'] == 0:
sys.stderr.write('EVM revert. Wish I had more to tell you')
sys.exit(1)
logg.info('mint to {} tx {}'.format(recipient_address, tx_hash_hex))
-
print(tx_hash_hex)
+ else:
+ print(o)
+
if __name__ == '__main__':
diff --git a/python/eth_badgetoken/token.py b/python/eth_badgetoken/token.py
@@ -15,6 +15,7 @@ from chainlib.jsonrpc import JSONRPCRequest
from chainlib.eth.constant import ZERO_ADDRESS
from hexathon import (
add_0x,
+ strip_0x,
)
# local imports
@@ -52,12 +53,13 @@ class BadgeToken(ERC721):
return 3500000
- def constructor(self, sender_address, declarator, name, symbol, tx_format=TxFormat.JSONRPC):
+ def constructor(self, sender_address, name, symbol, declarator, tx_format=TxFormat.JSONRPC):
+ declarator = strip_0x(declarator)
code = BadgeToken.bytecode()
enc = ABIContractEncoder()
- enc.address(declarator)
enc.string(name)
enc.string(symbol)
+ enc.address(declarator)
code += enc.get()
tx = self.template(sender_address, None, use_nonce=True)
tx = self.set_code(tx, code)
diff --git a/python/requirements.txt b/python/requirements.txt
@@ -1,3 +1,3 @@
-chainlib-eth~=0.0.5a1
-eth-erc20~=0.0.10a1
-eth-owned~=0.0.2a1
+chainlib-eth>=0.0.7a4,<0.1.0
+eth-erc20>=0.1.0,<0.2.0
+eth-owned>=0.0.3a1,<0.1.0
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = eth-erc721
-version = 0.0.2a1
+version = 0.0.3a2
description = ERC721 interface and simple contract with deployment script providing arbitrary minting of NFTs with freely settable tokenids
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/python/tests/test_app.py b/python/tests/test_app.py
@@ -41,7 +41,8 @@ class Test(EthTesterCase):
super(Test, self).setUp()
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
c = BadgeToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
- (tx_hash, o) = c.constructor(self.accounts[0], b'\x00' * 20, 'DevBadge', 'DEV')
+ #(tx_hash, o) = c.constructor(self.accounts[0], b'\x00' * 20, 'DevBadge', 'DEV')
+ (tx_hash, o) = c.constructor(self.accounts[0], 'DevBadge', 'DEV', self.accounts[1])
self.conn = RPCConnection.connect(self.chain_spec, 'default')
r = self.conn.do(o)
logg.debug('deployed with hash {}'.format(r))
@@ -95,7 +96,7 @@ class Test(EthTesterCase):
o = c.owner_of(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
owner_address = c.parse_owner_of(r)
- self.assertEqual(self.accounts[1], owner_address)
+ self.assertEqual(strip_0x(self.accounts[1]), owner_address)
o = c.token_of_owner_by_index(self.address, self.accounts[1], 0, sender_address=self.accounts[0])
r = self.rpc.do(o)
@@ -119,7 +120,7 @@ class Test(EthTesterCase):
o = c.get_approved(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
approved_address = c.parse_get_approved(r)
- self.assertEqual(approved_address, self.accounts[2])
+ self.assertEqual(approved_address, strip_0x(self.accounts[2]))
nonce_oracle = RPCNonceOracle(self.accounts[2], self.rpc)
c = BadgeToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
@@ -133,12 +134,12 @@ class Test(EthTesterCase):
o = c.owner_of(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
owner_address = c.parse_owner_of(r)
- self.assertEqual(owner_address, self.accounts[3])
+ self.assertEqual(owner_address, strip_0x(self.accounts[3]))
o = c.get_approved(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
approved_address = c.parse_get_approved(r)
- self.assertEqual(approved_address, ZERO_ADDRESS)
+ self.assertEqual(approved_address, strip_0x(ZERO_ADDRESS))
@@ -189,7 +190,7 @@ class Test(EthTesterCase):
o = c.owner_of(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
owner_address = c.parse_owner_of(r)
- self.assertEqual(owner_address, self.accounts[3])
+ self.assertEqual(owner_address, strip_0x(self.accounts[3]))
def test_transfer(self):
@@ -242,7 +243,7 @@ class Test(EthTesterCase):
o = c.owner_of(self.address, token_id, sender_address=self.accounts[0])
r = self.rpc.do(o)
owner_address = c.parse_owner_of(r)
- self.assertEqual(self.accounts[4], owner_address)
+ self.assertEqual(strip_0x(self.accounts[4]), owner_address)
def test_token_uri(self):
diff --git a/solidity/BadgeToken.sol b/solidity/BadgeToken.sol
@@ -14,7 +14,7 @@ contract BadgeToken {
mapping(uint256 => address) tokenOwner; // tokenId to owner address
mapping(address => uint256[]) tokenOwnerIndex; // index of owned tokens by owner address
mapping(uint256 => uint256) tokenOwnerIdIndex; // index of owned token ids in tokenOwnerIndex
- mapping(address => uint256) tokenOwnerCursor; // end of token owner index array
+ mapping(address => uint256) public tokenOwnerCount; // end of token owner index array
mapping(uint256 => address) tokenAllowance; // backend for approve
mapping(address => address) tokenOperator; // backend for setApprovalForAll
@@ -44,7 +44,7 @@ contract BadgeToken {
// Minter
event Mint(address indexed _minter, address indexed _beneficiary, uint256 value);
- constructor(address _declarator, string memory _name, string memory _symbol) {
+ constructor(string memory _name, string memory _symbol, address _declarator) {
declarator = _declarator;
owner = msg.sender;
name = _name;
@@ -54,7 +54,7 @@ contract BadgeToken {
// ERC-721
function balanceOf(address _owner) external view returns (uint256) {
- return tokenOwnerCursor[_owner];
+ return tokenOwnerCount[_owner];
}
// ERC-721
@@ -75,10 +75,10 @@ contract BadgeToken {
tokenAllowance[_tokenId] = address(0);
tokenOwnerIndex[_from][tokenOwnerIdIndex[_tokenId]] = tokenOwnerIndex[_from][tokenOwnerIndex[_from].length-1];
- tokenOwnerCursor[_from]--;
+ tokenOwnerCount[_from]--;
tokenOwnerIndex[_to].push(_tokenId);
- tokenOwnerCursor[_to]++;
+ tokenOwnerCount[_to]++;
tokenOwner[_tokenId] = _to;
@@ -153,7 +153,7 @@ contract BadgeToken {
// ERC-721 (Enumerable - optional)
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) {
- require(_index < tokenOwnerCursor[_owner]);
+ require(_index < tokenOwnerCount[_owner]);
return tokenOwnerIndex[_owner][_index];
}
@@ -214,7 +214,7 @@ contract BadgeToken {
tokenOwner[newTokenId] = _beneficiary;
tokenOwnerIdIndex[tokenOwnerIndex[_beneficiary].length] = _tokenId;
tokenOwnerIndex[_beneficiary].push(_tokenId);
- tokenOwnerCursor[_beneficiary]++;
+ tokenOwnerCount[_beneficiary]++;
emit Mint(msg.sender, _beneficiary, _tokenId);