Rename internal and private functions

This commit is contained in:
Amir Bandeali
2019-04-30 16:20:41 -07:00
parent 25e2baaea7
commit 3e461ac2e5
60 changed files with 448 additions and 452 deletions

View File

@@ -88,11 +88,11 @@ contract ERC1155 is
nfOwners[id] = to;
// You could keep balance of NF type in base type id like so:
// uint256 baseType = getNonFungibleBaseType(_id);
// balances[baseType][_from] = balances[baseType][_from].safeSub(_value);
// balances[baseType][_to] = balances[baseType][_to].safeAdd(_value);
// balances[baseType][_from] = balances[baseType][_from]._safeSub(_value);
// balances[baseType][_to] = balances[baseType][_to]._safeAdd(_value);
} else {
balances[id][from] = safeSub(balances[id][from], value);
balances[id][to] = safeAdd(balances[id][to], value);
balances[id][from] = _safeSub(balances[id][from], value);
balances[id][to] = _safeAdd(balances[id][to], value);
}
emit TransferSingle(msg.sender, from, to, id, value);
@@ -170,8 +170,8 @@ contract ERC1155 is
);
nfOwners[id] = to;
} else {
balances[id][from] = safeSub(balances[id][from], value);
balances[id][to] = safeAdd(balances[id][to], value);
balances[id][from] = _safeSub(balances[id][from], value);
balances[id][to] = _safeAdd(balances[id][to], value);
}
}
emit TransferBatch(msg.sender, from, to, ids, values);

View File

@@ -114,7 +114,7 @@ contract ERC1155Mintable is
uint256 quantity = quantities[i];
// Grant the items to the caller
balances[id][dst] = safeAdd(quantity, balances[id][dst]);
balances[id][dst] = _safeAdd(quantity, balances[id][dst]);
// Emit the Transfer/Mint event.
// the 0x0 source address implies a mint
@@ -172,7 +172,7 @@ contract ERC1155Mintable is
nfOwners[id] = dst;
// You could use base-type id to store NF type balances if you wish.
// balances[_type][dst] = quantity.safeAdd(balances[_type][dst]);
// balances[_type][dst] = quantity._safeAdd(balances[_type][dst]);
emit TransferSingle(msg.sender, address(0x0), dst, id, 1);
@@ -194,6 +194,6 @@ contract ERC1155Mintable is
// record the `maxIndex` of this nft type
// this allows us to mint more nft's of this type in a subsequent call.
maxIndex[type_] = safeAdd(to.length, maxIndex[type_]);
maxIndex[type_] = _safeAdd(to.length, maxIndex[type_]);
}
}