Blockwell

Bonding Token

ERC20

This contract is an ERC20 token.

Name Bonding Token
Symbol BONT
Decimals 18
Total Supply 100,000 BONT

About

Stats

Public Functions 19
Event Types 5
Code Size 43,172 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

ContinuousBurn Event

Parameters help
burner
address help
amount
uint256 help
reimbursement
uint256 help

ContinuousMint Event

Parameters help
minter
address help
amount
uint256 help
deposit
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Functions Expand All Collapse All

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

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

allowance keyboard_arrow_up

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

transfer keyboard_arrow_up

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

approve keyboard_arrow_up

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

transferFrom keyboard_arrow_up

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)
  {
    require(value <= _allowed[from][msg.sender]);

    _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
    _transfer(from, to, value);
    return true;
  }

increaseAllowance keyboard_arrow_up

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

decreaseAllowance keyboard_arrow_up

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

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

calculatePurchaseReturn keyboard_arrow_up

Parameters help

Name Type
_supply
uint256 help
_reserveBalance
uint256 help
_reserveRatio
uint32 help
_depositAmount
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
    function calculatePurchaseReturn(
        uint256 _supply,
        uint256 _reserveBalance,
        uint32 _reserveRatio,
        uint256 _depositAmount) public constant returns (uint256)
    {
        // validate input
        require(_supply > 0 && _reserveBalance > 0 && _reserveRatio > 0 && _reserveRatio <= MAX_RESERVE_RATIO);
        // special case for 0 deposit amount
        if (_depositAmount == 0) {
            return 0;
        }
        // special case if the ratio = 100%
        if (_reserveRatio == MAX_RESERVE_RATIO) {
            return _supply.mul(_depositAmount).div(_reserveBalance);
        }
        uint256 result;
        uint8 precision;
        uint256 baseN = _depositAmount.add(_reserveBalance);
        (result, precision) = power(
            baseN, _reserveBalance, _reserveRatio, MAX_RESERVE_RATIO
        );
        uint256 newTokenSupply = _supply.mul(result) >> precision;
        return newTokenSupply - _supply;
    }

calculateSaleReturn keyboard_arrow_up

Parameters help

Name Type
_supply
uint256 help
_reserveBalance
uint256 help
_reserveRatio
uint32 help
_sellAmount
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
    function calculateSaleReturn(
        uint256 _supply,
        uint256 _reserveBalance,
        uint32 _reserveRatio,
        uint256 _sellAmount) public constant returns (uint256)
    {
        // validate input
        require(_supply > 0 && _reserveBalance > 0 && _reserveRatio > 0 && _reserveRatio <= MAX_RESERVE_RATIO && _sellAmount <= _supply);
        // special case for 0 sell amount
        if (_sellAmount == 0) {
            return 0;
        }
        // special case for selling the entire supply
        if (_sellAmount == _supply) {
            return _reserveBalance;
        }
        // special case if the ratio = 100%
        if (_reserveRatio == MAX_RESERVE_RATIO) {
            return _reserveBalance.mul(_sellAmount).div(_supply);
        }
        uint256 result;
        uint8 precision;
        uint256 baseD = _supply - _sellAmount;
        (result, precision) = power(
            _supply, baseD, MAX_RESERVE_RATIO, _reserveRatio
        );
        uint256 oldBalance = _reserveBalance.mul(result);
        uint256 newBalance = _reserveBalance << precision;
        return oldBalance.sub(newBalance).div(result);
    }

mint keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function mint() public payable {
        _continuousMint(msg.value);
    }

burn keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function burn(uint256 _amount) public {
        uint256 returnAmount = _continuousBurn(_amount);
        msg.sender.transfer(returnAmount);
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function () public payable { mint(); }

calculateContinuousMintReturn keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function calculateContinuousMintReturn(uint256 _amount)
    public view returns (uint256 mintAmount)
    {
        return calculatePurchaseReturn(totalSupply(), reserveBalance, uint32(reserveRatio), _amount);
    }

calculateContinuousBurnReturn keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function calculateContinuousBurnReturn(uint256 _amount)
    public view returns (uint256 burnAmount)
    {
        return calculateSaleReturn(totalSupply(), reserveBalance, uint32(reserveRatio), _amount);
    }