small fixes
This commit is contained in:
parent
72dffc3a47
commit
04e13c6913
|
@ -354,8 +354,7 @@ contract MiniMeToken is MiniMeTokenInterface, Controlled {
|
|||
// requires that the `parentToken.balanceOfAt` be queried at the
|
||||
// genesis block for that token as this contains initial balance of
|
||||
// this token
|
||||
if ((balances[_owner].length == 0)
|
||||
|| (balances[_owner][0].fromBlock > _blockNumber)) {
|
||||
if ((balances[_owner].length == 0) || (balances[_owner][0].fromBlock > _blockNumber)) {
|
||||
if (address(parentToken) != 0) {
|
||||
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock));
|
||||
} else {
|
||||
|
@ -381,8 +380,7 @@ contract MiniMeToken is MiniMeTokenInterface, Controlled {
|
|||
// requires that the `parentToken.totalSupplyAt` be queried at the
|
||||
// genesis block for this token as that contains totalSupply of this
|
||||
// token at this block number.
|
||||
if ((totalSupplyHistory.length == 0)
|
||||
|| (totalSupplyHistory[0].fromBlock > _blockNumber)) {
|
||||
if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) {
|
||||
if (address(parentToken) != 0) {
|
||||
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock));
|
||||
} else {
|
||||
|
@ -519,7 +517,7 @@ contract MiniMeToken is MiniMeTokenInterface, Controlled {
|
|||
Checkpoint[] storage checkpoints,
|
||||
uint _block
|
||||
)
|
||||
constant
|
||||
view
|
||||
internal
|
||||
returns (uint)
|
||||
{
|
||||
|
@ -556,8 +554,10 @@ contract MiniMeToken is MiniMeTokenInterface, Controlled {
|
|||
* @param _value The new number of tokens
|
||||
*/
|
||||
function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value) internal {
|
||||
if ((checkpoints.length == 0)
|
||||
|| (checkpoints[checkpoints.length -1].fromBlock < block.number)) {
|
||||
if (
|
||||
(checkpoints.length == 0) ||
|
||||
(checkpoints[checkpoints.length - 1].fromBlock < block.number))
|
||||
{
|
||||
Checkpoint storage newCheckPoint = checkpoints[checkpoints.length++];
|
||||
newCheckPoint.fromBlock = uint128(block.number);
|
||||
newCheckPoint.value = uint128(_value);
|
||||
|
@ -574,13 +574,13 @@ contract MiniMeToken is MiniMeTokenInterface, Controlled {
|
|||
*/
|
||||
function isContract(address _addr) internal view returns(bool) {
|
||||
uint size;
|
||||
if (_addr == 0){
|
||||
if (_addr == 0) {
|
||||
return false;
|
||||
}
|
||||
assembly {
|
||||
size := extcodesize(_addr)
|
||||
}
|
||||
return size>0;
|
||||
return size > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue