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
Constants (1) keyboard_arrow_up
State Variables (10) keyboard_arrow_up
Functions
transfer keyboard_arrow_up
Modifiers help
isRunning checks for the following:
validAddress checks for the following:
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;
}
transferFrom keyboard_arrow_up
Modifiers help
isRunning checks for the following:
validAddress checks for the following:
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;
}
approve keyboard_arrow_up
Modifiers help
isRunning checks for the following:
validAddress checks for the following:
Requirements help
One or more of the following:
-
allowance for the sender's address for _spender
must be equal to
0
- OR
_value
must be equal to
0
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
start keyboard_arrow_up
burn keyboard_arrow_up
Modifiers help
isRunning checks for the following:
validAddress checks for the following:
Requirements 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.
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
Modifiers help
ownerOnly checks for the following:
Source Code
function setDeadline(uint256 _deadline) public ownerOnly {
deadline = _deadline;
}
withdraw keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
ownerOnly checks for the following:
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
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.