make token always a string

This commit is contained in:
Michele Balistreri 2020-02-28 18:04:25 +03:00
parent 37182158e0
commit 2b288a92e1
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,8 @@ import parseArgs from 'minimist';
import fs from 'fs';
const factoryABI = [{"constant":false,"inputs":[{"name":"keycard","type":"address"},{"components":[{"name":"maxTxValue","type":"uint256"},{"name":"minBlockDistance","type":"uint256"}],"name":"settings","type":"tuple"},{"name":"keycardIsOwner","type":"bool"},{"name":"optToken","type":"address"},{"name":"optTokenMaxTxAmount","type":"uint256"}],"name":"create","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x03fbbd28"},{"constant":false,"inputs":[{"name":"_wallet","type":"address"},{"name":"_keycard","type":"address"}],"name":"unregisterFromOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x25a6e9a1"},{"constant":false,"inputs":[{"name":"_oldOwner","type":"address"},{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x299a7bcc"},{"constant":false,"inputs":[{"name":"_oldKeycard","type":"address"},{"name":"_newKeycard","type":"address"}],"name":"setKeycard","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4349c8bc"},{"constant":false,"inputs":[{"name":"_owner","type":"address"},{"name":"_keycard","type":"address"}],"name":"unregister","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4a45b60b"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"countWalletsForOwner","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x624de70e"},{"constant":false,"inputs":[{"name":"_owner","type":"address"},{"name":"_keycard","type":"address"}],"name":"register","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xaa677354"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"keycardsWallets","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcf7661b9"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"ownersWallets","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xde59dda1"},{"anonymous":false,"inputs":[{"indexed":false,"name":"wallet","type":"address"}],"name":"NewWallet","type":"event","signature":"0xd627a1aeb13261b560c345aaf7d003d55a27193b9284c0b941f53cd62a045f16"}];
const argv = parseArgs(process.argv.slice(2), {string: ["registry", "keycard"], default: {"endpoint": "ws://127.0.0.1:8546", "maxTxValue": 10000000000000, "minBlockDistance": 5, "token": "0x0000000000000000000000000000000000000000", "tokenMaxTxValue": 10000000000000}});
const argv = parseArgs(process.argv.slice(2), {string: ["registry", "keycard", "token"], default: {"endpoint": "ws://127.0.0.1:8546", "maxTxValue": 10000000000000, "minBlockDistance": 5, "token": "0x0000000000000000000000000000000000000000", "tokenMaxTxValue": 10000000000000}});
const web3 = new Web3(argv["endpoint"]);
const KeycardWalletFactory = new web3.eth.Contract(factoryABI, argv["registry"]);