From a50772dcd7dbc597d6254b60af5768a0f223b206 Mon Sep 17 00:00:00 2001 From: yanyanho Date: Fri, 7 Aug 2020 11:40:00 +0800 Subject: [PATCH] add bac and mixer abi and bin --- commands/zeth_deploy.py | 11 +- commands/zeth_token_approve.py | 33 +-- commands/zeth_token_deploy.py | 50 +++-- contract/BAC001.abi | 1 + contract/BAC001.bin | 1 + contract/BAC001.py | 210 ++++++++++++++++++++ contract/ERC20Mintable.py | 121 ----------- contract/Groth16Mixer.abi | 19 +- contract/Groth16Mixer.bin | 2 +- contract/Groth16Mixer.py | 12 +- contract/bac/BAC001.sol | 47 ++--- contract/mixer/BaseMixer.sol | 47 ++--- contract/mixer/__init__.py | 0 contract/mixer/abi/Groth16Mixer.abi | 2 +- contract/mixer/abi/Groth16Mixer.bin | 2 +- python_web3/bin/accounts/pyaccount.keystore | 2 +- test_commands/scenario.py | 18 +- zkclientapp/routes.py | 6 +- 18 files changed, 323 insertions(+), 261 deletions(-) create mode 100644 contract/BAC001.abi create mode 100644 contract/BAC001.bin create mode 100644 contract/BAC001.py delete mode 100644 contract/ERC20Mintable.py create mode 100644 contract/mixer/__init__.py diff --git a/commands/zeth_deploy.py b/commands/zeth_deploy.py index d6157bb..a794eb8 100644 --- a/commands/zeth_deploy.py +++ b/commands/zeth_deploy.py @@ -39,11 +39,14 @@ def deploy( constructArgs = [5, to_checksum_address(token_address), verification_key_params['Alpha'], verification_key_params['Beta1'], verification_key_params['Beta2'], verification_key_params['Delta1'], verification_key_params['Delta2'], verification_key_params['ABC_coords']] si = Groth16Mixer("") - abi5 = [{'inputs': [{'internalType': 'uint256', 'name': 'mk_depth', 'type': 'uint256'}, {'internalType': 'address', 'name': 'token', 'type': 'address'}, {'internalType': 'uint256[2]', 'name': 'Alpha', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[]', 'name': 'ABC_coords', 'type': 'uint256[]'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'string', 'name': 'message', 'type': 'string'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'message', 'type': 'bytes32'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'root', 'type': 'bytes32'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'nullifiers', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'commitments', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'LogMix', 'type': 'event'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_hsig', 'outputs': [{'internalType': 'bytes32', 'name': 'hsig', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256', 'name': 'index', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_nullifier', 'outputs': [{'internalType': 'bytes32', 'name': 'nf', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_public_values', 'outputs': [{'internalType': 'uint256', 'name': 'vpub_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'vpub_out', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'get_constants', 'outputs': [{'internalType': 'uint256', 'name': 'js_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'js_out', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'num_inputs', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'bytes32', 'name': 'commitment', 'type': 'bytes32'}], 'name': 'insert', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'uint256[2]', 'name': 'a', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'b', 'type': 'uint256[4]'}, {'internalType': 'uint256[2]', 'name': 'c', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'vk', 'type': 'uint256[4]'}, {'internalType': 'uint256', 'name': 'sigma', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'input', 'type': 'uint256[9]'}, {'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'mix', 'outputs': [], 'payable': True, 'stateMutability': 'payable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'token', 'outputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'address', 'name': 'from', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'tokenFallback', 'outputs': [], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}] - bin5 = "60806040523480156200001157600080fd5b50604051620037d3380380620037d3833981810160405262000037919081019062000685565b878781806005811462000081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007890620008ba565b60405180910390fd5b50620000926200040360201b60201c565b506000806000603f8110620000a357fe5b0154905060016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555081604260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061010060fd106200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000876565b60405180910390fd5b60fd6002800260010160fd610100030260406002020110620001b5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ac9062000898565b60405180910390fd5b505050604051806040016040528087600060028110620001d157fe5b6020020151815260200187600160028110620001e957fe5b6020020151815250604360000160008201518160000155602082015181600101559050506040518060800160405280866000600281106200022657fe5b60200201518152602001866001600281106200023e57fe5b60200201518152602001856000600281106200025657fe5b60200201518152602001856001600281106200026e57fe5b6020020151815250604360020160008201518160000155602082015181600101556040820151816002015560608201518160030155905050604051806080016040528084600060028110620002bf57fe5b6020020151815260200184600160028110620002d757fe5b6020020151815260200183600060028110620002ef57fe5b60200201518152602001836001600281106200030757fe5b602002015181525060436006016000820151816000015560208201518160010155604082015181600201556060820151816003015590505060008090505b60028251816200035157fe5b046043600a018054905014620003f4576043600a0160405180604001604052808484815181106200037e57fe5b602002602001015181526020018460018501815181106200039b57fe5b602002602001015181525090806001815401808255809150509060018203906000526020600020906002020160009091929091909150600082015181600001556020820151816001015550505060028101905062000345565b505050505050505050620009d9565b60008060001b90508060006002600560020a60020203603f81106200042457fe5b018190555060006002600560020a816200043a57fe5b0490505b600081111562000495576200045f82836200049960201b620016c61760201c565b9150600060028260020203905082600082603f81106200047b57fe5b0181905550600282816200048b57fe5b049150506200043e565b5050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a8112156200053457602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050620004f9565b508484868a8888880808089550505050505092915050565b6000815190506200055d81620009a5565b92915050565b600082601f8301126200057557600080fd5b60026200058c62000586826200090a565b620008dc565b91508183856020840282011115620005a357600080fd5b60005b83811015620005d75781620005bc88826200066e565b845260208401935060208301925050600181019050620005a6565b5050505092915050565b600082601f830112620005f357600080fd5b81516200060a62000604826200092d565b620008dc565b915081818352602084019350602081019050838560208402820111156200063057600080fd5b60005b838110156200066457816200064988826200066e565b84526020840193506020830192505060018101905062000633565b5050505092915050565b6000815190506200067f81620009bf565b92915050565b6000806000806000806000806101a0898b031215620006a357600080fd5b6000620006b38b828c016200066e565b9850506020620006c68b828c016200054c565b9750506040620006d98b828c0162000563565b9650506080620006ec8b828c0162000563565b95505060c0620006ff8b828c0162000563565b945050610100620007138b828c0162000563565b935050610140620007278b828c0162000563565b92505061018089015167ffffffffffffffff8111156200074657600080fd5b620007548b828c01620005e1565b9150509295985092959890939650565b600062000773602d8362000956565b91507f41206861736820646967657374206669747320696e20612073696e676c65206660008301527f69656c6420656c656d656e742e000000000000000000000000000000000000006020830152604082019050919050565b6000620007db602b8362000956565b91507f546f6f206d616e7920696e70757420616e64206f7574707574206e6f7465732060008301527f636f6e736964657265642e0000000000000000000000000000000000000000006020830152604082019050919050565b600062000843601f8362000956565b91507f496e76616c696420646570746820696e20426173654d65726b6c6554726565006000830152602082019050919050565b60006020820190508181036000830152620008918162000764565b9050919050565b60006020820190508181036000830152620008b381620007cc565b9050919050565b60006020820190508181036000830152620008d58162000834565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156200090057600080fd5b8060405250919050565b600067ffffffffffffffff8211156200092257600080fd5b602082029050919050565b600067ffffffffffffffff8211156200094557600080fd5b602082029050602081019050919050565b600082825260208201905092915050565b600062000974826200097b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620009b08162000967565b8114620009bc57600080fd5b50565b620009ca816200099b565b8114620009d657600080fd5b50565b612dea80620009e96000396000f3fe60806040526004361061007b5760003560e01c806397e004891161004e57806397e0048914610161578063c0ee0b8a1461017d578063f9eb943f146101a6578063fc0c546a146101d35761007b565b806305ceb93c146100805780631f40927c146100bd5780632d287e43146100fb578063354d06fd14610124575b600080fd5b34801561008c57600080fd5b506100a760048036036100a29190810190611cdb565b6101fe565b6040516100b491906127a6565b60405180910390f35b3480156100c957600080fd5b506100e460048036036100df9190810190611c5f565b61031e565b6040516100f29291906129ed565b60405180910390f35b34801561010757600080fd5b50610122600480360361011d9190810190611c89565b61039b565b005b34801561013057600080fd5b5061014b60048036036101469190810190611c5f565b610420565b60405161015891906127a6565b60405180910390f35b61017b60048036036101769190810190611ba4565b61049e565b005b34801561018957600080fd5b506101a4600480360361019f9190810190611b3d565b6106c0565b005b3480156101b257600080fd5b506101bb6108cb565b6040516101ca93929190612a16565b60405180910390f35b3480156101df57600080fd5b506101e86108ef565b6040516101f5919061272b565b60405180910390f35b600060028310610243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023a9061280d565b60405180910390fd5b600060fd610100038460010102604060020201905060fd61010003810160fd10156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029a906128ad565b60405180910390fd5b600060fd826002800260010160fd610100030260406002020161010003018560028002600101600260010101600981106102d957fe5b602002015160001b901b901c9050600060fd6101000385876002600101016009811061030157fe5b6020020151901b90508160001c810160001b935050505092915050565b600080600083600280026001016002600101016009811061033b57fe5b602002015190506002800260010160fd610100030281901c905064e8d4a5100067ffffffffffffffff168167ffffffffffffffff1602915064e8d4a5100067ffffffffffffffff16604082901c67ffffffffffffffff1602925050915091565b600560020a603f54106103e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103da9061288d565b60405180910390fd5b6000603f549050603f60008154600101919050819055506000816001600560020a0301905082600082603f811061041657fe5b0181905550505050565b60008060fd60406002026002800260010160fd6101000302604060020201610100030184600280026001016002600101016009811061045b57fe5b602002015160001b901b901c9050600060fd6101000384600280600101016009811061048357fe5b6020020151901b90508160001c810160001b92505050919050565b6104a6611777565b6104b1858483610915565b600060023373ffffffffffffffffffffffffffffffffffffffff16846000600281106104d957fe5b6020020151856001600281106104eb57fe5b60200201518c8c8c8a60405160200161050a97969594939291906126b1565b6040516020818303038152906040526040516105269190612685565b602060405180830381855afa158015610543573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506105669190810190611cb2565b90506105ba8660006004811061057857fe5b60200201518760016004811061058a57fe5b60200201518860026004811061059c57fe5b6020020151896003600481106105ae57fe5b60200201518986610b23565b6105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f09061298d565b60405180910390fd5b61060589898987610bfa565b610644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063b9061292d565b60405180910390fd5b61064c611777565b6106568582610e03565b60006106626002610e5f565b905061066d81610ec1565b7f36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618818584886040516106a294939291906127c1565b60405180910390a16106b386610ef0565b5050505050505050505050565b6106c8611799565b83816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816020018181525050818160400181905250600060188360038151811061072457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c60108460028151811061078457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c6008856001815181106107e457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c8560008151811061084257fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660e01c01010190508060e01b82606001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250505050505050565b60008060006002925060029150600160028002600101600260010101019050909192565b604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b604060008360006009811061092657fe5b602002015160001b815260200190815260200160002060009054906101000a900460ff16610989576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610980906128cd565b60405180910390fd5b60008090505b6002811015610a575760006109a482856101fe565b90506041600082815260200190815260200160002060009054906101000a900460ff1615610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fe9061282d565b60405180910390fd5b60016041600083815260200190815260200160002060006101000a81548160ff02191690831515021790555080838360028110610a4057fe5b60200201818152505050808060010191505061098f565b50600060028285604051602001610a6f929190612659565b604051602081830303815290604052604051610a8b9190612685565b602060405180830381855afa158015610aa8573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250610acb9190810190611cb2565b90506000610ad884610420565b9050808214610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b13906128ed565b60405180910390fd5b5050505050565b6000610b2d6117f6565b6107d05a038682528560208301528360408301526020608083016060846000600286f150604082018981528860208201526040816060836000600787f1506040836080856000600687f15060016040840152600260608401528560808401526040816060836000600787f150505080600260058110610ba857fe5b602002015181600060058110610bba57fe5b6020020151148015610bed575080600360058110610bd457fe5b602002015181600160058110610be657fe5b6020020151145b9150509695505050505050565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019050610c28611818565b86600060028110610c3557fe5b602002015181600001818152505086600160028110610c5057fe5b602002015181602001818152505085600060048110610c6b57fe5b602002015181604001818152505085600160048110610c8657fe5b602002015181606001818152505085600260048110610ca157fe5b602002015181608001818152505085600360048110610cbc57fe5b60200201518160a001818152505084600060028110610cd757fe5b60200201518160c001818152505084600160028110610cf257fe5b60200201518160e0018181525050606060016002800260010160026001010101604051908082528060200260200182016040528015610d405781602001602082028038833980820191505090505b50905060008090505b60016002800260010160026001010101811015610de85783868260098110610d6d57fe5b602002015110610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da99061296d565b60405180910390fd5b858160098110610dbe57fe5b6020020151828281518110610dcf57fe5b6020026020010181815250508080600101915050610d49565b50610df381836112a8565b6001149350505050949350505050565b60008090505b6002811015610e5a576000838260010160098110610e2357fe5b602002015160001b905080838360028110610e3a57fe5b602002018181525050610e4c8161039b565b508080600101915050610e09565b505050565b600080603f549050600083603f540390506000600560020a90505b6001811115610ea857610e8e8183856115c5565b809450819350505060028181610ea057fe5b049050610e7a565b600080603f8110610eb557fe5b01549350505050919050565b60016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080610efc8361031e565b91509150600082111561104357600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ffb576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401610fc393929190612746565b600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b505050505061103e565b81341461103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110349061294d565b60405180910390fd5b5b6110fb565b60003411156110fa5760003373ffffffffffffffffffffffffffffffffffffffff16346040516110729061269c565b60006040518083038185875af1925050503d80600081146110af576040519150601f19603f3d011682016040523d82523d6000602084013e6110b4565b606091505b50509050806110f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ef9061284d565b60405180910390fd5b505b5b60008111156112a357600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f4576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016111bc92919061277d565b600060405180830381600087803b1580156111d657600080fd5b505af11580156111ea573d6000803e3d6000fd5b50505050506112a2565b60003373ffffffffffffffffffffffffffffffffffffffff168260405161121a9061269c565b60006040518083038185875af1925050503d8060008114611257576040519150601f19603f3d011682016040523d82523d6000602084013e61125c565b606091505b50509050806112a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112979061286d565b60405180910390fd5b505b5b505050565b60006043600a01805490506001845101146112f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ef9061290d565b60405180910390fd5b61130061185d565b6000600190506107d05a03600a60430183526020832060208701875160200281018254865260018301546020870152600283019250604086015b8183101561138957835481526001840154602082015282516040820152604081606083600060078af160408860808a600060068bf180821688169750505060028401935060208301925061133a565b5050505050806113ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c5906129cd565b60405180910390fd5b7f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a083015260435460c083015260016043015460e083015260026043015461010083015260036043015461012083015260046043015461014083015260056043015461016083015283516101808301527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47602085015181810682036101a085015260408601516101c085015260608601516101e0850152608086015161020085015260a086015161022085015260c086015161024085015260e08601516102608501526006604301546102808501526007604301546102a08501526008604301546102c08501526009604301546102e085015260208461030086600060086107d05a03f192505050806115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a0906129ad565b60405180910390fd5b816000601881106115b657fe5b60200201519250505092915050565b60008060006001860390506000600119861682019050600080600187161461163c576001868401039050611618600082603f81106115ff57fe5b0154600085600202603f811061161157fe5b01546116c6565b60006002600184038161162757fe5b04603f811061163257fe5b0181905550611642565b85830190505b5b8181111561169e5760028103905061167a600082603f811061166157fe5b0154600060018401603f811061167357fe5b01546116c6565b60006002600184038161168957fe5b04603f811061169457fe5b0181905550611643565b600287816116a857fe5b04600260018801816116b657fe5b0494509450505050935093915050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a81121561175f57602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050611726565b508484868a8888880808089550505050505092915050565b6040518060400160405280600290602082028038833980820191505090505090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016060815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6040518060a00160405280600590602082028038833980820191505090505090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806103000160405280601890602082028038833980820191505090505090565b60008135905061188f81612d62565b92915050565b600082601f8301126118a657600080fd5b60026118b96118b482612a7a565b612a4d565b9150818360005b838110156118f057813586016118d68882611a80565b8452602084019350602083019250506001810190506118c0565b5050505092915050565b600082601f83011261190b57600080fd5b600261191e61191982612a9c565b612a4d565b9150818385602084028201111561193457600080fd5b60005b83811015611964578161194a8882611b28565b845260208401935060208301925050600181019050611937565b5050505092915050565b600082601f83011261197f57600080fd5b600461199261198d82612abe565b612a4d565b915081838560208402820111156119a857600080fd5b60005b838110156119d857816119be8882611b28565b8452602084019350602083019250506001810190506119ab565b5050505092915050565b600082601f8301126119f357600080fd5b6009611a06611a0182612ae0565b612a4d565b91508183856020840282011115611a1c57600080fd5b60005b83811015611a4c5781611a328882611b28565b845260208401935060208301925050600181019050611a1f565b5050505092915050565b600081359050611a6581612d79565b92915050565b600081519050611a7a81612d79565b92915050565b600082601f830112611a9157600080fd5b8135611aa4611a9f82612b02565b612a4d565b91508082526020830160208301858383011115611ac057600080fd5b611acb838284612d05565b50505092915050565b600082601f830112611ae557600080fd5b8135611af8611af382612b2e565b612a4d565b91508082526020830160208301858383011115611b1457600080fd5b611b1f838284612d05565b50505092915050565b600081359050611b3781612d90565b92915050565b600080600060608486031215611b5257600080fd5b6000611b6086828701611880565b9350506020611b7186828701611b28565b925050604084013567ffffffffffffffff811115611b8e57600080fd5b611b9a86828701611ad4565b9150509250925092565b60008060008060008060006102e0888a031215611bc057600080fd5b6000611bce8a828b016118fa565b9750506040611bdf8a828b0161196e565b96505060c0611bf08a828b016118fa565b955050610100611c028a828b0161196e565b945050610180611c148a828b01611b28565b9350506101a0611c268a828b016119e2565b9250506102c088013567ffffffffffffffff811115611c4457600080fd5b611c508a828b01611895565b91505092959891949750929550565b60006101208284031215611c7257600080fd5b6000611c80848285016119e2565b91505092915050565b600060208284031215611c9b57600080fd5b6000611ca984828501611a56565b91505092915050565b600060208284031215611cc457600080fd5b6000611cd284828501611a6b565b91505092915050565b6000806101408385031215611cef57600080fd5b6000611cfd85828601611b28565b9250506020611d0e858286016119e2565b9150509250929050565b6000611d248383611fba565b60208301905092915050565b6000611d3c8383611fd8565b60208301905092915050565b6000611d548383612018565b905092915050565b6000611d688383612633565b60208301905092915050565b611d7d81612ccf565b82525050565b611d8c81612c89565b82525050565b611d9b81612b8c565b611da58184612c1a565b9250611db082612b5a565b8060005b83811015611de1578151611dc88782611d18565b9650611dd383612bd9565b925050600181019050611db4565b505050505050565b611df281612b8c565b611dfc8184612c25565b9250611e0782612b5a565b8060005b83811015611e38578151611e1f8782611d30565b9650611e2a83612bd9565b925050600181019050611e0b565b505050505050565b6000611e4b82612b97565b611e558185612c30565b935083602082028501611e6785612b64565b8060005b85811015611ea35784840389528151611e848582611d48565b9450611e8f83612be6565b925060208a01995050600181019050611e6b565b50829750879550505050505092915050565b611ebe81612ba2565b611ec88184612c3b565b9250611ed382612b6e565b8060005b83811015611f04578151611eeb8782611d5c565b9650611ef683612bf3565b925050600181019050611ed7565b505050505050565b611f1581612bad565b611f1f8184612c46565b9250611f2a82612b78565b8060005b83811015611f5b578151611f428782611d5c565b9650611f4d83612c00565b925050600181019050611f2e565b505050505050565b611f6c81612bb8565b611f768184612c51565b9250611f8182612b82565b8060005b83811015611fb2578151611f998782611d5c565b9650611fa483612c0d565b925050600181019050611f85565b505050505050565b611fc381612c9b565b82525050565b611fd281612c9b565b82525050565b611fe181612c9b565b82525050565b6000611ff282612bce565b611ffc8185612c6d565b935061200c818560208601612d14565b80840191505092915050565b600061202382612bc3565b61202d8185612c5c565b935061203d818560208601612d14565b61204681612d51565b840191505092915050565b600061205c82612bc3565b6120668185612c6d565b9350612076818560208601612d14565b80840191505092915050565b600061208f601883612c78565b91507f6e756c6c696669657220696e646578206f766572666c6f7700000000000000006000830152602082019050919050565b60006120cf603783612c78565b91507f496e76616c6964206e756c6c69666965723a2054686973206e756c6c6966696560008301527f722068617320616c7265616479206265656e20757365640000000000000000006020830152604082019050919050565b6000612135601e83612c78565b91507f767075625f696e2072657475726e207472616e73666572206661696c656400006000830152602082019050919050565b6000612175601883612c78565b91507f767075625f6f7574207472616e73666572206661696c656400000000000000006000830152602082019050919050565b60006121b5602783612c78565b91507f4d65726b6c6520747265652066756c6c3a2043616e6e6f7420617070656e642060008301527f616e796d6f7265000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061221b603083612c78565b91507f6e756c6c6966696572207772697474656e20696e20646966666572656e74207260008301527f6573696475616c2062697420662e652e000000000000000000000000000000006020830152604082019050919050565b6000612281602583612c78565b91507f496e76616c696420726f6f743a205468697320726f6f7420646f65736e27742060008301527f65786973740000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006122e7604983612c78565b91507f496e76616c696420687369673a2054686973206873696720646f6573206e6f7460008301527f20636f72726573706f6e6420746f207468652068617368206f6620766b20616e60208301527f6420746865206e667300000000000000000000000000000000000000000000006040830152606082019050919050565b6000612373602283612c78565b91507f496e707574206c656e67746820646966666572732066726f6d2065787065637460008301527f65640000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123d9603383612c78565b91507f496e76616c69642070726f6f663a20556e61626c6520746f207665726966792060008301527f7468652070726f6f6620636f72726563746c79000000000000000000000000006020830152604082019050919050565b600061243f602a83612c78565b91507f57726f6e67206d73672e76616c75653a2056616c75652070616964206973206e60008301527f6f7420636f7272656374000000000000000000000000000000000000000000006020830152604082019050919050565b60006124a5601c83612c78565b91507f496e707574206973206e6f7420696e207363616c6172206669656c64000000006000830152602082019050919050565b60006124e5603b83612c78565b91507f496e76616c6964207369676e61747572653a20556e61626c6520746f2076657260008301527f69667920746865207369676e617475726520636f72726563746c7900000000006020830152604082019050919050565b600061254b600083612c6d565b9150600082019050919050565b6000612565603783612c78565b91507f43616c6c20746f20626e3235364164642c20626e3235365363616c61724d756c60008301527f206f7220626e32353650616972696e67206661696c65640000000000000000006020830152604082019050919050565b60006125cb603983612c78565b91507f43616c6c20746f2074686520626e323536416464206f7220626e32353653636160008301527f6c61724d756c20707265636f6d70696c6564206661696c6564000000000000006020830152604082019050919050565b61262d81612cc5565b82525050565b61263c81612cc5565b82525050565b61265361264e82612cc5565b612d47565b82525050565b60006126658285611de9565b6040820191506126758284611f0c565b6080820191508190509392505050565b60006126918284611fe7565b915081905092915050565b60006126a78261253e565b9150819050919050565b60006126bd828a612642565b6020820191506126cd8289612051565b91506126d98288612051565b91506126e58287611eb5565b6040820191506126f58286611f0c565b6080820191506127058285611eb5565b6040820191506127158284611f63565b6101208201915081905098975050505050505050565b60006020820190506127406000830184611d83565b92915050565b600060608201905061275b6000830186611d74565b6127686020830185611d83565b6127756040830184612624565b949350505050565b60006040820190506127926000830185611d74565b61279f6020830184612624565b9392505050565b60006020820190506127bb6000830184611fc9565b92915050565b600060c0820190506127d66000830187611fc9565b6127e36020830186611d92565b6127f06060830185611d92565b81810360a08301526128028184611e40565b905095945050505050565b6000602082019050818103600083015261282681612082565b9050919050565b60006020820190508181036000830152612846816120c2565b9050919050565b6000602082019050818103600083015261286681612128565b9050919050565b6000602082019050818103600083015261288681612168565b9050919050565b600060208201905081810360008301526128a6816121a8565b9050919050565b600060208201905081810360008301526128c68161220e565b9050919050565b600060208201905081810360008301526128e681612274565b9050919050565b60006020820190508181036000830152612906816122da565b9050919050565b6000602082019050818103600083015261292681612366565b9050919050565b60006020820190508181036000830152612946816123cc565b9050919050565b6000602082019050818103600083015261296681612432565b9050919050565b6000602082019050818103600083015261298681612498565b9050919050565b600060208201905081810360008301526129a6816124d8565b9050919050565b600060208201905081810360008301526129c681612558565b9050919050565b600060208201905081810360008301526129e6816125be565b9050919050565b6000604082019050612a026000830185612624565b612a0f6020830184612624565b9392505050565b6000606082019050612a2b6000830186612624565b612a386020830185612624565b612a456040830184612624565b949350505050565b6000604051905081810181811067ffffffffffffffff82111715612a7057600080fd5b8060405250919050565b600067ffffffffffffffff821115612a9157600080fd5b602082029050919050565b600067ffffffffffffffff821115612ab357600080fd5b602082029050919050565b600067ffffffffffffffff821115612ad557600080fd5b602082029050919050565b600067ffffffffffffffff821115612af757600080fd5b602082029050919050565b600067ffffffffffffffff821115612b1957600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115612b4557600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600060029050919050565b600060029050919050565b600060029050919050565b600060049050919050565b600060099050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612c9482612ca5565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612cda82612ce1565b9050919050565b6000612cec82612cf3565b9050919050565b6000612cfe82612ca5565b9050919050565b82818337600083830152505050565b60005b83811015612d32578082015181840152602081019050612d17565b83811115612d41576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612d6b81612c89565b8114612d7657600080fd5b50565b612d8281612c9b565b8114612d8d57600080fd5b50565b612d9981612cc5565b8114612da457600080fd5b5056fea365627a7a72315820581195eb613966cd593b726868fc28cf68f8daa35097a7bd66193af259e0d6006c6578706572696d656e74616cf564736f6c63430005110040" - + fo = open("./contract/mixer/abi/Groth16Mixer.abi") + abi = fo.read() + fo.close() + f1 = open("./contract/mixer/abi/Groth16Mixer.bin") + bin = f1.read() + f1.close() client = BcosClient() - mixerTransactionRecipient = client.sendRawTransactionGetReceipt("", abi5, None, constructArgs, bin5, 30000000, 15) + mixerTransactionRecipient = client.sendRawTransactionGetReceipt("", abi, None, constructArgs, bin) mixer_address = mixerTransactionRecipient['contractAddress'] print(f"deploy: mixer_address={mixer_address}") #mixer_instance = Groth16Mixer(address) diff --git a/commands/zeth_token_approve.py b/commands/zeth_token_approve.py index 256d7eb..369fd22 100644 --- a/commands/zeth_token_approve.py +++ b/commands/zeth_token_approve.py @@ -4,8 +4,9 @@ from commands.utils import EtherValue from click import ClickException + +from contract.BAC001 import BAC001 from contract.Groth16Mixer import Groth16Mixer -from contract.ERC20Mintable import ERC20Mintable from python_web3.eth_account.account import Account from python_web3.client.bcoskeypair import BcosKeyPair from commands.constants import USER_DIR, FISCO_ADDRESS_FILE @@ -13,37 +14,37 @@ from os.path import exists -def token_approve(tokens: str, mixer_addr: str, token_addr: str, username: str, password: str) : +def asset_approve(assets: str, mixer_addr: str, asset_addr: str, username: str, password: str) : """ - Approve the mixer to spend some amount of tokens + Approve the mixer to spend some amount of assets """ - approve_value = EtherValue(tokens) + approve_value = EtherValue(assets) #eth_addr = load_eth_address(eth_addr) #client_ctx = ctx.obj #web3 = open_web3_from_ctx(client_ctx) #mixer_desc = load_mixer_description_from_ctx(client_ctx) - #if not mixer_desc.token: - # raise ClickException("no token for mixer {mixer_desc.mixer.address}") + #if not mixer_desc.asset: + # raise ClickException("no asset for mixer {mixer_desc.mixer.address}") - token_instance = ERC20Mintable(token_addr) + asset_instance = BAC001(asset_addr) keystore_file = "{}/{}/{}".format(USER_DIR, username, FISCO_ADDRESS_FILE) with open(keystore_file, "r") as dump_f: keytext = json.load(dump_f) privkey = Account.decrypt(keytext, password) - token_instance.client.ecdsa_account = Account.from_key(privkey) + asset_instance.client.ecdsa_account = Account.from_key(privkey) keypair = BcosKeyPair() - keypair.private_key = token_instance.client.ecdsa_account.privateKey - keypair.public_key = token_instance.client.ecdsa_account.publickey - keypair.address = token_instance.client.ecdsa_account.address - token_instance.client.keypair = keypair - print(f"- {username} approves the transfer of ERC20Token to the Mixer") - out, transactionReceipt = token_instance.approve( + keypair.private_key = asset_instance.client.ecdsa_account.privateKey + keypair.public_key = asset_instance.client.ecdsa_account.publickey + keypair.address = asset_instance.client.ecdsa_account.address + asset_instance.client.keypair = keypair + print(f"- {username} approves the transfer of BAC001asset to the Mixer") + out, transactionReceipt = asset_instance.approve( mixer_addr, approve_value.wei) print("approve tranaction output", out) - outputresult = token_instance.allowance(token_instance.client.ecdsa_account.address, mixer_addr) + outputresult = asset_instance.allowance(asset_instance.client.ecdsa_account.address, mixer_addr) print(f"- The allowance for the Mixer from {username} is: {outputresult}") return outputresult if __name__ == '__main__': - token_approve() \ No newline at end of file + asset_approve() \ No newline at end of file diff --git a/commands/zeth_token_deploy.py b/commands/zeth_token_deploy.py index 37abe87..71ea73d 100644 --- a/commands/zeth_token_deploy.py +++ b/commands/zeth_token_deploy.py @@ -8,33 +8,45 @@ from zeth.mixer_client import MixerClient from zeth.utils import EtherValue ''' +import json + from click import Context, command, option, pass_context from typing import Optional from web3 import Web3 -from contract.ERC20Mintable import ERC20Mintable -#from test_commands.deploy_test_token import mint_token - +#from test_commands.deploy_test_asset import mint_asset +from contract.BAC001 import BAC001 +from python_web3.client.bcosclient import BcosClient -def deploy_token( - miner_address: Optional[str], - token_amount: Optional[int] +def deploy_asset( + description, + shortName, + minUnit, + total_amount: Optional[int] ) : """ Deploy the zeth contracts and record the instantiation details. """ - token_si = ERC20Mintable("") - token_result = token_si.deploy("contract/ERC20Mintable.bin") - token_address = token_result['contractAddress'] - token_instance = ERC20Mintable(token_address) - print(f"deploy: token_address={token_address}") - token_instance.mint( - miner_address, - Web3.toWei(token_amount, 'ether')) - print("- Initial balances: ") - outputresult = token_instance.balanceOf(miner_address) - print(f" {miner_address} : {outputresult}") - return token_address + # description, string memory shortName, uint8 minUnit, uint256 totalAmount + constructArgs= [description,shortName,18,total_amount] + fo = open("./contract/bac/abi/BAC001.abi") + abi = fo.read() + fo.close() + f1 = open("./contract/bac/abi/BAC001.bin") + bin = f1.read() + f1.close() + client = BcosClient() + assetTransactionRecipient = client.sendRawTransactionGetReceipt("", abi, None, constructArgs, bin, 30000000, 15) + asset_address = assetTransactionRecipient['contractAddress'] + asset_instance = BAC001(asset_address) + print(f"deploy: asset_address= {asset_address}") + # asset_instance.issue( + # miner_address, + # Web3.toWei(asset_amount, 'ether'), '') + # print("- Initial balances: ") + # outputresult = asset_instance.balanceOf(miner_address) + # print(f" {miner_address} : {outputresult}") + return asset_address if __name__ == '__main__': - deploy_token() + deploy_asset() diff --git a/contract/BAC001.abi b/contract/BAC001.abi new file mode 100644 index 0000000..56afd9a --- /dev/null +++ b/contract/BAC001.abi @@ -0,0 +1 @@ +[{'inputs': [{'internalType': 'string', 'name': 'description', 'type': 'string'}, {'internalType': 'string', 'name': 'shortName', 'type': 'string'}, {'internalType': 'uint8', 'name': 'minUnit', 'type': 'uint8'}, {'internalType': 'uint256', 'name': 'totalAmount', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'owner', 'type': 'address'}, {'indexed': True, 'internalType': 'address', 'name': 'spender', 'type': 'address'}, {'indexed': False, 'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}], 'name': 'Approval', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'IssuerAdded', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'IssuerRemoved', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'from', 'type': 'address'}, {'indexed': True, 'internalType': 'address', 'name': 'to', 'type': 'address'}, {'indexed': False, 'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'indexed': False, 'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'Send', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'Suspended', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'SuspenderAdded', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': True, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'SuspenderRemoved', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'UnSuspended', 'type': 'event'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'addIssuer', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'addSuspender', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'address', 'name': 'owner', 'type': 'address'}, {'internalType': 'address', 'name': 'spender', 'type': 'address'}], 'name': 'allowance', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'spender', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}], 'name': 'approve', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'address', 'name': 'owner', 'type': 'address'}], 'name': 'balance', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address[]', 'name': 'to', 'type': 'address[]'}, {'internalType': 'uint256[]', 'name': 'values', 'type': 'uint256[]'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'batchSend', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'spender', 'type': 'address'}, {'internalType': 'uint256', 'name': 'subtractedValue', 'type': 'uint256'}], 'name': 'decreaseAllowance', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'description', 'outputs': [{'internalType': 'string', 'name': '', 'type': 'string'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'destroy', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'from', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'destroyFrom', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'spender', 'type': 'address'}, {'internalType': 'uint256', 'name': 'addedValue', 'type': 'uint256'}], 'name': 'increaseAllowance', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'isIssuer', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'address', 'name': 'account', 'type': 'address'}], 'name': 'isSuspender', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'to', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'issue', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'minUnit', 'outputs': [{'internalType': 'uint8', 'name': '', 'type': 'uint8'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [], 'name': 'renounceIssuer', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [], 'name': 'renounceSuspender', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'to', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'send', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': 'from', 'type': 'address'}, {'internalType': 'address', 'name': 'to', 'type': 'address'}, {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}, {'internalType': 'bytes', 'name': 'data', 'type': 'bytes'}], 'name': 'sendFrom', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'shortName', 'outputs': [{'internalType': 'string', 'name': '', 'type': 'string'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [], 'name': 'suspend', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'suspended', 'outputs': [{'internalType': 'bool', 'name': '', 'type': 'bool'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'totalAmount', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, {'constant': False, 'inputs': [], 'name': 'unSuspend', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}] \ No newline at end of file diff --git a/contract/BAC001.bin b/contract/BAC001.bin new file mode 100644 index 0000000..92f316a --- /dev/null +++ b/contract/BAC001.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b506040516200358d3803806200358d833981810160405260808110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011557600080fd5b838201915060208201858111156200012c57600080fd5b82518660018202830111640100000000821117156200014a57600080fd5b8083526020830192505050908051906020019080838360005b838110156200018057808201518184015260208101905062000163565b50505050905090810190601f168015620001ae5780820380516001836020036101000a031916815260200191505b506040526020018051906020019092919080519060200190929190505050620001dd336200028a60201b60201c565b620001ee33620002eb60201b60201c565b6000600260006101000a81548160ff021916908315150217905550836006908051906020019062000221929190620007ba565b5082600790805190602001906200023a929190620007ba565b5081600860006101000a81548160ff021916908360ff16021790555062000280338360ff16600a0a8302604051806020016040528060008152506200034c60201b60201c565b5050505062000869565b620002a58160006200056d60201b620029411790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f05e7c881d716bee8cb7ed92293133ba156704252439e5c502c277448f04e20c260405160405180910390a250565b620003068160016200056d60201b620029411790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167ff4fbb5a5e62a703643fe5be0722720f728980fdde74f11d76eca7e13bdc3301d60405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415620003d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806200354a6021913960400191505060405180910390fd5b620003f0826005546200065160201b62001eff1790919060201c565b6005819055506200044f82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546200065160201b62001eff1790919060201c565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f76d4fc8756cf1c2b5aa667285d8c20b304dcd86209b4c34a84fc491867de76f184846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156200052c5780820151818401526020810190506200050f565b50505050905090810190601f1680156200055a5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050565b6200057f8282620006da60201b60201c565b15620005f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080828401905083811015620006d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000763576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806200356b6022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620007fd57805160ff19168380011785556200082e565b828001600101855582156200082e579182015b828111156200082d57825182559160200191906001019062000810565b5b5090506200083d919062000841565b5090565b6200086691905b808211156200086257600081600090555060010162000848565b5090565b90565b612cd180620008796000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80639126d03c116100c3578063c83503621161007c578063c835036214610a39578063d0e7d61114610abc578063d7fb71c914610bc1578063dd62ed3e14610bcb578063e3d670d714610c43578063e6400bbe14610c9b57610158565b80639126d03c14610767578063938050e1146107c35780639bd9bbc6146107cd5780639cb35cbd146108b2578063a457c2d7146108d6578063bb3acde91461093c57610158565b8063452dee2811610115578063452dee28146105335780634ef7902e1461053d57806357a70df814610622578063702efdf3146106665780637284e41614610688578063877b9a671461070b57610158565b806303dfd47c1461015d578063095ea7b3146102225780631a39d8ef1461028857806320694db0146102a657806337f26e5b146102ea57806339509351146104cd575b600080fd5b6102206004803603604081101561017357600080fd5b81019080803590602001909291908035906020019064010000000081111561019a57600080fd5b8201836020820111156101ac57600080fd5b803590602001918460018302840111640100000000831117156101ce57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610ca5565b005b61026e6004803603604081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cb4565b604051808215151515815260200191505060405180910390f35b610290610d4e565b6040518082815260200191505060405180910390f35b6102e8600480360360208110156102bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d58565b005b6104cb6004803603606081101561030057600080fd5b810190808035906020019064010000000081111561031d57600080fd5b82018360208201111561032f57600080fd5b8035906020019184602083028401116401000000008311171561035157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103b157600080fd5b8201836020820111156103c357600080fd5b803590602001918460208302840111640100000000831117156103e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610dc2565b005b610519600480360360408110156104e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f89565b604051808215151515815260200191505060405180910390f35b61053b6110b1565b005b6106206004803603606081101561055357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561059a57600080fd5b8201836020820111156105ac57600080fd5b803590602001918460018302840111640100000000831117156105ce57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506110bc565b005b6106646004803603602081101561063857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110cc565b005b61066e611136565b604051808215151515815260200191505060405180910390f35b61069061114d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106d05780820151818401526020810190506106b5565b50505050905090810190601f1680156106fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61074d6004803603602081101561072157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ef565b604051808215151515815260200191505060405180910390f35b6107a96004803603602081101561077d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120c565b604051808215151515815260200191505060405180910390f35b6107cb611229565b005b6108b0600480360360608110156107e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561082a57600080fd5b82018360208201111561083c57600080fd5b8035906020019184600183028401116401000000008311171561085e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611234565b005b6108ba611329565b604051808260ff1660ff16815260200191505060405180910390f35b610922600480360360408110156108ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611340565b604051808215151515815260200191505060405180910390f35b610a1f6004803603606081101561095257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561099957600080fd5b8201836020820111156109ab57600080fd5b803590602001918460018302840111640100000000831117156109cd57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611468565b604051808215151515815260200191505060405180910390f35b610a416114de565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a81578082015181840152602081019050610a66565b50505050905090810190601f168015610aae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610bbf60048036036080811015610ad257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610b3957600080fd5b820183602082011115610b4b57600080fd5b80359060200191846001830284011164010000000083111715610b6d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611580565b005b610bc961170f565b005b610c2d60048036036040811015610be157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186f565b6040518082815260200191505060405180910390f35b610c8560048036036020811015610c5957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118f6565b6040518082815260200191505060405180910390f35b610ca361193f565b005b610cb0338383611aa0565b5050565b6000600260009054906101000a900460ff1615610d39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b610d44338484611cae565b6001905092915050565b6000600554905090565b610d61336111ef565b610db6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612bd36030913960400191505060405180910390fd5b610dbf81611ea5565b50565b600260009054906101000a900460ff1615610e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b8151835114610e9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612b886026913960400191505060405180910390fd5b60008090505b8351811015610f8357600073ffffffffffffffffffffffffffffffffffffffff16848281518110610ed257fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612bae6025913960400191505060405180910390fd5b610f78848281518110610f5657fe5b6020026020010151848381518110610f6a57fe5b602002602001015184611234565b806001019050610ea5565b50505050565b6000600260009054906101000a900460ff161561100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b6110a733846110a285600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b611cae565b6001905092915050565b6110ba33611f87565b565b6110c7838383611fe1565b505050565b6110d53361120c565b61112a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612c036036913960400191505060405180910390fd5b6111338161208a565b50565b6000600260009054906101000a900460ff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111e55780601f106111ba576101008083540402835291602001916111e5565b820191906000526020600020905b8154815290600101906020018083116111c857829003601f168201915b5050505050905090565b60006112058260006120e490919063ffffffff16565b9050919050565b60006112228260016120e490919063ffffffff16565b9050919050565b611232336121c2565b565b600260009054906101000a900460ff16156112b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b6112c33384848461221c565b6112cf338484846124c1565b611324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612b10602e913960400191505060405180910390fd5b505050565b6000600860009054906101000a900460ff16905090565b6000600260009054906101000a900460ff16156113c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b61145e338461145985600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b611cae565b6001905092915050565b6000611473336111ef565b6114c8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180612bd36030913960400191505060405180910390fd5b6114d3848484612733565b600190509392505050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115765780601f1061154b57610100808354040283529160200191611576565b820191906000526020600020905b81548152906001019060200180831161155957829003601f168201915b5050505050905090565b600260009054906101000a900460ff1615611603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b61160f8484848461221c565b6116a884336116a385600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b611cae565b6116b4848484846124c1565b611709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612b10602e913960400191505060405180910390fd5b50505050565b6117183361120c565b61176d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612c036036913960400191505060405180910390fd5b600260009054906101000a900460ff166117ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f53757370656e6461626c653a206e6f742073757370656e64656400000000000081525060200191505060405180910390fd5b6000600260006101000a81548160ff0219169083151502179055507f349b4285cb8dde314c53fd9d8e8e578381a7375e4f76f9dd9fe07f9960f120a433604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6119483361120c565b61199d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612c036036913960400191505060405180910390fd5b600260009054906101000a900460ff1615611a20576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53757370656e6461626c653a2073757370656e6465640000000000000000000081525060200191505060405180910390fd5b6001600260006101000a81548160ff0219169083151502179055507f6f123d3d54c84a7960a573b31c221dcd86e13fd849c5adb0c6ca851468cc1ae433604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b636025913960400191505060405180910390fd5b611b3b826005546126aa90919063ffffffff16565b600581905550611b9382600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f76d4fc8756cf1c2b5aa667285d8c20b304dcd86209b4c34a84fc491867de76f184846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611c6e578082015181840152602081019050611c53565b50505050905090810190601f168015611c9b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b3e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611dba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612aed6023913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b611eb981600061294190919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f05e7c881d716bee8cb7ed92293133ba156704252439e5c502c277448f04e20c260405160405180910390a250565b600080828401905083811015611f7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b611f9b816001612a1c90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f17eb45856cd2283111eeb8a1dddf8a43121889e3ce798241f96d2afed353eaa360405160405180910390a250565b611fec838383611aa0565b612085833361208085600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b611cae565b505050565b61209e81600161294190919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167ff4fbb5a5e62a703643fe5be0722720f728980fdde74f11d76eca7e13bdc3301d60405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561216b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612c7b6022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6121d6816000612a1c90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167faf66545c919a3be306ee446d8f42a9558b5b022620df880517bc9593ec0f2d5260405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156122bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4241433030313a2073656e6420746f20746865207a65726f206164647265737381525060200191505060405180910390fd5b61231182600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126aa90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123a682600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f76d4fc8756cf1c2b5aa667285d8c20b304dcd86209b4c34a84fc491867de76f184846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612480578082015181840152602081019050612465565b50505050905090810190601f1680156124ad5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350505050565b60006124e28473ffffffffffffffffffffffffffffffffffffffff16612ad9565b6124ef57600190506126a2565b60008473ffffffffffffffffffffffffffffffffffffffff1663c73d16ae878787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156125ca5780820151818401526020810190506125af565b50505050905090810190601f1680156125f75780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561261957600080fd5b505af115801561262d573d6000803e3d6000fd5b505050506040513d602081101561264357600080fd5b8101908080519060200190929190505050905063c73d16ae60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150505b949350505050565b600082821115612722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156127b9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612c5a6021913960400191505060405180910390fd5b6127ce82600554611eff90919063ffffffff16565b60058190555061282682600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eff90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f76d4fc8756cf1c2b5aa667285d8c20b304dcd86209b4c34a84fc491867de76f184846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156129015780820151818401526020810190506128e6565b50505050905090810190601f16801561292e5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050565b61294b82826120e4565b156129be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b612a2682826120e4565b612a7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612c396021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080823b90506000811191505091905056fe4241433030313a20617070726f766520746f20746865207a65726f20616464726573734241433030313a2073656e6420746f206e6f6e20424143303031526563656976657220696d706c656d656e7465724241433030313a20617070726f76652066726f6d20746865207a65726f20616464726573734241433030313a2064657374726f792066726f6d20746865207a65726f2061646472657373746f20616e642076616c756573206172726179206c656e676874206d757374206d617463682e64657374696e6174696f6e2061646472657373206d757374206265206e6f6e2d7a65726f2e497373756572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652049737375657220726f6c6553757370656e646572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652053757370656e64657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c654241433030313a20697373756520746f20746865207a65726f2061646472657373526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373a265627a7a72315820ea68f575a369e3e2a9af93a2051728b3b715eff177ab21281245d33e40d78b5e64736f6c634300051100324241433030313a20697373756520746f20746865207a65726f2061646472657373526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373 \ No newline at end of file diff --git a/contract/BAC001.py b/contract/BAC001.py new file mode 100644 index 0000000..a89f21c --- /dev/null +++ b/contract/BAC001.py @@ -0,0 +1,210 @@ +# template for codegen +from eth_utils import to_checksum_address + +from python_web3.client.bcosclient import ( + BcosClient +) +from python_web3.client.datatype_parser import DatatypeParser +import json + + +class BAC001: # name of abi + address = None + contract_abi_string = '''[{"inputs": [{"internalType": "string", "name": "description", "type": "string"}, {"internalType": "string", "name": "shortName", "type": "string"}, {"internalType": "uint8", "name": "minUnit", "type": "uint8"}, {"internalType": "uint256", "name": "totalAmount", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "owner", "type": "address"}, {"indexed": true, "internalType": "address", "name": "spender", "type": "address"}, {"indexed": false, "internalType": "uint256", "name": "value", "type": "uint256"}], "name": "Approval", "type": "event", "topic": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "IssuerAdded", "type": "event", "topic": "0x05e7c881d716bee8cb7ed92293133ba156704252439e5c502c277448f04e20c2"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "IssuerRemoved", "type": "event", "topic": "0xaf66545c919a3be306ee446d8f42a9558b5b022620df880517bc9593ec0f2d52"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "from", "type": "address"}, {"indexed": true, "internalType": "address", "name": "to", "type": "address"}, {"indexed": false, "internalType": "uint256", "name": "value", "type": "uint256"}, {"indexed": false, "internalType": "bytes", "name": "data", "type": "bytes"}], "name": "Send", "type": "event", "topic": "0x76d4fc8756cf1c2b5aa667285d8c20b304dcd86209b4c34a84fc491867de76f1"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "address", "name": "account", "type": "address"}], "name": "Suspended", "type": "event", "topic": "0x6f123d3d54c84a7960a573b31c221dcd86e13fd849c5adb0c6ca851468cc1ae4"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "SuspenderAdded", "type": "event", "topic": "0xf4fbb5a5e62a703643fe5be0722720f728980fdde74f11d76eca7e13bdc3301d"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "SuspenderRemoved", "type": "event", "topic": "0x17eb45856cd2283111eeb8a1dddf8a43121889e3ce798241f96d2afed353eaa3"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "address", "name": "account", "type": "address"}], "name": "UnSuspended", "type": "event", "topic": "0x349b4285cb8dde314c53fd9d8e8e578381a7375e4f76f9dd9fe07f9960f120a4"}, {"constant": false, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "addIssuer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "addSuspender", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "owner", "type": "address"}, {"internalType": "address", "name": "spender", "type": "address"}], "name": "allowance", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}], "name": "approve", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "owner", "type": "address"}], "name": "balance", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address[]", "name": "to", "type": "address[]"}, {"internalType": "uint256[]", "name": "values", "type": "uint256[]"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "batchSend", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "subtractedValue", "type": "uint256"}], "name": "decreaseAllowance", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "description", "outputs": [{"internalType": "string", "name": "", "type": "string"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "destroy", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "from", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "destroyFrom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "addedValue", "type": "uint256"}], "name": "increaseAllowance", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "isIssuer", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "isSuspender", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "to", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "issue", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "minUnit", "outputs": [{"internalType": "uint8", "name": "", "type": "uint8"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [], "name": "renounceIssuer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [], "name": "renounceSuspender", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "to", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "send", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "from", "type": "address"}, {"internalType": "address", "name": "to", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "sendFrom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "shortName", "outputs": [{"internalType": "string", "name": "", "type": "string"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [], "name": "suspend", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "suspended", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": true, "inputs": [], "name": "totalAmount", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [], "name": "unSuspend", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}]''' + contract_abi = None + data_parser = DatatypeParser() + client = None + + def __init__(self, address): + self.client = BcosClient() + self.address = address + self.contract_abi = json.loads(self.contract_abi_string) + self.data_parser.set_abi(self.contract_abi) + + def deploy(self, contract_bin_file): + result = self.client.deployFromFile(contract_bin_file) + self.address = result["contractAddress"] + return result + + # ------------------------------------------ + def addIssuer(self, account): + func_name = 'addIssuer' + args = [to_checksum_address(account)] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def addSuspender(self, account): + func_name = 'addSuspender' + args = [to_checksum_address(account)] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def allowance(self, owner, spender): + func_name = 'allowance' + args = [to_checksum_address(owner), to_checksum_address(spender)] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def approve(self, spender, value): + func_name = 'approve' + args = [to_checksum_address(spender), value] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def balance(self, owner): + func_name = 'balance' + args = [to_checksum_address(owner)] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def batchSend(self, to, values, data): + func_name = 'batchSend' + args = [to, values, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def decreaseAllowance(self, spender, subtractedValue): + func_name = 'decreaseAllowance' + args = [to_checksum_address(spender), subtractedValue] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def description(self): + func_name = 'description' + args = [] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def destroy(self, value, data): + func_name = 'destroy' + args = [value, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def destroyFrom(self, from1, value, data): + func_name = 'destroyFrom' + args = [to_checksum_address(from1), value, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def increaseAllowance(self, spender, addedValue): + func_name = 'increaseAllowance' + args = [to_checksum_address(spender), addedValue] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def isIssuer(self, account): + func_name = 'isIssuer' + args = [to_checksum_address(account)] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def isSuspender(self, account): + func_name = 'isSuspender' + args = [to_checksum_address(account)] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def issue(self, to, value, data): + func_name = 'issue' + args = [to_checksum_address(to), value, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def minUnit(self): + func_name = 'minUnit' + args = [] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def renounceIssuer(self): + func_name = 'renounceIssuer' + args = [] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def renounceSuspender(self): + func_name = 'renounceSuspender' + args = [] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def send(self, to, value, data): + func_name = 'send' + args = [to_checksum_address(to), value, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def sendFrom(self, from1, to, value, data): + func_name = 'sendFrom' + args = [to_checksum_address(from1), to_checksum_address(to), value, data] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def shortName(self): + func_name = 'shortName' + args = [] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def suspend(self): + func_name = 'suspend' + args = [] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt + + # ------------------------------------------ + def suspended(self): + func_name = 'suspended' + args = [] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def totalAmount(self): + func_name = 'totalAmount' + args = [] + result = self.client.call(self.address, self.contract_abi, func_name, args) + return result + + # ------------------------------------------ + def unSuspend(self): + func_name = 'unSuspend' + args = [] + receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) + outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) + return outputresult, receipt diff --git a/contract/ERC20Mintable.py b/contract/ERC20Mintable.py deleted file mode 100644 index 3daf82a..0000000 --- a/contract/ERC20Mintable.py +++ /dev/null @@ -1,121 +0,0 @@ -# template for codegen -import sys -sys.path.append('../') -from python_web3.client.bcosclient import ( - BcosClient -) -from python_web3.client.datatype_parser import DatatypeParser -import json - -from python_web3.eth_utils import to_checksum_address - - -class ERC20Mintable: # name of abi - address = None - contract_abi_string = '''[{"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "owner", "type": "address"}, {"indexed": true, "internalType": "address", "name": "spender", "type": "address"}, {"indexed": false, "internalType": "uint256", "name": "value", "type": "uint256"}], "name": "Approval", "type": "event", "topic": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "MinterAdded", "type": "event", "topic": "0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"}], "name": "MinterRemoved", "type": "event", "topic": "0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "from", "type": "address"}, {"indexed": true, "internalType": "address", "name": "to", "type": "address"}, {"indexed": false, "internalType": "uint256", "name": "value", "type": "uint256"}], "name": "Transfer", "type": "event", "topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"}, {"constant": false, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "addMinter", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "owner", "type": "address"}, {"internalType": "address", "name": "spender", "type": "address"}], "name": "allowance", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "approve", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "balanceOf", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "subtractedValue", "type": "uint256"}], "name": "decreaseAllowance", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "spender", "type": "address"}, {"internalType": "uint256", "name": "addedValue", "type": "uint256"}], "name": "increaseAllowance", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "account", "type": "address"}], "name": "isMinter", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "account", "type": "address"}, {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "mint", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [], "name": "renounceMinter", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "totalSupply", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "recipient", "type": "address"}, {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "transfer", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "sender", "type": "address"}, {"internalType": "address", "name": "recipient", "type": "address"}, {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "transferFrom", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}]''' - contract_abi = None - data_parser = DatatypeParser() - client = None - - def __init__(self, address): - self.client = BcosClient() - self.address = address - self.contract_abi = json.loads(self.contract_abi_string) - self.data_parser.set_abi(self.contract_abi) - - def deploy(self, contract_bin_file): - result = self.client.deployFromFile(contract_bin_file) - self.address = result["contractAddress"] - return result - - # ------------------------------------------ - def addMinter(self, account): - func_name = 'addMinter' - args = [to_checksum_address(account)] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def allowance(self, owner, spender): - func_name = 'allowance' - args = [to_checksum_address(owner), to_checksum_address(spender)] - result = self.client.call(self.address, self.contract_abi, func_name, args) - return result - - # ------------------------------------------ - def approve(self, spender, amount): - func_name = 'approve' - args = [to_checksum_address(spender), amount] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def balanceOf(self, account): - func_name = 'balanceOf' - args = [to_checksum_address(account)] - result = self.client.call(self.address, self.contract_abi, func_name, args) - return result - - # ------------------------------------------ - def decreaseAllowance(self, spender, subtractedValue): - func_name = 'decreaseAllowance' - args = [to_checksum_address(spender), subtractedValue] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def increaseAllowance(self, spender, addedValue): - func_name = 'increaseAllowance' - args = [to_checksum_address(spender), addedValue] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def isMinter(self, account): - func_name = 'isMinter' - args = [to_checksum_address(account)] - result = self.client.call(self.address, self.contract_abi, func_name, args) - return result - - # ------------------------------------------ - def mint(self, account, amount): - func_name = 'mint' - args = [to_checksum_address(account), amount] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def renounceMinter(self): - func_name = 'renounceMinter' - args = [] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def totalSupply(self): - func_name = 'totalSupply' - args = [] - result = self.client.call(self.address, self.contract_abi, func_name, args) - return result - - # ------------------------------------------ - def transfer(self, recipient, amount): - func_name = 'transfer' - args = [to_checksum_address(recipient), amount] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt - - # ------------------------------------------ - def transferFrom(self, sender, recipient, amount): - func_name = 'transferFrom' - args = [to_checksum_address(sender), to_checksum_address(recipient), amount] - receipt = self.client.sendRawTransactionGetReceipt(self.address, self.contract_abi, func_name, args) - outputresult = self.data_parser.parse_receipt_output(func_name, receipt['output']) - return outputresult, receipt diff --git a/contract/Groth16Mixer.abi b/contract/Groth16Mixer.abi index 0eec46b..9f33554 100644 --- a/contract/Groth16Mixer.abi +++ b/contract/Groth16Mixer.abi @@ -1,18 +1 @@ -[ -{"inputs": [{"internalType": "uint256", "name": "mk_depth", "type": "uint256"}, -{"internalType": "address", "name": "token", "type": "address"}, - {"internalType": "uint256[2]", "name": "Alpha", "type": "uint256[2]"}, - {"internalType": "uint256[2]", "name": "Beta1", "type": "uint256[2]"}, - {"internalType": "uint256[2]", "name": "Beta2", "type": "uint256[2]"}, - {"internalType": "uint256[2]", "name": "Delta1", "type": "uint256[2]"}, - {"internalType": "uint256[2]", "name": "Delta2", "type": "uint256[2]"}, - {"internalType": "uint256[]", "name": "ABC_coords", "type": "uint256[]"}], - "payable": false, "stateMutability": "nonpayable", "type": "constructor"}, - {"anonymous": false, "inputs": [{"indexed": false, "internalType": "string", "name": "message", "type": "string"}], "name": "LogDebug", "type": "event"}, - {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "message", "type": "bytes32"}], "name": "LogDebug", "type": "event"}, - {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "root", "type": "bytes32"}, - {"indexed": false, "internalType": "bytes32[2]", "name": "nullifiers", "type": "bytes32[2]"}, - {"indexed": false, "internalType": "bytes32[2]", "name": "commitments", "type": "bytes32[2]"}, - {"indexed": false, "internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], - "name": "LogMix", "type": "event"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_hsig", "outputs": [{"internalType": "bytes32", "name": "hsig", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, - {"constant": true, "inputs": [{"internalType": "uint256", "name": "index", "type": "uint256"}, {"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_nullifier", "outputs": [{"internalType": "bytes32", "name": "nf", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_public_values", "outputs": [{"internalType": "uint256", "name": "vpub_in", "type": "uint256"}, {"internalType": "uint256", "name": "vpub_out", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [], "name": "get_constants", "outputs": [{"internalType": "uint256", "name": "js_in", "type": "uint256"}, {"internalType": "uint256", "name": "js_out", "type": "uint256"}, {"internalType": "uint256", "name": "num_inputs", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": false, "inputs": [{"internalType": "bytes32", "name": "commitment", "type": "bytes32"}], "name": "insert", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "uint256[2]", "name": "a", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "b", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "c", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256", "name": "sigma", "type": "uint256"}, {"internalType": "uint256[9]", "name": "input", "type": "uint256[9]"}, {"internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "mix", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function"}, {"constant": true, "inputs": [], "name": "token", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "from", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "tokenFallback", "outputs": [], "payable": false, "stateMutability": "pure", "type": "function"}] +[{'inputs': [{'internalType': 'uint256', 'name': 'mk_depth', 'type': 'uint256'}, {'internalType': 'address', 'name': 'token', 'type': 'address'}, {'internalType': 'uint256[2]', 'name': 'Alpha', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[]', 'name': 'ABC_coords', 'type': 'uint256[]'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'string', 'name': 'message', 'type': 'string'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'message', 'type': 'bytes32'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'root', 'type': 'bytes32'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'nullifiers', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'commitments', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'LogMix', 'type': 'event'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_hsig', 'outputs': [{'internalType': 'bytes32', 'name': 'hsig', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256', 'name': 'index', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_nullifier', 'outputs': [{'internalType': 'bytes32', 'name': 'nf', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_public_values', 'outputs': [{'internalType': 'uint256', 'name': 'vpub_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'vpub_out', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'get_constants', 'outputs': [{'internalType': 'uint256', 'name': 'js_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'js_out', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'num_inputs', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'bytes32', 'name': 'commitment', 'type': 'bytes32'}], 'name': 'insert', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'uint256[2]', 'name': 'a', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'b', 'type': 'uint256[4]'}, {'internalType': 'uint256[2]', 'name': 'c', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'vk', 'type': 'uint256[4]'}, {'internalType': 'uint256', 'name': 'sigma', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'input', 'type': 'uint256[9]'}, {'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'mix', 'outputs': [], 'payable': True, 'stateMutability': 'payable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': '', 'type': 'address'}, {'internalType': 'address', 'name': '', 'type': 'address'}, {'internalType': 'uint256', 'name': '', 'type': 'uint256'}, {'internalType': 'bytes', 'name': '', 'type': 'bytes'}], 'name': 'onBAC001Received', 'outputs': [{'internalType': 'bytes4', 'name': '', 'type': 'bytes4'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'token', 'outputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}] \ No newline at end of file diff --git a/contract/Groth16Mixer.bin b/contract/Groth16Mixer.bin index 1b18255..82b926c 100644 --- a/contract/Groth16Mixer.bin +++ b/contract/Groth16Mixer.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b50604051620025a4380380620025a4833981016040819052620000349162000479565b8787818060208114620000645760405162461bcd60e51b81526004016200005b9062000590565b60405180910390fd5b50620000786001600160e01b036200025a16565b50600080800154600081815264020000000060205260409020805460ff1916600117905564020000000280546001600160a01b0385166001600160a01b03199091161790559050505050604051806040016040528087600060028110620000db57fe5b6020020151815260200187600160028110620000f357fe5b602090810291909101519091528151640200000003559081015164020000000455604080516080808201835288518083528985015183860181905289518486018190528a87015160609586018190526402000000059390935564020000000691909155640200000007556402000000085582519081018352865180825287850151828601819052875194830185905294870151919092018190526402000000099190915564020000000a9290925564020000000b5564020000000c5560005b6002825181620001be57fe5b64020000000d54919004146200024b57640200000003600a016040518060400160405280848481518110620001ef57fe5b602002602001015181526020018484600101815181106200020c57fe5b602090810291909101810151909152825460018181018555600094855293829020835160029283029091019081559290910151919092015501620001b2565b5050505050505050506200064b565b60006401fffffffe81905563800000005b8015620002b357620002898283620002b760201b62000ef41760201c565b91506001196002820201826000826401ffffffff8110620002a657fe5b015550600290046200026b565b5050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a8112156200034f57602060002080600052868688838808089350868485099250868488858a878809090994505060010162000317565b508484868a88888808080898975050505050505050565b8051620003738162000626565b92915050565b600082601f8301126200038b57600080fd5b6002620003a26200039c82620005c9565b620005a2565b91508183856020840282011115620003b957600080fd5b60005b83811015620003e95781620003d288826200046c565b8452506020928301929190910190600101620003bc565b5050505092915050565b600082601f8301126200040557600080fd5b8151620004166200039c82620005e7565b915081818352602084019350602081019050838560208402820111156200043c57600080fd5b60005b83811015620003e957816200045588826200046c565b84525060209283019291909101906001016200043f565b8051620003738162000640565b6000806000806000806000806101a0898b0312156200049757600080fd5b6000620004a58b8b6200046c565b9850506020620004b88b828c0162000366565b9750506040620004cb8b828c0162000379565b9650506080620004de8b828c0162000379565b95505060c0620004f18b828c0162000379565b945050610100620005058b828c0162000379565b935050610140620005198b828c0162000379565b9250506101808901516001600160401b038111156200053757600080fd5b620005458b828c01620003f3565b9150509295985092959890939650565b600062000564601f8362000608565b7f496e76616c696420646570746820696e20426173654d65726b6c655472656500815260200192915050565b60208082528101620003738162000555565b6040518181016001600160401b0381118282101715620005c157600080fd5b604052919050565b60006001600160401b03821115620005e057600080fd5b5060200290565b60006001600160401b03821115620005fe57600080fd5b5060209081020190565b90815260200190565b60006001600160a01b03821662000373565b90565b620006318162000611565b81146200063d57600080fd5b50565b620006318162000623565b611f49806200065b6000396000f3fe60806040526004361061007b5760003560e01c806397e004891161004e57806397e0048914610126578063c0ee0b8a14610139578063f9eb943f14610159578063fc0c546a1461017d5761007b565b806305ceb93c146100805780631f40927c146100b65780632d287e43146100e4578063354d06fd14610106575b600080fd5b34801561008c57600080fd5b506100a061009b3660046113e9565b61019f565b6040516100ad9190611c7d565b60405180910390f35b3480156100c257600080fd5b506100d66100d136600461138e565b61022d565b6040516100ad929190611dbf565b3480156100f057600080fd5b506101046100ff3660046113ad565b610256565b005b34801561011257600080fd5b506100a061012136600461138e565b6102ad565b6101046101343660046112d5565b6102cc565b34801561014557600080fd5b50610104610154366004611270565b61043f565b34801561016557600080fd5b5061016e610526565b6040516100ad93929190611dcd565b34801561018957600080fd5b50610192610530565b6040516100ad9190611c2c565b6000600283106101ca5760405162461bcd60e51b81526004016101c190611ccf565b60405180910390fd5b60036001840102608081019060830160fd10156101f95760405162461bcd60e51b81526004016101c190611d1f565b610100830151607182011b60fd1c60006003858782016009811061021957fe5b6020020151901b9190910195945050505050565b610100015164e8d4a5100067ffffffffffffffff604f83901c8116820293600f9390931c160290565b6401ffffffff54640100000000116102805760405162461bcd60e51b81526004016101c190611d0f565b6401ffffffff80546001810182559063ffffffff8201908390600090839081106102a657fe5b0155505050565b61010081015160a09091015160031b6007600c9290921c919091160190565b6102d4610fa1565b6102df858483610543565b815160208084015160405160009360029361030693339390918f918f918f918d9101611bb8565b60408051601f198184030181529082905261032091611ba1565b602060405180830381855afa15801561033d573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525061036091908101906113cb565b86516020880151604089015160608a015193945061037f9389866106a4565b61039b5760405162461bcd60e51b81526004016101c190611d8f565b6103a789898987610743565b6103c35760405162461bcd60e51b81526004016101c190611d5f565b6103cb610fa1565b6103d58582610860565b60006103e160026108ad565b90506103ec816108ee565b7f36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618818584886040516104219493929190611c8b565b60405180910390a16104328661090d565b5050505050505050505050565b610447610fbf565b6001600160a01b0384168152602081018390526040810182905281516000906018908490600390811061047657fe5b016020015184516001600160f81b031990911690911c60e01c90601090859060029081106104a057fe5b016020015185516001600160f81b031990911690911c60e01c90600890869060019081106104ca57fe5b016020015186516001600160f81b031990911690911c60e01c9086906000906104ef57fe5b01602001516001600160e01b031963ff00000060e092831c16929092019290920192909201901b1660609092019190915250505050565b6002908190600990565b640200000002546001600160a01b031681565b81516000908152640200000000602052604090205460ff166105775760405162461bcd60e51b81526004016101c190611d2f565b60005b60028110156105fd57600061058f828561019f565b6000818152640200000001602052604090205490915060ff16156105c55760405162461bcd60e51b81526004016101c190611cdf565b600081815264020000000160205260409020805460ff19166001179055808383600281106105ef57fe5b60200201525060010161057a565b50600060028285604051602001610615929190611b7b565b60408051601f198184030181529082905261062f91611ba1565b602060405180830381855afa15801561064c573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525061066f91908101906113cb565b9050600061067c846102ad565b905080821461069d5760405162461bcd60e51b81526004016101c190611d3f565b5050505050565b60006106ae610ffa565b6107d05a038682528560208301528360408301526020608083016060846000600286f150604082018981528860208201526040816060836000600787f1506040836080856000600687f15060016040840152600260608401528560808401526040816060836000600787f150505060408101518151148015610737575060608101516020820151145b98975050505050505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000161076e611018565b86518152602080880151828201528651604080840191909152878201516060808501919091528189015160808501528089015160a0850152875160c08501528783015160e0850152815160098082526101408201909352909290919082016101208038833901905050905060005b600981101561084457838682600981106107f257fe5b6020020151106108145760405162461bcd60e51b81526004016101c190611d7f565b85816009811061082057fe5b602002015182828151811061083157fe5b60209081029190910101526001016107dc565b5061084f8183610b60565b60011493505050505b949350505050565b60005b60028110156108a857600083826001016009811061087d57fe5b602002015190508083836002811061089157fe5b602002015261089f81610256565b50600101610863565b505050565b6401ffffffff546000908281036401000000005b60018111156108e2576108d5818385610e2b565b93509150600290046108c1565b50506000549392505050565b600090815264020000000060205260409020805460ff19166001179055565b6000806109198361022d565b909250905081156109cf57640200000002546001600160a01b0316156109ab57640200000002546040516323b872dd60e01b81526001600160a01b039091169081906323b872dd9061097390339030908890600401611c3a565b600060405180830381600087803b15801561098d57600080fd5b505af11580156109a1573d6000803e3d6000fd5b50505050506109ca565b8134146109ca5760405162461bcd60e51b81526004016101c190611d6f565b610a53565b3415610a53576000336001600160a01b0316346040516109ee90611bad565b60006040518083038185875af1925050503d8060008114610a2b576040519150601f19603f3d011682016040523d82523d6000602084013e610a30565b606091505b5050905080610a515760405162461bcd60e51b81526004016101c190611cef565b505b80156108a857640200000002546001600160a01b031615610ade576402000000025460405163a9059cbb60e01b81526001600160a01b0390911690819063a9059cbb90610aa69033908690600401611c62565b600060405180830381600087803b158015610ac057600080fd5b505af1158015610ad4573d6000803e3d6000fd5b50505050506108a8565b6000336001600160a01b031682604051610af790611bad565b60006040518083038185875af1925050503d8060008114610b34576040519150601f19603f3d011682016040523d82523d6000602084013e610b39565b606091505b5050905080610b5a5760405162461bcd60e51b81526004016101c190611cff565b50505050565b64020000000d548251600091600190910114610b8e5760405162461bcd60e51b81526004016101c190611d4f565b610b9661105d565b60016107d05a03600a6402000000030183526020832060208701875160200281018254865260018301546020870152600283019250604086015b81831015610c1e57835481526001840154602082015282516040820152604081606083600060078af160408860808a600060068bf11695909516946002939093019260209290920191610bd0565b505050505080610c405760405162461bcd60e51b81526004016101c190611daf565b7f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a08301526402000000035460c08301526001640200000003015460e08301526002640200000003015461010083015260036402000000030154610120830152600464020000000301546101408301526005640200000003015461016083015283516101808301527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47602085015181810682036101a085015260408601516101c085015260608601516101e0850152608086015161020085015260a086015161022085015260c086015161024085015260e086015161026085015260066402000000030154610280850152600764020000000301546102a0850152600864020000000301546102c0850152600964020000000301546102e085015260208461030086600060086107d05a03f19250505080610e205760405162461bcd60e51b81526004016101c190611d9f565b505190505b92915050565b600080600019808601906001198616870101826001861615610e9f575060001982860101610e806000826401ffffffff8110610e6357fe5b01546000856002026401ffffffff8110610e7957fe5b0154610ef4565b600060026000198401046401ffffffff8110610e9857fe5b0155610ea4565b508185015b81811115610eda5760011901610e806000826401ffffffff8110610ec457fe5b01546000836001016401ffffffff8110610e7957fe5b600287046002600188010494509450505050935093915050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a811215610f8a57602060002080600052868688838808089350868485099250868488858a8788090909945050600101610f54565b508484868a88888808080898975050505050505050565b60405180604001604052806002906020820280388339509192915050565b604051806080016040528060006001600160a01b03168152602001600081526020016060815260200160006001600160e01b03191681525090565b6040518060a001604052806005906020820280388339509192915050565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518061030001604052806018906020820280388339509192915050565b8035610e2581611ee6565b600082601f83011261109857600080fd5b60026110ab6110a682611e0f565b611de8565b9150818360005b838110156110de57813586016110c88882611221565b84525060209283019291909101906001016110b2565b5050505092915050565b600082601f8301126110f957600080fd5b60026111076110a682611e0f565b9150818385602084028201111561111d57600080fd5b60005b838110156110de5781611133888261120b565b8452506020928301929190910190600101611120565b600082601f83011261115a57600080fd5b60046111686110a682611e0f565b9150818385602084028201111561117e57600080fd5b60005b838110156110de5781611194888261120b565b8452506020928301929190910190600101611181565b600082601f8301126111bb57600080fd5b60096111c96110a682611e0f565b915081838560208402820111156111df57600080fd5b60005b838110156110de57816111f5888261120b565b84525060209283019291909101906001016111e2565b8035610e2581611efd565b8051610e2581611efd565b600082601f83011261123257600080fd5b81356112406110a682611e2d565b9150808252602083016020830185838301111561125c57600080fd5b611267838284611ea4565b50505092915050565b60008060006060848603121561128557600080fd5b6000611291868661107c565b93505060206112a28682870161120b565b925050604084013567ffffffffffffffff8111156112bf57600080fd5b6112cb86828701611221565b9150509250925092565b60008060008060008060006102e0888a0312156112f157600080fd5b60006112fd8a8a6110e8565b975050604061130e8a828b01611149565b96505060c061131f8a828b016110e8565b9550506101006113318a828b01611149565b9450506101806113438a828b0161120b565b9350506101a06113558a828b016111aa565b9250506102c088013567ffffffffffffffff81111561137357600080fd5b61137f8a828b01611087565b91505092959891949750929550565b600061012082840312156113a157600080fd5b600061085884846111aa565b6000602082840312156113bf57600080fd5b6000610858848461120b565b6000602082840312156113dd57600080fd5b60006108588484611216565b60008061014083850312156113fd57600080fd5b6000611409858561120b565b925050602061141a858286016111aa565b9150509250929050565b60006114308383611655565b505060200190565b6000611444838361168d565b9392505050565b61145481611e93565b82525050565b61145481611e82565b61146c81611e58565b6114768184611e74565b925061148182611e55565b8060005b838110156114af5781516114998782611424565b96506114a483611e6e565b925050600101611485565b505050505050565b6114c081611e58565b6114ca8184611e74565b92506114d582611e55565b8060005b838110156114af5781516114ed8782611424565b96506114f883611e6e565b9250506001016114d9565b600061150e82611e58565b6115188185611e74565b93508360208202850161152a85611e55565b8060005b8581101561156457848403895281516115478582611438565b945061155283611e6e565b60209a909a019992505060010161152e565b5091979650505050505050565b61157a81611e58565b6115848184611e74565b925061158f82611e55565b8060005b838110156114af5781516115a78782611424565b96506115b283611e6e565b925050600101611593565b6115c681611e5e565b6115d08184611e74565b92506115db82611e55565b8060005b838110156114af5781516115f38782611424565b96506115fe83611e6e565b9250506001016115df565b61161281611e64565b61161c8184611e74565b925061162782611e55565b8060005b838110156114af57815161163f8782611424565b965061164a83611e6e565b92505060010161162b565b61145481611e55565b600061166982611e6a565b6116738185611e74565b9350611683818560208601611eb0565b9290920192915050565b600061169882611e6a565b6116a28185611e79565b93506116b2818560208601611eb0565b6116bb81611edc565b9093019392505050565b60006116d2601883611e79565b7f6e756c6c696669657220696e646578206f766572666c6f770000000000000000815260200192915050565b600061170b603783611e79565b7f496e76616c6964206e756c6c69666965723a2054686973206e756c6c6966696581527f722068617320616c7265616479206265656e2075736564000000000000000000602082015260400192915050565b600061176a601e83611e79565b7f767075625f696e2072657475726e207472616e73666572206661696c65640000815260200192915050565b60006117a3601883611e79565b7f767075625f6f7574207472616e73666572206661696c65640000000000000000815260200192915050565b60006117dc602783611e79565b7f4d65726b6c6520747265652066756c6c3a2043616e6e6f7420617070656e6420815266616e796d6f726560c81b602082015260400192915050565b6000611825603083611e79565b7f6e756c6c6966696572207772697474656e20696e20646966666572656e74207281526f32b9b4b23ab0b6103134ba103317329760811b602082015260400192915050565b6000611877602583611e79565b7f496e76616c696420726f6f743a205468697320726f6f7420646f65736e277420815264195e1a5cdd60da1b602082015260400192915050565b60006118be604983611e79565b7f496e76616c696420687369673a2054686973206873696720646f6573206e6f7481527f20636f72726573706f6e6420746f207468652068617368206f6620766b20616e6020820152686420746865206e667360b81b604082015260600192915050565b600061192f602283611e79565b7f496e707574206c656e67746820646966666572732066726f6d20657870656374815261195960f21b602082015260400192915050565b6000611973603383611e79565b7f496e76616c69642070726f6f663a20556e61626c6520746f20766572696679208152727468652070726f6f6620636f72726563746c7960681b602082015260400192915050565b60006119c8602a83611e79565b7f57726f6e67206d73672e76616c75653a2056616c75652070616964206973206e8152691bdd0818dbdc9c9958dd60b21b602082015260400192915050565b6000611a14601c83611e79565b7f496e707574206973206e6f7420696e207363616c6172206669656c6400000000815260200192915050565b6000611a4d603b83611e79565b7f496e76616c6964207369676e61747572653a20556e61626c6520746f2076657281527f69667920746865207369676e617475726520636f72726563746c790000000000602082015260400192915050565b6000610e25600083611e74565b6000611ab9603783611e79565b7f43616c6c20746f20626e3235364164642c20626e3235365363616c61724d756c81527f206f7220626e32353650616972696e67206661696c6564000000000000000000602082015260400192915050565b6000611b18603983611e79565b7f43616c6c20746f2074686520626e323536416464206f7220626e32353653636181527f6c61724d756c20707265636f6d70696c6564206661696c656400000000000000602082015260400192915050565b611454611b7682611e55565b611e55565b6000611b8782856114b7565b604082019150611b9782846115bd565b5060800192915050565b6000611444828461165e565b6000610e2582611a9f565b6000611bc4828a611b6a565b602082019150611bd4828961165e565b9150611be0828861165e565b9150611bec8287611571565b604082019150611bfc82866115bd565b608082019150611c0c8285611571565b604082019150611c1c8284611609565b5061012001979650505050505050565b60208101610e25828461145a565b60608101611c48828661144b565b611c55602083018561145a565b6108586040830184611655565b60408101611c70828561144b565b6114446020830184611655565b60208101610e258284611655565b60c08101611c998287611655565b611ca66020830186611463565b611cb36060830185611463565b81810360a0830152611cc58184611503565b9695505050505050565b60208082528101610e25816116c5565b60208082528101610e25816116fe565b60208082528101610e258161175d565b60208082528101610e2581611796565b60208082528101610e25816117cf565b60208082528101610e2581611818565b60208082528101610e258161186a565b60208082528101610e25816118b1565b60208082528101610e2581611922565b60208082528101610e2581611966565b60208082528101610e25816119bb565b60208082528101610e2581611a07565b60208082528101610e2581611a40565b60208082528101610e2581611aac565b60208082528101610e2581611b0b565b60408101611c708285611655565b60608101611ddb8286611655565b611c556020830185611655565b60405181810167ffffffffffffffff81118282101715611e0757600080fd5b604052919050565b600067ffffffffffffffff821115611e2657600080fd5b5060200290565b600067ffffffffffffffff821115611e4457600080fd5b506020601f91909101601f19160190565b90565b50600290565b50600490565b50600990565b5190565b60200190565b919050565b90815260200190565b60006001600160a01b038216610e25565b6000610e25826000610e2582611e82565b82818337506000910152565b60005b83811015611ecb578181015183820152602001611eb3565b83811115610b5a5750506000910152565b601f01601f191690565b611eef81611e82565b8114611efa57600080fd5b50565b611eef81611e5556fea365627a7a72315820e42326a4694c17436c7722fd4a82ac810b74162de26e7fd1035ac3ef5d5a29d16c6578706572696d656e74616cf564736f6c63430005110040 \ No newline at end of file +60806040523480156200001157600080fd5b506040516200364e3803806200364e833981810160405262000037919081019062000685565b878781806005811462000081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007890620008ba565b60405180910390fd5b50620000926200040360201b60201c565b506000806000603f8110620000a357fe5b0154905060016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555081604260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061010060fd106200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000876565b60405180910390fd5b60fd6002800260010160fd610100030260406002020110620001b5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ac9062000898565b60405180910390fd5b505050604051806040016040528087600060028110620001d157fe5b6020020151815260200187600160028110620001e957fe5b6020020151815250604360000160008201518160000155602082015181600101559050506040518060800160405280866000600281106200022657fe5b60200201518152602001866001600281106200023e57fe5b60200201518152602001856000600281106200025657fe5b60200201518152602001856001600281106200026e57fe5b6020020151815250604360020160008201518160000155602082015181600101556040820151816002015560608201518160030155905050604051806080016040528084600060028110620002bf57fe5b6020020151815260200184600160028110620002d757fe5b6020020151815260200183600060028110620002ef57fe5b60200201518152602001836001600281106200030757fe5b602002015181525060436006016000820151816000015560208201518160010155604082015181600201556060820151816003015590505060008090505b60028251816200035157fe5b046043600a018054905014620003f4576043600a0160405180604001604052808484815181106200037e57fe5b602002602001015181526020018460018501815181106200039b57fe5b602002602001015181525090806001815401808255809150509060018203906000526020600020906002020160009091929091909150600082015181600001556020820151816001015550505060028101905062000345565b505050505050505050620009d9565b60008060001b90508060006002600560020a60020203603f81106200042457fe5b018190555060006002600560020a816200043a57fe5b0490505b600081111562000495576200045f82836200049960201b620014e31760201c565b9150600060028260020203905082600082603f81106200047b57fe5b0181905550600282816200048b57fe5b049150506200043e565b5050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a8112156200053457602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050620004f9565b508484868a8888880808089550505050505092915050565b6000815190506200055d81620009a5565b92915050565b600082601f8301126200057557600080fd5b60026200058c62000586826200090a565b620008dc565b91508183856020840282011115620005a357600080fd5b60005b83811015620005d75781620005bc88826200066e565b845260208401935060208301925050600181019050620005a6565b5050505092915050565b600082601f830112620005f357600080fd5b81516200060a62000604826200092d565b620008dc565b915081818352602084019350602081019050838560208402820111156200063057600080fd5b60005b838110156200066457816200064988826200066e565b84526020840193506020830192505060018101905062000633565b5050505092915050565b6000815190506200067f81620009bf565b92915050565b6000806000806000806000806101a0898b031215620006a357600080fd5b6000620006b38b828c016200066e565b9850506020620006c68b828c016200054c565b9750506040620006d98b828c0162000563565b9650506080620006ec8b828c0162000563565b95505060c0620006ff8b828c0162000563565b945050610100620007138b828c0162000563565b935050610140620007278b828c0162000563565b92505061018089015167ffffffffffffffff8111156200074657600080fd5b620007548b828c01620005e1565b9150509295985092959890939650565b600062000773602d8362000956565b91507f41206861736820646967657374206669747320696e20612073696e676c65206660008301527f69656c6420656c656d656e742e000000000000000000000000000000000000006020830152604082019050919050565b6000620007db602b8362000956565b91507f546f6f206d616e7920696e70757420616e64206f7574707574206e6f7465732060008301527f636f6e736964657265642e0000000000000000000000000000000000000000006020830152604082019050919050565b600062000843601f8362000956565b91507f496e76616c696420646570746820696e20426173654d65726b6c6554726565006000830152602082019050919050565b60006020820190508181036000830152620008918162000764565b9050919050565b60006020820190508181036000830152620008b381620007cc565b9050919050565b60006020820190508181036000830152620008d58162000834565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156200090057600080fd5b8060405250919050565b600067ffffffffffffffff8211156200092257600080fd5b602082029050919050565b600067ffffffffffffffff8211156200094557600080fd5b602082029050602081019050919050565b600082825260208201905092915050565b600062000974826200097b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620009b08162000967565b8114620009bc57600080fd5b50565b620009ca816200099b565b8114620009d657600080fd5b50565b612c6580620009e96000396000f3fe60806040526004361061007b5760003560e01c806397e004891161004e57806397e0048914610161578063c73d16ae1461017d578063f9eb943f146101ba578063fc0c546a146101e75761007b565b806305ceb93c146100805780631f40927c146100bd5780632d287e43146100fb578063354d06fd14610124575b600080fd5b34801561008c57600080fd5b506100a760048036036100a29190810190611aaf565b610212565b6040516100b491906125c9565b60405180910390f35b3480156100c957600080fd5b506100e460048036036100df9190810190611a33565b610332565b6040516100f292919061282b565b60405180910390f35b34801561010757600080fd5b50610122600480360361011d9190810190611a5d565b6103af565b005b34801561013057600080fd5b5061014b60048036036101469190810190611a33565b610434565b60405161015891906125c9565b60405180910390f35b61017b60048036036101769190810190611978565b6104b2565b005b34801561018957600080fd5b506101a4600480360361019f91908101906118fd565b6106d4565b6040516101b19190612630565b60405180910390f35b3480156101c657600080fd5b506101cf6106e8565b6040516101de93929190612854565b60405180910390f35b3480156101f357600080fd5b506101fc61070c565b6040516102099190612528565b60405180910390f35b600060028310610257576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024e9061264b565b60405180910390fd5b600060fd610100038460010102604060020201905060fd61010003810160fd10156102b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ae906126eb565b60405180910390fd5b600060fd826002800260010160fd610100030260406002020161010003018560028002600101600260010101600981106102ed57fe5b602002015160001b901b901c9050600060fd6101000385876002600101016009811061031557fe5b6020020151901b90508160001c810160001b935050505092915050565b600080600083600280026001016002600101016009811061034f57fe5b602002015190506002800260010160fd610100030281901c905064e8d4a5100067ffffffffffffffff168167ffffffffffffffff1602915064e8d4a5100067ffffffffffffffff16604082901c67ffffffffffffffff1602925050915091565b600560020a603f54106103f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ee906126cb565b60405180910390fd5b6000603f549050603f60008154600101919050819055506000816001600560020a0301905082600082603f811061042a57fe5b0181905550505050565b60008060fd60406002026002800260010160fd6101000302604060020201610100030184600280026001016002600101016009811061046f57fe5b602002015160001b901b901c9050600060fd6101000384600280600101016009811061049757fe5b6020020151901b90508160001c810160001b92505050919050565b6104ba611594565b6104c5858483610732565b600060023373ffffffffffffffffffffffffffffffffffffffff16846000600281106104ed57fe5b6020020151856001600281106104ff57fe5b60200201518c8c8c8a60405160200161051e97969594939291906124ae565b60405160208183030381529060405260405161053a9190612482565b602060405180830381855afa158015610557573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525061057a9190810190611a86565b90506105ce8660006004811061058c57fe5b60200201518760016004811061059e57fe5b6020020151886002600481106105b057fe5b6020020151896003600481106105c257fe5b60200201518986610940565b61060d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610604906127cb565b60405180910390fd5b61061989898987610a17565b610658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064f9061276b565b60405180910390fd5b610660611594565b61066a8582610c20565b60006106766002610c7c565b905061068181610cde565b7f36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618818584886040516106b694939291906125e4565b60405180910390a16106c786610d0d565b5050505050505050505050565b600063c73d16ae60e01b9050949350505050565b60008060006002925060029150600160028002600101600260010101019050909192565b604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b604060008360006009811061074357fe5b602002015160001b815260200190815260200160002060009054906101000a900460ff166107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079d9061270b565b60405180910390fd5b60008090505b60028110156108745760006107c18285610212565b90506041600082815260200190815260200160002060009054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061266b565b60405180910390fd5b60016041600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508083836002811061085d57fe5b6020020181815250505080806001019150506107ac565b5060006002828560405160200161088c929190612456565b6040516020818303038152906040526040516108a89190612482565b602060405180830381855afa1580156108c5573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506108e89190810190611a86565b905060006108f584610434565b9050808214610939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109309061272b565b60405180910390fd5b5050505050565b600061094a6115b6565b6107d05a038682528560208301528360408301526020608083016060846000600286f150604082018981528860208201526040816060836000600787f1506040836080856000600687f15060016040840152600260608401528560808401526040816060836000600787f1505050806002600581106109c557fe5b6020020151816000600581106109d757fe5b6020020151148015610a0a5750806003600581106109f157fe5b602002015181600160058110610a0357fe5b6020020151145b9150509695505050505050565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019050610a456115d8565b86600060028110610a5257fe5b602002015181600001818152505086600160028110610a6d57fe5b602002015181602001818152505085600060048110610a8857fe5b602002015181604001818152505085600160048110610aa357fe5b602002015181606001818152505085600260048110610abe57fe5b602002015181608001818152505085600360048110610ad957fe5b60200201518160a001818152505084600060028110610af457fe5b60200201518160c001818152505084600160028110610b0f57fe5b60200201518160e0018181525050606060016002800260010160026001010101604051908082528060200260200182016040528015610b5d5781602001602082028038833980820191505090505b50905060008090505b60016002800260010160026001010101811015610c055783868260098110610b8a57fe5b602002015110610bcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc6906127ab565b60405180910390fd5b858160098110610bdb57fe5b6020020151828281518110610bec57fe5b6020026020010181815250508080600101915050610b66565b50610c1081836110c5565b6001149350505050949350505050565b60008090505b6002811015610c77576000838260010160098110610c4057fe5b602002015160001b905080838360028110610c5757fe5b602002018181525050610c69816103af565b508080600101915050610c26565b505050565b600080603f549050600083603f540390506000600560020a90505b6001811115610cc557610cab8183856113e2565b809450819350505060028181610cbd57fe5b049050610c97565b600080603f8110610cd257fe5b01549350505050919050565b60016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080610d1983610332565b915091506000821115610e6057600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e18576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663d0e7d6113330866040518463ffffffff1660e01b8152600401610de093929190612543565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505050610e5b565b813414610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e519061278b565b60405180910390fd5b5b610f18565b6000341115610f175760003373ffffffffffffffffffffffffffffffffffffffff1634604051610e8f90612499565b60006040518083038185875af1925050503d8060008114610ecc576040519150601f19603f3d011682016040523d82523d6000602084013e610ed1565b606091505b5050905080610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c9061268b565b60405180910390fd5b505b5b60008111156110c057600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611011576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639bd9bbc633846040518363ffffffff1660e01b8152600401610fd992919061258d565b600060405180830381600087803b158015610ff357600080fd5b505af1158015611007573d6000803e3d6000fd5b50505050506110bf565b60003373ffffffffffffffffffffffffffffffffffffffff168260405161103790612499565b60006040518083038185875af1925050503d8060008114611074576040519150601f19603f3d011682016040523d82523d6000602084013e611079565b606091505b50509050806110bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b4906126ab565b60405180910390fd5b505b5b505050565b60006043600a0180549050600184510114611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c9061274b565b60405180910390fd5b61111d61161d565b6000600190506107d05a03600a60430183526020832060208701875160200281018254865260018301546020870152600283019250604086015b818310156111a657835481526001840154602082015282516040820152604081606083600060078af160408860808a600060068bf1808216881697505050600284019350602083019250611157565b5050505050806111eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e29061280b565b60405180910390fd5b7f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a083015260435460c083015260016043015460e083015260026043015461010083015260036043015461012083015260046043015461014083015260056043015461016083015283516101808301527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47602085015181810682036101a085015260408601516101c085015260608601516101e0850152608086015161020085015260a086015161022085015260c086015161024085015260e08601516102608501526006604301546102808501526007604301546102a08501526008604301546102c08501526009604301546102e085015260208461030086600060086107d05a03f192505050806113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd906127eb565b60405180910390fd5b816000601881106113d357fe5b60200201519250505092915050565b600080600060018603905060006001198616820190506000806001871614611459576001868401039050611435600082603f811061141c57fe5b0154600085600202603f811061142e57fe5b01546114e3565b60006002600184038161144457fe5b04603f811061144f57fe5b018190555061145f565b85830190505b5b818111156114bb57600281039050611497600082603f811061147e57fe5b0154600060018401603f811061149057fe5b01546114e3565b6000600260018403816114a657fe5b04603f81106114b157fe5b0181905550611460565b600287816114c557fe5b04600260018801816114d357fe5b0494509450505050935093915050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a81121561157c57602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050611543565b508484868a8888880808089550505050505092915050565b6040518060400160405280600290602082028038833980820191505090505090565b6040518060a00160405280600590602082028038833980820191505090505090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806103000160405280601890602082028038833980820191505090505090565b60008135905061164f81612bdd565b92915050565b600082601f83011261166657600080fd5b6002611679611674826128b8565b61288b565b9150818360005b838110156116b057813586016116968882611840565b845260208401935060208301925050600181019050611680565b5050505092915050565b600082601f8301126116cb57600080fd5b60026116de6116d9826128da565b61288b565b915081838560208402820111156116f457600080fd5b60005b83811015611724578161170a88826118e8565b8452602084019350602083019250506001810190506116f7565b5050505092915050565b600082601f83011261173f57600080fd5b600461175261174d826128fc565b61288b565b9150818385602084028201111561176857600080fd5b60005b83811015611798578161177e88826118e8565b84526020840193506020830192505060018101905061176b565b5050505092915050565b600082601f8301126117b357600080fd5b60096117c66117c18261291e565b61288b565b915081838560208402820111156117dc57600080fd5b60005b8381101561180c57816117f288826118e8565b8452602084019350602083019250506001810190506117df565b5050505092915050565b60008135905061182581612bf4565b92915050565b60008151905061183a81612bf4565b92915050565b600082601f83011261185157600080fd5b813561186461185f82612940565b61288b565b9150808252602083016020830185838301111561188057600080fd5b61188b838284612b80565b50505092915050565b600082601f8301126118a557600080fd5b81356118b86118b38261296c565b61288b565b915080825260208301602083018583830111156118d457600080fd5b6118df838284612b80565b50505092915050565b6000813590506118f781612c0b565b92915050565b6000806000806080858703121561191357600080fd5b600061192187828801611640565b945050602061193287828801611640565b9350506040611943878288016118e8565b925050606085013567ffffffffffffffff81111561196057600080fd5b61196c87828801611894565b91505092959194509250565b60008060008060008060006102e0888a03121561199457600080fd5b60006119a28a828b016116ba565b97505060406119b38a828b0161172e565b96505060c06119c48a828b016116ba565b9550506101006119d68a828b0161172e565b9450506101806119e88a828b016118e8565b9350506101a06119fa8a828b016117a2565b9250506102c088013567ffffffffffffffff811115611a1857600080fd5b611a248a828b01611655565b91505092959891949750929550565b60006101208284031215611a4657600080fd5b6000611a54848285016117a2565b91505092915050565b600060208284031215611a6f57600080fd5b6000611a7d84828501611816565b91505092915050565b600060208284031215611a9857600080fd5b6000611aa68482850161182b565b91505092915050565b6000806101408385031215611ac357600080fd5b6000611ad1858286016118e8565b9250506020611ae2858286016117a2565b9150509250929050565b6000611af88383611d8e565b60208301905092915050565b6000611b108383611dac565b60208301905092915050565b6000611b288383611dfb565b905092915050565b6000611b3c8383612430565b60208301905092915050565b611b5181612b4a565b82525050565b611b6081612ad8565b82525050565b611b6f816129ca565b611b798184612a58565b9250611b8482612998565b8060005b83811015611bb5578151611b9c8782611aec565b9650611ba783612a17565b925050600181019050611b88565b505050505050565b611bc6816129ca565b611bd08184612a63565b9250611bdb82612998565b8060005b83811015611c0c578151611bf38782611b04565b9650611bfe83612a17565b925050600181019050611bdf565b505050505050565b6000611c1f826129d5565b611c298185612a6e565b935083602082028501611c3b856129a2565b8060005b85811015611c775784840389528151611c588582611b1c565b9450611c6383612a24565b925060208a01995050600181019050611c3f565b50829750879550505050505092915050565b611c92816129e0565b611c9c8184612a79565b9250611ca7826129ac565b8060005b83811015611cd8578151611cbf8782611b30565b9650611cca83612a31565b925050600181019050611cab565b505050505050565b611ce9816129eb565b611cf38184612a84565b9250611cfe826129b6565b8060005b83811015611d2f578151611d168782611b30565b9650611d2183612a3e565b925050600181019050611d02565b505050505050565b611d40816129f6565b611d4a8184612a8f565b9250611d55826129c0565b8060005b83811015611d86578151611d6d8782611b30565b9650611d7883612a4b565b925050600181019050611d59565b505050505050565b611d9781612aea565b82525050565b611da681612aea565b82525050565b611db581612aea565b82525050565b611dc481612af4565b82525050565b6000611dd582612a0c565b611ddf8185612abc565b9350611def818560208601612b8f565b80840191505092915050565b6000611e0682612a01565b611e108185612a9a565b9350611e20818560208601612b8f565b611e2981612bcc565b840191505092915050565b6000611e3f82612a01565b611e498185612abc565b9350611e59818560208601612b8f565b80840191505092915050565b6000611e72601883612ac7565b91507f6e756c6c696669657220696e646578206f766572666c6f7700000000000000006000830152602082019050919050565b6000611eb2603783612ac7565b91507f496e76616c6964206e756c6c69666965723a2054686973206e756c6c6966696560008301527f722068617320616c7265616479206265656e20757365640000000000000000006020830152604082019050919050565b6000611f18601e83612ac7565b91507f767075625f696e2072657475726e207472616e73666572206661696c656400006000830152602082019050919050565b6000611f58601883612ac7565b91507f767075625f6f7574207472616e73666572206661696c656400000000000000006000830152602082019050919050565b6000611f98602783612ac7565b91507f4d65726b6c6520747265652066756c6c3a2043616e6e6f7420617070656e642060008301527f616e796d6f7265000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611ffe603083612ac7565b91507f6e756c6c6966696572207772697474656e20696e20646966666572656e74207260008301527f6573696475616c2062697420662e652e000000000000000000000000000000006020830152604082019050919050565b6000612064602583612ac7565b91507f496e76616c696420726f6f743a205468697320726f6f7420646f65736e27742060008301527f65786973740000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006120ca604983612ac7565b91507f496e76616c696420687369673a2054686973206873696720646f6573206e6f7460008301527f20636f72726573706f6e6420746f207468652068617368206f6620766b20616e60208301527f6420746865206e667300000000000000000000000000000000000000000000006040830152606082019050919050565b6000612156602283612ac7565b91507f496e707574206c656e67746820646966666572732066726f6d2065787065637460008301527f65640000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006121bc603383612ac7565b91507f496e76616c69642070726f6f663a20556e61626c6520746f207665726966792060008301527f7468652070726f6f6620636f72726563746c79000000000000000000000000006020830152604082019050919050565b6000612222602a83612ac7565b91507f57726f6e67206d73672e76616c75653a2056616c75652070616964206973206e60008301527f6f7420636f7272656374000000000000000000000000000000000000000000006020830152604082019050919050565b6000612288601c83612ac7565b91507f496e707574206973206e6f7420696e207363616c6172206669656c64000000006000830152602082019050919050565b60006122c8603b83612ac7565b91507f496e76616c6964207369676e61747572653a20556e61626c6520746f2076657260008301527f69667920746865207369676e617475726520636f72726563746c7900000000006020830152604082019050919050565b600061232e600083612aab565b9150600082019050919050565b6000612348600083612abc565b9150600082019050919050565b6000612362603783612ac7565b91507f43616c6c20746f20626e3235364164642c20626e3235365363616c61724d756c60008301527f206f7220626e32353650616972696e67206661696c65640000000000000000006020830152604082019050919050565b60006123c8603983612ac7565b91507f43616c6c20746f2074686520626e323536416464206f7220626e32353653636160008301527f6c61724d756c20707265636f6d70696c6564206661696c6564000000000000006020830152604082019050919050565b61242a81612b40565b82525050565b61243981612b40565b82525050565b61245061244b82612b40565b612bc2565b82525050565b60006124628285611bbd565b6040820191506124728284611ce0565b6080820191508190509392505050565b600061248e8284611dca565b915081905092915050565b60006124a48261233b565b9150819050919050565b60006124ba828a61243f565b6020820191506124ca8289611e34565b91506124d68288611e34565b91506124e28287611c89565b6040820191506124f28286611ce0565b6080820191506125028285611c89565b6040820191506125128284611d37565b6101208201915081905098975050505050505050565b600060208201905061253d6000830184611b57565b92915050565b60006080820190506125586000830186611b48565b6125656020830185611b57565b6125726040830184612421565b818103606083015261258381612321565b9050949350505050565b60006060820190506125a26000830185611b48565b6125af6020830184612421565b81810360408301526125c081612321565b90509392505050565b60006020820190506125de6000830184611d9d565b92915050565b600060c0820190506125f96000830187611d9d565b6126066020830186611b66565b6126136060830185611b66565b81810360a08301526126258184611c14565b905095945050505050565b60006020820190506126456000830184611dbb565b92915050565b6000602082019050818103600083015261266481611e65565b9050919050565b6000602082019050818103600083015261268481611ea5565b9050919050565b600060208201905081810360008301526126a481611f0b565b9050919050565b600060208201905081810360008301526126c481611f4b565b9050919050565b600060208201905081810360008301526126e481611f8b565b9050919050565b6000602082019050818103600083015261270481611ff1565b9050919050565b6000602082019050818103600083015261272481612057565b9050919050565b60006020820190508181036000830152612744816120bd565b9050919050565b6000602082019050818103600083015261276481612149565b9050919050565b60006020820190508181036000830152612784816121af565b9050919050565b600060208201905081810360008301526127a481612215565b9050919050565b600060208201905081810360008301526127c48161227b565b9050919050565b600060208201905081810360008301526127e4816122bb565b9050919050565b6000602082019050818103600083015261280481612355565b9050919050565b60006020820190508181036000830152612824816123bb565b9050919050565b60006040820190506128406000830185612421565b61284d6020830184612421565b9392505050565b60006060820190506128696000830186612421565b6128766020830185612421565b6128836040830184612421565b949350505050565b6000604051905081810181811067ffffffffffffffff821117156128ae57600080fd5b8060405250919050565b600067ffffffffffffffff8211156128cf57600080fd5b602082029050919050565b600067ffffffffffffffff8211156128f157600080fd5b602082029050919050565b600067ffffffffffffffff82111561291357600080fd5b602082029050919050565b600067ffffffffffffffff82111561293557600080fd5b602082029050919050565b600067ffffffffffffffff82111561295757600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561298357600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600060029050919050565b600060029050919050565b600060029050919050565b600060049050919050565b600060099050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612ae382612b20565b9050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612b5582612b5c565b9050919050565b6000612b6782612b6e565b9050919050565b6000612b7982612b20565b9050919050565b82818337600083830152505050565b60005b83811015612bad578082015181840152602081019050612b92565b83811115612bbc576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612be681612ad8565b8114612bf157600080fd5b50565b612bfd81612aea565b8114612c0857600080fd5b50565b612c1481612b40565b8114612c1f57600080fd5b5056fea365627a7a7231582015c071139d561376dc726ac2a4746c70b465ba5933ab1663b55ed1c13980d2086c6578706572696d656e74616cf564736f6c63430005110040 \ No newline at end of file diff --git a/contract/Groth16Mixer.py b/contract/Groth16Mixer.py index d66d676..c00af77 100644 --- a/contract/Groth16Mixer.py +++ b/contract/Groth16Mixer.py @@ -1,4 +1,5 @@ # template for codegen +from eth_utils import to_checksum_address from python_web3.client.bcosclient import ( BcosClient @@ -6,12 +7,10 @@ from python_web3.client.datatype_parser import DatatypeParser import json -from python_web3.eth_utils import to_checksum_address - class Groth16Mixer: # name of abi address = None - contract_abi_string = '''[{"inputs": [{"internalType": "uint256", "name": "mk_depth", "type": "uint256"}, {"internalType": "address", "name": "token", "type": "address"}, {"internalType": "uint256[2]", "name": "Alpha", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta2", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta2", "type": "uint256[2]"}, {"internalType": "uint256[]", "name": "ABC_coords", "type": "uint256[]"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "string", "name": "message", "type": "string"}], "name": "LogDebug", "type": "event", "topic": "0xd44da6836c8376d1693e8b9cacf1c39b9bed3599164ad6d8e60902515f83938e"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "message", "type": "bytes32"}], "name": "LogDebug", "type": "event", "topic": "0x05e46912c9be87d8a6830598db8544b61884d9d22f3921597a9a6e8a340914b3"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "root", "type": "bytes32"}, {"indexed": false, "internalType": "bytes32[2]", "name": "nullifiers", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes32[2]", "name": "commitments", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "LogMix", "type": "event", "topic": "0x36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_hsig", "outputs": [{"internalType": "bytes32", "name": "hsig", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256", "name": "index", "type": "uint256"}, {"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_nullifier", "outputs": [{"internalType": "bytes32", "name": "nf", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_public_values", "outputs": [{"internalType": "uint256", "name": "vpub_in", "type": "uint256"}, {"internalType": "uint256", "name": "vpub_out", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [], "name": "get_constants", "outputs": [{"internalType": "uint256", "name": "js_in", "type": "uint256"}, {"internalType": "uint256", "name": "js_out", "type": "uint256"}, {"internalType": "uint256", "name": "num_inputs", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": false, "inputs": [{"internalType": "bytes32", "name": "commitment", "type": "bytes32"}], "name": "insert", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "uint256[2]", "name": "a", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "b", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "c", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256", "name": "sigma", "type": "uint256"}, {"internalType": "uint256[9]", "name": "input", "type": "uint256[9]"}, {"internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "mix", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function"}, {"constant": true, "inputs": [], "name": "token", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "from", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "tokenFallback", "outputs": [], "payable": false, "stateMutability": "pure", "type": "function"}]''' + contract_abi_string = '''[{"inputs": [{"internalType": "uint256", "name": "mk_depth", "type": "uint256"}, {"internalType": "address", "name": "token", "type": "address"}, {"internalType": "uint256[2]", "name": "Alpha", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta2", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta2", "type": "uint256[2]"}, {"internalType": "uint256[]", "name": "ABC_coords", "type": "uint256[]"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "string", "name": "message", "type": "string"}], "name": "LogDebug", "type": "event", "topic": "0xd44da6836c8376d1693e8b9cacf1c39b9bed3599164ad6d8e60902515f83938e"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "message", "type": "bytes32"}], "name": "LogDebug", "type": "event", "topic": "0x05e46912c9be87d8a6830598db8544b61884d9d22f3921597a9a6e8a340914b3"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "root", "type": "bytes32"}, {"indexed": false, "internalType": "bytes32[2]", "name": "nullifiers", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes32[2]", "name": "commitments", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "LogMix", "type": "event", "topic": "0x36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_hsig", "outputs": [{"internalType": "bytes32", "name": "hsig", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256", "name": "index", "type": "uint256"}, {"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_nullifier", "outputs": [{"internalType": "bytes32", "name": "nf", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_public_values", "outputs": [{"internalType": "uint256", "name": "vpub_in", "type": "uint256"}, {"internalType": "uint256", "name": "vpub_out", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [], "name": "get_constants", "outputs": [{"internalType": "uint256", "name": "js_in", "type": "uint256"}, {"internalType": "uint256", "name": "js_out", "type": "uint256"}, {"internalType": "uint256", "name": "num_inputs", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": false, "inputs": [{"internalType": "bytes32", "name": "commitment", "type": "bytes32"}], "name": "insert", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "uint256[2]", "name": "a", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "b", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "c", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256", "name": "sigma", "type": "uint256"}, {"internalType": "uint256[9]", "name": "input", "type": "uint256[9]"}, {"internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "mix", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "address", "name": "", "type": "address"}, {"internalType": "address", "name": "", "type": "address"}, {"internalType": "uint256", "name": "", "type": "uint256"}, {"internalType": "bytes", "name": "", "type": "bytes"}], "name": "onBAC001Received", "outputs": [{"internalType": "bytes4", "name": "", "type": "bytes4"}], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "token", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "payable": false, "stateMutability": "view", "type": "function"}]''' contract_abi = None data_parser = DatatypeParser() client = None @@ -77,10 +76,3 @@ def token(self): args = [] result = self.client.call(self.address, self.contract_abi, func_name, args) return result - - # ------------------------------------------ - def tokenFallback(self, from1, value, data): - func_name = 'tokenFallback' - args = [to_checksum_address(from1), value, data] - result = self.client.call(self.address, self.contract_abi, func_name, args) - return result diff --git a/contract/bac/BAC001.sol b/contract/bac/BAC001.sol index 9fc2836..ac5a950 100644 --- a/contract/bac/BAC001.sol +++ b/contract/bac/BAC001.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.25; +pragma solidity ^0.5.6; library Roles { @@ -215,10 +215,6 @@ contract Suspendable is SuspenderRole { } contract IBAC001Receiver { - /** - * @notice Handle the receipt of an NFT - * @dev The BAC001 smart contract calls this function on the recipient - */ function onBAC001Received(address operator, address from, uint256 value, bytes memory data) public returns (bytes4); } @@ -245,6 +241,7 @@ contract BAC001 is IssuerRole, Suspendable { uint8 private _minUnit; // Equals to `bytes4(keccak256("onBAC001Received(address,address,uint256,bytes)"))` + bytes4 private constant _BAC001_RECEIVED = 0xc73d16ae; @@ -275,16 +272,16 @@ contract BAC001 is IssuerRole, Suspendable { return _allowed[owner][spender]; } - function send(address to, uint256 value, bytes data) public whenNotSuspended { + function send(address to, uint256 value, bytes memory data) public whenNotSuspended { _send(msg.sender, to, value, data); require(_checkOnBAC001Received(msg.sender, to, value, data), "BAC001: send to non BAC001Receiver implementer"); } -// function safeSend(address to, uint256 value, bytes data) public whenNotSuspended { -// send(to, value, data); -// require(_checkOnBAC001Received(msg.sender, to, value, data), "BAC001: send to non BAC001Receiver implementer"); -// } + // function safeSend(address to, uint256 value, bytes data) public whenNotSuspended { + // send(to, value, data); + // require(_checkOnBAC001Received(msg.sender, to, value, data), "BAC001: send to non BAC001Receiver implementer"); + // } /** @@ -298,7 +295,7 @@ contract BAC001 is IssuerRole, Suspendable { /** * @dev Send assets from one address to another. */ - function sendFrom(address from, address to, uint256 value, bytes data) public whenNotSuspended { + function sendFrom(address from, address to, uint256 value, bytes memory data) public whenNotSuspended { _send(from, to, value, data); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); //add @@ -307,14 +304,14 @@ contract BAC001 is IssuerRole, Suspendable { } -//// safe todo -// function safeSendFrom(address from, address to, uint256 value, bytes data) public whenNotSuspended { -// sendFrom(from, to, value, data); -// require(_checkOnBAC001Received(from, to, value, data), "BAC001: send to non BAC001Receiver implementer"); -// } + //// safe todo + // function safeSendFrom(address from, address to, uint256 value, bytes data) public whenNotSuspended { + // sendFrom(from, to, value, data); + // require(_checkOnBAC001Received(from, to, value, data), "BAC001: send to non BAC001Receiver implementer"); + // } - function batchSend(address[] to, uint256[] values, bytes data) public whenNotSuspended { + function batchSend(address[] memory to, uint256[] memory values, bytes memory data) public whenNotSuspended { // MUST Throw on errors @@ -328,7 +325,7 @@ contract BAC001 is IssuerRole, Suspendable { } - function _checkOnBAC001Received(address from, address to, uint256 value, bytes data) + function _checkOnBAC001Received(address from, address to, uint256 value, bytes memory data) internal returns (bool) { if (!to.isContract()) { @@ -356,14 +353,14 @@ contract BAC001 is IssuerRole, Suspendable { return true; } - function destroy(uint256 value, bytes data) public { + function destroy(uint256 value, bytes memory data) public { _destroy(msg.sender, value, data); } /** * @dev Burns a specific amount of assets from the target address and decrements allowance. */ - function destroyFrom(address from, uint256 value, bytes data) public { + function destroyFrom(address from, uint256 value, bytes memory data) public { _destroyFrom(from, value, data); } @@ -387,14 +384,14 @@ contract BAC001 is IssuerRole, Suspendable { } - function issue(address to, uint256 value, bytes data) public onlyIssuer returns (bool) { + function issue(address to, uint256 value, bytes memory data) public onlyIssuer returns (bool) { _issue(to, value, data); return true; } /** * @dev Send asset for a specified addresses. */ - function _send(address from, address to, uint256 value, bytes data) internal { + function _send(address from, address to, uint256 value, bytes memory data) internal { require(to != address(0), "BAC001: send to the zero address"); _balances[from] = _balances[from].sub(value); @@ -405,7 +402,7 @@ contract BAC001 is IssuerRole, Suspendable { /** * @dev Internal function that issues an amount of the asset and assigns it to */ - function _issue(address account, uint256 value, bytes data) internal { + function _issue(address account, uint256 value, bytes memory data) internal { require(account != address(0), "BAC001: issue to the zero address"); _totalAmount = _totalAmount.add(value); @@ -416,7 +413,7 @@ contract BAC001 is IssuerRole, Suspendable { /** * @dev Internal function that destroys an amount of the asset of a given */ - function _destroy(address account, uint256 value, bytes data) internal { + function _destroy(address account, uint256 value, bytes memory data) internal { require(account != address(0), "BAC001: destroy from the zero address"); _totalAmount = _totalAmount.sub(value); @@ -438,7 +435,7 @@ contract BAC001 is IssuerRole, Suspendable { /** * @dev Internal function that destroys an amount of the asset of a given */ - function _destroyFrom(address account, uint256 value, bytes data) internal { + function _destroyFrom(address account, uint256 value, bytes memory data) internal { _destroy(account, value, data); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } diff --git a/contract/mixer/BaseMixer.sol b/contract/mixer/BaseMixer.sol index 2aef07c..f402912 100644 --- a/contract/mixer/BaseMixer.sol +++ b/contract/mixer/BaseMixer.sol @@ -7,47 +7,24 @@ pragma experimental ABIEncoderV2; import "./MerkleTreeMiMC7.sol"; -// Declare the ERC20 interface in order to handle ERC20 tokens transfers to and +// Declare the BAC001 interface in order to handle BAC001 tokens transfers to and // from the Mixer. Note that we only declare the functions we are interested in, // namely, transferFrom() (used to do a Deposit), and transfer() (used to do a // withdrawal) -contract ERC20 { - function transferFrom(address from, address to, uint256 value) public; - function transfer(address to, uint256 value) public; +contract BAC001 { + function sendFrom(address from, address to, uint256 value, bytes memory data) public; + function send(address to, uint256 value, bytes memory data) public; } -// ERC223 token compatible contract -contract ERC223ReceivingContract { - // See: - // https://github.com/Dexaran/ERC223-token-standard/blob/Recommended/Receiver_Interface.sol - struct Token { - address sender; - uint256 value; - bytes data; - bytes4 sig; - } - - function tokenFallback(address from, uint256 value, bytes memory data) - public pure { - Token memory tkn; - tkn.sender = from; - tkn.value = value; - tkn.data = data; - - // See: - // https://solidity.readthedocs.io/en/v0.5.5/types.html#conversions-between-elementary-types - uint32 u = - uint32(bytes4(data[0])) + - uint32(bytes4(data[1]) >> 8) + - uint32(bytes4(data[2]) >> 16) + - uint32(bytes4(data[3]) >> 24); - tkn.sig = bytes4(u); +contract BAC001Holder { + function onBAC001Received(address, address, uint256, bytes memory) public returns (bytes4) { + return this.onBAC001Received.selector; } } // BaseMixer implements the functions shared across all Mixers (regardless which // zkSNARK is used) -contract BaseMixer is MerkleTreeMiMC7, ERC223ReceivingContract { +contract BaseMixer is MerkleTreeMiMC7, BAC001Holder { // The roots of the different updated trees mapping(bytes32 => bool) roots; @@ -346,8 +323,8 @@ contract BaseMixer is MerkleTreeMiMC7, ERC223ReceivingContract { // If the vpub_in is > 0, we need to make sure the right amount is paid if (vpub_in > 0) { if (token != address(0)) { - ERC20 erc20Token = ERC20(token); - erc20Token.transferFrom(msg.sender, address(this), vpub_in); + BAC001 bac001Token = BAC001(token); + bac001Token.sendFrom(msg.sender, address(this), vpub_in,''); } else { require( msg.value == vpub_in, @@ -366,8 +343,8 @@ contract BaseMixer is MerkleTreeMiMC7, ERC223ReceivingContract { // msg.sender and send him the appropriate value IF proof is valid if (vpub_out > 0) { if (token != address(0)) { - ERC20 erc20Token = ERC20(token); - erc20Token.transfer(msg.sender, vpub_out); + BAC001 bac001Token = BAC001(token); + bac001Token.send(msg.sender, vpub_out, ""); } else { (bool success, ) = msg.sender.call.value(vpub_out)(""); require(success, "vpub_out transfer failed"); diff --git a/contract/mixer/__init__.py b/contract/mixer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/contract/mixer/abi/Groth16Mixer.abi b/contract/mixer/abi/Groth16Mixer.abi index cea9bbb..9f33554 100644 --- a/contract/mixer/abi/Groth16Mixer.abi +++ b/contract/mixer/abi/Groth16Mixer.abi @@ -1 +1 @@ -[{"inputs": [{"internalType": "uint256", "name": "mk_depth", "type": "uint256"}, {"internalType": "address", "name": "token", "type": "address"}, {"internalType": "uint256[2]", "name": "Alpha", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Beta2", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta1", "type": "uint256[2]"}, {"internalType": "uint256[2]", "name": "Delta2", "type": "uint256[2]"}, {"internalType": "uint256[]", "name": "ABC_coords", "type": "uint256[]"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "string", "name": "message", "type": "string"}], "name": "LogDebug", "type": "event"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "message", "type": "bytes32"}], "name": "LogDebug", "type": "event"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "bytes32", "name": "root", "type": "bytes32"}, {"indexed": false, "internalType": "bytes32[2]", "name": "nullifiers", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes32[2]", "name": "commitments", "type": "bytes32[2]"}, {"indexed": false, "internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "LogMix", "type": "event"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_hsig", "outputs": [{"internalType": "bytes32", "name": "hsig", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256", "name": "index", "type": "uint256"}, {"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_nullifier", "outputs": [{"internalType": "bytes32", "name": "nf", "type": "bytes32"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [{"internalType": "uint256[9]", "name": "primary_inputs", "type": "uint256[9]"}], "name": "assemble_public_values", "outputs": [{"internalType": "uint256", "name": "vpub_in", "type": "uint256"}, {"internalType": "uint256", "name": "vpub_out", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": true, "inputs": [], "name": "get_constants", "outputs": [{"internalType": "uint256", "name": "js_in", "type": "uint256"}, {"internalType": "uint256", "name": "js_out", "type": "uint256"}, {"internalType": "uint256", "name": "num_inputs", "type": "uint256"}], "payable": false, "stateMutability": "pure", "type": "function"}, {"constant": false, "inputs": [{"internalType": "bytes32", "name": "commitment", "type": "bytes32"}], "name": "insert", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": false, "inputs": [{"internalType": "uint256[2]", "name": "a", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "b", "type": "uint256[4]"}, {"internalType": "uint256[2]", "name": "c", "type": "uint256[2]"}, {"internalType": "uint256[4]", "name": "vk", "type": "uint256[4]"}, {"internalType": "uint256", "name": "sigma", "type": "uint256"}, {"internalType": "uint256[9]", "name": "input", "type": "uint256[9]"}, {"internalType": "bytes[2]", "name": "ciphertexts", "type": "bytes[2]"}], "name": "mix", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function"}, {"constant": true, "inputs": [], "name": "token", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "payable": false, "stateMutability": "view", "type": "function"}, {"constant": true, "inputs": [{"internalType": "address", "name": "from", "type": "address"}, {"internalType": "uint256", "name": "value", "type": "uint256"}, {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "tokenFallback", "outputs": [], "payable": false, "stateMutability": "pure", "type": "function"}] \ No newline at end of file +[{'inputs': [{'internalType': 'uint256', 'name': 'mk_depth', 'type': 'uint256'}, {'internalType': 'address', 'name': 'token', 'type': 'address'}, {'internalType': 'uint256[2]', 'name': 'Alpha', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Beta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta1', 'type': 'uint256[2]'}, {'internalType': 'uint256[2]', 'name': 'Delta2', 'type': 'uint256[2]'}, {'internalType': 'uint256[]', 'name': 'ABC_coords', 'type': 'uint256[]'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'constructor'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'string', 'name': 'message', 'type': 'string'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'message', 'type': 'bytes32'}], 'name': 'LogDebug', 'type': 'event'}, {'anonymous': False, 'inputs': [{'indexed': False, 'internalType': 'bytes32', 'name': 'root', 'type': 'bytes32'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'nullifiers', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes32[2]', 'name': 'commitments', 'type': 'bytes32[2]'}, {'indexed': False, 'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'LogMix', 'type': 'event'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_hsig', 'outputs': [{'internalType': 'bytes32', 'name': 'hsig', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256', 'name': 'index', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_nullifier', 'outputs': [{'internalType': 'bytes32', 'name': 'nf', 'type': 'bytes32'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [{'internalType': 'uint256[9]', 'name': 'primary_inputs', 'type': 'uint256[9]'}], 'name': 'assemble_public_values', 'outputs': [{'internalType': 'uint256', 'name': 'vpub_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'vpub_out', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'get_constants', 'outputs': [{'internalType': 'uint256', 'name': 'js_in', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'js_out', 'type': 'uint256'}, {'internalType': 'uint256', 'name': 'num_inputs', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'pure', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'bytes32', 'name': 'commitment', 'type': 'bytes32'}], 'name': 'insert', 'outputs': [], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'uint256[2]', 'name': 'a', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'b', 'type': 'uint256[4]'}, {'internalType': 'uint256[2]', 'name': 'c', 'type': 'uint256[2]'}, {'internalType': 'uint256[4]', 'name': 'vk', 'type': 'uint256[4]'}, {'internalType': 'uint256', 'name': 'sigma', 'type': 'uint256'}, {'internalType': 'uint256[9]', 'name': 'input', 'type': 'uint256[9]'}, {'internalType': 'bytes[2]', 'name': 'ciphertexts', 'type': 'bytes[2]'}], 'name': 'mix', 'outputs': [], 'payable': True, 'stateMutability': 'payable', 'type': 'function'}, {'constant': False, 'inputs': [{'internalType': 'address', 'name': '', 'type': 'address'}, {'internalType': 'address', 'name': '', 'type': 'address'}, {'internalType': 'uint256', 'name': '', 'type': 'uint256'}, {'internalType': 'bytes', 'name': '', 'type': 'bytes'}], 'name': 'onBAC001Received', 'outputs': [{'internalType': 'bytes4', 'name': '', 'type': 'bytes4'}], 'payable': False, 'stateMutability': 'nonpayable', 'type': 'function'}, {'constant': True, 'inputs': [], 'name': 'token', 'outputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}] \ No newline at end of file diff --git a/contract/mixer/abi/Groth16Mixer.bin b/contract/mixer/abi/Groth16Mixer.bin index 2449bce..82b926c 100644 --- a/contract/mixer/abi/Groth16Mixer.bin +++ b/contract/mixer/abi/Groth16Mixer.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b50604051620037d3380380620037d3833981810160405262000037919081019062000685565b878781806005811462000081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007890620008ba565b60405180910390fd5b50620000926200040360201b60201c565b506000806000603f8110620000a357fe5b0154905060016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555081604260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061010060fd106200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000876565b60405180910390fd5b60fd6002800260010160fd610100030260406002020110620001b5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ac9062000898565b60405180910390fd5b505050604051806040016040528087600060028110620001d157fe5b6020020151815260200187600160028110620001e957fe5b6020020151815250604360000160008201518160000155602082015181600101559050506040518060800160405280866000600281106200022657fe5b60200201518152602001866001600281106200023e57fe5b60200201518152602001856000600281106200025657fe5b60200201518152602001856001600281106200026e57fe5b6020020151815250604360020160008201518160000155602082015181600101556040820151816002015560608201518160030155905050604051806080016040528084600060028110620002bf57fe5b6020020151815260200184600160028110620002d757fe5b6020020151815260200183600060028110620002ef57fe5b60200201518152602001836001600281106200030757fe5b602002015181525060436006016000820151816000015560208201518160010155604082015181600201556060820151816003015590505060008090505b60028251816200035157fe5b046043600a018054905014620003f4576043600a0160405180604001604052808484815181106200037e57fe5b602002602001015181526020018460018501815181106200039b57fe5b602002602001015181525090806001815401808255809150509060018203906000526020600020906002020160009091929091909150600082015181600001556020820151816001015550505060028101905062000345565b505050505050505050620009d9565b60008060001b90508060006002600560020a60020203603f81106200042457fe5b018190555060006002600560020a816200043a57fe5b0490505b600081111562000495576200045f82836200049960201b620016c61760201c565b9150600060028260020203905082600082603f81106200047b57fe5b0181905550600282816200048b57fe5b049150506200043e565b5050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a8112156200053457602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050620004f9565b508484868a8888880808089550505050505092915050565b6000815190506200055d81620009a5565b92915050565b600082601f8301126200057557600080fd5b60026200058c62000586826200090a565b620008dc565b91508183856020840282011115620005a357600080fd5b60005b83811015620005d75781620005bc88826200066e565b845260208401935060208301925050600181019050620005a6565b5050505092915050565b600082601f830112620005f357600080fd5b81516200060a62000604826200092d565b620008dc565b915081818352602084019350602081019050838560208402820111156200063057600080fd5b60005b838110156200066457816200064988826200066e565b84526020840193506020830192505060018101905062000633565b5050505092915050565b6000815190506200067f81620009bf565b92915050565b6000806000806000806000806101a0898b031215620006a357600080fd5b6000620006b38b828c016200066e565b9850506020620006c68b828c016200054c565b9750506040620006d98b828c0162000563565b9650506080620006ec8b828c0162000563565b95505060c0620006ff8b828c0162000563565b945050610100620007138b828c0162000563565b935050610140620007278b828c0162000563565b92505061018089015167ffffffffffffffff8111156200074657600080fd5b620007548b828c01620005e1565b9150509295985092959890939650565b600062000773602d8362000956565b91507f41206861736820646967657374206669747320696e20612073696e676c65206660008301527f69656c6420656c656d656e742e000000000000000000000000000000000000006020830152604082019050919050565b6000620007db602b8362000956565b91507f546f6f206d616e7920696e70757420616e64206f7574707574206e6f7465732060008301527f636f6e736964657265642e0000000000000000000000000000000000000000006020830152604082019050919050565b600062000843601f8362000956565b91507f496e76616c696420646570746820696e20426173654d65726b6c6554726565006000830152602082019050919050565b60006020820190508181036000830152620008918162000764565b9050919050565b60006020820190508181036000830152620008b381620007cc565b9050919050565b60006020820190508181036000830152620008d58162000834565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156200090057600080fd5b8060405250919050565b600067ffffffffffffffff8211156200092257600080fd5b602082029050919050565b600067ffffffffffffffff8211156200094557600080fd5b602082029050602081019050919050565b600082825260208201905092915050565b600062000974826200097b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620009b08162000967565b8114620009bc57600080fd5b50565b620009ca816200099b565b8114620009d657600080fd5b50565b612dea80620009e96000396000f3fe60806040526004361061007b5760003560e01c806397e004891161004e57806397e0048914610161578063c0ee0b8a1461017d578063f9eb943f146101a6578063fc0c546a146101d35761007b565b806305ceb93c146100805780631f40927c146100bd5780632d287e43146100fb578063354d06fd14610124575b600080fd5b34801561008c57600080fd5b506100a760048036036100a29190810190611cdb565b6101fe565b6040516100b491906127a6565b60405180910390f35b3480156100c957600080fd5b506100e460048036036100df9190810190611c5f565b61031e565b6040516100f29291906129ed565b60405180910390f35b34801561010757600080fd5b50610122600480360361011d9190810190611c89565b61039b565b005b34801561013057600080fd5b5061014b60048036036101469190810190611c5f565b610420565b60405161015891906127a6565b60405180910390f35b61017b60048036036101769190810190611ba4565b61049e565b005b34801561018957600080fd5b506101a4600480360361019f9190810190611b3d565b6106c0565b005b3480156101b257600080fd5b506101bb6108cb565b6040516101ca93929190612a16565b60405180910390f35b3480156101df57600080fd5b506101e86108ef565b6040516101f5919061272b565b60405180910390f35b600060028310610243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023a9061280d565b60405180910390fd5b600060fd610100038460010102604060020201905060fd61010003810160fd10156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029a906128ad565b60405180910390fd5b600060fd826002800260010160fd610100030260406002020161010003018560028002600101600260010101600981106102d957fe5b602002015160001b901b901c9050600060fd6101000385876002600101016009811061030157fe5b6020020151901b90508160001c810160001b935050505092915050565b600080600083600280026001016002600101016009811061033b57fe5b602002015190506002800260010160fd610100030281901c905064e8d4a5100067ffffffffffffffff168167ffffffffffffffff1602915064e8d4a5100067ffffffffffffffff16604082901c67ffffffffffffffff1602925050915091565b600560020a603f54106103e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103da9061288d565b60405180910390fd5b6000603f549050603f60008154600101919050819055506000816001600560020a0301905082600082603f811061041657fe5b0181905550505050565b60008060fd60406002026002800260010160fd6101000302604060020201610100030184600280026001016002600101016009811061045b57fe5b602002015160001b901b901c9050600060fd6101000384600280600101016009811061048357fe5b6020020151901b90508160001c810160001b92505050919050565b6104a6611777565b6104b1858483610915565b600060023373ffffffffffffffffffffffffffffffffffffffff16846000600281106104d957fe5b6020020151856001600281106104eb57fe5b60200201518c8c8c8a60405160200161050a97969594939291906126b1565b6040516020818303038152906040526040516105269190612685565b602060405180830381855afa158015610543573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506105669190810190611cb2565b90506105ba8660006004811061057857fe5b60200201518760016004811061058a57fe5b60200201518860026004811061059c57fe5b6020020151896003600481106105ae57fe5b60200201518986610b23565b6105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f09061298d565b60405180910390fd5b61060589898987610bfa565b610644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063b9061292d565b60405180910390fd5b61064c611777565b6106568582610e03565b60006106626002610e5f565b905061066d81610ec1565b7f36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618818584886040516106a294939291906127c1565b60405180910390a16106b386610ef0565b5050505050505050505050565b6106c8611799565b83816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816020018181525050818160400181905250600060188360038151811061072457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c60108460028151811061078457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c6008856001815181106107e457fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60e01c8560008151811061084257fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660e01c01010190508060e01b82606001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250505050505050565b60008060006002925060029150600160028002600101600260010101019050909192565b604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b604060008360006009811061092657fe5b602002015160001b815260200190815260200160002060009054906101000a900460ff16610989576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610980906128cd565b60405180910390fd5b60008090505b6002811015610a575760006109a482856101fe565b90506041600082815260200190815260200160002060009054906101000a900460ff1615610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fe9061282d565b60405180910390fd5b60016041600083815260200190815260200160002060006101000a81548160ff02191690831515021790555080838360028110610a4057fe5b60200201818152505050808060010191505061098f565b50600060028285604051602001610a6f929190612659565b604051602081830303815290604052604051610a8b9190612685565b602060405180830381855afa158015610aa8573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250610acb9190810190611cb2565b90506000610ad884610420565b9050808214610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b13906128ed565b60405180910390fd5b5050505050565b6000610b2d6117f6565b6107d05a038682528560208301528360408301526020608083016060846000600286f150604082018981528860208201526040816060836000600787f1506040836080856000600687f15060016040840152600260608401528560808401526040816060836000600787f150505080600260058110610ba857fe5b602002015181600060058110610bba57fe5b6020020151148015610bed575080600360058110610bd457fe5b602002015181600160058110610be657fe5b6020020151145b9150509695505050505050565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019050610c28611818565b86600060028110610c3557fe5b602002015181600001818152505086600160028110610c5057fe5b602002015181602001818152505085600060048110610c6b57fe5b602002015181604001818152505085600160048110610c8657fe5b602002015181606001818152505085600260048110610ca157fe5b602002015181608001818152505085600360048110610cbc57fe5b60200201518160a001818152505084600060028110610cd757fe5b60200201518160c001818152505084600160028110610cf257fe5b60200201518160e0018181525050606060016002800260010160026001010101604051908082528060200260200182016040528015610d405781602001602082028038833980820191505090505b50905060008090505b60016002800260010160026001010101811015610de85783868260098110610d6d57fe5b602002015110610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da99061296d565b60405180910390fd5b858160098110610dbe57fe5b6020020151828281518110610dcf57fe5b6020026020010181815250508080600101915050610d49565b50610df381836112a8565b6001149350505050949350505050565b60008090505b6002811015610e5a576000838260010160098110610e2357fe5b602002015160001b905080838360028110610e3a57fe5b602002018181525050610e4c8161039b565b508080600101915050610e09565b505050565b600080603f549050600083603f540390506000600560020a90505b6001811115610ea857610e8e8183856115c5565b809450819350505060028181610ea057fe5b049050610e7a565b600080603f8110610eb557fe5b01549350505050919050565b60016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080610efc8361031e565b91509150600082111561104357600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ffb576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401610fc393929190612746565b600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b505050505061103e565b81341461103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110349061294d565b60405180910390fd5b5b6110fb565b60003411156110fa5760003373ffffffffffffffffffffffffffffffffffffffff16346040516110729061269c565b60006040518083038185875af1925050503d80600081146110af576040519150601f19603f3d011682016040523d82523d6000602084013e6110b4565b606091505b50509050806110f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ef9061284d565b60405180910390fd5b505b5b60008111156112a357600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f4576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016111bc92919061277d565b600060405180830381600087803b1580156111d657600080fd5b505af11580156111ea573d6000803e3d6000fd5b50505050506112a2565b60003373ffffffffffffffffffffffffffffffffffffffff168260405161121a9061269c565b60006040518083038185875af1925050503d8060008114611257576040519150601f19603f3d011682016040523d82523d6000602084013e61125c565b606091505b50509050806112a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112979061286d565b60405180910390fd5b505b5b505050565b60006043600a01805490506001845101146112f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ef9061290d565b60405180910390fd5b61130061185d565b6000600190506107d05a03600a60430183526020832060208701875160200281018254865260018301546020870152600283019250604086015b8183101561138957835481526001840154602082015282516040820152604081606083600060078af160408860808a600060068bf180821688169750505060028401935060208301925061133a565b5050505050806113ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c5906129cd565b60405180910390fd5b7f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a083015260435460c083015260016043015460e083015260026043015461010083015260036043015461012083015260046043015461014083015260056043015461016083015283516101808301527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47602085015181810682036101a085015260408601516101c085015260608601516101e0850152608086015161020085015260a086015161022085015260c086015161024085015260e08601516102608501526006604301546102808501526007604301546102a08501526008604301546102c08501526009604301546102e085015260208461030086600060086107d05a03f192505050806115a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a0906129ad565b60405180910390fd5b816000601881106115b657fe5b60200201519250505092915050565b60008060006001860390506000600119861682019050600080600187161461163c576001868401039050611618600082603f81106115ff57fe5b0154600085600202603f811061161157fe5b01546116c6565b60006002600184038161162757fe5b04603f811061163257fe5b0181905550611642565b85830190505b5b8181111561169e5760028103905061167a600082603f811061166157fe5b0154600060018401603f811061167357fe5b01546116c6565b60006002600184038161168957fe5b04603f811061169457fe5b0181905550611643565b600287816116a857fe5b04600260018801816116b657fe5b0494509450505050935093915050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a81121561175f57602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050611726565b508484868a8888880808089550505050505092915050565b6040518060400160405280600290602082028038833980820191505090505090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016060815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6040518060a00160405280600590602082028038833980820191505090505090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806103000160405280601890602082028038833980820191505090505090565b60008135905061188f81612d62565b92915050565b600082601f8301126118a657600080fd5b60026118b96118b482612a7a565b612a4d565b9150818360005b838110156118f057813586016118d68882611a80565b8452602084019350602083019250506001810190506118c0565b5050505092915050565b600082601f83011261190b57600080fd5b600261191e61191982612a9c565b612a4d565b9150818385602084028201111561193457600080fd5b60005b83811015611964578161194a8882611b28565b845260208401935060208301925050600181019050611937565b5050505092915050565b600082601f83011261197f57600080fd5b600461199261198d82612abe565b612a4d565b915081838560208402820111156119a857600080fd5b60005b838110156119d857816119be8882611b28565b8452602084019350602083019250506001810190506119ab565b5050505092915050565b600082601f8301126119f357600080fd5b6009611a06611a0182612ae0565b612a4d565b91508183856020840282011115611a1c57600080fd5b60005b83811015611a4c5781611a328882611b28565b845260208401935060208301925050600181019050611a1f565b5050505092915050565b600081359050611a6581612d79565b92915050565b600081519050611a7a81612d79565b92915050565b600082601f830112611a9157600080fd5b8135611aa4611a9f82612b02565b612a4d565b91508082526020830160208301858383011115611ac057600080fd5b611acb838284612d05565b50505092915050565b600082601f830112611ae557600080fd5b8135611af8611af382612b2e565b612a4d565b91508082526020830160208301858383011115611b1457600080fd5b611b1f838284612d05565b50505092915050565b600081359050611b3781612d90565b92915050565b600080600060608486031215611b5257600080fd5b6000611b6086828701611880565b9350506020611b7186828701611b28565b925050604084013567ffffffffffffffff811115611b8e57600080fd5b611b9a86828701611ad4565b9150509250925092565b60008060008060008060006102e0888a031215611bc057600080fd5b6000611bce8a828b016118fa565b9750506040611bdf8a828b0161196e565b96505060c0611bf08a828b016118fa565b955050610100611c028a828b0161196e565b945050610180611c148a828b01611b28565b9350506101a0611c268a828b016119e2565b9250506102c088013567ffffffffffffffff811115611c4457600080fd5b611c508a828b01611895565b91505092959891949750929550565b60006101208284031215611c7257600080fd5b6000611c80848285016119e2565b91505092915050565b600060208284031215611c9b57600080fd5b6000611ca984828501611a56565b91505092915050565b600060208284031215611cc457600080fd5b6000611cd284828501611a6b565b91505092915050565b6000806101408385031215611cef57600080fd5b6000611cfd85828601611b28565b9250506020611d0e858286016119e2565b9150509250929050565b6000611d248383611fba565b60208301905092915050565b6000611d3c8383611fd8565b60208301905092915050565b6000611d548383612018565b905092915050565b6000611d688383612633565b60208301905092915050565b611d7d81612ccf565b82525050565b611d8c81612c89565b82525050565b611d9b81612b8c565b611da58184612c1a565b9250611db082612b5a565b8060005b83811015611de1578151611dc88782611d18565b9650611dd383612bd9565b925050600181019050611db4565b505050505050565b611df281612b8c565b611dfc8184612c25565b9250611e0782612b5a565b8060005b83811015611e38578151611e1f8782611d30565b9650611e2a83612bd9565b925050600181019050611e0b565b505050505050565b6000611e4b82612b97565b611e558185612c30565b935083602082028501611e6785612b64565b8060005b85811015611ea35784840389528151611e848582611d48565b9450611e8f83612be6565b925060208a01995050600181019050611e6b565b50829750879550505050505092915050565b611ebe81612ba2565b611ec88184612c3b565b9250611ed382612b6e565b8060005b83811015611f04578151611eeb8782611d5c565b9650611ef683612bf3565b925050600181019050611ed7565b505050505050565b611f1581612bad565b611f1f8184612c46565b9250611f2a82612b78565b8060005b83811015611f5b578151611f428782611d5c565b9650611f4d83612c00565b925050600181019050611f2e565b505050505050565b611f6c81612bb8565b611f768184612c51565b9250611f8182612b82565b8060005b83811015611fb2578151611f998782611d5c565b9650611fa483612c0d565b925050600181019050611f85565b505050505050565b611fc381612c9b565b82525050565b611fd281612c9b565b82525050565b611fe181612c9b565b82525050565b6000611ff282612bce565b611ffc8185612c6d565b935061200c818560208601612d14565b80840191505092915050565b600061202382612bc3565b61202d8185612c5c565b935061203d818560208601612d14565b61204681612d51565b840191505092915050565b600061205c82612bc3565b6120668185612c6d565b9350612076818560208601612d14565b80840191505092915050565b600061208f601883612c78565b91507f6e756c6c696669657220696e646578206f766572666c6f7700000000000000006000830152602082019050919050565b60006120cf603783612c78565b91507f496e76616c6964206e756c6c69666965723a2054686973206e756c6c6966696560008301527f722068617320616c7265616479206265656e20757365640000000000000000006020830152604082019050919050565b6000612135601e83612c78565b91507f767075625f696e2072657475726e207472616e73666572206661696c656400006000830152602082019050919050565b6000612175601883612c78565b91507f767075625f6f7574207472616e73666572206661696c656400000000000000006000830152602082019050919050565b60006121b5602783612c78565b91507f4d65726b6c6520747265652066756c6c3a2043616e6e6f7420617070656e642060008301527f616e796d6f7265000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061221b603083612c78565b91507f6e756c6c6966696572207772697474656e20696e20646966666572656e74207260008301527f6573696475616c2062697420662e652e000000000000000000000000000000006020830152604082019050919050565b6000612281602583612c78565b91507f496e76616c696420726f6f743a205468697320726f6f7420646f65736e27742060008301527f65786973740000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006122e7604983612c78565b91507f496e76616c696420687369673a2054686973206873696720646f6573206e6f7460008301527f20636f72726573706f6e6420746f207468652068617368206f6620766b20616e60208301527f6420746865206e667300000000000000000000000000000000000000000000006040830152606082019050919050565b6000612373602283612c78565b91507f496e707574206c656e67746820646966666572732066726f6d2065787065637460008301527f65640000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123d9603383612c78565b91507f496e76616c69642070726f6f663a20556e61626c6520746f207665726966792060008301527f7468652070726f6f6620636f72726563746c79000000000000000000000000006020830152604082019050919050565b600061243f602a83612c78565b91507f57726f6e67206d73672e76616c75653a2056616c75652070616964206973206e60008301527f6f7420636f7272656374000000000000000000000000000000000000000000006020830152604082019050919050565b60006124a5601c83612c78565b91507f496e707574206973206e6f7420696e207363616c6172206669656c64000000006000830152602082019050919050565b60006124e5603b83612c78565b91507f496e76616c6964207369676e61747572653a20556e61626c6520746f2076657260008301527f69667920746865207369676e617475726520636f72726563746c7900000000006020830152604082019050919050565b600061254b600083612c6d565b9150600082019050919050565b6000612565603783612c78565b91507f43616c6c20746f20626e3235364164642c20626e3235365363616c61724d756c60008301527f206f7220626e32353650616972696e67206661696c65640000000000000000006020830152604082019050919050565b60006125cb603983612c78565b91507f43616c6c20746f2074686520626e323536416464206f7220626e32353653636160008301527f6c61724d756c20707265636f6d70696c6564206661696c6564000000000000006020830152604082019050919050565b61262d81612cc5565b82525050565b61263c81612cc5565b82525050565b61265361264e82612cc5565b612d47565b82525050565b60006126658285611de9565b6040820191506126758284611f0c565b6080820191508190509392505050565b60006126918284611fe7565b915081905092915050565b60006126a78261253e565b9150819050919050565b60006126bd828a612642565b6020820191506126cd8289612051565b91506126d98288612051565b91506126e58287611eb5565b6040820191506126f58286611f0c565b6080820191506127058285611eb5565b6040820191506127158284611f63565b6101208201915081905098975050505050505050565b60006020820190506127406000830184611d83565b92915050565b600060608201905061275b6000830186611d74565b6127686020830185611d83565b6127756040830184612624565b949350505050565b60006040820190506127926000830185611d74565b61279f6020830184612624565b9392505050565b60006020820190506127bb6000830184611fc9565b92915050565b600060c0820190506127d66000830187611fc9565b6127e36020830186611d92565b6127f06060830185611d92565b81810360a08301526128028184611e40565b905095945050505050565b6000602082019050818103600083015261282681612082565b9050919050565b60006020820190508181036000830152612846816120c2565b9050919050565b6000602082019050818103600083015261286681612128565b9050919050565b6000602082019050818103600083015261288681612168565b9050919050565b600060208201905081810360008301526128a6816121a8565b9050919050565b600060208201905081810360008301526128c68161220e565b9050919050565b600060208201905081810360008301526128e681612274565b9050919050565b60006020820190508181036000830152612906816122da565b9050919050565b6000602082019050818103600083015261292681612366565b9050919050565b60006020820190508181036000830152612946816123cc565b9050919050565b6000602082019050818103600083015261296681612432565b9050919050565b6000602082019050818103600083015261298681612498565b9050919050565b600060208201905081810360008301526129a6816124d8565b9050919050565b600060208201905081810360008301526129c681612558565b9050919050565b600060208201905081810360008301526129e6816125be565b9050919050565b6000604082019050612a026000830185612624565b612a0f6020830184612624565b9392505050565b6000606082019050612a2b6000830186612624565b612a386020830185612624565b612a456040830184612624565b949350505050565b6000604051905081810181811067ffffffffffffffff82111715612a7057600080fd5b8060405250919050565b600067ffffffffffffffff821115612a9157600080fd5b602082029050919050565b600067ffffffffffffffff821115612ab357600080fd5b602082029050919050565b600067ffffffffffffffff821115612ad557600080fd5b602082029050919050565b600067ffffffffffffffff821115612af757600080fd5b602082029050919050565b600067ffffffffffffffff821115612b1957600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115612b4557600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600060029050919050565b600060029050919050565b600060029050919050565b600060049050919050565b600060099050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612c9482612ca5565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612cda82612ce1565b9050919050565b6000612cec82612cf3565b9050919050565b6000612cfe82612ca5565b9050919050565b82818337600083830152505050565b60005b83811015612d32578082015181840152602081019050612d17565b83811115612d41576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612d6b81612c89565b8114612d7657600080fd5b50565b612d8281612c9b565b8114612d8d57600080fd5b50565b612d9981612cc5565b8114612da457600080fd5b5056fea365627a7a7231582050896d86e76884fde4fc8b2c86258ea7642db8c7044364187de62ad90657faf46c6578706572696d656e74616cf564736f6c63430005110040 \ No newline at end of file +60806040523480156200001157600080fd5b506040516200364e3803806200364e833981810160405262000037919081019062000685565b878781806005811462000081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200007890620008ba565b60405180910390fd5b50620000926200040360201b60201c565b506000806000603f8110620000a357fe5b0154905060016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555081604260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061010060fd106200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000876565b60405180910390fd5b60fd6002800260010160fd610100030260406002020110620001b5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ac9062000898565b60405180910390fd5b505050604051806040016040528087600060028110620001d157fe5b6020020151815260200187600160028110620001e957fe5b6020020151815250604360000160008201518160000155602082015181600101559050506040518060800160405280866000600281106200022657fe5b60200201518152602001866001600281106200023e57fe5b60200201518152602001856000600281106200025657fe5b60200201518152602001856001600281106200026e57fe5b6020020151815250604360020160008201518160000155602082015181600101556040820151816002015560608201518160030155905050604051806080016040528084600060028110620002bf57fe5b6020020151815260200184600160028110620002d757fe5b6020020151815260200183600060028110620002ef57fe5b60200201518152602001836001600281106200030757fe5b602002015181525060436006016000820151816000015560208201518160010155604082015181600201556060820151816003015590505060008090505b60028251816200035157fe5b046043600a018054905014620003f4576043600a0160405180604001604052808484815181106200037e57fe5b602002602001015181526020018460018501815181106200039b57fe5b602002602001015181525090806001815401808255809150509060018203906000526020600020906002020160009091929091909150600082015181600001556020820151816001015550505060028101905062000345565b505050505050505050620009d9565b60008060001b90508060006002600560020a60020203603f81106200042457fe5b018190555060006002600560020a816200043a57fe5b0490505b600081111562000495576200045f82836200049960201b620014e31760201c565b9150600060028260020203905082600082603f81106200047b57fe5b0181905550600282816200048b57fe5b049150506200043e565b5050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a8112156200053457602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050620004f9565b508484868a8888880808089550505050505092915050565b6000815190506200055d81620009a5565b92915050565b600082601f8301126200057557600080fd5b60026200058c62000586826200090a565b620008dc565b91508183856020840282011115620005a357600080fd5b60005b83811015620005d75781620005bc88826200066e565b845260208401935060208301925050600181019050620005a6565b5050505092915050565b600082601f830112620005f357600080fd5b81516200060a62000604826200092d565b620008dc565b915081818352602084019350602081019050838560208402820111156200063057600080fd5b60005b838110156200066457816200064988826200066e565b84526020840193506020830192505060018101905062000633565b5050505092915050565b6000815190506200067f81620009bf565b92915050565b6000806000806000806000806101a0898b031215620006a357600080fd5b6000620006b38b828c016200066e565b9850506020620006c68b828c016200054c565b9750506040620006d98b828c0162000563565b9650506080620006ec8b828c0162000563565b95505060c0620006ff8b828c0162000563565b945050610100620007138b828c0162000563565b935050610140620007278b828c0162000563565b92505061018089015167ffffffffffffffff8111156200074657600080fd5b620007548b828c01620005e1565b9150509295985092959890939650565b600062000773602d8362000956565b91507f41206861736820646967657374206669747320696e20612073696e676c65206660008301527f69656c6420656c656d656e742e000000000000000000000000000000000000006020830152604082019050919050565b6000620007db602b8362000956565b91507f546f6f206d616e7920696e70757420616e64206f7574707574206e6f7465732060008301527f636f6e736964657265642e0000000000000000000000000000000000000000006020830152604082019050919050565b600062000843601f8362000956565b91507f496e76616c696420646570746820696e20426173654d65726b6c6554726565006000830152602082019050919050565b60006020820190508181036000830152620008918162000764565b9050919050565b60006020820190508181036000830152620008b381620007cc565b9050919050565b60006020820190508181036000830152620008d58162000834565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156200090057600080fd5b8060405250919050565b600067ffffffffffffffff8211156200092257600080fd5b602082029050919050565b600067ffffffffffffffff8211156200094557600080fd5b602082029050602081019050919050565b600082825260208201905092915050565b600062000974826200097b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620009b08162000967565b8114620009bc57600080fd5b50565b620009ca816200099b565b8114620009d657600080fd5b50565b612c6580620009e96000396000f3fe60806040526004361061007b5760003560e01c806397e004891161004e57806397e0048914610161578063c73d16ae1461017d578063f9eb943f146101ba578063fc0c546a146101e75761007b565b806305ceb93c146100805780631f40927c146100bd5780632d287e43146100fb578063354d06fd14610124575b600080fd5b34801561008c57600080fd5b506100a760048036036100a29190810190611aaf565b610212565b6040516100b491906125c9565b60405180910390f35b3480156100c957600080fd5b506100e460048036036100df9190810190611a33565b610332565b6040516100f292919061282b565b60405180910390f35b34801561010757600080fd5b50610122600480360361011d9190810190611a5d565b6103af565b005b34801561013057600080fd5b5061014b60048036036101469190810190611a33565b610434565b60405161015891906125c9565b60405180910390f35b61017b60048036036101769190810190611978565b6104b2565b005b34801561018957600080fd5b506101a4600480360361019f91908101906118fd565b6106d4565b6040516101b19190612630565b60405180910390f35b3480156101c657600080fd5b506101cf6106e8565b6040516101de93929190612854565b60405180910390f35b3480156101f357600080fd5b506101fc61070c565b6040516102099190612528565b60405180910390f35b600060028310610257576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024e9061264b565b60405180910390fd5b600060fd610100038460010102604060020201905060fd61010003810160fd10156102b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ae906126eb565b60405180910390fd5b600060fd826002800260010160fd610100030260406002020161010003018560028002600101600260010101600981106102ed57fe5b602002015160001b901b901c9050600060fd6101000385876002600101016009811061031557fe5b6020020151901b90508160001c810160001b935050505092915050565b600080600083600280026001016002600101016009811061034f57fe5b602002015190506002800260010160fd610100030281901c905064e8d4a5100067ffffffffffffffff168167ffffffffffffffff1602915064e8d4a5100067ffffffffffffffff16604082901c67ffffffffffffffff1602925050915091565b600560020a603f54106103f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ee906126cb565b60405180910390fd5b6000603f549050603f60008154600101919050819055506000816001600560020a0301905082600082603f811061042a57fe5b0181905550505050565b60008060fd60406002026002800260010160fd6101000302604060020201610100030184600280026001016002600101016009811061046f57fe5b602002015160001b901b901c9050600060fd6101000384600280600101016009811061049757fe5b6020020151901b90508160001c810160001b92505050919050565b6104ba611594565b6104c5858483610732565b600060023373ffffffffffffffffffffffffffffffffffffffff16846000600281106104ed57fe5b6020020151856001600281106104ff57fe5b60200201518c8c8c8a60405160200161051e97969594939291906124ae565b60405160208183030381529060405260405161053a9190612482565b602060405180830381855afa158015610557573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525061057a9190810190611a86565b90506105ce8660006004811061058c57fe5b60200201518760016004811061059e57fe5b6020020151886002600481106105b057fe5b6020020151896003600481106105c257fe5b60200201518986610940565b61060d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610604906127cb565b60405180910390fd5b61061989898987610a17565b610658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064f9061276b565b60405180910390fd5b610660611594565b61066a8582610c20565b60006106766002610c7c565b905061068181610cde565b7f36ed7c3f2ecfb5a5226c478b034d33144c060afe361be291e948f861dcddc618818584886040516106b694939291906125e4565b60405180910390a16106c786610d0d565b5050505050505050505050565b600063c73d16ae60e01b9050949350505050565b60008060006002925060029150600160028002600101600260010101019050909192565b604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b604060008360006009811061074357fe5b602002015160001b815260200190815260200160002060009054906101000a900460ff166107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079d9061270b565b60405180910390fd5b60008090505b60028110156108745760006107c18285610212565b90506041600082815260200190815260200160002060009054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061266b565b60405180910390fd5b60016041600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508083836002811061085d57fe5b6020020181815250505080806001019150506107ac565b5060006002828560405160200161088c929190612456565b6040516020818303038152906040526040516108a89190612482565b602060405180830381855afa1580156108c5573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506108e89190810190611a86565b905060006108f584610434565b9050808214610939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109309061272b565b60405180910390fd5b5050505050565b600061094a6115b6565b6107d05a038682528560208301528360408301526020608083016060846000600286f150604082018981528860208201526040816060836000600787f1506040836080856000600687f15060016040840152600260608401528560808401526040816060836000600787f1505050806002600581106109c557fe5b6020020151816000600581106109d757fe5b6020020151148015610a0a5750806003600581106109f157fe5b602002015181600160058110610a0357fe5b6020020151145b9150509695505050505050565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019050610a456115d8565b86600060028110610a5257fe5b602002015181600001818152505086600160028110610a6d57fe5b602002015181602001818152505085600060048110610a8857fe5b602002015181604001818152505085600160048110610aa357fe5b602002015181606001818152505085600260048110610abe57fe5b602002015181608001818152505085600360048110610ad957fe5b60200201518160a001818152505084600060028110610af457fe5b60200201518160c001818152505084600160028110610b0f57fe5b60200201518160e0018181525050606060016002800260010160026001010101604051908082528060200260200182016040528015610b5d5781602001602082028038833980820191505090505b50905060008090505b60016002800260010160026001010101811015610c055783868260098110610b8a57fe5b602002015110610bcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc6906127ab565b60405180910390fd5b858160098110610bdb57fe5b6020020151828281518110610bec57fe5b6020026020010181815250508080600101915050610b66565b50610c1081836110c5565b6001149350505050949350505050565b60008090505b6002811015610c77576000838260010160098110610c4057fe5b602002015160001b905080838360028110610c5757fe5b602002018181525050610c69816103af565b508080600101915050610c26565b505050565b600080603f549050600083603f540390506000600560020a90505b6001811115610cc557610cab8183856113e2565b809450819350505060028181610cbd57fe5b049050610c97565b600080603f8110610cd257fe5b01549350505050919050565b60016040600083815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080610d1983610332565b915091506000821115610e6057600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e18576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663d0e7d6113330866040518463ffffffff1660e01b8152600401610de093929190612543565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505050610e5b565b813414610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e519061278b565b60405180910390fd5b5b610f18565b6000341115610f175760003373ffffffffffffffffffffffffffffffffffffffff1634604051610e8f90612499565b60006040518083038185875af1925050503d8060008114610ecc576040519150601f19603f3d011682016040523d82523d6000602084013e610ed1565b606091505b5050905080610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c9061268b565b60405180910390fd5b505b5b60008111156110c057600073ffffffffffffffffffffffffffffffffffffffff16604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611011576000604260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639bd9bbc633846040518363ffffffff1660e01b8152600401610fd992919061258d565b600060405180830381600087803b158015610ff357600080fd5b505af1158015611007573d6000803e3d6000fd5b50505050506110bf565b60003373ffffffffffffffffffffffffffffffffffffffff168260405161103790612499565b60006040518083038185875af1925050503d8060008114611074576040519150601f19603f3d011682016040523d82523d6000602084013e611079565b606091505b50509050806110bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b4906126ab565b60405180910390fd5b505b5b505050565b60006043600a0180549050600184510114611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c9061274b565b60405180910390fd5b61111d61161d565b6000600190506107d05a03600a60430183526020832060208701875160200281018254865260018301546020870152600283019250604086015b818310156111a657835481526001840154602082015282516040820152604081606083600060078af160408860808a600060068bf1808216881697505050600284019350602083019250611157565b5050505050806111eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e29061280b565b60405180910390fd5b7f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a083015260435460c083015260016043015460e083015260026043015461010083015260036043015461012083015260046043015461014083015260056043015461016083015283516101808301527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47602085015181810682036101a085015260408601516101c085015260608601516101e0850152608086015161020085015260a086015161022085015260c086015161024085015260e08601516102608501526006604301546102808501526007604301546102a08501526008604301546102c08501526009604301546102e085015260208461030086600060086107d05a03f192505050806113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd906127eb565b60405180910390fd5b816000601881106113d357fe5b60200201519250505092915050565b600080600060018603905060006001198616820190506000806001871614611459576001868401039050611435600082603f811061141c57fe5b0154600085600202603f811061142e57fe5b01546114e3565b60006002600184038161144457fe5b04603f811061144f57fe5b018190555061145f565b85830190505b5b818111156114bb57600281039050611497600082603f811061147e57fe5b0154600060018401603f811061149057fe5b01546114e3565b6000600260018403816114a657fe5b04603f81106114b157fe5b0181905550611460565b600287816114c557fe5b04600260018801816114d357fe5b0494509450505050935093915050565b60007fdec937b7fa8db3de380427a8cc947bfab68514522c3439cfa2e99655098368146000527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284828282088381820984858383098683840909925060005b605a81121561157c57602060002080600052868688838808089350868485099250868488858a8788090909945050600181019050611543565b508484868a8888880808089550505050505092915050565b6040518060400160405280600290602082028038833980820191505090505090565b6040518060a00160405280600590602082028038833980820191505090505090565b60405180610100016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806103000160405280601890602082028038833980820191505090505090565b60008135905061164f81612bdd565b92915050565b600082601f83011261166657600080fd5b6002611679611674826128b8565b61288b565b9150818360005b838110156116b057813586016116968882611840565b845260208401935060208301925050600181019050611680565b5050505092915050565b600082601f8301126116cb57600080fd5b60026116de6116d9826128da565b61288b565b915081838560208402820111156116f457600080fd5b60005b83811015611724578161170a88826118e8565b8452602084019350602083019250506001810190506116f7565b5050505092915050565b600082601f83011261173f57600080fd5b600461175261174d826128fc565b61288b565b9150818385602084028201111561176857600080fd5b60005b83811015611798578161177e88826118e8565b84526020840193506020830192505060018101905061176b565b5050505092915050565b600082601f8301126117b357600080fd5b60096117c66117c18261291e565b61288b565b915081838560208402820111156117dc57600080fd5b60005b8381101561180c57816117f288826118e8565b8452602084019350602083019250506001810190506117df565b5050505092915050565b60008135905061182581612bf4565b92915050565b60008151905061183a81612bf4565b92915050565b600082601f83011261185157600080fd5b813561186461185f82612940565b61288b565b9150808252602083016020830185838301111561188057600080fd5b61188b838284612b80565b50505092915050565b600082601f8301126118a557600080fd5b81356118b86118b38261296c565b61288b565b915080825260208301602083018583830111156118d457600080fd5b6118df838284612b80565b50505092915050565b6000813590506118f781612c0b565b92915050565b6000806000806080858703121561191357600080fd5b600061192187828801611640565b945050602061193287828801611640565b9350506040611943878288016118e8565b925050606085013567ffffffffffffffff81111561196057600080fd5b61196c87828801611894565b91505092959194509250565b60008060008060008060006102e0888a03121561199457600080fd5b60006119a28a828b016116ba565b97505060406119b38a828b0161172e565b96505060c06119c48a828b016116ba565b9550506101006119d68a828b0161172e565b9450506101806119e88a828b016118e8565b9350506101a06119fa8a828b016117a2565b9250506102c088013567ffffffffffffffff811115611a1857600080fd5b611a248a828b01611655565b91505092959891949750929550565b60006101208284031215611a4657600080fd5b6000611a54848285016117a2565b91505092915050565b600060208284031215611a6f57600080fd5b6000611a7d84828501611816565b91505092915050565b600060208284031215611a9857600080fd5b6000611aa68482850161182b565b91505092915050565b6000806101408385031215611ac357600080fd5b6000611ad1858286016118e8565b9250506020611ae2858286016117a2565b9150509250929050565b6000611af88383611d8e565b60208301905092915050565b6000611b108383611dac565b60208301905092915050565b6000611b288383611dfb565b905092915050565b6000611b3c8383612430565b60208301905092915050565b611b5181612b4a565b82525050565b611b6081612ad8565b82525050565b611b6f816129ca565b611b798184612a58565b9250611b8482612998565b8060005b83811015611bb5578151611b9c8782611aec565b9650611ba783612a17565b925050600181019050611b88565b505050505050565b611bc6816129ca565b611bd08184612a63565b9250611bdb82612998565b8060005b83811015611c0c578151611bf38782611b04565b9650611bfe83612a17565b925050600181019050611bdf565b505050505050565b6000611c1f826129d5565b611c298185612a6e565b935083602082028501611c3b856129a2565b8060005b85811015611c775784840389528151611c588582611b1c565b9450611c6383612a24565b925060208a01995050600181019050611c3f565b50829750879550505050505092915050565b611c92816129e0565b611c9c8184612a79565b9250611ca7826129ac565b8060005b83811015611cd8578151611cbf8782611b30565b9650611cca83612a31565b925050600181019050611cab565b505050505050565b611ce9816129eb565b611cf38184612a84565b9250611cfe826129b6565b8060005b83811015611d2f578151611d168782611b30565b9650611d2183612a3e565b925050600181019050611d02565b505050505050565b611d40816129f6565b611d4a8184612a8f565b9250611d55826129c0565b8060005b83811015611d86578151611d6d8782611b30565b9650611d7883612a4b565b925050600181019050611d59565b505050505050565b611d9781612aea565b82525050565b611da681612aea565b82525050565b611db581612aea565b82525050565b611dc481612af4565b82525050565b6000611dd582612a0c565b611ddf8185612abc565b9350611def818560208601612b8f565b80840191505092915050565b6000611e0682612a01565b611e108185612a9a565b9350611e20818560208601612b8f565b611e2981612bcc565b840191505092915050565b6000611e3f82612a01565b611e498185612abc565b9350611e59818560208601612b8f565b80840191505092915050565b6000611e72601883612ac7565b91507f6e756c6c696669657220696e646578206f766572666c6f7700000000000000006000830152602082019050919050565b6000611eb2603783612ac7565b91507f496e76616c6964206e756c6c69666965723a2054686973206e756c6c6966696560008301527f722068617320616c7265616479206265656e20757365640000000000000000006020830152604082019050919050565b6000611f18601e83612ac7565b91507f767075625f696e2072657475726e207472616e73666572206661696c656400006000830152602082019050919050565b6000611f58601883612ac7565b91507f767075625f6f7574207472616e73666572206661696c656400000000000000006000830152602082019050919050565b6000611f98602783612ac7565b91507f4d65726b6c6520747265652066756c6c3a2043616e6e6f7420617070656e642060008301527f616e796d6f7265000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611ffe603083612ac7565b91507f6e756c6c6966696572207772697474656e20696e20646966666572656e74207260008301527f6573696475616c2062697420662e652e000000000000000000000000000000006020830152604082019050919050565b6000612064602583612ac7565b91507f496e76616c696420726f6f743a205468697320726f6f7420646f65736e27742060008301527f65786973740000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006120ca604983612ac7565b91507f496e76616c696420687369673a2054686973206873696720646f6573206e6f7460008301527f20636f72726573706f6e6420746f207468652068617368206f6620766b20616e60208301527f6420746865206e667300000000000000000000000000000000000000000000006040830152606082019050919050565b6000612156602283612ac7565b91507f496e707574206c656e67746820646966666572732066726f6d2065787065637460008301527f65640000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006121bc603383612ac7565b91507f496e76616c69642070726f6f663a20556e61626c6520746f207665726966792060008301527f7468652070726f6f6620636f72726563746c79000000000000000000000000006020830152604082019050919050565b6000612222602a83612ac7565b91507f57726f6e67206d73672e76616c75653a2056616c75652070616964206973206e60008301527f6f7420636f7272656374000000000000000000000000000000000000000000006020830152604082019050919050565b6000612288601c83612ac7565b91507f496e707574206973206e6f7420696e207363616c6172206669656c64000000006000830152602082019050919050565b60006122c8603b83612ac7565b91507f496e76616c6964207369676e61747572653a20556e61626c6520746f2076657260008301527f69667920746865207369676e617475726520636f72726563746c7900000000006020830152604082019050919050565b600061232e600083612aab565b9150600082019050919050565b6000612348600083612abc565b9150600082019050919050565b6000612362603783612ac7565b91507f43616c6c20746f20626e3235364164642c20626e3235365363616c61724d756c60008301527f206f7220626e32353650616972696e67206661696c65640000000000000000006020830152604082019050919050565b60006123c8603983612ac7565b91507f43616c6c20746f2074686520626e323536416464206f7220626e32353653636160008301527f6c61724d756c20707265636f6d70696c6564206661696c6564000000000000006020830152604082019050919050565b61242a81612b40565b82525050565b61243981612b40565b82525050565b61245061244b82612b40565b612bc2565b82525050565b60006124628285611bbd565b6040820191506124728284611ce0565b6080820191508190509392505050565b600061248e8284611dca565b915081905092915050565b60006124a48261233b565b9150819050919050565b60006124ba828a61243f565b6020820191506124ca8289611e34565b91506124d68288611e34565b91506124e28287611c89565b6040820191506124f28286611ce0565b6080820191506125028285611c89565b6040820191506125128284611d37565b6101208201915081905098975050505050505050565b600060208201905061253d6000830184611b57565b92915050565b60006080820190506125586000830186611b48565b6125656020830185611b57565b6125726040830184612421565b818103606083015261258381612321565b9050949350505050565b60006060820190506125a26000830185611b48565b6125af6020830184612421565b81810360408301526125c081612321565b90509392505050565b60006020820190506125de6000830184611d9d565b92915050565b600060c0820190506125f96000830187611d9d565b6126066020830186611b66565b6126136060830185611b66565b81810360a08301526126258184611c14565b905095945050505050565b60006020820190506126456000830184611dbb565b92915050565b6000602082019050818103600083015261266481611e65565b9050919050565b6000602082019050818103600083015261268481611ea5565b9050919050565b600060208201905081810360008301526126a481611f0b565b9050919050565b600060208201905081810360008301526126c481611f4b565b9050919050565b600060208201905081810360008301526126e481611f8b565b9050919050565b6000602082019050818103600083015261270481611ff1565b9050919050565b6000602082019050818103600083015261272481612057565b9050919050565b60006020820190508181036000830152612744816120bd565b9050919050565b6000602082019050818103600083015261276481612149565b9050919050565b60006020820190508181036000830152612784816121af565b9050919050565b600060208201905081810360008301526127a481612215565b9050919050565b600060208201905081810360008301526127c48161227b565b9050919050565b600060208201905081810360008301526127e4816122bb565b9050919050565b6000602082019050818103600083015261280481612355565b9050919050565b60006020820190508181036000830152612824816123bb565b9050919050565b60006040820190506128406000830185612421565b61284d6020830184612421565b9392505050565b60006060820190506128696000830186612421565b6128766020830185612421565b6128836040830184612421565b949350505050565b6000604051905081810181811067ffffffffffffffff821117156128ae57600080fd5b8060405250919050565b600067ffffffffffffffff8211156128cf57600080fd5b602082029050919050565b600067ffffffffffffffff8211156128f157600080fd5b602082029050919050565b600067ffffffffffffffff82111561291357600080fd5b602082029050919050565b600067ffffffffffffffff82111561293557600080fd5b602082029050919050565b600067ffffffffffffffff82111561295757600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561298357600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600060029050919050565b600060029050919050565b600060029050919050565b600060049050919050565b600060099050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612ae382612b20565b9050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612b5582612b5c565b9050919050565b6000612b6782612b6e565b9050919050565b6000612b7982612b20565b9050919050565b82818337600083830152505050565b60005b83811015612bad578082015181840152602081019050612b92565b83811115612bbc576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612be681612ad8565b8114612bf157600080fd5b50565b612bfd81612aea565b8114612c0857600080fd5b50565b612c1481612b40565b8114612c1f57600080fd5b5056fea365627a7a7231582015c071139d561376dc726ac2a4746c70b465ba5933ab1663b55ed1c13980d2086c6578706572696d656e74616cf564736f6c63430005110040 \ No newline at end of file diff --git a/python_web3/bin/accounts/pyaccount.keystore b/python_web3/bin/accounts/pyaccount.keystore index 1ff8821..af3aed5 100644 --- a/python_web3/bin/accounts/pyaccount.keystore +++ b/python_web3/bin/accounts/pyaccount.keystore @@ -1 +1 @@ -{"address": "95198b93705e394a916579e048c8a32ddfb900f7", "crypto": {"cipher": "aes-128-ctr", "cipherparams": {"iv": "08914ce9686399cf0b3383a687bda88e"}, "ciphertext": "779ba3be11624e7f3417530f9133b4479d635ce36df00a364f114f4dc2105faa", "kdf": "scrypt", "kdfparams": {"dklen": 32, "n": 262144, "r": 1, "p": 8, "salt": "fbb85bc239b2188b8da3968e20ef09e7"}, "mac": "62db212e67000aae00ea1ca26181f32b54b6330df18acf89bb0a09cf6c3b5065"}, "id": "a2ed5353-f861-4873-95fb-344604c74f63", "version": 3} \ No newline at end of file +{"address": "598cf8fba4dcc36417f4c11497dee7eb23fb1431", "crypto": {"cipher": "aes-128-ctr", "cipherparams": {"iv": "5084e8cf9d89faa61a2f6d52463c14d9"}, "ciphertext": "a2ce1e296ba8dc9876913f65d8dc7b9e7809b01d3dd65337e0de96515e982f68", "kdf": "scrypt", "kdfparams": {"dklen": 32, "n": 262144, "r": 1, "p": 8, "salt": "67f35505528b5350c3c31e6d59a05549"}, "mac": "5387854ebdc82c3063aa5a5737e1eefa2c45c5f6dae617097a1b75e6214a5776"}, "id": "b3b36e31-5690-4866-8ab3-264ebb25c567", "version": 3} \ No newline at end of file diff --git a/test_commands/scenario.py b/test_commands/scenario.py index 8e7817d..3314d33 100644 --- a/test_commands/scenario.py +++ b/test_commands/scenario.py @@ -504,12 +504,12 @@ def compile_mixer() -> Interface: set_solc_version(SOL_COMPILER_VERSION) compiled_sol = compile_files([path_to_token], allow_paths=allowed_path) mixer_interface = compiled_sol[path_to_token + ":Groth16Mixer"] - # fo = open("./contract/mixer/abi/Groth16Mixer.abi", "w") - # fo1 = open("./contract/mixer/abi/Groth16Mixer.bin", "w") - # fo.write(str(mixer_interface["abi"])) - # fo.close() - # fo1.write(str(mixer_interface["bin"])) - # fo1.close() + fo = open("./contract/mixer/abi/Groth16Mixer.abi", "w") + fo1 = open("./contract/mixer/abi/Groth16Mixer.bin", "w") + fo.write(str(mixer_interface["abi"])) + fo.close() + fo1.write(str(mixer_interface["bin"])) + fo1.close() return mixer_interface def code_gen(abi_file): @@ -519,4 +519,8 @@ def code_gen(abi_file): # outputfile = os.path.join("./contract/mixer/abi/", ) fo = open("./contract/mixer/abi/Groth16Mixer.py", "w") fo.write(template) - fo.close() \ No newline at end of file + fo.close() + + +if __name__ == '__main__': + compile_mixer() \ No newline at end of file diff --git a/zkclientapp/routes.py b/zkclientapp/routes.py index 40d526b..93f8949 100644 --- a/zkclientapp/routes.py +++ b/zkclientapp/routes.py @@ -3,7 +3,7 @@ from commands.event_sync import event_sync from commands.zeth_deposit import deposit from commands.zeth_token_approve import token_approve -from commands.zeth_token_deploy import deploy_token +from commands.zeth_token_deploy import deploy_asset from commands.zeth_deploy import deploy from commands.zeth_mix import mix from commands.zeth_ls_commits import ls_commits @@ -19,6 +19,8 @@ from django.http import JsonResponse from os.path import exists from typing import List, Tuple + +from zeth.wallet import _ensure_dir from . import models from .models import merkletree @@ -111,7 +113,7 @@ def genZbacAddr(request) -> None: def deployToken(request) -> None: result = {} req = json.loads(request.body) - token_address = deploy_token(req['miner_address'], req['token_amount']) + token_address = deploy_asset(req['miner_address'], req['token_amount']) if token_address : result['status'] = 0 result['address'] = str(token_address)