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
85308
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.
85308
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 = _msgSende...
return _owner;
* * @dev Returns the address of the current owner.
85308
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 = _msgSende...
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 ...
85308
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 = _msgSende...
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.
85309
Ownable
Ownable
contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() p...
owner = msg.sender; newOwner = address(0);
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85309
Ownable
transferOwnership
contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() p...
require(address(0) != _newOwner); newOwner = _newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to.
85309
Pausable
pause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modif...
paused = true; emit Pause();
* * @dev called by the owner to pause, triggers stopped state
85309
Pausable
unpause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modif...
paused = false; emit Unpause();
* * @dev called by the owner to unpause, returns to normal state
85309
Crowdsale
Crowdsale
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(_whiteList != address(0)); multisig = 0x10f78f2a70B52e6c3b490113c72Ba9A90ff1b5CA; team = 0x10f78f2a70B52e6c3b490113c72Ba9A90ff1b5CA; maxCap = 1510000000e8; minInvestETH = 1 ether/2; currentStep = Step.FundingPreSale; numOfBlocksInMinute = 408; ...
Crowdsale {constructor} @notice fired when contract is crated. Initializes all constant and initial values. @param _dollarToEtherRatio {uint} how many dollars are in one eth. $333.44/ETH would be passed as 33344
85309
Crowdsale
setTokenAddress
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(token == address(0)); token = _tokenAddress; return true;
@notice Specify address of token contract @param _tokenAddress {address} address of token contract @return res {bool}
85309
Crowdsale
advanceStep
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(Step.FundingPreSale == currentStep); currentStep = Step.FundingPublicSale; minInvestETH = 1 ether/4;
@notice set the step of the campaign from presale to public sale contract is deployed in presale mode WARNING: there is no way to go back
85309
Crowdsale
prepareRefund
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(crowdsaleClosed); require(msg.value == ethReceivedPresale.add(ethReceivedMain)); // make sure that proper amount of ether is sent currentStep = Step.Refunding;
@notice in case refunds are needed, money can be returned to the contract and contract switched to mode refunding
85309
Crowdsale
numberOfBackers
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
return backersIndex.length;
@notice return number of contributors @return {uint} number of contributors
85309
Crowdsale
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
contribute(msg.sender);
{fallback function} @notice It will call internal function which handles allocation of Ether and calculates tokens. Contributor will be instructed to specify sufficient amount of gas. e.g. 250,000
85309
Crowdsale
start
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(startBlock == 0); require(_block <= (numOfBlocksInMinute * 60 * 24 * 54)/100); // allow max 54 days for campaign startBlock = block.number; endBlock = startBlock.add(_block);
@notice It will be called by owner to start the sale
85309
Crowdsale
adjustDuration
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(startBlock > 0); require(_block < (numOfBlocksInMinute * 60 * 24 * 60)/100); // allow for max of 60 days for campaign require(_block > block.number.sub(startBlock)); // ensure that endBlock is not set in the past endBlock = startBlock.add(_block);
@notice Due to changing average of block time this function will allow on adjusting duration of campaign closer to the end
85309
Crowdsale
contribute
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(!crowdsaleClosed); require(whiteList.isWhiteListed(_backer)); // ensure that user is whitelisted uint tokensToSend = determinePurchase(); Backer storage backer = backers[_backer]; if (backer.weiReceived == 0) backersIndex.push(_backer); ...
@notice It will be called by fallback function whenever ether is sent to it @param _backer {address} address of contributor @return res {bool} true if transaction was successful
85309
Crowdsale
determinePurchase
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(msg.value >= minInvestETH); // ensure that min contributions amount is met uint tokensToSend = msg.value.mul(1e8) / tokenPriceWei; //1e8 ensures that token gets 8 decimal values if (Step.FundingPublicSale == currentStep) { // calculate price of token in public sale ...
@notice determine if purchase is valid and return proper number of tokens @return tokensToSend {uint} proper number of tokens based on the timline
85309
Crowdsale
finalize
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(!crowdsaleClosed); // purchasing precise number of tokens might be impractical, thus subtract 1000 // tokens so finalization is possible near the end require(block.number >= endBlock || totalTokensSent + priorTokensSent >= maxCap - 1000); crowdsaleClosed = true; ...
@notice This function will finalize the sale. It will only execute if predetermined sale time passed or all tokens are sold. it will fail if minimum cap is not reached
85309
Crowdsale
drain
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
multisig.transfer(address(this).balance);
@notice Fail-safe drain
85309
Crowdsale
tokenDrain
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
if (block.number > endBlock) { require(token.transfer(multisig, token.balanceOf(this))); }
@notice Fail-safe token transfer
85309
Crowdsale
refund
contract Crowdsale is Pausable { using SafeMath for uint; struct Backer { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; } Token public token; // Token contract reference address public multisig; // Mul...
require(currentStep == Step.Refunding); Backer storage backer = backers[msg.sender]; require(backer.weiReceived > 0); // ensure that user has sent contribution require(!backer.refunded); // ensure that user hasn't been refunded yet backer.refunded = true; /...
@notice it will allow contributors to get refund in case campaign failed @return {bool} true if successful
85309
Token
Token
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
require(_crowdsaleAddress != address(0)); locked = true; // Lock the transfer of tokens during the crowdsale totalSupply = 2600000000e8; name = "Kripton"; // Set the name for display purposes symbol = "LPK"; // Set the...
@notice The Token contract
85309
Token
unlock
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
locked = false;
@notice unlock token for trading
85309
Token
lock
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
locked = true;
@lock token from trading during ICO
85309
Token
transfer
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true;
@notice transfer tokens to given address @param _to {address} address or recipient @param _value {uint} amount to transfer @return {bool} true if successful
85309
Token
transferFrom
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
require(balances[_from] >= _value); // Check if the sender has enough require(_value <= allowed[_from][msg.sender]); // Check if allowed is greater or equal balances[_from] = balances[_from].sub(_value); // Subtract from the sender balances[_to] = balances[_to].add(_value); // Add t...
@notice transfer tokens from given address to another address @param _from {address} from whom tokens are transferred @param _to {address} to whom tokens are transferred @parm _value {uint} amount of tokens to transfer @return {bool} true if successful
85309
Token
balanceOf
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
return balances[_owner];
@notice to query balance of account @return _owner {address} address of user to query balance
85309
Token
approve
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
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...
85309
Token
allowance
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
return allowed[_owner][_spender];
@notice to query of allowance of one user to the other @param _owner {address} of the owner of the account @param _spender {address} of the spender of the account @return remaining {uint} amount of remaining allowance
85309
Token
increaseApproval
contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint8 public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; mappin...
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol
85309
WhiteList
isWhiteListed
contract WhiteList is Ownable { mapping(address => bool) public whiteList; uint public totalWhiteListed; //white listed users number event LogWhiteListed(address indexed user, uint whiteListedNum); event LogWhiteListedMultiple(uint whiteListedNum); event LogRemoveWhiteListed(address index...
return whiteList[_user];
@notice it will return status of white listing @return true if user is white listed and false if is not
85309
WhiteList
removeFromWhiteList
contract WhiteList is Ownable { mapping(address => bool) public whiteList; uint public totalWhiteListed; //white listed users number event LogWhiteListed(address indexed user, uint whiteListedNum); event LogWhiteListedMultiple(uint whiteListedNum); event LogRemoveWhiteListed(address index...
require(whiteList[_user] == true); whiteList[_user] = false; totalWhiteListed--; emit LogRemoveWhiteListed(_user);
@notice it will remove whitelisted user @param _contributor {address} of user to unwhitelist
85309
WhiteList
addToWhiteList
contract WhiteList is Ownable { mapping(address => bool) public whiteList; uint public totalWhiteListed; //white listed users number event LogWhiteListed(address indexed user, uint whiteListedNum); event LogWhiteListedMultiple(uint whiteListedNum); event LogRemoveWhiteListed(address index...
if (whiteList[_user] != true) { whiteList[_user] = true; totalWhiteListed++; emit LogWhiteListed(_user, totalWhiteListed); }else revert();
@notice it will white list one member @param _user {address} of user to whitelist @return true if successful
85309
WhiteList
addToWhiteListMultiple
contract WhiteList is Ownable { mapping(address => bool) public whiteList; uint public totalWhiteListed; //white listed users number event LogWhiteListed(address indexed user, uint whiteListedNum); event LogWhiteListedMultiple(uint whiteListedNum); event LogRemoveWhiteListed(address index...
for (uint i = 0; i < _users.length; ++i) { if (whiteList[_users[i]] != true) { whiteList[_users[i]] = true; totalWhiteListed++; } } emit LogWhiteListedMultiple(totalWhiteListed);
@notice it will white list multiple members @param _user {address[]} of users to whitelist @return true if successful
85312
ERC20
null
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
_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.
85312
ERC20
name
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
return _name;
* * @dev Returns the name of the token.
85312
ERC20
symbol
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
return _symbol;
* * @dev Returns the symbol of the token, usually a shorter version of the * name.
85312
ERC20
decimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
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 * ...
85312
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; string private _name; string private _symbol; uint8 private _dec...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85312
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; string private _name; string private _symbol; uint8 private _dec...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85312
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; string private _name; string private _symbol; uint8 private _dec...
_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`.
85312
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; string private _name; string private _symbol; uint8 private _dec...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85312
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; string private _name; string private _symbol; uint8 private _dec...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85312
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; string private _name; string private _symbol; uint8 private _dec...
_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`...
85312
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; string private _name; string private _symbol; uint8 private _dec...
_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...
85312
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; string private _name; string private _symbol; uint8 private _dec...
_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...
85312
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; string private _name; string private _symbol; uint8 private _dec...
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...
85312
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; string private _name; string private _symbol; uint8 private _dec...
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.
85312
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; string private _name; string private _symbol; uint8 private _dec...
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.
85312
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; string private _name; string private _symbol; uint8 private _dec...
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 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: * ...
85312
ERC20
_setupDecimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
_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.
85312
ERC20
_beforeTokenTransfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _dec...
* * @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 ...
85312
CsfERC20
null
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); _setupDecimals(decimals); //Mint amount to the sender _mint(_msgSender(), initialAmount * (10 ** uint256(decimals)));
* * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, `PAUSER_ROLE` to the * account that deploys the contract. * * See {ERC20-constructor}.
85312
CsfERC20
transferOwnership
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); grantRole(DEFAULT_ADMIN_ROLE, newOwner); grantRole(MINTER_ROLE, newOwner); grantRole(PAUSER_ROLE, newOwner); revokeRole(MINTER_ROLE, _msgSender()); revokeRole(PAUSER_ROLE, _msgSender()); revokeRole(DEFAULT_ADMI...
* * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. * force setup DEFAULT_ADMIN_ROLE to owner, in case him has renounced DEFAULT_ADMIN_ROLE * beacuse he need to have almost DEFAULT_ADMIN_ROLE role to grant all role to the newOwne...
85312
CsfERC20
renounceOwnership
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
revert("CsfERC20: renounceOwnership function was disabled; please use transferOwnership");
* * @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 ...
85312
CsfERC20
mint
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
_mint(to, amount);
* * @dev Creates `amount` new tokens for `to`. * * See {ERC20-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`.
85312
CsfERC20
pause
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
_pause();
* * @dev Pauses all token transfers. * * See {ERC20Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`.
85312
CsfERC20
unpause
contract CsfERC20 is Context, AccessControl, Ownable, ERC20Burnable, ERC20Pausable { using SafeMath for uint256; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROL...
_unpause();
* * @dev Unpauses all token transfers. * * See {ERC20Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`.
85314
FreeEther
contract FreeEther { // This contract has free Ether for anyone to withdraw. This is just a fun test to see if anyone looks at this. If there's any Ether in this contract, go ahead and take it! Just call the gimmeEther() function. If there's no Ether in this contract, someone's already taken it. /...
// We will deposit 0.1 Ether to the contract for anyone to claim!
This contract has free Ether for anyone to withdraw. This is just a fun test to see if anyone looks at this. If there's any Ether in this contract, go ahead and take it! Just call the gimmeEther() function. If there's no Ether in this contract, someone's already taken it. Visit ETH93.com
85315
PEPSI
setMinSwapTokensThreshold
contract PEPSI is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PEPSICO NFT"; string private constant _symbol = "PEPSI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) privat...
_swapTokensAtAmount = swapTokensAtAmount;
Set minimum tokens required to swap.
85315
PEPSI
toggleSwap
contract PEPSI is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PEPSICO NFT"; string private constant _symbol = "PEPSI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) privat...
swapEnabled = _swapEnabled;
Set minimum tokens required to swap.
85315
PEPSI
setMaxTxnAmount
contract PEPSI is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PEPSICO NFT"; string private constant _symbol = "PEPSI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) privat...
_maxTxAmount = maxTxAmount;
Set MAx transaction
85317
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMathUint256 for uint256; uint256 internal supply; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. ...
return internalTransfer(msg.sender, _to, _value);
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
85317
BasicToken
internalTransfer
contract BasicToken is ERC20Basic { using SafeMathUint256 for uint256; uint256 internal supply; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. ...
balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); onTokenTransfer(_from, _to, _value); return true;
* * @dev allows internal token transfers * @param _from The source address * @param _to The destination address
85317
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMathUint256 for uint256; uint256 internal supply; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. ...
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.
85317
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { using SafeMathUint256 for uint256; // Approvals of this amount are simply considered an everlasting approval which is not decremented when transfers occur uint256 public constant ETERNAL_APPROVAL_VALUE = 2 ** 256 - 1; mapping (address => mapping (add...
uint256 _allowance = allowed[_from][msg.sender]; if (_allowance != ETERNAL_APPROVAL_VALUE) { allowed[_from][msg.sender] = _allowance.sub(_value); } internalTransfer(_from, _to, _value); return true;
* * @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 amout of tokens to be transfered
85317
StandardToken
approve
contract StandardToken is ERC20, BasicToken { using SafeMathUint256 for uint256; // Approvals of this amount are simply considered an everlasting approval which is not decremented when transfers occur uint256 public constant ETERNAL_APPROVAL_VALUE = 2 ** 256 - 1; mapping (address => mapping (add...
approveInternal(msg.sender, _spender, _value); return true;
* * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent.
85317
StandardToken
allowance
contract StandardToken is ERC20, BasicToken { using SafeMathUint256 for uint256; // Approvals of this amount are simply considered an everlasting approval which is not decremented when transfers occur uint256 public constant ETERNAL_APPROVAL_VALUE = 2 ** 256 - 1; mapping (address => mapping (add...
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 specifing the amount of tokens still avaible for the spender.
85317
StandardToken
increaseApproval
contract StandardToken is ERC20, BasicToken { using SafeMathUint256 for uint256; // Approvals of this amount are simply considered an everlasting approval which is not decremented when transfers occur uint256 public constant ETERNAL_APPROVAL_VALUE = 2 ** 256 - 1; mapping (address => mapping (add...
approveInternal(msg.sender, _spender, allowed[msg.sender][_spender].add(_addedValue)); return true;
* * @dev Increase the amount of tokens that an owner allowed to a spender. * * Approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) * @param _spender The address which will spend t...
85317
StandardToken
decreaseApproval
contract StandardToken is ERC20, BasicToken { using SafeMathUint256 for uint256; // Approvals of this amount are simply considered an everlasting approval which is not decremented when transfers occur uint256 public constant ETERNAL_APPROVAL_VALUE = 2 ** 256 - 1; mapping (address => mapping (add...
uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { approveInternal(msg.sender, _spender, 0); } else { approveInternal(msg.sender, _spender, oldValue.sub(_subtractedValue)); } 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) * @param _spender The address which will spend t...
85317
VariableSupplyToken
mint
contract VariableSupplyToken is StandardToken { using SafeMathUint256 for uint256; event Mint(address indexed target, uint256 value); event Burn(address indexed target, uint256 value); /** * @dev mint tokens for a specified address * @param _target The address to mint tokens for. ...
balances[_target] = balances[_target].add(_amount); supply = supply.add(_amount); Mint(_target, _amount); onMint(_target, _amount); return true;
* * @dev mint tokens for a specified address * @param _target The address to mint tokens for. * @param _amount The amount to be minted.
85317
VariableSupplyToken
burn
contract VariableSupplyToken is StandardToken { using SafeMathUint256 for uint256; event Mint(address indexed target, uint256 value); event Burn(address indexed target, uint256 value); /** * @dev mint tokens for a specified address * @param _target The address to mint tokens for. ...
balances[_target] = balances[_target].sub(_amount); supply = supply.sub(_amount); Burn(_target, _amount); onBurn(_target, _amount); return true;
* * @dev burn tokens belonging to a specified address * @param _target The address to burn tokens for. * @param _amount The amount to be burned.
85317
ReputationToken
migrateBalancesFromLegacyRep
contract ReputationToken is DelegationTarget, ITyped, Initializable, VariableSupplyToken, IReputationToken { using SafeMathUint256 for uint256; string constant public name = "Reputation"; string constant public symbol = "REP"; uint8 constant public decimals = 18; IUniverse private universe; ...
ERC20 _legacyRepToken = getLegacyRepToken(); for (uint256 i = 0; i < _holders.length; i++) { migrateBalanceFromLegacyRep(_holders[i], _legacyRepToken); } return true;
* * @dev Copies the balance of a batch of addresses from the legacy contract * @param _holders Array of addresses to migrate balance * @return True if operation was completed
85317
ReputationToken
migrateBalanceFromLegacyRep
contract ReputationToken is DelegationTarget, ITyped, Initializable, VariableSupplyToken, IReputationToken { using SafeMathUint256 for uint256; string constant public name = "Reputation"; string constant public symbol = "REP"; uint8 constant public decimals = 18; IUniverse private universe; ...
if (balances[_holder] > 0) { return false; // Already copied, move on } uint256 amount = _legacyRepToken.balanceOf(_holder); if (amount == 0) { return false; // Has no balance in legacy contract, move on } mint(_holder, amount); ...
* * @dev Copies the balance of a single addresses from the legacy contract * @param _holder Address to migrate balance * @return True if balance was copied, false if was already copied or address had no balance
85317
ReputationToken
migrateAllowancesFromLegacyRep
contract ReputationToken is DelegationTarget, ITyped, Initializable, VariableSupplyToken, IReputationToken { using SafeMathUint256 for uint256; string constant public name = "Reputation"; string constant public symbol = "REP"; uint8 constant public decimals = 18; IUniverse private universe; ...
ERC20 _legacyRepToken = getLegacyRepToken(); for (uint256 i = 0; i < _owners.length; i++) { address _owner = _owners[i]; address _spender = _spenders[i]; uint256 _allowance = _legacyRepToken.allowance(_owner, _spender); approveInternal(_owner, _spen...
* * @dev Copies the allowances of a batch of addresses from the legacy contract. This is an optional step which may only be done before the migration is complete but is not required to complete it. * @param _owners Array of owner addresses to migrate allowances * @param _spenders Array of spender addr...
85320
Ownable
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public {<FILL_FUNCTION_BODY>} /**...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85320
Ownable
transferOwnership
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
85320
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
85320
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); 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.
85320
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.
85320
StandardToken
transferFrom
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_fr...
* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
85320
StandardToken
approve
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi...
85320
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.
85320
StandardToken
increaseApproval
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true;
* * @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 * @...
85320
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); } 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 * @...
85320
QIUToken
QIUToken
contract QIUToken is StandardToken,Ownable { string public name = 'QIUToken'; string public symbol = 'QIU'; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 5000000000; uint public eth2qiuRate = 10000; function() public payable { } // make this contract to receive ethers fu...
totalSupply_ = INITIAL_SUPPLY; balances[owner] = INITIAL_SUPPLY / 10; balances[this] = INITIAL_SUPPLY - balances[owner];
make this contract to receive ethers
85320
QIUToken
ownerTransferFrom
contract QIUToken is StandardToken,Ownable { string public name = 'QIUToken'; string public symbol = 'QIU'; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 5000000000; uint public eth2qiuRate = 10000; function() public payable { } // make this contract to receive ethers fu...
require(tx.origin == owner); // only the owner can call the method. require(_to != address(0)); require(_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); re...
* * @dev Transfer tokens from one address to another, only owner can do this super-user operate * @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
85320
QIUToken
originTransfer
contract QIUToken is StandardToken,Ownable { string public name = 'QIUToken'; string public symbol = 'QIU'; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 5000000000; uint public eth2qiuRate = 10000; function() public payable { } // make this contract to receive ethers fu...
require(_to != address(0)); require(_value <= balances[tx.origin]); // SafeMath.sub will throw if there is not enough balance. balances[tx.origin] = balances[tx.origin].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(tx.origin, _to, _value); ...
* * @dev transfer token for a specified address,but different from transfer is replace msg.sender with tx.origin * @param _to The address to transfer to. * @param _value The amount to be transferred.
85320
QIUToken
getETHBalance
contract QIUToken is StandardToken,Ownable { string public name = 'QIUToken'; string public symbol = 'QIU'; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 5000000000; uint public eth2qiuRate = 10000; function() public payable { } // make this contract to receive ethers fu...
return this.balance; // balance is "inherited" from the address type
// transfer out method function ownerETHCashout(address account) public onlyOwner { account.transfer(this.balance); }
85322
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>} function _msgSender() internal view virtual returns (address payable) { retur...
Empty internal constructor, to prevent people from mistakenly deploying an instance of this contract, which should be used via inheritance.
85322
Hedgehog
null
contract Hedgehog 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; ma...
_name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(owner, initialSupply*(10**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.
85322
Hedgehog
name
contract Hedgehog 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; ma...
return _name;
* * @dev Returns the name of the token.
85322
Hedgehog
totalSupply
contract Hedgehog 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; ma...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85322
Hedgehog
balanceOf
contract Hedgehog 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; ma...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85322
Hedgehog
transfer
contract Hedgehog 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; ma...
_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`.
85322
Hedgehog
allowance
contract Hedgehog 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; ma...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85322
Hedgehog
approve
contract Hedgehog 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; ma...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85322
Hedgehog
transferFrom
contract Hedgehog 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; ma...
_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...
85322
Hedgehog
increaseAllowance
contract Hedgehog 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; ma...
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...