eth-address-index

signed metadata declarations for ethereum addresses
Log | Files | Refs

commit 28abd891dcc696753f2a12d35afe83fd80b86771
parent d659ae72f54aba1f40074a47e16e5acb2fdf5957
Author: nolash <dev@holbrook.no>
Date:   Tue, 29 Dec 2020 20:05:15 +0100

Add token index executables

Diffstat:
Dpython/eth_token_endorser/__init__.py | 1-
Dpython/eth_token_endorser/data/GiftableToken.bin | 2--
Dpython/eth_token_endorser/data/GiftableToken.json | 1-
Dpython/eth_token_endorser/data/TokenEndorser.bin | 2--
Dpython/eth_token_endorser/data/TokenEndorser.json | 1-
Dpython/eth_token_endorser/runnable/add.py | 59-----------------------------------------------------------
Dpython/eth_token_endorser/runnable/deploy.py | 62--------------------------------------------------------------
Dpython/eth_token_endorser/token.py | 79-------------------------------------------------------------------------------
Mpython/eth_token_index/data/TokenUniqueSymbolIndex.bin | 4++--
Apython/eth_token_index/runnable/add.py | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apython/eth_token_index/runnable/deploy.py | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rpython/tests/test_deploy.py -> python/tests/test_tokenindex.py | 0
12 files changed, 135 insertions(+), 209 deletions(-)

diff --git a/python/eth_token_endorser/__init__.py b/python/eth_token_endorser/__init__.py @@ -1 +0,0 @@ -from .token import TokenEndorser diff --git a/python/eth_token_endorser/data/GiftableToken.bin b/python/eth_token_endorser/data/GiftableToken.bin @@ -1 +0,0 @@ -60806040523480156200001157600080fd5b506040516200120338038062001203833981810160405260608110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011557600080fd5b838201915060208201858111156200012c57600080fd5b82518660018202830111640100000000821117156200014a57600080fd5b8083526020830192505050908051906020019080838360005b838110156200018057808201518184015260208101905062000163565b50505050905090810190601f168015620001ae5780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600290805190602001906200021a929190620002af565b50816003908051906020019062000233929190620002af565b5080600460006101000a81548160ff021916908360ff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505062000365565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002e7576000855562000333565b82601f106200030257805160ff191683800117855562000333565b8280016001018555821562000333579182015b828111156200033257825182559160200191906001019062000315565b5b50905062000342919062000346565b5090565b5b808211156200036157600081600090555060010162000347565b5090565b610e8e80620003756000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806355b6ed5c1161007157806355b6ed5c146102bd57806370a082311461033557806395d89b411461038d578063983b2d5614610410578063a0712d681461046a578063a9059cbb146104ae576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be5780633092afd514610242578063313ce5671461029c575b600080fd5b6100c1610512565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b0565b60405180821515815260200191505060405180910390f35b6101a86106ab565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b1565b60405180821515815260200191505060405180910390f35b6102846004803603602081101561025857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a8565b60405180821515815260200191505060405180910390f35b6102a4610a9a565b604051808260ff16815260200191505060405180910390f35b61031f600480360360408110156102d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aad565b6040518082815260200191505060405180910390f35b6103776004803603602081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad2565b6040518082815260200191505060405180910390f35b610395610aea565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d55780820151818401526020810190506103ba565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104526004803603602081101561042657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b88565b60405180821515815260200191505060405180910390f35b6104966004803603602081101561048057600080fd5b8101908080359060200190929190505050610c43565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d01565b60405180821515815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105a85780601f1061057d576101008083540402835291602001916105a8565b820191906000526020600020905b81548152906001019060200180831161058b57829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561073c57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561078857600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040518082815260200191505060405180910390a4600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a3057508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a3957600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600460009054906101000a900460ff1681565b6007602052816000526040600020602052806000526040600020600091509150505481565b60066020528060005260406000206000915090505481565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b805780601f10610b5557610100808354040283529160200191610b80565b820191906000526020600020905b815481529060010190602001808311610b6357829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610be357600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610c9b57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508160056000828254019250508190555060019050919050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d4f57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509291505056fea2646970667358221220decedd646f4686c330f11369f5c7b4908d8940d20f00c85711890c5f75172d8764736f6c63430007050033 -\ No newline at end of file diff --git a/python/eth_token_endorser/data/GiftableToken.json b/python/eth_token_endorser/data/GiftableToken.json @@ -1 +0,0 @@ -[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"}],"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":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"address","name":"_spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferFrom","type":"event"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"addMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"removeMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/python/eth_token_endorser/data/TokenEndorser.bin b/python/eth_token_endorser/data/TokenEndorser.bin @@ -1 +0,0 @@ -608060405234801561001057600080fd5b506001600081905550600660009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111398061008c6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063427f91a61161005b578063427f91a6146101125780634f64b2be146101425780639367d97514610172578063e6088e83146101a25761007d565b80630f1244d3146100825780632d580ef6146100b25780633fac3587146100e2575b600080fd5b61009c60048036038101906100979190610c5a565b6101d2565b6040516100a99190610e03565b60405180910390f35b6100cc60048036038101906100c79190610b90565b61021b565b6040516100d99190610e1e565b60405180910390f35b6100fc60048036038101906100f79190610bcc565b610685565b6040516101099190610e54565b60405180910390f35b61012c60048036038101906101279190610b67565b6106b6565b6040516101399190610e54565b60405180910390f35b61015c60048036038101906101579190610cdc565b6106ce565b6040516101699190610e03565b60405180910390f35b61018c60048036038101906101879190610b67565b61070d565b6040516101999190610e54565b60405180910390f35b6101bc60048036038101906101b79190610c08565b610725565b6040516101c99190610e39565b60405180910390f35b6005818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006102268361073d565b50600080602867ffffffffffffffff81111561026b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561029d5781602001600182028036833780820191505090505b5090506000856040516020016102b39190610dba565b604051602081830303815290604052905060005b601481101561038f57818181518110610309577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b83828151811061034d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061038790610fe6565b9150506102c7565b50336040516020016103a19190610dba565b604051602081830303815290604052905060005b6014811015610489578181815181106103f7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b836014836104109190610efc565b81518110610447577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061048190610fe6565b9150506103b5565b5060028260405161049a9190610dd5565b602060405180830381855afa1580156104b7573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906104da9190610c31565b92506000801b6001600085815260200190815260200160002054146104fe57600080fd5b846001600085815260200190815260200160002081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549080600181540180825580915050600190039060005260206000200160009091909190915055600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061060b90610fe6565b91905055506000543373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fb8a4220b7c147fc6e04861db14024976c551727749a09806414670fac57e5340886040516106709190610e39565b60405180910390a46001935050505092915050565b600360205281600052604060002081815481106106a157600080fd5b90600052602060002001600091509150505481565b60026020528060005260406000206000915090505481565b600681815481106106de57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b60016020528060005260406000206000915090505481565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561078f5760009050610a3e565b6000808373ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516108399190610dd5565b6000604051808303816000865af19150503d8060008114610876576040519150601f19603f3d011682016040523d82523d6000602084013e61087b565b606091505b50915091508161088a57600080fd5b6000818060200190518101906108a09190610c9b565b9050600073ffffffffffffffffffffffffffffffffffffffff166005826040516108ca9190610dec565b908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461091957600080fd5b6006859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600054600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550846005826040516109d39190610dec565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600080815480929190610a3190610fe6565b9190505550600193505050505b919050565b6000610a56610a5184610ea0565b610e6f565b905082815260208101848484011115610a6e57600080fd5b610a79848285610fa4565b509392505050565b6000610a94610a8f84610ea0565b610e6f565b905082815260208101848484011115610aac57600080fd5b610ab7848285610fb3565b509392505050565b600081359050610ace816110be565b92915050565b600081359050610ae3816110d5565b92915050565b600081519050610af8816110d5565b92915050565b600082601f830112610b0f57600080fd5b8135610b1f848260208601610a43565b91505092915050565b600082601f830112610b3957600080fd5b8151610b49848260208601610a81565b91505092915050565b600081359050610b61816110ec565b92915050565b600060208284031215610b7957600080fd5b6000610b8784828501610abf565b91505092915050565b60008060408385031215610ba357600080fd5b6000610bb185828601610abf565b9250506020610bc285828601610ad4565b9150509250929050565b60008060408385031215610bdf57600080fd5b6000610bed85828601610abf565b9250506020610bfe85828601610b52565b9150509250929050565b600060208284031215610c1a57600080fd5b6000610c2884828501610ad4565b91505092915050565b600060208284031215610c4357600080fd5b6000610c5184828501610ae9565b91505092915050565b600060208284031215610c6c57600080fd5b600082013567ffffffffffffffff811115610c8657600080fd5b610c9284828501610afe565b91505092915050565b600060208284031215610cad57600080fd5b600082015167ffffffffffffffff811115610cc757600080fd5b610cd384828501610b28565b91505092915050565b600060208284031215610cee57600080fd5b6000610cfc84828501610b52565b91505092915050565b610d0e81610f52565b82525050565b610d25610d2082610f52565b61102f565b82525050565b610d3481610f64565b82525050565b610d4381610f70565b82525050565b6000610d5482610ed0565b610d5e8185610ee6565b9350610d6e818560208601610fb3565b80840191505092915050565b6000610d8582610edb565b610d8f8185610ef1565b9350610d9f818560208601610fb3565b80840191505092915050565b610db481610f9a565b82525050565b6000610dc68284610d14565b60148201915081905092915050565b6000610de18284610d49565b915081905092915050565b6000610df88284610d7a565b915081905092915050565b6000602082019050610e186000830184610d05565b92915050565b6000602082019050610e336000830184610d2b565b92915050565b6000602082019050610e4e6000830184610d3a565b92915050565b6000602082019050610e696000830184610dab565b92915050565b6000604051905081810181811067ffffffffffffffff82111715610e9657610e95611082565b5b8060405250919050565b600067ffffffffffffffff821115610ebb57610eba611082565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600081905092915050565b6000610f0782610f9a565b9150610f1283610f9a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610f4757610f46611053565b5b828201905092915050565b6000610f5d82610f7a565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610fd1578082015181840152602081019050610fb6565b83811115610fe0576000848401525b50505050565b6000610ff182610f9a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561102457611023611053565b5b600182019050919050565b600061103a82611041565b9050919050565b600061104c826110b1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008160601b9050919050565b6110c781610f52565b81146110d257600080fd5b50565b6110de81610f70565b81146110e957600080fd5b50565b6110f581610f9a565b811461110057600080fd5b5056fea2646970667358221220b8f2c7741375a75c920a4152b00634fd6b771f728ba3117ab25bf6d17dc721f764736f6c63430008000033 -\ No newline at end of file diff --git a/python/eth_token_endorser/data/TokenEndorser.json b/python/eth_token_endorser/data/TokenEndorser.json @@ -1 +0,0 @@ -[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_adder","type":"address"},{"indexed":true,"internalType":"uint256","name":"_index","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"EndorsementAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"endorsement","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"endorser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"endorserTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"tokenSymbolIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] diff --git a/python/eth_token_endorser/runnable/add.py b/python/eth_token_endorser/runnable/add.py @@ -1,59 +0,0 @@ -"""Adds a new token endorsement - -.. moduleauthor:: Louis Holbrook <dev@holbrook.no> -.. pgp:: 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 - -""" - -# standard imports -import os -import json -import argparse -import logging - -# third-party imports -import web3 - - -logging.basicConfig(level=logging.WARNING) -logg = logging.getLogger() - -logging.getLogger('web3').setLevel(logging.WARNING) -logging.getLogger('urllib3').setLevel(logging.WARNING) - -script_dir = os.path.dirname(__file__) -data_dir = os.path.join(script_dir, '..', 'data') - -argparser = argparse.ArgumentParser() -argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') -argparser.add_argument('-a', '--contract-address', dest='a', type=str, help='Token endorsement contract address') -argparser.add_argument('-t', '--token-address', dest='t', type=str, help='Contract address of token to endorse') -argparser.add_argument('-o', '--endorser-address', dest='o', type=str, help='Address to use to sign endorsement transaction') -argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir)) -argparser.add_argument('-v', action='store_true', help='Be verbose') -argparser.add_argument('sha256hash', type=str, help='SHA256 sum of endorsement data') -args = argparser.parse_args() - -if args.v: - logg.setLevel(logging.DEBUG) - -def main(): - w3 = web3.Web3(web3.Web3.HTTPProvider(args.p)) - - f = open(os.path.join(args.abi_dir, 'TokenEndorser.json'), 'r') - abi = json.load(f) - f.close() - - w3.eth.defaultAccount = w3.eth.accounts[0] - if args.o != None: - w3.eth.defaultAccount = args.o - logg.debug('endorser address {}'.format(w3.eth.defaultAccount)) - - c = w3.eth.contract(abi=abi, address=args.a) - - tx_hash = c.functions.add(args.t, args.sha256hash).transact() - print(tx_hash.hex()) - - -if __name__ == '__main__': - main() diff --git a/python/eth_token_endorser/runnable/deploy.py b/python/eth_token_endorser/runnable/deploy.py @@ -1,62 +0,0 @@ -"""Deploys token endorsement contract - -.. moduleauthor:: Louis Holbrook <dev@holbrook.no> -.. pgp:: 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 - -""" - -# standard imports -import os -import json -import argparse -import logging - -# third-party imports -import web3 - - -logging.basicConfig(level=logging.WARNING) -logg = logging.getLogger() - -logging.getLogger('web3').setLevel(logging.WARNING) -logging.getLogger('urllib3').setLevel(logging.WARNING) - -script_dir = os.path.dirname(__file__) -data_dir = os.path.join(script_dir, '..', 'data') - -argparser = argparse.ArgumentParser() -argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') -argparser.add_argument('-o', '--owner', dest='o', type=str, help='Accounts index owner') -argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir)) -argparser.add_argument('-v', action='store_true', help='Be verbose') -args = argparser.parse_args() - -if args.v: - logg.setLevel(logging.DEBUG) - -def main(): - w3 = web3.Web3(web3.Web3.HTTPProvider(args.p)) - - f = open(os.path.join(args.abi_dir, 'TokenEndorser.json'), 'r') - abi = json.load(f) - f.close() - - f = open(os.path.join(args.abi_dir, 'TokenEndorser.bin'), 'r') - bytecode = f.read() - f.close() - - w3.eth.defaultAccount = w3.eth.accounts[0] - if args.o != None: - w3.eth.defaultAccount = args.o - logg.debug('owner address {}'.format(w3.eth.defaultAccount)) - - c = w3.eth.contract(abi=abi, bytecode=bytecode) - tx_hash = c.constructor().transact() - - rcpt = w3.eth.getTransactionReceipt(tx_hash) - - print(rcpt.contractAddress) - - -if __name__ == '__main__': - main() diff --git a/python/eth_token_endorser/token.py b/python/eth_token_endorser/token.py @@ -1,79 +0,0 @@ -# Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 -# SPDX-License-Identifier: GPL-3.0-or-later -# File-version: 1 -# Description: Python interface to abi and bin files for faucet contracts - -# standard imports -import logging -import json -import os -import hashlib - -logg = logging.getLogger(__name__) - -moddir = os.path.dirname(__file__) -datadir = os.path.join(moddir, 'data') - - -class TokenEndorser: - - __abi = None - __bytecode = None - __address = None - - def __init__(self, w3, address, signer_address=None): - abi = TokenEndorser.abi() - TokenEndorser.bytecode() - self.__address = address - self.contract = w3.eth.contract(abi=abi, address=address) - self.w3 = w3 - if signer_address != None: - self.signer_address = signer_address - else: - if type(self.w3.eth.defaultAccount).__name__ == 'Empty': - self.w3.eth.defaultAccount = self.w3.eth.accounts[0] - self.signer_address = self.w3.eth.defaultAccount - - - @staticmethod - def abi(): - if TokenEndorser.__abi == None: - f = open(os.path.join(datadir, 'TokenEndorser.json'), 'r') - TokenEndorser.__abi = json.load(f) - f.close() - return TokenEndorser.__abi - - - @staticmethod - def bytecode(): - if TokenEndorser.__bytecode == None: - f = open(os.path.join(datadir, 'TokenEndorser.bin')) - TokenEndorser.__bytecode = f.read() - f.close() - return TokenEndorser.__bytecode - - - def token_from_symbol(self, symbol): - return self.contract.functions.tokenSymbolIndex(symbol).call() - - - def endorsed_tokens(self, endorser_address): - tokens = [] - for i in range(self.contract.functions.endorserTokenCount(endorser_address).call()): - tidx = self.contract.functions.endorser(endorser_address, i).call() - t = self.contract.functions.tokens(tidx).call() - tokens.append(t) - return tokens - - - def add(self, token_address, data): - self.contract.functions.add(token_address, data).transact({'from': self.signer_address}) - - -def to_endorsement_key(token_address_hex, endorser_address_hex): - h = hashlib.new('sha256') - h.update(bytes.fromhex(token_address_hex[2:])) - h.update(bytes.fromhex(endorser_address_hex[2:])) - return h.digest() - - diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.bin b/python/eth_token_index/data/TokenUniqueSymbolIndex.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a1a806100606000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ec578063bb34534c1461010a578063cbb834341461013a578063d22057a9146101585761007d565b80634f64b2be146100825780637ef50298146100b2578063880ad0af146100e2575b600080fd5b61009c60048036038101906100979190610714565b610188565b6040516100a991906107f2565b60405180910390f35b6100cc60048036038101906100c79190610645565b6101c7565b6040516100d99190610848565b60405180910390f35b6100ea6101df565b005b6100f461021a565b60405161010191906107f2565b60405180910390f35b610124600480360381019061011f9190610645565b61023e565b60405161013191906107f2565b60405180910390f35b6101426102c4565b60405161014f9190610848565b60405180910390f35b610172600480360381019061016d9190610697565b6102d1565b60405161017f919061080d565b60405180910390f35b6002818154811061019857600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090505481565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021190610828565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600084815260200190815260200160002054905060028181548110610291577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600280549050905090565b600060606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161038291906107db565b6000604051808303816000865af19150503d80600081146103bf576040519150601f19603f3d011682016040523d82523d6000602084013e6103c4565b606091505b5091509150816103d357600080fd5b808060200190518101906103e791906106d3565b94506002856040516103f991906107db565b602060405180830381855afa158015610416573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610439919061066e565b935083881461044757600080fd5b60016000858152602001908152602001600020549250600073ffffffffffffffffffffffffffffffffffffffff16600284815481106104af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104fa57600080fd5b60028054905060016000868152602001908152602001600020819055506002879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019550505050505092915050565b600061059c61059784610894565b610863565b9050828152602081018484840111156105b457600080fd5b6105bf84828561093d565b509392505050565b6000813590506105d68161099f565b92915050565b6000813590506105eb816109b6565b92915050565b600081519050610600816109b6565b92915050565b600082601f83011261061757600080fd5b8151610627848260208601610589565b91505092915050565b60008135905061063f816109cd565b92915050565b60006020828403121561065757600080fd5b6000610665848285016105dc565b91505092915050565b60006020828403121561068057600080fd5b600061068e848285016105f1565b91505092915050565b600080604083850312156106aa57600080fd5b60006106b8858286016105dc565b92505060206106c9858286016105c7565b9150509250929050565b6000602082840312156106e557600080fd5b600082015167ffffffffffffffff8111156106ff57600080fd5b61070b84828501610606565b91505092915050565b60006020828403121561072657600080fd5b600061073484828501610630565b91505092915050565b610746816108eb565b82525050565b610755816108fd565b82525050565b6000610766826108c4565b61077081856108cf565b935061078081856020860161093d565b80840191505092915050565b60006107996017836108da565b91507f6f776e65722063616e6e6f74206265206368616e6765640000000000000000006000830152602082019050919050565b6107d581610933565b82525050565b60006107e7828461075b565b915081905092915050565b6000602082019050610807600083018461073d565b92915050565b6000602082019050610822600083018461074c565b92915050565b600060208201905081810360008301526108418161078c565b9050919050565b600060208201905061085d60008301846107cc565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561088a57610889610970565b5b8060405250919050565b600067ffffffffffffffff8211156108af576108ae610970565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108f682610913565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561095b578082015181840152602081019050610940565b8381111561096a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6109a8816108eb565b81146109b357600080fd5b50565b6109bf81610909565b81146109ca57600080fd5b50565b6109d681610933565b81146109e157600080fd5b5056fea26469706673582212202ccad4d8425a8283d41cfdbe1a799b322c946ee19e2e74b11748d2836abf48b664736f6c63430008000033 -\ No newline at end of file +608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506109e3806100c46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ec578063bb34534c1461010a578063cbb834341461013a578063d22057a9146101585761007d565b80634f64b2be146100825780637ef50298146100b2578063880ad0af146100e2575b600080fd5b61009c600480360381019061009791906106dd565b610188565b6040516100a991906107bb565b60405180910390f35b6100cc60048036038101906100c7919061060e565b6101c7565b6040516100d99190610811565b60405180910390f35b6100ea6101df565b005b6100f461021a565b60405161010191906107bb565b60405180910390f35b610124600480360381019061011f919061060e565b61023e565b60405161013191906107bb565b60405180910390f35b6101426102c4565b60405161014f9190610811565b60405180910390f35b610172600480360381019061016d9190610660565b6102d1565b60405161017f91906107d6565b60405180910390f35b6002818154811061019857600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090505481565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610211906107f1565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600084815260200190815260200160002054905060028181548110610291577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600280549050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461032c57600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516103db91906107a4565b6000604051808303816000865af19150503d8060008114610418576040519150601f19603f3d011682016040523d82523d6000602084013e61041d565b606091505b50915091508161042c57600080fd5b80806020019051810190610440919061069c565b945060028560405161045291906107a4565b602060405180830381855afa15801561046f573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906104929190610637565b93508388146104a057600080fd5b60016000858152602001908152602001600020549250600083146104c357600080fd5b60028054905060016000868152602001908152602001600020819055506002879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019550505050505092915050565b60006105656105608461085d565b61082c565b90508281526020810184848401111561057d57600080fd5b610588848285610906565b509392505050565b60008135905061059f81610968565b92915050565b6000813590506105b48161097f565b92915050565b6000815190506105c98161097f565b92915050565b600082601f8301126105e057600080fd5b81516105f0848260208601610552565b91505092915050565b60008135905061060881610996565b92915050565b60006020828403121561062057600080fd5b600061062e848285016105a5565b91505092915050565b60006020828403121561064957600080fd5b6000610657848285016105ba565b91505092915050565b6000806040838503121561067357600080fd5b6000610681858286016105a5565b925050602061069285828601610590565b9150509250929050565b6000602082840312156106ae57600080fd5b600082015167ffffffffffffffff8111156106c857600080fd5b6106d4848285016105cf565b91505092915050565b6000602082840312156106ef57600080fd5b60006106fd848285016105f9565b91505092915050565b61070f816108b4565b82525050565b61071e816108c6565b82525050565b600061072f8261088d565b6107398185610898565b9350610749818560208601610906565b80840191505092915050565b60006107626017836108a3565b91507f6f776e65722063616e6e6f74206265206368616e6765640000000000000000006000830152602082019050919050565b61079e816108fc565b82525050565b60006107b08284610724565b915081905092915050565b60006020820190506107d06000830184610706565b92915050565b60006020820190506107eb6000830184610715565b92915050565b6000602082019050818103600083015261080a81610755565b9050919050565b60006020820190506108266000830184610795565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561085357610852610939565b5b8060405250919050565b600067ffffffffffffffff82111561087857610877610939565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108bf826108dc565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610924578082015181840152602081019050610909565b83811115610933576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610971816108b4565b811461097c57600080fd5b50565b610988816108d2565b811461099357600080fd5b50565b61099f816108fc565b81146109aa57600080fd5b5056fea264697066735822122065acf4d9b69a14b392a3392cf17e2db9d96934bf3e05a4ed9f7d8be85f6aebaa64736f6c63430008000033 +\ No newline at end of file diff --git a/python/eth_token_index/runnable/add.py b/python/eth_token_index/runnable/add.py @@ -0,0 +1,71 @@ +"""Adds a new token to the token symbol index + +.. moduleauthor:: Louis Holbrook <dev@holbrook.no> +.. pgp:: 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 + +""" + +# standard imports +import os +import json +import argparse +import logging +import hashlib + +# third-party imports +import web3 + + +logging.basicConfig(level=logging.WARNING) +logg = logging.getLogger() + +logging.getLogger('web3').setLevel(logging.WARNING) +logging.getLogger('urllib3').setLevel(logging.WARNING) + +script_dir = os.path.dirname(__file__) +data_dir = os.path.join(script_dir, '..', 'data') + +argparser = argparse.ArgumentParser() +argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') +argparser.add_argument('-r', '--contract-address', dest='r', type=str, help='Token endorsement contract address') +argparser.add_argument('-o', '--owner-address', dest='o', type=str, help='Address to use to sign endorsement transaction') +argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir)) +argparser.add_argument('-v', action='store_true', help='Be verbose') +argparser.add_argument('address', type=str, help='Ethereum address to add declaration to') +args = argparser.parse_args() + +if args.v: + logg.setLevel(logging.DEBUG) + +def main(): + w3 = web3.Web3(web3.Web3.HTTPProvider(args.p)) + + f = open(os.path.join(args.abi_dir, 'TokenUniqueSymbolIndex.json'), 'r') + abi = json.load(f) + f.close() + + f = open(os.path.join(args.abi_dir, 'ERC20.json'), 'r') + erc20_abi = json.load(f) + f.close() + + t = w3.eth.contract(abi=erc20_abi, address=args.address) + token_symbol = t.functions.symbol().call() + + w3.eth.defaultAccount = w3.eth.accounts[0] + if args.o != None: + w3.eth.defaultAccount = args.o + logg.debug('owner address {}'.format(w3.eth.defaultAccount)) + + c = w3.eth.contract(abi=abi, address=args.r) + + h = hashlib.new('sha256') + h.update(token_symbol.encode('utf-8')) + z = h.digest() + logg.info('token symbol {} => {}'.format(token_symbol, z.hex())) + + tx_hash = c.functions.register('0x' + z.hex(), args.address).transact() + print(tx_hash.hex()) + + +if __name__ == '__main__': + main() diff --git a/python/eth_token_index/runnable/deploy.py b/python/eth_token_index/runnable/deploy.py @@ -0,0 +1,62 @@ +"""Deploys the token symbol index + +.. moduleauthor:: Louis Holbrook <dev@holbrook.no> +.. pgp:: 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 + +""" + +# standard imports +import os +import json +import argparse +import logging + +# third-party imports +import web3 + + +logging.basicConfig(level=logging.WARNING) +logg = logging.getLogger() + +logging.getLogger('web3').setLevel(logging.WARNING) +logging.getLogger('urllib3').setLevel(logging.WARNING) + +script_dir = os.path.dirname(__file__) +data_dir = os.path.join(script_dir, '..', 'data') + +argparser = argparse.ArgumentParser() +argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') +argparser.add_argument('-o', '--owner', dest='o', type=str, help='Accounts declarator owner') +argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir)) +argparser.add_argument('-v', action='store_true', help='Be verbose') +args = argparser.parse_args() + +if args.v: + logg.setLevel(logging.DEBUG) + +def main(): + w3 = web3.Web3(web3.Web3.HTTPProvider(args.p)) + + f = open(os.path.join(args.abi_dir, 'TokenUniqueSymbolIndex.json'), 'r') + abi = json.load(f) + f.close() + + f = open(os.path.join(args.abi_dir, 'TokenUniqueSymbolIndex.bin'), 'r') + bytecode = f.read() + f.close() + + w3.eth.defaultAccount = w3.eth.accounts[0] + if args.o != None: + w3.eth.defaultAccount = args.o + logg.debug('owner address {}'.format(w3.eth.defaultAccount)) + + c = w3.eth.contract(abi=abi, bytecode=bytecode) + tx_hash = c.constructor().transact() + + rcpt = w3.eth.getTransactionReceipt(tx_hash) + + print(rcpt.contractAddress) + + +if __name__ == '__main__': + main() diff --git a/python/tests/test_deploy.py b/python/tests/test_tokenindex.py