diff --git a/bin/MasterDistiller.js b/bin/MasterDistiller.js index 85e381a201525eb56059da06eef41df7d8c4c5cb..ff0f76f1efa24c6074c53c163568ffd7a6ef73ec 100755 --- a/bin/MasterDistiller.js +++ b/bin/MasterDistiller.js @@ -2,6 +2,7 @@ "use strict" +const BigInteger = require('big-integer'); const Libbfa = require( process.env.BFAHOME + '/bin/libbfa.js'); const rl = require('readline').createInterface( { input: process.stdin, output: process.stdout } @@ -192,9 +193,9 @@ function editAccount( entry, pallet ) (answer) => { if ( bfa.isNumeric(answer) ) { - answer *= notation[1]; + var bi = BigInteger( answer ).multiply( notation[1] ); console.log("Sending update to the SC..."); - Distillery.methods.setEtherAllowance(acct,answer) + Distillery.methods.setEtherAllowance(acct,web3.utils.toHex(bi)) .send( {"from": bfa.account } ) .then( function(a){ diff --git a/package-lock.json b/package-lock.json index 0e2a51b929e0064d643caa5450faf3df70da8254..d8557b74ea86f6f78274468094327a25b35a5975 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,6 +87,11 @@ "tweetnacl": "^0.14.3" } }, + "big-integer": { + "version": "1.6.43", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.43.tgz", + "integrity": "sha512-9dULc9jsKmXl0Aeunug8wbF+58n+hQoFjqClN7WeZwGLh0XJUWyJJ9Ee+Ep+Ql/J9fRsTVaeThp8MhiCCrY0Jg==" + }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", diff --git a/package.json b/package.json index aacf29acbcd4939100a5023d9f70c4728936ba56..cf247387cb53e24d067e9461570ef8c253a9486c 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "Blockchain Federal Argentina", "dependencies": { + "big-integer": "^1.6.43", "request": "^2.88.0", "require": "^2.4.20", "web3": "^1.0.0-beta.55"