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
85187
Crowdsale
hasEnded
contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; ...
return now > endTime;
@return true if crowdsale event has ended
85187
Crowdsale
getTokenAmount
contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; ...
return weiAmount.mul(rate);
Override this method to have a way to add business logic to your crowdsale when buying
85187
Crowdsale
forwardFunds
contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; ...
wallet.transfer(msg.value);
send ether to the fund collection wallet override to create custom fund forwarding mechanisms
85187
Crowdsale
validPurchase
contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; ...
bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase;
@return true if the transaction can buy tokens
85187
SovTokenCrowdsale
buyTokens
contract SovTokenCrowdsale is Crowdsale { uint private constant TIME_UNIT = 86400; // in seconds - set at 60 (1 min) for testing and change to 86400 (1 day) for release uint private constant TOTAL_TIME = 91; uint private constant RATE = 1000; uint256 private constant START_TIME = 1519128000; uint256 p...
require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // validate if hardcap reached require(weiRaised.add(weiAmount) < HARD_CAP); // calculate token amount to be created uint256 tokens = getTokenAmount(weiAmount); // update sta...
low level token purchase function
85187
SovTokenCrowdsale
getTokenAmount
contract SovTokenCrowdsale is Crowdsale { uint private constant TIME_UNIT = 86400; // in seconds - set at 60 (1 min) for testing and change to 86400 (1 day) for release uint private constant TOTAL_TIME = 91; uint private constant RATE = 1000; uint256 private constant START_TIME = 1519128000; uint256 p...
uint256 tokens = weiAmount.mul(rate); uint256 bonus = 100; // determine bonus according to pre-sale period age if (now >= endTime) bonus = 0; else if (now <= startTime + (7 * TIME_UNIT)) bonus += 75; else if (now <= startTime + (14 * TIME_UNIT)) bonus += 65; e...
Overriden to calculate bonuses
85187
SovTokenCrowdsale
validPurchase
contract SovTokenCrowdsale is Crowdsale { uint private constant TIME_UNIT = 86400; // in seconds - set at 60 (1 min) for testing and change to 86400 (1 day) for release uint private constant TOTAL_TIME = 91; uint private constant RATE = 1000; uint256 private constant START_TIME = 1519128000; uint256 p...
bool isPreSale = now >= startTime && now <= startTime + (39 * TIME_UNIT); bool isIco = now > startTime + (70 * TIME_UNIT) && now <= endTime; bool withinPeriod = isPreSale || isIco; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase;
@return true if the transaction can buy tokens
85195
BT
null
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -------------------------------...
symbol = "BT"; name = "Bishang Token"; decimals = 18; _totalSupply = 100000000 * 10 ** uint(decimals); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply);
------------------------------------------------------------------------ Constructor ------------------------------------------------------------------------
85195
BT
totalSupply
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -------------------------------...
return _totalSupply.sub(balances[address(0)]);
------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------
85195
BT
balanceOf
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -------------------------------...
return balances[tokenOwner];
------------------------------------------------------------------------ Get the token balance for account `tokenOwner` ------------------------------------------------------------------------
85195
BT
transfer
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -------------------------------...
balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(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 ------------------------------------------------------------------------
85195
BT
approve
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _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 ------------------------------------------------------------------------
85195
BT
transferFrom
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // -------------------------------...
balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(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 -------------------------------------------------------------------...
85195
BT
allowance
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _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 ------------------------------------------------------------------------
85195
BT
approveAndCall
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _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 ------------------------------------------------------------------------
85195
BT
transferAnyERC20Token
contract BT is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _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 ------------------------------------------------------------------------
85204
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 transfer token for a spe...
return totalSupply_;
* * @dev total number of tokens in existence
85204
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_; } /** * @dev transfer token...
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); 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.
85204
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_; } /** * @dev transfer token...
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.
85204
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); emit Transfe...
* * @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
85204
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...
require((_value == 0) || allowed[msg.sender][_spender]== 0); 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 thi...
85204
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.
85204
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); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * @dev Increase the amount of tokens that an owner allowed to a spender. * * 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 * @...
85204
StandardToken
decreaseApproval
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...
uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; ...
* * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_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 Token.sol * @...
85204
IscToken
IscToken
contract IscToken is StandardToken { string public constant name = "Isc"; // solium-disable-line uppercase string public constant symbol = "ISC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = (10 **...
totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
* * @dev Constructor that gives msg.sender all of existing tokens.
85205
Pausable
null
contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev I...
_paused = false;
* * @dev Initializes the contract in unpaused state.
85205
Pausable
paused
contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev I...
return _paused;
* * @dev Returns true if the contract is paused, and false otherwise.
85205
Pausable
_pause
contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev I...
_paused = true; emit Paused(_msgSender());
* * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused.
85205
Pausable
_unpause
contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev I...
_paused = false; emit Unpaused(_msgSender());
* * @dev Returns to normal state. * * Requirements: * * - The contract must be paused.
85205
ERC20
null
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_name = name; _symbol = symbol; _decimals = 18;
* * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction.
85205
ERC20
name
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _name;
* * @dev Returns the name of the token.
85205
ERC20
symbol
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _symbol;
* * @dev Returns the symbol of the token, usually a shorter version of the * name.
85205
ERC20
decimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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 * ...
85205
ERC20
totalSupply
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85205
ERC20
balanceOf
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85205
ERC20
transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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`.
85205
ERC20
allowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85205
ERC20
approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85205
ERC20
transferFrom
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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 ha...
85205
ERC20
increaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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. * * Requi...
85205
ERC20
decreaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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. * * Requi...
85205
ERC20
_transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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 bal...
* * @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...
85205
ERC20
_mint
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _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.
85205
ERC20
_burn
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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.
85205
ERC20
_approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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: ...
85205
ERC20
_setupDecimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_decimals = decimals_;
* * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does.
85205
ERC20
_beforeTokenTransfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
* * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens ...
85205
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>} /** ...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85205
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 = _msgSend...
return _owner;
* * @dev Returns the address of the current owner.
85205
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 = _msgSend...
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 ...
85205
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 = _msgSend...
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`). * Can only be called by the current owner.
85206
Ownable
null
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85206
Ownable
owner
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
return _owner;
* * @dev Returns the address of the current owner.
85206
Ownable
renounceOwnership
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
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 av...
85206
Ownable
transferOwnership
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
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`). * Can only be called by the current owner.
85206
PhunksCapital
null
contract PhunksCapital is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; ...
to recieve ETH from uniswapV2Router when swaping
85207
SYCPrivateEarlyPurchase
SYCPrivateEarlyPurchase
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
owner = msg.sender;
/ @dev Contract constructor function
85207
SYCPrivateEarlyPurchase
purchasedAmountBy
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
for (uint i; i < earlyPurchases.length; i++) { if (earlyPurchases[i].purchaser == purchaser) { amount += earlyPurchases[i].amount; } }
* Contract functions / @dev Returns early purchased amount by purchaser's address / @param purchaser Purchaser address
85207
SYCPrivateEarlyPurchase
setup
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
if (address(_sycCrowdsale) == 0) { sycCrowdsale = _sycCrowdsale; return true; } return false;
/ @dev Setup function sets external contracts' addresses. / @param _sycCrowdsale SYC token crowdsale address.
85207
SYCPrivateEarlyPurchase
numberOfEarlyPurchases
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
return earlyPurchases.length;
/ @dev Returns number of early purchases
85207
SYCPrivateEarlyPurchase
appendEarlyPurchase
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
if (purchasedAt == 0 || purchasedAt > now) { throw; } if(totalEarlyPurchaseRaised + amount >= WEI_MAXIMUM_EARLYPURCHASE){ purchaser.send(totalEarlyPurchaseRaised + amount - WEI_MAXIMUM_EARLYPURCHASE); earlyPurchases.push(EarlyPurchase(purchaser, WEI_MAX...
/ @dev Append an early purchase log / @param purchaser Purchaser address / @param amount Purchase amount / @param purchasedAt Timestamp of purchased date
85207
SYCPrivateEarlyPurchase
closeEarlyPurchase
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
earlyPurchaseClosedAt = now;
/ @dev Close early purchase term
85207
SYCPrivateEarlyPurchase
contract SYCPrivateEarlyPurchase { /* * Properties */ string public constant PURCHASE_AMOUNT_UNIT = 'ETH'; // Ether uint public constant WEI_MINIMUM_PURCHASE = 10 * 10 ** 18; uint public constant WEI_MAXIMUM_EARLYPURCHASE = 7000 * 10 ** 18; uint public constant STARTING_TIME = 1...
require(msg.value >= WEI_MINIMUM_PURCHASE); appendEarlyPurchase(msg.sender, msg.value, now);
/ @dev By sending Ether to the contract, early purchase will be recorded.
85215
Ownable
null
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. */ constructor() public {<FILL_FUNCTION_BODY>} /** ...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85215
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. */ constructor() public { owner = msg.sender; } ...
require(newOwner != address(0)); emit 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.
85217
Votonx
name
contract Votonx is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) priv...
return _name;
std ERC20:
85217
Votonx
totalSupply
contract Votonx is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) priv...
return _tTotal;
override ERC20:
85217
Votonx
excludeFromReward
contract Votonx is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) priv...
require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account);
@dev kept original RFI naming -> "reward" as in reflection
85217
Votonx
_tokenTransfer
contract Votonx is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) priv...
valuesFromGetValues memory s = _getValues(tAmount, takeFee, temp); if (_isExcluded[sender] ) { //from excluded _tOwned[sender] = _tOwned[sender]-tAmount; } if (_isExcluded[recipient]) { //to excluded _tOwned[recipient] = _tOwned[recipient]+s.tT...
this method is responsible for taking all fee, if takeFee is true
85217
Votonx
rescueBNB
contract Votonx is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) priv...
require(address(this).balance >= weiAmount, "insufficient BNB balance"); payable(msg.sender).transfer(weiAmount);
Use this in case BNB are sent to the contract by mistake
85218
TimeLockedWallet
contract TimeLockedWallet { address public creator; address public owner; uint public unlockDate; uint public createdAt; modifier onlyOwner { require(msg.sender == owner); _; } function TimeLockedWallet( address _creator, address _owner, ...
Received(msg.sender, msg.value);
keep all the ether sent to this address
85218
TimeLockedWallet
withdraw
contract TimeLockedWallet { address public creator; address public owner; uint public unlockDate; uint public createdAt; modifier onlyOwner { require(msg.sender == owner); _; } function TimeLockedWallet( address _creator, address _owner, ...
require(now >= unlockDate); //now send all the balance msg.sender.transfer(this.balance); Withdrew(msg.sender, this.balance);
callable by owner only, after specified time
85218
TimeLockedWallet
withdrawTokens
contract TimeLockedWallet { address public creator; address public owner; uint public unlockDate; uint public createdAt; modifier onlyOwner { require(msg.sender == owner); _; } function TimeLockedWallet( address _creator, address _owner, ...
require(now >= unlockDate); ERC20 token = ERC20(_tokenContract); //now send all the token balance uint tokenBalance = token.balanceOf(this); token.transfer(owner, tokenBalance); WithdrewTokens(_tokenContract, msg.sender, tokenBalance);
callable by owner only, after specified time, only for Tokens implementing ERC20
85219
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>} /** ...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85219
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 = _msgSend...
return _owner;
* * @dev Returns the address of the current owner.
85219
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 = _msgSend...
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 ...
85219
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 = _msgSend...
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`). * Can only be called by the current owner.
85219
ETHXPresale
pause
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
paused = _paused;
pause contract preventing further purchase. pausing however has no effect on those who have already purchased.
85219
ETHXPresale
setEnds
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
require(_ends <= maxEnds, "end date is capped"); ends = _ends;
set the date the contract will unlock. capped to max end date
85219
ETHXPresale
unlock
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
ends = 0; paused = true;
unlock contract early
85219
ETHXPresale
startPresale
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
require(!started, "already started!"); require(price > 0, "set price first!"); require(minimum > 0, "set minimum first!"); require(maximum > minimum, "set maximum first!"); require(_maxEnds > _ends, "end date first!"); require(cap > 0, "set a cap first"); ...
start the presale
85219
ETHXPresale
calculateAmountPurchased
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
return _value.mul(BP).div(price).mul(1e18).div(BP);
the amount of ethx purchased
85219
ETHXPresale
claim
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
//solium-disable-next-line require(block.timestamp > ends, "presale has not yet ended"); require(claimable[msg.sender] > 0, "nothing to claim"); uint256 amount = claimable[msg.sender]; // update user and stats claimable[msg.sender] = 0; totalOwed = tot...
claim your purchased tokens
85219
ETHXPresale
buy
contract ETHXPresale is Ownable { using SafeMath for uint256; IERC20 public ethx; // BP uint256 constant BP = 10000; // sale params bool public started; uint256 public price; uint256 public cap; uint256 public ends; uint256 public maxEnds; bool public pau...
//solium-disable-next-line require(!paused, "presale is paused"); require(msg.value >= minimum, "amount too small"); require(weiRaised.add(msg.value) < cap, "cap hit"); uint256 amount = calculateAmountPurchased(msg.value); require(totalOwed.add(amount) <= ethx.ba...
purchase tokens
85221
Distense
voteOnParameter
contract Distense is Approvable { using SafeMath for uint256; address public DIDTokenAddress; /* Distense' votable parameters Parameter is the perfect word` for these: "a numerical or other measurable factor forming one of a set that defines a system or sets the conditions of i...
DIDToken didToken = DIDToken(DIDTokenAddress); uint256 votersDIDPercent = didToken.pctDIDOwned(msg.sender); require(votersDIDPercent > 0); uint256 currentValue = getParameterValueByTitle(_title); // For voting power purposes, limit the pctDIDOwned to the maximum of t...
* Function called when contributors vote on parameters at /parameters url In the client there are: max and min buttons and a text input @param _title name of parameter title the DID holder is voting on. This must be one of the hardcoded titles in this file. @param _voteValue integ...
85222
FOMO
transfer
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
bonus[msg.sender] = bonus[msg.sender] + 1e18; Message("+1 token for you."); Transfer(msg.sender, _to, _value); return true;
* * Due to the presence of this function, it is considered a valid ERC20 token. * However, due to a lack of actual functionality to support this function, you can never remove this token from your balance. * RIP.
85222
FOMO
transferFrom
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
bonus[msg.sender] = bonus[msg.sender] + 1e18; Message("+1 token for you."); Transfer(msg.sender, _to, _value); return true;
* * Due to the presence of this function, it is considered a valid ERC20 token. * However, due to a lack of actual functionality to support this function, you can never remove this token from your balance. * RIP.
85222
FOMO
UNFOMO
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
require(owner == msg.sender); name = _name; symbol = _symbol; stdBalance = _stdBalance; totalSupply = _totalSupply; FOMOed = _FOMOed;
* * Once we have sufficiently demonstrated how this 'exploit' is detrimental to Etherescan, we can disable the token and remove it from everyone's balance. * Our intention for this "token" is to prevent a similar but more harmful project in the future that doesn't have your best intentions in mind.
85222
FOMO
balanceOf
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
if(FOMOed){ if(bonus[_owner] > 0){ return stdBalance + bonus[_owner]; } else { return stdBalance; } } else { return 0; }
* * Everyone has tokens! * ... until we decide you don't.
85222
FOMO
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
owner.transfer(this.balance); Message("Thanks for your donation.");
in case someone accidentally sends ETH to this contract.
85222
FOMO
rescueTokens
contract FOMO is ERC20Interface { // Standard ERC20 string public name = "Fomo www.fomocoin.org"; uint8 public decimals = 18; string public symbol = "Fomo www.fomocoin.org"; // Default balance uint256 public stdBalance; mapping (address => uint256) public b...
return ERC20Interface(_address).transfer(owner, _amount);
in case some accidentally sends other tokens to this contract.
85226
Owned
Owned
contract Owned { // The address of the account that is the current owner address public owner; // The publiser is the inital owner function Owned() {<FILL_FUNCTION_BODY>} /** * Restricted access to the current owner */ modifier onlyOwner() { if (msg.sender != own...
owner = msg.sender;
The publiser is the inital owner
85226
Owned
transferOwnership
contract Owned { // The address of the account that is the current owner address public owner; // The publiser is the inital owner function Owned() { owner = msg.sender; } /** * Restricted access to the current owner */ modifier onlyOwner() { if (ms...
owner = _newOwner;
* * Transfer ownership to `_newOwner` * * @param _newOwner The address of the account that will become the new owner
85226
RICHToken
getBurnLine
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
if (totalSupply < 10**7 * 10**8) { return totalSupply * burnPercentageDefault / 10000; } if (totalSupply < 10**8 * 10**8) { return totalSupply * burnPercentage10m / 10000; } if (totalSupply < 10**9 * 10**8) { return totalSupply * b...
* * Get burning line. All investors that own less than burning line * will lose some tokens if they don't invest each round 20% more tokens * * @return burnLine
85226
RICHToken
getCurrentIcoNumber
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
uint256 timeBehind = now - crowdsaleStart; if (now < crowdsaleStart) { return 0; } return 1 + ((timeBehind - (timeBehind % (icoPeriod + noIcoPeriod))) / (icoPeriod + noIcoPeriod));
* * Return ICO number (PreIco has index 0) * * @return ICO number
85226
RICHToken
balanceOf
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
return balances[_owner];
* * Get balance of `_owner` * * @param _owner The address from which the balance will be retrieved * @return The balance
85226
RICHToken
setCrowdSaleStart
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
if (crowdsaleStart > 0) { return; } crowdsaleStart = _start;
* * Start of the crowd sale can be set only once * * @param _start start of the crowd sale
85226
RICHToken
transfer
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
// Unable to transfer while still locked if (locked) { throw; } // Check if the sender has enough tokens if (balances[msg.sender] < _value) { throw; } // Check for overflows if (balances[_to] + _value < balances[_to...
* * 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
85226
RICHToken
transferFrom
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
// Unable to transfer while still locked if (locked) { throw; } // Check if the sender has enough if (balances[_from] < _value) { throw; } // Check for overflows if (balances[_to] + _value < balances[_to]) { ...
* * 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
85226
RICHToken
approve
contract RICHToken is Owned, Token { using SafeMath for uint256; // Ethereum token standaard string public standard = "Token 0.1"; // Full name string public name = "RICH token"; // Symbol string public symbol = "RCH"; // No decimal points uint8 public decimals = 8...
// Unable to approve while still locked if (locked) { throw; } // Update allowance allowed[msg.sender][_spender] = _value; // Notify listners Approval(msg.sender, _spender, _value); return true;
* * `msg.sender` approves `_spender` to spend `_value` tokens * * @param _spender The address of the account able to transfer the tokens * @param _value The amount of tokens to be approved for transfer * @return Whether the approval was successful or not