Blockwell

dego.finance

ERC20

This contract is an ERC20 token.

Name dego.finance
Symbol DEGO
Decimals 18
Total Supply 9,847,095 DEGO

About link

Dego Finance (DEGO) is a cryptocurrency and operates on the Ethereum platform. Dego Finance has a current supply of 8,607,383. The last known price of Dego Finance is 6.29185665 USD and is down -14.25 over the last 24 hours. It is currently trading on 25 active market(s) with $33,701,629.06 traded over the last 24 hours. More information can be found at https://dego.finance/.

Stats

Public Functions 17
Event Types 6
Code Size 19,837 bytes

Library Use

Uses SafeMath for uint256.

Events (6) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

GovernanceTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Mint Event

Parameters help
from
address help
to
address help
value
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

eveRewardPool Event

Parameters help
rewardPool
address help

eveSetRate Event

Parameters help
burn_rate
uint256 help
reward_rate
uint256 help

_maxGovernValueRate Constant

uint256 help
2000

_minGovernValueRate Constant

uint256 help
10

_rateBase Constant

uint256 help
10000

_maxSupply Variable

uint256 help

_openTransfer Variable

bool help

_burnRate Variable

uint256 help

_rewardRate Variable

uint256 help

_totalBurnToken Variable

uint256 help

_totalRewardToken Variable

uint256 help

_rewardPool Variable

address help

_burnPool Variable

address help

governance Variable

address help

_minters Variable

mapping(address => bool) help

_balances Variable

mapping(address => uint256) help

_totalSupply Variable

uint256 help
Internal Variable

_allowances Variable

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

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 help
Internal Variable

Functions Expand All Collapse All

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;
}

setGovernance keyboard_arrow_up

Parameters help

Name Type
_governance
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setGovernance(address _governance) public onlyGovernance {
  require(_governance != address(0), "new governance the zero address");
  emit GovernanceTransferred(governance, _governance);
  governance = _governance;
}

enableOpenTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function enableOpenTransfer() public onlyGovernance {
  _openTransfer = true;
}

Parameters help

Name Type
spender
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 amount) external returns (bool) {
  require(msg.sender != address(0), "ERC20: approve from the zero address");
  require(spender != address(0), "ERC20: approve to the zero address");

  _allowances[msg.sender][spender] = amount;
  emit Approval(msg.sender, spender, amount);

  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)
  external
  view
  returns (uint256)
{
  return _allowances[owner][spender];
}

Parameters help

Name Type
owner
address help

Properties

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

Parameters help

This function has no parameters.

Properties

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

mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(address account, uint256 amount) external {
  require(account != address(0), "ERC20: mint to the zero address");
  require(_minters[msg.sender], "!minter");

  uint256 curMintSupply = _totalSupply.add(_totalBurnToken);
  uint256 newMintSupply = curMintSupply.add(amount);
  require(newMintSupply <= _maxSupply, "supply is max!");

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);

  emit Mint(address(0), account, amount);
  emit Transfer(address(0), account, amount);
}

addMinter keyboard_arrow_up

Parameters help

Name Type
_minter
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function addMinter(address _minter) public onlyGovernance {
  _minters[_minter] = true;
}

removeMinter keyboard_arrow_up

Parameters help

Name Type
_minter
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function removeMinter(address _minter) public onlyGovernance {
  _minters[_minter] = false;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() external payable {
  revert();
}

setRate keyboard_arrow_up

Parameters help

Name Type
burn_rate
uint256 help
reward_rate
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setRate(uint256 burn_rate, uint256 reward_rate) public onlyGovernance {
  require(
    _maxGovernValueRate >= burn_rate && burn_rate >= _minGovernValueRate,
    "invalid burn rate"
  );
  require(
    _maxGovernValueRate >= reward_rate && reward_rate >= _minGovernValueRate,
    "invalid reward rate"
  );

  _burnRate = burn_rate;
  _rewardRate = reward_rate;

  emit eveSetRate(burn_rate, reward_rate);
}

setRewardPool keyboard_arrow_up

Parameters help

Name Type
rewardPool
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setRewardPool(address rewardPool) public onlyGovernance {
  require(rewardPool != address(0x0));

  _rewardPool = rewardPool;

  emit eveRewardPool(_rewardPool);
}

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) external returns (bool) {
  return _transfer(msg.sender, to, value);
}

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
) external returns (bool) {
  uint256 allow = _allowances[from][msg.sender];
  _allowances[from][msg.sender] = allow.sub(value);

  return _transfer(from, to, value);
}

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 DegoToken._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) internal returns (bool) {
  // :)
  require(_openTransfer || from == governance, "transfer closed");

  require(from != address(0), "ERC20: transfer from the zero address");
  require(to != address(0), "ERC20: transfer to the zero address");

  uint256 sendAmount = value;
  uint256 burnFee = (value.mul(_burnRate)).div(_rateBase);
  if (burnFee > 0) {
    //to burn
    _balances[_burnPool] = _balances[_burnPool].add(burnFee);
    _totalSupply = _totalSupply.sub(burnFee);
    sendAmount = sendAmount.sub(burnFee);

    _totalBurnToken = _totalBurnToken.add(burnFee);

    emit Transfer(from, _burnPool, burnFee);
  }

  uint256 rewardFee = (value.mul(_rewardRate)).div(_rateBase);
  if (rewardFee > 0) {
    //to reward
    _balances[_rewardPool] = _balances[_rewardPool].add(rewardFee);
    sendAmount = sendAmount.sub(rewardFee);

    _totalRewardToken = _totalRewardToken.add(rewardFee);

    emit Transfer(from, _rewardPool, rewardFee);
  }

  _balances[from] = _balances[from].sub(value);
  _balances[to] = _balances[to].add(sendAmount);

  emit Transfer(from, to, sendAmount);

  return true;
}