Blockwell

SUKU

ERC20

This contract is an ERC20 token.

Name SUKU
Symbol SUKU
Decimals 18
Total Supply 1,500,000,000 SUKU

About link description

SUKU (SUKU) is a cryptocurrency and operates on the Ethereum platform. SUKU has a current supply of 1,500,000,000 with 119,149,903 in circulation. The last known price of SUKU is 0.16801199 USD and is down -4.44 over the last 24 hours. It is currently trading on 7 active market(s) with $212,808.85 traded over the last 24 hours. More information can be found at https://www.suku.world/.

Stats

Public Functions 26
Event Types 9
Code Size 27,002 bytes

Events (9) keyboard_arrow_up

AddressAddedToWhitelist Event

Parameters help
addedAddress
address help
whitelist
uint8 help
addedBy
address help

AddressRemovedFromWhitelist Event

Parameters help
removedAddress
address help
whitelist
uint8 help
removedBy
address help

AdminAdded Event

Parameters help
addedAdmin
address help
addedBy
address help

AdminRemoved Event

Parameters help
removedAdmin
address help
removedBy
address help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

OutboundWhitelistUpdated Event

Parameters help
updatedBy
address help
sourceWhitelist
uint8 help
destinationWhitelist
uint8 help
from
bool help
to
bool help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

RestrictionsDisabled Event

Parameters help
owner
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

TOKEN_NAME Constant

string help
SUKU

TOKEN_SYMBOL Constant

string help
SUKU

TOKEN_DECIMALS Constant

uint8 help
18

HUNDRED_MILLION Constant

uint256 help
100000000

TOKEN_SUPPLY Constant

uint256 help

SUCCESS_CODE Constant

uint8 help
0

FAILURE_NON_WHITELIST Constant

uint8 help
1

SUCCESS_MESSAGE Constant

string help
SUCCESS

FAILURE_NON_WHITELIST_MESSAGE Constant

string help
The transfer was restricted due to white list configuration.

UNKNOWN_ERROR Constant

string help
Unknown Error Code

NO_WHITELIST Constant

uint8 help
0

addressWhitelists Variable

mapping(address => uint8) help

administrators Variable

mapping(address => bool) help

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

_totalSupply Variable

uint256 help
Internal Variable

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 help
Internal Variable

outboundWhitelistsEnabled Variable

mapping(uint8 => mapping(uint8 => bool)) help
Internal Variable

_owner Variable

address help
Internal Variable

_restrictionsEnabled Variable

bool help
Internal Variable

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function owner() public view returns (address) {
  return _owner;
}

isOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function isOwner() public view returns (bool) {
  return msg.sender == _owner;
}

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function renounceOwnership() public onlyOwner {
  emit OwnershipTransferred(_owner, address(0));
  _owner = address(0);
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  _transferOwnership(newOwner);
}

isRestrictionEnabled keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function isRestrictionEnabled() public view returns (bool) {
  return _restrictionsEnabled;
}

disableRestrictions keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function disableRestrictions() public onlyOwner {
  require(_restrictionsEnabled, "Restrictions are already disabled.");

  // Set the flag
  _restrictionsEnabled = false;

  // Trigger the event
  emit RestrictionsDisabled(msg.sender);
}

isAdministrator keyboard_arrow_up

Parameters help

Name Type
addressToTest
address help

Properties

Visibility help public
Mutability help view
Source Code
function isAdministrator(address addressToTest) public view returns (bool) {
  return administrators[addressToTest];
}

addAdmin keyboard_arrow_up

Parameters help

Name Type
adminToAdd
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function addAdmin(address adminToAdd) public onlyOwner {
  // Verify the account is not already an admin
  require(
    administrators[adminToAdd] == false,
    "Account to be added to admin list is already an admin"
  );

  // Set the address mapping to true to indicate it is an administrator account.
  administrators[adminToAdd] = true;

  // Emit the event for any watchers.
  emit AdminAdded(adminToAdd, msg.sender);
}

removeAdmin keyboard_arrow_up

Parameters help

Name Type
adminToRemove
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function removeAdmin(address adminToRemove) public onlyOwner {
  // Verify the account is an admin
  require(
    administrators[adminToRemove] == true,
    "Account to be removed from admin list is not already an admin"
  );

  // Set the address mapping to false to indicate it is NOT an administrator account.
  administrators[adminToRemove] = false;

  // Emit the event for any watchers.
  emit AdminRemoved(adminToRemove, msg.sender);
}

addToWhitelist keyboard_arrow_up

Parameters help

Name Type
addressToAdd
address help
whitelist
uint8 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdministrator checks for the following:
null
Source Code
function addToWhitelist(address addressToAdd, uint8 whitelist)
  public
  onlyAdministrator
{
  // Verify the whitelist is valid
  require(whitelist != NO_WHITELIST, "Invalid whitelist ID supplied");

  // Save off the previous white list
  uint8 previousWhitelist = addressWhitelists[addressToAdd];

  // Set the address's white list ID
  addressWhitelists[addressToAdd] = whitelist;

  // If the previous whitelist existed then we want to indicate it has been removed
  if (previousWhitelist != NO_WHITELIST) {
    // Emit the event for tracking
    emit AddressRemovedFromWhitelist(
      addressToAdd,
      previousWhitelist,
      msg.sender
    );
  }

  // Emit the event for new whitelist
  emit AddressAddedToWhitelist(addressToAdd, whitelist, msg.sender);
}

removeFromWhitelist keyboard_arrow_up

Parameters help

