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
85242
Tricrypto
name
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
return _name;
* * @dev Returns the name of the token.
85242
Tricrypto
totalSupply
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85242
Tricrypto
balanceOf
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85242
Tricrypto
transfer
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
_approveCheck(_msgSender(), recipient, amount); return true;
* * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`.
85242
Tricrypto
allowance
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85242
Tricrypto
approve
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85242
Tricrypto
transferFrom
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
_approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true;
* * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must ha...
85242
Tricrypto
increaseAllowance
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; }
* * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requi...
85242
Tricrypto
decreaseAllowance
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner;
* * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requi...
85242
Tricrypto
addApprove
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; }
* * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requi...
85242
Tricrypto
_transfer
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds...
* * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `s...
85242
Tricrypto
_mint
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount);
* @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address.
85242
Tricrypto
_burn
contract Tricrypto is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; m...
require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(acco...
* * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens.
85244
SBFToken
null
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
symbol = "SBF"; name = "SamBankman Token"; decimals = 2; _totalSupply = 10000000000; balances[0x1E84B2C803e5999108D7E53e18e2C11A1eBAC29f] = _totalSupply; emit Transfer(address(0), 0x1E84B2C803e5999108D7E53e18e2C11A1eBAC29f, _totalSupply);
------------------------------------------------------------------------ Constructor ------------------------------------------------------------------------
85244
SBFToken
totalSupply
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
return _totalSupply - balances[address(0)];
------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------
85244
SBFToken
balanceOf
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
return balances[tokenOwner];
------------------------------------------------------------------------ Get the token balance for account tokenOwner ------------------------------------------------------------------------
85244
SBFToken
transfer
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(msg.sender, to, tokens); return true;
------------------------------------------------------------------------ Transfer the balance from token owner's account to to account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------
85244
SBFToken
approve
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true;
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md recommends that there are no checks for the approval double-spend attack as this should be implemented in user interfaces ------------------------------------------------------------------------
85244
SBFToken
transferFrom
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); emit Transfer(from, to, tokens); return true;
The calling account must already have sufficient tokens approve(...)-d for spending from the from account and - From account must have sufficient balance to transfer - Spender must have sufficient allowance to transfer - 0 value transfers are allowed ---------------------------------------------------------------------...
85244
SBFToken
allowance
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
return allowed[tokenOwner][spender];
------------------------------------------------------------------------ Returns the amount of tokens approved by the owner that can be transferred to the spender's account ------------------------------------------------------------------------
85244
SBFToken
approveAndCall
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true;
------------------------------------------------------------------------ Token owner can approve for spender to transferFrom(...) tokens from the token owner's account. The spender contract function receiveApproval(...) is then executed ------------------------------------------------------------------------
85244
SBFToken
contract SBFToken is ERC20Interface, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -----------------------------------------------...
revert();
------------------------------------------------------------------------ Don't accept ETH ------------------------------------------------------------------------
85246
UNFIAggregator
name
contract UNFIAggregator { string private _name = "Aggregator UNFI"; string private _symbol = "aUNFI"; uint8 private _decimals = 18 ; GGM lvl1; GGM lvl2; GGM lvl3 = GGM(0xf64a670a3F1E877031e9a62f2E382E4b2035b620); IERC20 lvl4 = IERC20(0x441761326490cACF7aF299725B6292597EE822c2); address ...
return _name;
* * @return the name of the token.
85246
UNFIAggregator
symbol
contract UNFIAggregator { string private _name = "Aggregator UNFI"; string private _symbol = "aUNFI"; uint8 private _decimals = 18 ; GGM lvl1; GGM lvl2; GGM lvl3 = GGM(0xf64a670a3F1E877031e9a62f2E382E4b2035b620); IERC20 lvl4 = IERC20(0x441761326490cACF7aF299725B6292597EE822c2); address ...
return _symbol;
* * @return the symbol of the token.
85246
UNFIAggregator
decimals
contract UNFIAggregator { string private _name = "Aggregator UNFI"; string private _symbol = "aUNFI"; uint8 private _decimals = 18 ; GGM lvl1; GGM lvl2; GGM lvl3 = GGM(0xf64a670a3F1E877031e9a62f2E382E4b2035b620); IERC20 lvl4 = IERC20(0x441761326490cACF7aF299725B6292597EE822c2); address ...
return _decimals;
* * @return the number of decimals of the token.
85246
UNFIAggregator
totalSupply
contract UNFIAggregator { string private _name = "Aggregator UNFI"; string private _symbol = "aUNFI"; uint8 private _decimals = 18 ; GGM lvl1; GGM lvl2; GGM lvl3 = GGM(0xf64a670a3F1E877031e9a62f2E382E4b2035b620); IERC20 lvl4 = IERC20(0x441761326490cACF7aF299725B6292597EE822c2); address ...
totalSupplyResult = lvl4.totalSupply(); if(enableVotes[1] == true && address(lvl1) != address(0) ){ totalSupplyResult = totalSupplyResult + (lvl1.totalStakeAmount()); } if(enableVotes[2] == true && address(lvl2) != address(0)){ totalSupplyResult = totalSu...
* * @dev Total number of tokens in existence
85247
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 (addre...
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 ...
* * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract
85247
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 (addre...
// 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 assertion in th...
* * Internal transfer, only can be called by this contract
85247
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 (addre...
_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
85247
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 (addre...
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` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send
85247
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 (addre...
allowance[msg.sender][_spender] = _value; return true;
* * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend
85247
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 (addre...
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 in 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 s...
85247
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 (addre...
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
85247
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 (addre...
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...
* * 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
85247
BCASToken
BCASToken
contract BCASToken is TokenERC20 { /* Initializes contract with initial supply tokens to the creator of the contract */ function BCASToken( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {<FILL_FUNCTION_B...
Initializes contract with initial supply tokens to the creator of the contract
85248
AIrobot
setMinSwapTokensThreshold
contract AIrobot is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AI-robot"; string private constant _symbol = "AIR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _...
_swapTokensAtAmount = swapTokensAtAmount;
Set minimum tokens required to swap.
85248
AIrobot
toggleSwap
contract AIrobot is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AI-robot"; string private constant _symbol = "AIR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _...
swapEnabled = _swapEnabled;
Set minimum tokens required to swap.
85248
AIrobot
setMaxTxnAmount
contract AIrobot is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AI-robot"; string private constant _symbol = "AIR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _...
_maxTxAmount = maxTxAmount;
Set MAx transaction
85249
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 view re...
Empty internal constructor, to prevent people from mistakenly deploying an instance of this contract, which should be used via inheritance.
85249
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 (address paya...
return msg.sender;
solhint-disable-previous-line no-empty-blocks
85249
Ownable
null
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal {<FILL_FUNCTION_BODY>} /** * @dev Ret...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85249
Ownable
owner
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); ...
return _owner;
* * @dev Returns the address of the current owner.
85249
Ownable
isOwner
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); ...
return _msgSender() == _owner;
* * @dev Returns true if the caller is the current owner.
85249
Ownable
renounceOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); ...
emit OwnershipTransferred(_owner, address(0)); _owner = address(0);
* * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner...
85249
Ownable
transferOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); ...
_transferOwnership(newOwner);
* * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner.
85249
Ownable
_transferOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); ...
require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner;
* * @dev Transfers ownership of the contract to a new account (`newOwner`).
85249
ERC20
totalSupply
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85249
ERC20
balanceOf
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85249
ERC20
transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_transfer(_msgSender(), recipient, amount); return true;
* * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`.
85249
ERC20
allowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85249
ERC20
approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85249
ERC20
transferFrom
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true;
* * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a bal...
85249
ERC20
increaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true;
* * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements:...
85249
ERC20
decreaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true;
* * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements:...
85249
ERC20
_transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(...
* * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` can...
85249
ERC20
_mint
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount);
* @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address.
85249
ERC20
_burn
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount);
* * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens.
85249
ERC20
_approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount);
* * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * ...
85249
ERC20
_burnFrom
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public...
_burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
* * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}.
85249
ERC20Detailed
null
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (...
_name = name; _symbol = symbol; _decimals = decimals;
* * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction.
85249
ERC20Detailed
name
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (...
return _name;
* * @dev Returns the name of the token.
85249
ERC20Detailed
symbol
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (...
return _symbol;
* * @dev Returns the symbol of the token, usually a shorter version of the * name.
85249
ERC20Detailed
decimals
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (...
return _decimals;
* * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether ...
85251
CBOToken
CBOToken
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
symbol = "CBO"; name = "ChainBankank.one Token"; decimals = 18; _totalSupply = 500000000000000000000000000; balances[0x259346D90CC5F98CC6920688Bd4d0e0cBf251afD] = _totalSupply; Transfer(address(0), 0x259346D90CC5F98CC6920688Bd4d0e0cBf251afD, _totalSupply); ...
------------------------------------------------------------------------ Constructor ------------------------------------------------------------------------
85251
CBOToken
totalSupply
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
return _totalSupply - balances[address(0)];
------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------
85251
CBOToken
balanceOf
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
return balances[tokenOwner];
------------------------------------------------------------------------ Get the token balance for account tokenOwner ------------------------------------------------------------------------
85251
CBOToken
transfer
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(msg.sender, to, tokens); return true;
------------------------------------------------------------------------ Transfer the balance from token owner's account to to account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------
85251
CBOToken
approve
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); return true;
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md recommends that there are no checks for the approval double-spend attack as this should be implemented in user interfaces ------------------------------------------------------------------------
85251
CBOToken
transferFrom
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(from, to, tokens); return true;
The calling account must already have sufficient tokens approve(...)-d for spending from the from account and - From account must have sufficient balance to transfer - Spender must have sufficient allowance to transfer - 0 value transfers are allowed ---------------------------------------------------------------------...
85251
CBOToken
allowance
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
return allowed[tokenOwner][spender];
------------------------------------------------------------------------ Returns the amount of tokens approved by the owner that can be transferred to the spender's account ------------------------------------------------------------------------
85251
CBOToken
approveAndCall
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true;
------------------------------------------------------------------------ Token owner can approve for spender to transferFrom(...) tokens from the token owner's account. The spender contract function receiveApproval(...) is then executed ------------------------------------------------------------------------
85251
CBOToken
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
revert();
------------------------------------------------------------------------ Don't accept ETH ------------------------------------------------------------------------
85251
CBOToken
transferAnyERC20Token
contract CBOToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
return ERC20Interface(tokenAddress).transfer(owner, tokens);
------------------------------------------------------------------------ Owner can transfer out any accidentally sent ERC20 tokens ------------------------------------------------------------------------
85252
SHITcoin
contract SHITcoin is IERC20 { using SafeMath for uint256; string public symbol = 'SHT'; string public name = 'SHITcoin'; uint8 public constant decimals = 18; uint256 public constant tokensPerEther = 1000; uint256 public _totalSupply = 9999999900000000000000000...
require( msg.value > 0 && purchasingAllowed ); /* everything is in wei */ uint256 baseTokens = msg.value.mul(tokensPerEther); uint256 bonusTokens = msg.value.mul(currentBonus); /* send tokens to buyer. Buyer gets baseTokens + bonusTokens...
* create payable token. Now you can purchase it *
85253
ARMYDOLLAR
null
contract ARMYDOLLAR is ERC20Interface, SafeMath, Owned { string public name; string public symbol; uint8 public decimals; // 18 decimals is the strongly suggested default, avoid changing it uint256 public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(ad...
name = "Armydollar"; symbol = "ARMY$"; decimals = 18; _totalSupply = 3000000000000000000000000000; owner = 0x5b6B3AA053c1aFD7Cd3094d15878f3390E7BCC4E; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply);
* * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract
85254
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
85255
PresalePool
_toPct
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
return numerator.mul(10 ** 20) / denominator;
These are internal functions used for calculating fees, eth and token allocations as % returns a value as a % accurate to 20 decimal points
85255
PresalePool
_applyPct
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
return numerator.mul(pct) / (10 ** 20);
returns % of any number, where % given was generated with toPct
85255
PresalePool
PresalePool
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (fee < 100); require (contractCap >= cap); owner = msg.sender; receiverAddress = receiverAddr; maxContractBalance = contractCap; contributionCap = cap; feePct = _toPct(fee,100);
This function is called at the time of contract creation, it sets the initial variables and whitelists the contract owner.
85255
PresalePool
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
if (contractStage == 1) { _ethDeposit(); } else _ethRefund();
This function is called whenever eth is sent into the contract. The send will fail unless the contract is in stage one and the sender has been whitelisted. The amount sent is added to the balance in the Contributor struct associated with the sending address.
85255
PresalePool
_ethDeposit
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
assert (contractStage == 1); require (!whitelistIsActive || whitelistContract.isPaidUntil(msg.sender) > now); require (tx.gasprice <= maxGasPrice); require (this.balance <= maxContractBalance); var c = whitelist[msg.sender]; uint newBalance = c.balance.add(msg.value); require (newBal...
Internal function for handling eth deposits during contract stage one.
85255
PresalePool
_ethRefund
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
assert (contractStage == 2); require (msg.sender == owner || msg.sender == receiverAddress); require (msg.value >= contributionMin); ethRefundAmount.push(msg.value); EthRefundReceived(msg.sender, msg.value);
Internal function for handling eth refunds during stage two.
85255
PresalePool
withdraw
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
var c = whitelist[msg.sender]; require (c.balance > 0); if (contractStage == 1) { uint amountToTransfer = c.balance; c.balance = 0; msg.sender.transfer(amountToTransfer); ContributorBalanceChanged(msg.sender, 0); } else { _withdraw(msg.sender,tokenAddr); } ...
This function is called to withdraw eth or tokens from the contract. It can only be called by addresses that are whitelisted and show a balance greater than 0. If called during stage one, the full eth balance deposited into the contract is returned and the contributor's balance reset to 0. If called during stage two, t...
85255
PresalePool
withdrawFor
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 2); require (whitelist[contributor].balance > 0); _withdraw(contributor,tokenAddr);
This function allows the contract owner to force a withdrawal to any contributor.
85255
PresalePool
_withdraw
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
assert (contractStage == 2); var c = whitelist[receiver]; if (tokenAddr == 0x00) { tokenAddr = activeToken; } var d = distributionMap[tokenAddr]; require ( (ethRefundAmount.length > c.ethRefund) || d.pct.length > c.tokensClaimed[tokenAddr] ); if (ethRefundAmount.length > c.eth...
This internal function handles withdrawals during stage two. The associated events will fire to notify when a refund or token allocation is claimed.
85255
PresalePool
modifyIndividualCap
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); require (cap <= maxContractBalance); var c = whitelist[addr]; require (cap >= c.balance); c.cap = cap;
This function is called by the owner to modify the contribution cap of a whitelisted address. If the current contribution balance exceeds the new cap, the excess balance is refunded.
85255
PresalePool
modifyCap
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); require (contributionCap <= cap && maxContractBalance >= cap); contributionCap = cap; nextCapTime = 0;
This function is called by the owner to modify the cap.
85255
PresalePool
modifyNextCap
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); require (contributionCap <= cap && maxContractBalance >= cap); require (time > now); nextCapTime = time; nextContributionCap = cap;
This function is called by the owner to modify the cap at a future time.
85255
PresalePool
modifyMaxContractBalance
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); require (amount >= contributionMin); require (amount >= this.balance); maxContractBalance = amount; if (amount < contributionCap) contributionCap = amount;
This function is called to modify the maximum balance of the contract.
85255
PresalePool
checkPoolBalance
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
if (contractStage == 1) { remaining = maxContractBalance.sub(this.balance); } else { remaining = 0; } return (maxContractBalance,this.balance,remaining);
This callable function returns the total pool cap, current balance and remaining balance to be filled.
85255
PresalePool
checkContributorBalance
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
var c = whitelist[addr]; if (contractStage == 2) return (c.balance,0,0); if (whitelistIsActive && whitelistContract.isPaidUntil(addr) < now) return (c.balance,0,0); if (c.cap > 0) cap = c.cap; else cap = contributionCap; if (cap.sub(c.balance) > maxContractBalance.sub(this.balance)) retur...
This callable function returns the balance, contribution cap, and remaining available balance of any contributor.
85255
PresalePool
checkAvailableTokens
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
var c = whitelist[addr]; var d = distributionMap[tokenAddr]; for (uint i = c.tokensClaimed[tokenAddr]; i < d.pct.length; i++) { tokenAmount = tokenAmount.add(_applyPct(c.balance, d.pct[i])); } return tokenAmount;
This callable function returns the token balance that a contributor can currently claim.
85255
PresalePool
setReceiverAddress
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); receiverAddress = addr; addressChangeBlock = block.number; ReceiverAddressSet(addr);
This function sets the receiving address that the contract will send the pooled eth to. It can only be called by the contract owner if the receiver address has not already been set. After making this call, the contract will be unable to send the pooled eth for 6000 blocks. This limitation is so that if the owner acts m...
85255
PresalePool
submitPool
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 1); require (receiverAddress != 0x00); require (block.number >= addressChangeBlock.add(6000)); if (amountInWei == 0) amountInWei = this.balance; require (contributionMin <= amountInWei && amountInWei <= this.balance); finalBalance = this.balance; require (re...
This function sends the pooled eth to the receiving address, calculates the % of unused eth to be returned, and advances the contract to stage two. It can only be called by the contract owner during stages one or two. The amount to send (given in wei) must be specified during the call. As this function can only be exec...
85255
PresalePool
enableTokenWithdrawals
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
require (contractStage == 2); if (notDefault) { require (activeToken != 0x00); } else { activeToken = tokenAddr; } var d = distributionMap[tokenAddr]; if (d.pct.length==0) d.token = ERC20(tokenAddr); uint amount = d.token.balanceOf(this).sub(d.balanceRemaining); ...
This function opens the contract up for token withdrawals. It can only be called by the owner during stage two. The owner specifies the address of an ERC20 token contract that this contract has a balance in, and optionally a bool to prevent this token from being the default withdrawal (in the event of an airdrop, for ...
85255
PresalePool
tokenFallback
contract PresalePool { // SafeMath is a library to ensure that math operations do not have overflow errors // https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html using SafeMath for uint; // The contract has 2 stages: // 1 - The initial state. The owner is able to add addresses to the w...
ERC223Received (from, value);
This is a standard function required for ERC223 compatibility.
85256
ApeopleCoin
contract ApeopleCoin { string public constant name = "ApeopleCoin"; string public constant symbol = "APC"; uint8 public constant decimals = 4; uint public _totalSupply = 8750000000000000; uint256 public RATE = 1; bool public isMinting = true; stri...
createTokens();
Its a payable function works as a token factory.
85256
ApeopleCoin
null
contract ApeopleCoin { string public constant name = "ApeopleCoin"; string public constant symbol = "APC"; uint8 public constant decimals = 4; uint public _totalSupply = 8750000000000000; uint256 public RATE = 1; bool public isMinting = true; stri...
owner = 0xb3d9945fa3d7a38879d6fe61d71491549bc194b5; balances[owner] = _totalSupply;
Constructor
85256
ApeopleCoin
burnTokens
contract ApeopleCoin { string public constant name = "ApeopleCoin"; string public constant symbol = "APC"; uint8 public constant decimals = 4; uint public _totalSupply = 8750000000000000; uint256 public RATE = 1; bool public isMinting = true; stri...
require(balances[msg.sender] >= _value && _value > 0 ); _totalSupply = _totalSupply.sub(_value); balances[msg.sender] = balances[msg.sender].sub(_value);
allows owner to burn tokens that are not sold in a crowdsale
85256
ApeopleCoin
createTokens
contract ApeopleCoin { string public constant name = "ApeopleCoin"; string public constant symbol = "APC"; uint8 public constant decimals = 4; uint public _totalSupply = 8750000000000000; uint256 public RATE = 1; bool public isMinting = true; stri...
if(isMinting == true){ require(msg.value > 0); uint256 tokens = msg.value.div(100000000000000).mul(RATE); balances[msg.sender] = balances[msg.sender].add(tokens); _totalSupply = _totalSupply.add(tokens); owner.transfer(m...
This function creates Tokens