Blockwell

DREP

ERC20

This contract is an ERC20 token.

Name DREP
Symbol DREP
Decimals 18
Total Supply 100,000,000 DREP

About link

Drep [new] (DREP) is a cryptocurrency and operates on the Ethereum platform. Drep [new] has a current supply of 100,000,000 with 39,900,000 in circulation. The last known price of Drep [new] is 0.45708745 USD and is down -16.13 over the last 24 hours. It is currently trading on 8 active market(s) with $4,779,527.62 traded over the last 24 hours. More information can be found at https://www.drep.org/.

Stats

Public Functions 9
Event Types 4
Code Size 4,150 bytes

Events (4) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Upgrade Event

Parameters help
_from
address help
_value
uint256 help

Withdraw Event

Parameters help
_to
address help
_value
uint256 help

initialSupply Constant

uint256 help
100000000

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

stopped Variable

bool help

deadline Variable

uint256 help

balanceOf Variable

mapping(address => uint256) help

allowance Variable

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

owner Variable

address help
Internal Variable

oldDrepAddr Variable

address 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

Modifiers help

Requirements help

Source Code
function transfer(address _to, uint256 _value)
  public
  isRunning
  validAddress
  returns (bool success)
{
  require(_to != address(0));
  require(balanceOf[msg.sender] >= _value);
  require(balanceOf[_to] + _value >= balanceOf[_to]);
  balanceOf[msg.sender] -= _value;
  balanceOf[_to] += _value;
  emit Transfer(msg.sender, _to, _value);
  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public isRunning validAddress returns (bool success) {
  require(_to != address(0));
  require(balanceOf[_from] >= _value);
  require(balanceOf[_to] + _value >= balanceOf[_to]);
  require(allowance[_from][msg.sender] >= _value);
  allowance[_from][msg.sender] -= _value;
  balanceOf[_from] -= _value;
  balanceOf[_to] += _value;
  emit Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address _spender, uint256 _value)
  public
  isRunning
  validAddress
  returns (bool success)
{
  require(_value == 0 || allowance[msg.sender][_spender] == 0);
  allowance[msg.sender][_spender] = _value;
  emit Approval(msg.sender, _spender, _value);
  return true;
}

stop keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function stop() public ownerOnly {
  stopped = true;
}

start keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function start() public ownerOnly {
  stopped = false;
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function burn(uint256 _value) public isRunning validAddress {
  require(balanceOf[msg.sender] >= _value);
  require(totalSupply >= _value);
  balanceOf[msg.sender] -= _value;
  totalSupply -= _value;
}

upgrade keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function upgrade() public {
  require(block.number <= deadline, "upgrade finished");
  uint256 balance = IERC20(oldDrepAddr).balanceOf(msg.sender);
  if (balance > 0) {
    IERC20(oldDrepAddr).transferFrom(msg.sender, address(this), balance);
    IERC20(oldDrepAddr).burn(balance);
    uint256 value = balance / 100;
    IERC20(address(this)).transfer(msg.sender, value);
    emit Upgrade(msg.sender, value);
  }
}

setDeadline keyboard_arrow_up

Parameters help

Name Type
_deadline
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setDeadline(uint256 _deadline) public ownerOnly {
  deadline = _deadline;
}

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function withdraw() public ownerOnly {
  require(block.number > deadline, "time too early");
  uint256 balance = balanceOf[address(this)];
  IERC20(address(this)).transfer(owner, balance);
  emit Withdraw(owner, balance);
}

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.