Name Type
addressToRemove
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdministrator checks for the following:
null
Source Code
function removeFromWhitelist(address addressToRemove) public onlyAdministrator {
  // Save off the previous white list
  uint8 previousWhitelist = addressWhitelists[addressToRemove];

  // Zero out the previous white list
  addressWhitelists[addressToRemove] = NO_WHITELIST;

  // Emit the event for tracking
  emit AddressRemovedFromWhitelist(
    addressToRemove,
    previousWhitelist,
    msg.sender
  );
}

updateOutboundWhitelistEnabled keyboard_arrow_up

Parameters help

Name Type
sourceWhitelist
uint8 help
destinationWhitelist
uint8 help
newEnabledValue
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdministrator checks for the following:
null
Source Code
function updateOutboundWhitelistEnabled(
  uint8 sourceWhitelist,
  uint8 destinationWhitelist,
  bool newEnabledValue
) public onlyAdministrator {
  // Get the old enabled flag
  bool oldEnabledValue = outboundWhitelistsEnabled[sourceWhitelist][
    destinationWhitelist
  ];

  // Update to the new value
  outboundWhitelistsEnabled[sourceWhitelist][
    destinationWhitelist
  ] = newEnabledValue;

  // Emit event for tracking
  emit OutboundWhitelistUpdated(
    msg.sender,
    sourceWhitelist,
    destinationWhitelist,
    oldEnabledValue,
    newEnabledValue
  );
}

checkWhitelistAllowed keyboard_arrow_up

Parameters help

Name Type
sender
address help
receiver
address help

Properties

Visibility help public
Mutability help view
Source Code
function checkWhitelistAllowed(address sender, address receiver)
  public
  view
  returns (bool)
{
  // First get each address white list
  uint8 senderWhiteList = addressWhitelists[sender];
  uint8 receiverWhiteList = addressWhitelists[receiver];

  // If either address is not on a white list then the check should fail
  if (senderWhiteList == NO_WHITELIST || receiverWhiteList == NO_WHITELIST) {
    return false;
  }

  // Determine if the sending whitelist is allowed to send to the destination whitelist
  return outboundWhitelistsEnabled[senderWhiteList][receiverWhiteList];
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() public view returns (string memory) {
  return _name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string memory) {
  return _symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  return _decimals;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view returns (uint256) {
  return _totalSupply;
}

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address owner) public view returns (uint256) {
  return _balances[owner];
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  public
  view
  returns (uint256)
{
  return _allowed[owner][spender];
}

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address to, uint256 value)
  public
  notRestricted(msg.sender, to, value)
  returns (bool success)
{
  success = super.transfer(to, value);
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 value) public returns (bool) {
  require(spender != address(0));

  _allowed[msg.sender][spender] = value;
  emit Approval(msg.sender, spender, value);
  return true;
}

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public notRestricted(from, to, value) returns (bool success) {
  success = super.transferFrom(from, to, value);
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseAllowance(address spender, uint256 addedValue)
  public
  returns (bool)
{
  require(spender != address(0));

  _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
  emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  public
  returns (bool)
{
  require(spender != address(0));

  _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(
    subtractedValue
  );
  emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
  return true;
}

detectTransferRestriction keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function detectTransferRestriction(
  address from,
  address to,
  uint256
) public view returns (uint8) {
  // If the restrictions have been disabled by the owner, then just return success
  // Logic defined in Restrictable parent class
  if (!isRestrictionEnabled()) {
    return SUCCESS_CODE;
  }

  // If the contract owner is transferring, then ignore reistrictions
  if (from == owner()) {
    return SUCCESS_CODE;
  }

  // Restrictions are enabled, so verify the whitelist config allows the transfer.
  // Logic defined in Whitelistable parent class
  if (!checkWhitelistAllowed(from, to)) {
    return FAILURE_NON_WHITELIST;
  }

  // If no restrictions were triggered return success
  return SUCCESS_CODE;
}

messageForTransferRestriction keyboard_arrow_up

Parameters help

Name Type
restrictionCode
uint8 help

Properties

Visibility help public
Mutability help view
Source Code
function messageForTransferRestriction(uint8 restrictionCode)
  public
  view
  returns (string memory)
{
  if (restrictionCode == SUCCESS_CODE) {
    return SUCCESS_MESSAGE;
  }

  if (restrictionCode == FAILURE_NON_WHITELIST) {
    return FAILURE_NON_WHITELIST_MESSAGE;
  }

  // An unknown error code was passed in.
  return UNKNOWN_ERROR;
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) internal {
  require(to != address(0));

  _balances[from] = _balances[from].sub(value);
  _balances[to] = _balances[to].add(value);
  emit Transfer(from, to, value);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 value) internal {
  require(account != address(0));

  _totalSupply = _totalSupply.add(value);
  _balances[account] = _balances[account].add(value);
  emit Transfer(address(0), account, value);
}

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 value) internal {
  require(account != address(0));

  _totalSupply = _totalSupply.sub(value);
  _balances[account] = _balances[account].sub(value);
  emit Transfer(account, address(0), value);
}

internal ERC20._burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burnFrom(address account, uint256 value) internal {
  _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
  _burn(account, value);
  emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _owner = msg.sender;
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable._transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transferOwnership(address newOwner) internal {
  require(newOwner != address(0));
  emit OwnershipTransferred(_owner, newOwner);
  _owner = newOwner;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _owner = msg.sender;
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable._transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transferOwnership(address newOwner) internal {
  require(newOwner != address(0));
  emit OwnershipTransferred(_owner, newOwner);
  _owner = newOwner;
}