mirror of https://github.com/vacp2p/minime.git
Merge pull request #25 from Giveth/readabilityOverflowCheck
Readability of overflow check
This commit is contained in:
commit
83940910f0
|
@ -417,9 +417,9 @@ contract MiniMeToken is Controlled {
|
|||
) onlyController returns (bool) {
|
||||
uint curTotalSupply = totalSupply();
|
||||
if (curTotalSupply + _amount < curTotalSupply) throw; // Check for overflow
|
||||
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
|
||||
var previousBalanceTo = balanceOf(_owner);
|
||||
uint previousBalanceTo = balanceOf(_owner);
|
||||
if (previousBalanceTo + _amount < previousBalanceTo) throw; // Check for overflow
|
||||
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
|
||||
updateValueAtNow(balances[_owner], previousBalanceTo + _amount);
|
||||
Transfer(0, _owner, _amount);
|
||||
return true;
|
||||
|
@ -434,9 +434,9 @@ contract MiniMeToken is Controlled {
|
|||
) onlyController returns (bool) {
|
||||
uint curTotalSupply = totalSupply();
|
||||
if (curTotalSupply < _amount) throw;
|
||||
updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
|
||||
var previousBalanceFrom = balanceOf(_owner);
|
||||
uint previousBalanceFrom = balanceOf(_owner);
|
||||
if (previousBalanceFrom < _amount) throw;
|
||||
updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
|
||||
updateValueAtNow(balances[_owner], previousBalanceFrom - _amount);
|
||||
Transfer(_owner, 0, _amount);
|
||||
return true;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -237,7 +237,9 @@ module.exports = function () {
|
|||
async.series([function (cb1) {
|
||||
params.abi = MiniMeTokenFactoryAbi;
|
||||
params.byteCode = MiniMeTokenFactoryByteCode;
|
||||
console.log("yyyy");
|
||||
_deploy(web3, params, function (err, _tokenFactory) {
|
||||
console.log("ERROR2: ", err);
|
||||
if (err) {
|
||||
cb1(err);
|
||||
return;
|
||||
|
@ -246,6 +248,7 @@ module.exports = function () {
|
|||
cb1();
|
||||
});
|
||||
}, function (cb1) {
|
||||
console.log("zzzz");
|
||||
params.abi = MiniMeTokenAbi;
|
||||
params.byteCode = MiniMeTokenByteCode;
|
||||
_deploy(web3, params, cb1);
|
||||
|
|
|
@ -244,4 +244,4 @@ module.exports = class MiniMeToken {
|
|||
});
|
||||
}, _cb);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4020,9 +4020,9 @@
|
|||
"integrity": "sha1-nbOE/0uJqPYVY9kjldhiWxjzr7A="
|
||||
},
|
||||
"runethtx": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/runethtx/-/runethtx-0.0.6.tgz",
|
||||
"integrity": "sha1-1Phg3dvJwfn1kNxLkIayYbRe3mM=",
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/runethtx/-/runethtx-0.0.7.tgz",
|
||||
"integrity": "sha1-kUXXp4Po44O/CVgN7ahzYx5vwpM=",
|
||||
"requires": {
|
||||
"async": "2.5.0"
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"bignumber.js": "^4.0.0",
|
||||
"ethconnector": "0.0.24",
|
||||
"lodash": "^4.17.4",
|
||||
"runethtx": "0.0.6"
|
||||
"runethtx": "0.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.22.2",
|
||||
|
|
Loading…
Reference in New Issue