CocosToken
ERC20
This contract is an ERC20 token.
Name
CocosToken
Symbol
COCOS
Decimals
18
Total Supply
100,000,000,000 COCOS
About
link
description
Cocos-BCX (COCOS) is a cryptocurrency token and operates on the Ethereum platform. Cocos-BCX has a current supply of 100,000,000,000 with 39,326,586,220 in circulation. The last known price of Cocos-BCX is $0.000487 USD and is up 6.80% over the last 24 hours. It is currently trading on 13 active market(s) with $1,171,860.627 traded over the last 24 hours. More information can be found at https://www.cocosbcx.io/.
Stats
Public Functions
27
Event Types
12
Code Size
28,770 bytes
Library Use
Uses SafeMath for uint.
Events (12) keyboard_arrow_up
Functions
owner keyboard_arrow_up
isOwner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
isPauser keyboard_arrow_up
addPauser keyboard_arrow_up
renouncePauser keyboard_arrow_up
paused keyboard_arrow_up
pause keyboard_arrow_up
unpause keyboard_arrow_up
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value) public returns (bool) {
if (paused() == true) {
// , only white list pass
require(whiteAccountMap[msg.sender] != 0, "contract is in paused, only in white list can transfer");
}
else {
// check black list
require(blackAccountMap[msg.sender] == 0,"address in black list, can't transfer");
}
return super.transfer(_to, _value);
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if (paused() == true) {
// frozen contract , only white list pass
require(whiteAccountMap[msg.sender] != 0, "contract is in paused, can't transfer");
if (msg.sender != _from) {
require(whiteAccountMap[_from] != 0, "contract is in paused, can't transfer");
}
}
else {
// check black list
require(blackAccountMap[msg.sender] == 0, "address in black list, can't transfer");
if (msg.sender != _from) {
require(blackAccountMap[_from] == 0,"address in black list, can't transfer");
}
}
return super.transferFrom(_from, _to, _value);
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
constructor keyboard_arrow_up
withdrawFromContract keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
validAddress checks for the following:
Requirements help
Source Code
function withdrawFromContract(address _to) public onlyOwner validAddress(_to) returns (bool) {
uint256 contractBalance = balanceOf(address(this));
require(contractBalance > 0, "not enough balance");
_transfer(address(this), _to, contractBalance);
return true;
}
addWhiteAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
validAddress checks for the following:
Requirements help
Source Code
function addWhiteAccount(address _whiteAccount) public
onlyOwner
validAddress(_whiteAccount){
require(whiteAccountMap[_whiteAccount]==0, "has in white list");
uint256 index = whiteAccounts.length;
require(index < 4294967296, "white list is too long");
whiteAccounts.length += 1;
whiteAccounts[index] = _whiteAccount;
whiteAccountMap[_whiteAccount] = index + 1;
emit AddWhiteAccount(msg.sender,_whiteAccount);
}
delWhiteAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
validAddress checks for the following:
Requirements help
Source Code
function delWhiteAccount(address _whiteAccount) public
onlyOwner
validAddress(_whiteAccount){
require(whiteAccountMap[_whiteAccount]!=0,"not in white list");
uint256 index = whiteAccountMap[_whiteAccount];
if (index == whiteAccounts.length)
{
whiteAccounts.length -= 1;
}else{
address lastaddress = whiteAccounts[whiteAccounts.length-1];
whiteAccounts[index-1] = lastaddress;
whiteAccounts.length -= 1;
whiteAccountMap[lastaddress] = index;
}
delete whiteAccountMap[_whiteAccount];
emit DelWhiteAccount(msg.sender,_whiteAccount);
}
addBlackAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
validAddress checks for the following:
Requirements help
Source Code
function addBlackAccount(address _blackAccount) public
onlyOwner
validAddress(_blackAccount){
require(blackAccountMap[_blackAccount]==0, "has in black list");
uint256 index = blackAccounts.length;
require(index < 4294967296, "black list is too long");
blackAccounts.length += 1;
blackAccounts[index] = _blackAccount;
blackAccountMap[_blackAccount] = index + 1;
emit AddBlackAccount(msg.sender, _blackAccount);
}
delBlackAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
validAddress checks for the following:
Requirements help
Source Code
function delBlackAccount(address _blackAccount) public
onlyOwner
validAddress(_blackAccount){
require(blackAccountMap[_blackAccount]!=0,"not in black list");
uint256 index = blackAccountMap[_blackAccount];
if (index == blackAccounts.length)
{
blackAccounts.length -= 1;
}else{
address lastaddress = blackAccounts[blackAccounts.length-1];
blackAccounts[index-1] = lastaddress;
blackAccounts.length -= 1;
blackAccountMap[lastaddress] = index;
}
delete blackAccountMap[_blackAccount];
emit DelBlackAccount(msg.sender, _blackAccount);
}