ERC20
This contract is an ERC20 token.
Name
Leverj
Symbol
LEV
Decimals
9
Total Supply
1,000,000,000 LEV
About
Stats
Public Functions
8
Event Types
2
Code Size
11,463 bytes
State Variables (9) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
validTransfer checks for the following:
One or more of the following:
-transfersAllowed must be true - OR
sale
must be equal to
the sender's address
Requirements help
Source Code
function transfer(address _to, uint256 _value)
public
validTransfer
returns (bool success)
{
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
//require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]);
require(balances[msg.sender] >= _value);
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
transferFrom keyboard_arrow_up
Modifiers help
validTransfer checks for the following:
One or more of the following:
-transfersAllowed must be true - OR
sale
must be equal to
the sender's address
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) public validTransfer returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
//require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value);
balances[_to] = SafeMath.add(balances[_to], _value);
balances[_from] = SafeMath.sub(balances[_from], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
Transfer(_from, _to, _value);
return true;
}
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address _spender, uint256 _value)
public
returns (bool success)
{
require(balances[msg.sender] >= _value);
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
allowance keyboard_arrow_up
approveAndCall keyboard_arrow_up
Source Code
function approveAndCall(
address _spender,
uint256 _value,
bytes _extraData
) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
require(
_spender.call(
bytes4(
bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))
),
msg.sender,
_value,
this,
_extraData
)
);
return true;
}
reversePurchase keyboard_arrow_up
Modifiers help
onlySale checks for the following:
Requirements help
Source Code
function reversePurchase(address _tokenHolder) public onlySale {
require(!transfersAllowed);
uint256 value = balances[_tokenHolder];
balances[_tokenHolder] = SafeMath.sub(balances[_tokenHolder], value);
balances[sale] = SafeMath.add(balances[sale], value);
Transfer(_tokenHolder, sale, value);
}
removeTransferLock keyboard_arrow_up
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.