Adds overflow test and better protection given limitations

This commit is contained in:
Andy Tudhope 2019-04-11 17:24:53 +02:00
parent afc8adb22c
commit 55ad0385ce
No known key found for this signature in database
GPG Key ID: 02A3DFA93BF26AD2
1 changed files with 2 additions and 1 deletions

View File

@ -630,7 +630,8 @@ contract("DAppStore", function () {
let max = await DAppStore.methods.max().call();
// Choose a safeMax 1% higher than is currently set
let safe = await DAppStore.methods.safeMax().call();
let amount = parseInt(max, 10) * (parseInt(safe, 10) + 1);
let percent = (safe/max * 100) + 1;
let amount = parseInt(max, 10) * percent;
await SNT.methods.generateTokens(accounts[0], amount).send();
const encodedCall = DAppStore.methods.createDApp(id,amount).encodeABI();