Blockwell

Doctors Coin

ERC20

This contract is an ERC20 token.

Name Doctors Coin
Symbol DRS
Decimals 18
Total Supply 10,000,000,000 DRS

About link description

Doctors Coin (DRS) is a cryptocurrency and operates on the Ethereum platform. Doctors Coin has a current supply of 10,000,000,000 with 229,741,603 in circulation. The last known price of Doctors Coin is 0.72067492 USD and is down -1.63 over the last 24 hours. It is currently trading on 14 active market(s) with $4,886,424.90 traded over the last 24 hours. More information can be found at https://drscoin.net/.

Stats

Public Functions 15
Event Types 7
Code Size 12,688 bytes

Events (7) keyboard_arrow_up

AirDrop Event

Parameters help
_receiver
address help
_amount
uint256 help

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Burn Event

Parameters help
from
address help
value
uint256 help

Mint Event

Parameters help
from
address help
value
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

TransferDisabled Event

Parameters help
bool help

TransferEnabled Event

Parameters help
bool help

owner Variable

address help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

TransferAllowed Variable

bool help

airDropHistory Variable

mapping(address => uint256) help

balanceOf Variable

mapping(address => uint256) help

LockList Variable

mapping(address => bool) help

LockedTokens Variable

mapping(address => uint256) help

_allowance Variable

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

Functions Expand All Collapse All

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address _to, uint256 _value) public returns (bool) {
  _transfer(msg.sender, _to, _value);
  return true;
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public returns (bool) {
  require(LockList[msg.sender] == false, "ERC20: User Locked !");

  uint256 stage;
  stage = balanceOf[msg.sender].sub(
    _value,
    "ERC20: transfer amount exceeds balance"
  );
  require(
    stage >= LockedTokens[msg.sender],
    "ERC20: transfer amount exceeds Senders Locked Amount"
  );

  balanceOf[msg.sender] = balanceOf[msg.sender].sub(
    _value,
    "ERC20: Burn amount exceeds balance."
  );
  totalSupply = totalSupply.sub(
    _value,
    "ERC20: Burn amount exceeds total supply"
  );

  emit Burn(msg.sender, _value);
  emit Transfer(msg.sender, address(0), _value);

  return true;
}

burnFrom keyboard_arrow_up

Parameters help

Name Type
Account
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function burnFrom(address Account, uint256 _value)
  public
  returns (bool success)
{
  require(LockList[msg.sender] == false, "ERC20: User Locked !");
  require(LockList[Account] == false, "ERC20: Owner Locked !");
  uint256 stage;
  require(Account != address(0), "ERC20: Burn from the zero address");

  _approve(
    Account,
    msg.sender,
    _allowance[Account][msg.sender].sub(
      _value,
      "ERC20: burn amount exceeds allowance"
    )
  );

  //Do not allow burn if Accounts tokens are locked.
  stage = balanceOf[Account].sub(
    _value,
    "ERC20: Transfer amount exceeds allowance"
  );
  require(
    stage >= LockedTokens[Account],
    "ERC20: Burn amount exceeds accounts locked amount"
  );
  balanceOf[Account] = stage; // Subtract from the sender

  //Deduct burn amount from totalSupply
  totalSupply = totalSupply.sub(
    _value,
    "ERC20: Burn Amount exceeds totalSupply"
  );

  emit Burn(Account, _value);
  emit Transfer(Account, address(0), _value);

  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public returns (bool success) {
  _transfer(_from, _to, _value);
  _approve(
    _from,
    msg.sender,
    _allowance[_from][msg.sender].sub(
      _value,
      "ERC20: transfer amount exceeds allowance"
    )
  );

  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value)
  public
  returns (bool success)
{
  uint256 unapprovbal;

  // Do not allow approval if amount exceeds locked amount
  unapprovbal = balanceOf[msg.sender].sub(
    _value,
    "ERC20: Allowance exceeds balance of approver"
  );
  require(
    unapprovbal >= LockedTokens[msg.sender],
    "ERC20: Approval amount exceeds locked amount "
  );

  _allowance[msg.sender][_spender] = _value;
  emit Approval(msg.sender, _spender, _value);
  return true;
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveAndCall(
  address _spender,
  uint256 _value,
  bytes memory _extraData
) public returns (bool success) {
  tokenRecipient spender = tokenRecipient(_spender);
  if (approve(_spender, _value)) {
    spender.receiveApproval(msg.sender, _value, address(this), _extraData);
    return true;
  }
}

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 _allowance[_owner][_spender];
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  require(newOwner != address(0), "ERC20 New Owner cannot be zero address");
  owner = newOwner;
}

UserLock keyboard_arrow_up

Parameters help

Name Type
Account
address help
mode
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function UserLock(address Account, bool mode) public onlyOwner {
  LockList[Account] = mode;
}

LockTokens keyboard_arrow_up

Parameters help

Name Type
Account
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function LockTokens(address Account, uint256 amount) public onlyOwner {
  LockedTokens[Account] = amount;
}

UnLockTokens keyboard_arrow_up

Parameters help

Name Type
Account
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function UnLockTokens(address Account) public onlyOwner {
  LockedTokens[Account] = 0;
}

mint keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(uint256 _value) public onlyOwner returns (bool success) {
  require(balanceOf[msg.sender] >= _value);
  require(balanceOf[msg.sender] != 0x0); // Check if the sender has enough
  balanceOf[msg.sender] = balanceOf[msg.sender].add(
    _value,
    "ERC20: Addition overflow"
  ); // Subtract from the sender
  totalSupply = totalSupply.add(_value, "ERC20: totalSupply increased ");
  emit Mint(msg.sender, _value);
  return true;
}

dropToken keyboard_arrow_up

Parameters help

Name Type
receivers
address[] help
values
uint256[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function dropToken(address[] memory receivers, uint256[] memory values)
  public
  onlyOwner
{
  require(receivers.length != 0);
  require(receivers.length == values.length);

  for (uint256 i = 0; i < receivers.length; i++) {
    address receiver = receivers[i];
    uint256 amount = values[i];

    transfer(receiver, amount);
    airDropHistory[receiver] += amount;

    emit AirDrop(receiver, amount);
  }
}

enableTokenTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function enableTokenTransfer() public onlyOwner {
  TransferAllowed = true;
  emit TransferEnabled(true);
}

disableTokenTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function disableTokenTransfer() public onlyOwner {
  TransferAllowed = false;
  emit TransferDisabled(true);
}

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 TOKENERC20._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 {
  uint256 stage;

  require(_from != address(0), "ERC20: transfer from the zero address");
  require(_to != address(0), "ERC20: transfer to the zero address"); // Prevent transfer to 0x0 address. Use burn() instead

  require(LockList[msg.sender] == false, "ERC20: Caller Locked !"); // Check if msg.sender is locked or not
  require(LockList[_from] == false, "ERC20: Sender Locked !");
  require(LockList[_to] == false, "ERC20: Receipient Locked !");
  require(TransferAllowed == true, "ERC20: Transfer enabled false !");

  // Check if sender balance is locked
  stage = balanceOf[_from].sub(
    _value,
    "ERC20: transfer amount exceeds balance"
  );
  require(
    stage >= LockedTokens[_from],
    "ERC20: transfer amount exceeds Senders Locked Amount"
  );

  //Deduct and add balance
  balanceOf[_from] = stage;
  balanceOf[_to] = balanceOf[_to].add(_value, "ERC20: Addition overflow");

  //emit Transfer event
  emit Transfer(_from, _to, _value);
}

internal TOKENERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
_spender
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address _spender,
  uint256 amount
) internal {
  require(owner != address(0), "ERC20: approve from the zero address");
  require(_spender != address(0), "ERC20: approve to the zero address");

  _allowance[owner][_spender] = amount;
  emit Approval(owner, _spender, amount);
}