source_idx
stringlengths
1
5
contract_name
stringlengths
1
48
func_name
stringlengths
0
52
masked_contract
stringlengths
105
184k
func_body
stringlengths
0
324k
func_requirement
stringlengths
1
28.3k
136
VNETToken
mintWithLock
contract VNETToken is Ownable, AbstractToken { event Donate(address indexed _from, uint256 _amount); /** * @dev Constructor */ constructor() public { name = "VNET Token"; symbol = "VNET"; decimals = 6; value = "1 Token = 100 GByte client newtwork traffi...
require(mintAgents[msg.sender] && totalSupply_.add(_amount) <= cap); require(_amount >= _lockedAmount); totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); lockedBalanceMap[_to] = lockedBalanceMap[_to] > 0 ? lockedBalanceMap[_to].add(_loc...
* * @dev Function to mint tokens, and lock some of them with a release time * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @param _lockedAmount The amount of tokens to be locked. * @param _releaseTime The timestamp about to re...
141
Ownable
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() {<FILL_FUNCTION_BODY>} /** * @dev Throws if called by any account other than the owner. */ m...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
141
Ownable
transferOwnership
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. ...
require(newOwner != address(0)); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
141
ApusToken
batchTransfer
contract ApusToken is ERC20,StakeStandard,Ownable { using SafeMath for uint256; string public name = "Apus Token"; string public symbol = "APUS"; uint public decimals = 18; uint public chainStartTime; uint public chainStartBlockNumber; uint public stakeStartTime; uint public ...
require( _recipients.length > 0 && _recipients.length == _values.length); uint total = 0; for(uint i = 0; i < _values.length; i++){ total = total.add(_values[i]); } require(total <= balances[msg.sender]); uint64 _now = uint64(now); for(uin...
Batch token transfer. Used by contract creator to distribute initial tokens to holders
142
BasicToken
totalSupply
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) {<FILL_FUNCTION_BODY>} /** * @dev Transf...
return totalSupply_;
* * @dev Total number of tokens in existence
142
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** ...
require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true;
* * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
142
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** ...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
142
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_v...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
142
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to...
// avoid race condition require((_value == 0) || (allowed[msg.sender][_spender] == 0), "reset allowance to 0 before change it's value."); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this ...
142
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender.
142
WORLDToken_StandardToken
null
contract WORLDToken_StandardToken is StandardToken { // region{fields} string public name; string public symbol; uint8 public decimals; uint256 public claimAmount; // region{Constructor} // note : [(final)totalSupply] >> claimAmount *...
name = _token_name; symbol = _symbol; claimAmount = _claim_amount; decimals = _decimals; totalSupply_ = claimAmount.mul(10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; ...
region{Constructor} note : [(final)totalSupply] >> claimAmount * 10 ** decimals example : args << "The WORLD Token No.X", "WORLDX", "10000000000", "18"
142
WORLDToken_StandardToken_U
null
contract WORLDToken_StandardToken_U is StandardToken { // region{fields} string public name; string public symbol; uint8 public decimals; uint256 public claimAmount; // region{Constructor} // note : [(final)totalSupply] >> claimAmount...
name = _token_name; symbol = _symbol; claimAmount = _claim_amount; decimals = _decimals; totalSupply_ = claimAmount.mul(10 ** uint256(decimals)); balances[_initial_account] = totalSupply_; ...
region{Constructor} note : [(final)totalSupply] >> claimAmount * 10 ** decimals example : args << "The WORLD Token No.X", "WORLDX", "10000000000", "18"
146
ICOBuyer
set_addresses
contract ICOBuyer { // Emergency kill switch in case a critical bug is found. address public developer = 0xF23B127Ff5a6a8b60CC4cbF937e5683315894DDA; // The crowdsale address. Settable by the developer. address public sale; // The token address. Settable by the developer. ERC20 public token; ...
// Only allow the developer to set the sale and token addresses. require(msg.sender == developer); // Only allow setting the addresses once. // Set the crowdsale and token addresses. sale = _sale; token = ERC20(_token);
Allows the developer to set the crowdsale and token addresses.
146
ICOBuyer
withdraw
contract ICOBuyer { // Emergency kill switch in case a critical bug is found. address public developer = 0xF23B127Ff5a6a8b60CC4cbF937e5683315894DDA; // The crowdsale address. Settable by the developer. address public sale; // The token address. Settable by the developer. ERC20 public token; ...
developer.transfer(this.balance); require(token.transfer(developer, token.balanceOf(address(this))));
Withdraws all ETH deposited or tokens purchased by the given user and rewards the caller.
146
ICOBuyer
buy
contract ICOBuyer { // Emergency kill switch in case a critical bug is found. address public developer = 0xF23B127Ff5a6a8b60CC4cbF937e5683315894DDA; // The crowdsale address. Settable by the developer. address public sale; // The token address. Settable by the developer. ERC20 public token; ...
require(sale != 0x0); require(sale.call.value(this.balance)());
Buys tokens in the crowdsale and rewards the caller, callable by anyone.
146
ICOBuyer
contract ICOBuyer { // Emergency kill switch in case a critical bug is found. address public developer = 0xF23B127Ff5a6a8b60CC4cbF937e5683315894DDA; // The crowdsale address. Settable by the developer. address public sale; // The token address. Settable by the developer. ERC20 public token; ...
Default function. Called when a user sends ETH to the contract.
147
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
147
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
147
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_fr...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
147
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi...
147
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender.
147
StandardToken
increaseApproval
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol
147
Ownable
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public {<FILL_FUNCTION_BODY>} /...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
147
Ownable
transferOwnership
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
149
Context
_msgSender
contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) {<FILL_FUNCTION_BODY>} }
return msg.sender;
solhint-disable-previous-line no-empty-blocks
150
owned
changeOwner
contract owned { address public owner; //*** OwnershipTransferred ***// event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function owned() public { owner = msg.sender; } //*** Change Owner ***// function changeOwner(address newOwner) onlyOwner publi...
owner = newOwner;
*** Change Owner ***//
150
owned
transferOwnership
contract owned { address public owner; //*** OwnershipTransferred ***// event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function owned() public { owner = msg.sender; } //*** Change Owner ***// function changeOwner(address newOwner) onlyOwner publi...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
*** Transfer OwnerShip ***//
150
GraphenePowerToken
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
require(msg.value>0); require(msg.sender != 0x0); uint256 weiAmount; uint256 tokens; wallet=owner; if(isPreSale()){ wallet=preSaleAddress; weiAmount=6000; } else if(isIco()){ wallet=icoAdd...
*** Payable ***//
150
GraphenePowerToken
transfer
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
if(transfersEnabled){ require(balanceOf[_to] >= _value); // Subtract from the sender balanceOf[msg.sender] = (balanceOf[msg.sender] -_value); balanceOf[_to] =(balanceOf[_to] + _value); Transfer(msg.sender, _to, _value); return true; } else{ retur...
Send coins
150
GraphenePowerToken
transferFrom
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
if(transfersEnabled){ // Check if the sender has enough require(balanceOf[_from] >= _value); // Check allowed require(_value <= allowed[_from][msg.sender]); // Subtract from the sender balanceOf[_from] = (balanceOf[_from] - _value); // Add the same to the rec...
*** Transfer From ***//
150
GraphenePowerToken
transferOwner
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
// Subtract from the sender totalSupply=(totalSupply-_value); // Add the same to the recipient balanceOf[_to] = (balanceOf[_to] + _value); Transfer(this, _to, _value);
*** Transfer OnlyOwner ***//
150
GraphenePowerToken
allowance
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
return allowed[_owner][_spender];
*** Allowance ***//
150
GraphenePowerToken
approve
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
*** Approve ***//
150
GraphenePowerToken
burnOwner
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
destroyOwner(msg.sender, _value); Burn(msg.sender, _value); return true;
*** Burn Owner***//
150
GraphenePowerToken
destroyOwner
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
balanceOf[_from] =(balanceOf[_from] - _amount); totalSupply = (totalSupply - _amount); Transfer(_from, this, _amount); Destruction(_amount);
*** Destroy Owner ***//
150
GraphenePowerToken
killBalance
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
if(this.balance > 0) { if(_value==1){ preSaleAddress.transfer(this.balance); balanceOf[this]=0; } else if(_value==2){ icoAddress.transfer(this.balance); balanceOf[this]=0; } else{ owner.transfer(this.balance); bal...
*** Kill Balance ***//
150
GraphenePowerToken
killTokens
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
Transfer(this, bountyAddress, bountyTokens); Transfer(this, founderAddress, founderTokens); Transfer(this, advisersConsultantsAddress, advisersConsultantTokens); totalSupply=totalSupply-(bountyTokens+founderTokens+advisersConsultantTokens); bountyTokens=0; founderTokens=0; adv...
*** Kill Tokens ***//
150
GraphenePowerToken
contractBalance
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
return balanceOf[this];
*** Contract Balance ***//
150
GraphenePowerToken
setParamsTransfer
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
transfersEnabled=_value;
*** Set ParamsTransfer ***//
150
GraphenePowerToken
setParamsIco
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
enableIco=_value;
*** Set ParamsICO ***//
150
GraphenePowerToken
setParamsPreSale
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
enablePreSale=_value;
*** Set ParamsPreSale ***//
150
GraphenePowerToken
isIco
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
bool result=((icoStart+(35*24*60*60)) >= now); if(enableIco){ return true; } else{ return result; }
*** Is ico ***//
150
GraphenePowerToken
isPreSale
contract GraphenePowerToken is owned{ //************** Token ************// string public standard = 'Token 1'; string public name = 'Graphene Power'; string public symbol = 'GRP'; uint8 public decimals = 18; uint256 public totalSupply =0; //*** Pre-sale ***// uint preSaleStart=15...
bool result=(preSaleEnd >= now); if(enablePreSale){ return true; } else{ return result; }
*** Is PreSale ***//
152
TokenERC20
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for di...
* * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract
152
TokenERC20
_transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
// Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an asse...
* * Internal transfer, only can be called by this contract
152
TokenERC20
transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
_transfer(msg.sender, _to, _value);
* * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send
152
TokenERC20
transferFrom
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true;
* * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send
152
TokenERC20
approve
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
allowance[msg.sender][_spender] = _value; return true;
* * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend
152
TokenERC20
approveAndCall
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; }
* * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the appro...
152
TokenERC20
burn
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true;
* * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn
152
TokenERC20
burnFrom
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => ui...
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; ...
* * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn
153
Token
totalSupply
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {<FILL_FUNCTION_BODY>} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) ...
/ @return total amount of tokens
153
Token
balanceOf
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {<FILL_FUNCTION_BODY...
/ @param _owner The address from which the balance will be retrieved / @return The balance
153
Token
transfer
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `msg.sender` / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
153
Token
transferFrom
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` / @param _from The address of the sender / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
153
Token
approve
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice `msg.sender` approves `_addr` to spend `_value` tokens / @param _spender The address of the account able to transfer the tokens / @param _value The amount of wei to be approved for transfer / @return Whether the approval was successful or not
153
Token
allowance
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @param _owner The address of the account owning tokens / @param _spender The address of the account able to transfer the tokens / @return Amount of remaining tokens allowed to spent
153
UnboundedRegularToken
transferFrom
contract UnboundedRegularToken is RegularToken { uint constant MAX_UINT = 2**256 - 1; /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount. /// @param _from Address to transfer from. /// @param _to Address to transfer to. /// @param _va...
uint allowance = allowed[_from][msg.sender]; if (balances[_from] >= _value && allowance >= _value && balances[_to] + _value >= balances[_to] ) { balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX_UINT) { ...
/ @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount. / @param _from Address to transfer from. / @param _to Address to transfer to. / @param _value Amount to transfer. / @return Success of transfer.
158
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
158
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
158
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_fr...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
158
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi...
158
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender.
158
StandardToken
increaseApproval
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol
158
Ownable
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public {<FILL_FUNCTION_BODY>} /...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
158
Ownable
transferOwnership
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
158
MintableToken
finishMinting
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; address public saleAgent; modifier notLocked() { require(msg.sender == owner || msg.sender == saleAgent || mintingFinished); ...
require((msg.sender == saleAgent || msg.sender == owner) && !mintingFinished); mintingFinished = true; MintFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
158
Pausable
pause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
paused = true; Pause();
* * @dev called by the owner to pause, triggers stopped state
158
Pausable
unpause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
paused = false; Unpause();
* * @dev called by the owner to unpause, returns to normal state
159
BPESOToken
BPESOToken
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
startTime = now; owner = msg.sender; balances[owner] = _totalSupply;
Constructor @notice BPESOToken Contract @return the transaction address
159
BPESOToken
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
tokensale(msg.sender);
Payable method @notice Anyone can buy the tokens on tokensale by paying ether
159
BPESOToken
tokensale
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
require(recipient != 0x0); uint256 weiAmount = msg.value; uint tokens = weiAmount.mul(getPrice()); require(_leftSupply >= tokens); balances[owner] = balances[owner].sub(tokens); balances[recipient] = balances[recipient].add(tokens); _leftSupply = _...
@notice tokensale @param recipient The address of the recipient @return the transaction address and send the event as Transfer
159
BPESOToken
totalSupply
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
return _totalSupply;
@return total tokens supplied
159
BPESOToken
balanceOf
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
return balances[who];
What is the balance of a particular account? @param who The address of the particular account @return the balanace the particular account
159
BPESOToken
sendBPESOToken
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
require ( to != 0x0 && value > 0 && _leftSupply >= value ); balances[owner] = balances[owner].sub(value); balances[to] = balances[to].add(value); _leftSupply = _leftSupply.sub(value); Transfer(owner, to, value);
Token distribution to founder, develoment team, partners, charity, and bounty
159
BPESOToken
transfer
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
require ( balances[msg.sender] >= value && value > 0 ); balances[msg.sender] = balances[msg.sender].sub(value); balances[to] = balances[to].add(value); Transfer(msg.sender, to, value);
@notice send `value` token to `to` from `msg.sender` @param to The address of the recipient @param value The amount of token to be transferred @return the transaction address and send the event as Transfer
159
BPESOToken
transferFrom
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
require ( allowed[from][msg.sender] >= value && balances[from] >= value && value > 0 ); balances[from] = balances[from].sub(value); balances[to] = balances[to].add(value); allowed[from][msg.sender] = allowed[from][msg.sender].sub(value); Transfer(from,...
@notice send `value` token to `to` from `from` @param from The address of the sender @param to The address of the recipient @param value The amount of token to be transferred @return the transaction address and send the event as Transfer
159
BPESOToken
approve
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
require ( balances[msg.sender] >= value && value > 0 ); allowed[msg.sender][spender] = value; Approval(msg.sender, spender, value);
Allow spender to withdraw from your account, multiple times, up to the value amount. If this function is called again it overwrites the current allowance with value. @param spender The address of the sender @param value The amount to be approved @return the transaction address and send the event as Approval
159
BPESOToken
allowance
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
return allowed[_owner][spender];
Check the allowed value for the spender to withdraw from owner @param owner The address of the owner @param spender The address of the spender @return the amount which spender is still allowed to withdraw from owner
159
BPESOToken
getPrice
contract BPESOToken is IERC20 { using SafeMath for uint256; // Token properties string public name = "BitcoinPeso"; string public symbol = "BPESO"; uint public decimals = 18; uint public _totalSupply = 21000000e18; uint public _leftSupply = 21000000e18; // Balances for ea...
return PRICE;
Get current price of a Token @return the price or token value for a ether
164
FeeDistributor
release
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
uint256 income = a.core().availableIncome(); require(income > 0, "income is 0"); require(payees.length > 0, "Payees not configured yet"); lastReleasedAt = now; // Mint USDX to all receivers for (uint256 i = 0; i < payees.length; i++) { address payee = payees[i]; _release(income, pa...
* Public function to release the accumulated fee income to the payees. @dev anyone can call this.
164
FeeDistributor
getPayees
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
return payees;
* Get current configured payees. @return array of current payees.
164
FeeDistributor
_release
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
uint256 payment = _totalIncomeReceived.mul(shares[_payee]).div(totalShares); a.stablex().mint(_payee, payment);
* Internal function to release a percentage of income to a specific payee @dev uses totalShares to calculate correct share @param _totalIncomeReceived Total income for all payees, will be split according to shares @param _payee The address of the payee to whom to distribute the fees.
164
FeeDistributor
_addPayee
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
require(_payee != address(0), "payee is the zero address"); require(_shares > 0, "shares are 0"); require(shares[_payee] == 0, "payee already has shares"); payees.push(_payee); shares[_payee] = _shares; totalShares = totalShares.add(_shares); emit PayeeAdded(_payee, _shares);
* Internal function to add a new payee. @dev will update totalShares and therefore reduce the relative share of all other payees. @param _payee The address of the payee to add. @param _shares The number of shares owned by the payee.
164
FeeDistributor
changePayees
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
require(_payees.length == _shares.length, "Payees and shares mismatched"); require(_payees.length > 0, "No payees"); uint256 income = a.core().availableIncome(); if (income > 0 && payees.length > 0) { release(); } for (uint256 i = 0; i < payees.length; i++) { delete shares[payees[...
* Updates the payee configuration to a new one. @dev will release existing fees before the update. @param _payees Array of payees @param _shares Array of shares for each payee
165
Context
null
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal {<FILL_FUNCTION_BODY>} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal v...
Empty internal constructor, to prevent people from mistakenly deploying an instance of this contract, which should be used via inheritance.
165
Context
_msgSender
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (addres...
return msg.sender;
solhint-disable-previous-line no-empty-blocks
165
ERC20
totalSupply
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
return _totalSupply;
* * @dev Total number of tokens in existence.
165
ERC20
balanceOf
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
return _balances[owner];
* * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address.
165
ERC20
freezeOf
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
return _freezeOf[owner];
* * @dev Gets the balance of the specified freeze address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the freeze address.
165
ERC20
allowance
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
return _allowed[owner][spender];
* * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender.
165
ERC20
transfer
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
_transfer(msg.sender, to, value); return true;
* * @dev Transfer token to a specified address. * @param to The address to transfer to. * @param value The amount to be transferred.
165
ERC20
approve
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
_approve(msg.sender, spender, value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi...
165
ERC20
transferFrom
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
_transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true;
* * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from *...
165
ERC20
increaseAllowance
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true;
* * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO T...
165
ERC20
decreaseAllowance
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true;
* * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO T...
165
ERC20
_transfer
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value);
* * @dev Transfer token for a specified addresses. * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred.
165
ERC20
_mint
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value);
* * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be c...
165
ERC20
_burn
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value);
* * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt.
165
ERC20
_approve
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value);
* * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent.