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.
Events (5) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
approve keyboard_arrow_up
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
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
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
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
isOwner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
calculatePurchaseReturn keyboard_arrow_up
Parameters help
Requirements help
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
Requirements help
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
burn keyboard_arrow_up
constructor keyboard_arrow_up
calculateContinuousMintReturn keyboard_arrow_up
Requirements help
UNKNOWN VALUE
must be greater than
0
Source Code
function calculateContinuousMintReturn(uint256 _amount)
public view returns (uint256 mintAmount)
{
return calculatePurchaseReturn(totalSupply(), reserveBalance, uint32(reserveRatio), _amount);
}
calculateContinuousBurnReturn keyboard_arrow_up
Requirements help
UNKNOWN VALUE
must be greater than
0
Source Code
function calculateContinuousBurnReturn(uint256 _amount)
public view returns (uint256 burnAmount)
{
return calculateSaleReturn(totalSupply(), reserveBalance, uint32(reserveRatio), _amount);
}