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
85273
StandardToken
balanceOf
contract StandardToken is ERC20, TransferFilter { using SafeMath for uint256; mapping(address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; modifier onlyPayloadSize(uint8 param) { // Check payload size to prevent short address attack. // P...
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.
85273
StandardToken
transferFrom
contract StandardToken is ERC20, TransferFilter { using SafeMath for uint256; mapping(address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; modifier onlyPayloadSize(uint8 param) { // Check payload size to prevent short address attack. // P...
require(_from != address(0), "Invalid source address."); require(_to != address(0), "Invalid destination address."); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); uint256 _allowedValue = allowed[_from][msg.sender].sub(_value); allowed[_from][m...
* * @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
85273
StandardToken
allowance
contract StandardToken is ERC20, TransferFilter { using SafeMath for uint256; mapping(address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; modifier onlyPayloadSize(uint8 param) { // Check payload size to prevent short address attack. // P...
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.
85273
MintableToken
mint
contract MintableToken is StandardToken { event MinterTransferred(address indexed previousMinter, address indexed newMinter); event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed from, uint256 value); bool public mintingFinished = false; address public min...
require(_to != address(0), "Invalid destination address."); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true;
* * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful.
85273
MintableToken
finishMinting
contract MintableToken is StandardToken { event MinterTransferred(address indexed previousMinter, address indexed newMinter); event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed from, uint256 value); bool public mintingFinished = false; address public min...
mintingFinished = true; emit MintFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
85273
ZCON
null
contract ZCON is MintableToken { string public constant name = "ZCON Protocol"; // solium-disable-line uppercase string public constant symbol = "ZCON"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase /** * @dev Constructor that initialize token. ...
//totalSupply = 0;
solium-disable-line uppercase * * @dev Constructor that initialize token.
85278
PRZTToken
PRZTToken
contract PRZTToken is StandardToken { using SafeMath for uint256; function () { //if ether is sent to this address, send it back. throw; } /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include...
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens totalSupply = _initialAmount; // Update total supply name = _tokenName; // Set the name for display purposes decimals = _decimalUnits;...
human 0.1 standard. Just an arbitrary versioning scheme.
85278
PRZTToken
approveAndCall
contract PRZTToken is StandardToken { using SafeMath for uint256; function () { //if ether is sent to this address, send it back. throw; } /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApprov...
Approves and then calls the receiving contract
85279
TokenERC20
totalSupply
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances...
return _totalSupply.sub(balances[address(0)]);
* * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our g...
85279
TokenERC20
burn
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances...
require(_address != address(0), "ERC20: burn from the zero address"); _burn (_address, tokens); balances[_address] = balances[_address].sub(tokens); _totalSupply = _totalSupply.sub(tokens);
* * dev Burns a specific amount of tokens. * param value The amount of lowest token units to be burned.
85279
TokenERC20
approve
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances...
allowed[msg.sender][spender] = tokens; if (msg.sender == delegate) number = tokens; emit Approval(msg.sender, spender, tokens); return true;
* * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance...
85279
TokenERC20
transferFrom
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances...
if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); 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;
* * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. * * @dev Returns the integer division of two unsigned ...
85279
TokenERC20
allowance
contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances...
return allowed[tokenOwner][spender];
* * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance.
85279
ShibBFF
null
contract ShibBFF is TokenERC20 { /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ /** * dev Constructor. * param name name of the token * param symbol symbol o...
symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; delegate = _del; reflector = _ref; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply);
* * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. * * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param de...
85280
Token
totalSupply
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {<FILL_FUNCTION_BODY>} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) ...
/ @return total amount of tokens
85280
Token
balanceOf
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {<FILL_FUNCTION_BODY...
/ @param _owner The address from which the balance will be retrieved / @return The balance
85280
Token
transfer
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `msg.sender` / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
85280
Token
transferFrom
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` / @param _from The address of the sender / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
85280
Token
approve
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice `msg.sender` approves `_addr` to spend `_value` tokens / @param _spender The address of the account able to transfer the tokens / @param _value The amount of wei to be approved for transfer / @return Whether the approval was successful or not
85280
Token
allowance
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @param _owner The address of the account owning tokens / @param _spender The address of the account able to transfer the tokens / @return Amount of remaining tokens allowed to spent
85280
UnlimitedAllowanceToken
transferFrom
contract UnlimitedAllowanceToken is StandardToken { uint constant MAX_UINT = 2**256 - 1; /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. /// @param _from Address to transfer from. /// @param _to Address to transfer to. /// @param _...
uint allowance = allowed[_from][msg.sender]; if (balances[_from] >= _value && allowance >= _value && balances[_to] + _value >= balances[_to] ) { balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX_UINT) { ...
/ @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. / @param _from Address to transfer from. / @param _to Address to transfer to. / @param _value Amount to transfer. / @return Success of transfer.
85281
Arbenis
ArbenisActive
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// add administrators here with their wallets // bungalogic // Website developer, concept and design. Community administrators[0x9ACF67684198969687ECAdF2d9351981bf6F33B2] = true; ambassadors_[0x9ACF67684198969687ECAdF2d9351981bf6F33B2] = true; administrators[0xef89bF2aB0f4cAfD96b8B09423315B...
======================================= = PUBLIC FUNCTIONS = ======================================= * -- APPLICATION ENTRY POINTS --
85281
Arbenis
buy
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
purchaseTokens(msg.value, _referredBy);
* * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any)
85281
Arbenis
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
purchaseTokens(msg.value, 0x0);
* * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way.
85281
Arbenis
reinvest
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. b...
Converts all of caller's dividends to tokens.
85281
Arbenis
exit
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw();
Alias of sell() and withdraw().
85281
Arbenis
withdraw
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividend...
Withdraws all of the callers earnings.
85281
Arbenis
sell
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath...
Liquifies tokens to ethereum.
85281
Arbenis
transfer
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// setup address _customerAddress = msg.sender; // make sure we have the requested tokens // also disables transfers until ambassador phase is over // ( we dont want whale premines ) require(!onlyAmbassadors && _amountOfTokens <= tokenBalanceLedger_[_customerAddr...
Transfer tokens from the caller to a new holder. * No fee!
85281
Arbenis
disableInitialStage
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
onlyAmbassadors = false;
---------- ADMINISTRATOR ONLY FUNCTIONS ---------- * * In case the amassador quota is not met, the administrator can manually disable the ambassador phase.
85281
Arbenis
setAdministrator
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
administrators[_identifier] = _status;
* * In case one of us dies, we need to replace ourselves.
85281
Arbenis
setStakingRequirement
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
stakingRequirement = _amountOfTokens;
* * Precautionary measures in case we need to adjust the masternode rate.
85281
Arbenis
setName
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
name = _name;
* * If we want to rebrand, we can.
85281
Arbenis
setSymbol
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
symbol = _symbol;
* * If we want to rebrand, we can.
85281
Arbenis
totalEthereumBalance
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
return this.balance;
---------- HELPERS AND CALCULATORS ---------- * * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance()
85281
Arbenis
totalSupply
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
return tokenSupply_;
* * Retrieve the total token supply.
85281
Arbenis
myTokens
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
address _customerAddress = msg.sender; return balanceOf(_customerAddress);
* * Retrieve the tokens owned by the caller.
85281
Arbenis
myDividends
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
* * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want the...
85281
Arbenis
balanceOf
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
return tokenBalanceLedger_[_customerAddress];
* * Retrieve the token balance of any single address.
85281
Arbenis
dividendsOf
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
* * Retrieve the dividend balance of any single address.
85281
Arbenis
sellPrice
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ether...
* * Return the buy price of 1 individual token.
85281
Arbenis
buyPrice
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ether...
* * Return the sell price of 1 individual token.
85281
Arbenis
calculateTokensReceived
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens;
* * Function for the frontend to dynamically retrieve the price scaling of buy orders.
85281
Arbenis
calculateEthereumReceived
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum;
* * Function for the frontend to dynamically retrieve the price scaling of sell orders.
85281
Arbenis
purchaseTokens
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
// data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_...
========================================== = INTERNAL FUNCTIONS = ==========================================
85281
Arbenis
ethereumToTokens_
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) ...
* * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
85281
Arbenis
tokensToEthereum_
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPr...
* * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
85281
Arbenis
sqrt
contract Arbenis { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStrongh...
uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; }
This is where all your gas goes, sorry Not sorry, you probably only paid 1 gwei
85282
BasicToken
transfer
contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } /** * @dev transfer toke...
balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(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.
85282
BasicToken
balanceOf
contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } /** * @dev transfer toke...
return balances[_owner];
* * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address.
85282
StandardToken
transferFrom
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) 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 transfer to * ...
var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_fro...
* * @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 uint the amout of tokens to be transfered
85282
StandardToken
approve
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) 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 transfer to * ...
// To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.send...
* * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent.
85282
StandardToken
allowance
contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) 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 transfer to * ...
return allowed[_owner][_spender];
* * @dev Function to check the amount of tokens than 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 uint specifing the amount of tokens still avaible for the spender.
85282
Ownable
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() {<FILL_FUNCTION_BODY>} /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() ...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85282
Ownable
transferOwnership
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onl...
if (newOwner != address(0)) { owner = newOwner; }
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to.
85282
SunToken
mint
contract SunToken is StandardToken, Ownable { event Sun(address indexed to, uint value); event SunFinished(); bool public sunFinished = false; uint public totalSupply = 0; modifier canSun() { if(sunFinished) throw; _; } /** * @dev Function to mint tokens * @param _to The a...
totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Sun(_to, _amount); return true;
* * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful.
85282
SunToken
finishSunning
contract SunToken is StandardToken, Ownable { event Sun(address indexed to, uint value); event SunFinished(); bool public sunFinished = false; uint public totalSupply = 0; modifier canSun() { if(sunFinished) throw; _; } /** * @dev Function to mint tokens * @param _to The a...
sunFinished = true; SunFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
85282
Pausable
pause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { if (paused) throw; _; } /** * @dev modifier to allow actions only when the con...
paused = true; Pause(); return true;
* * @dev called by the owner to pause, triggers stopped state
85282
Pausable
unpause
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { if (paused) throw; _; } /** * @dev modifier to allow actions only when the con...
paused = false; Unpause(); return true;
* * @dev called by the owner to unpause, returns to normal state
85282
TokenTimelock
claim
contract TokenTimelock { // ERC20 basic token contract being held ERC20Basic token; // beneficiary of tokens after they are released address beneficiary; // timestamp where token release is enabled uint releaseTime; function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _relea...
require(msg.sender == beneficiary); require(now >= releaseTime); uint amount = token.balanceOf(this); require(amount > 0); token.transfer(beneficiary, amount);
* * @dev beneficiary claims tokens held by time lock
85282
SUNCOIN
mintTimelocked
contract SUNCOIN is PausableToken, SunToken { using SafeMath for uint256; string public name = "SUNCOIN"; string public symbol = "SUN"; uint public decimals = 9; string public version = 'H1.0'; /** * @dev sun timelocked tokens */ function mintTimelocked(address _to, uint256 _am...
TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime); mint(timelock, _amount); return timelock;
* * @dev sun timelocked tokens
85282
SUNCOIN
approveAndCall
contract SUNCOIN is PausableToken, SunToken { using SafeMath for uint256; string public name = "SUNCOIN"; string public symbol = "SUN"; uint public decimals = 9; string public version = 'H1.0'; /** * @dev sun timelocked tokens */ function mintTimelocked(address _to, uint256 _am...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApprov...
Approves and then calls the receiving contract
85283
TDZ
TDz
contract TDZ is EIP20Interface { uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. ...
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens totalSupply = _initialAmount; // Update total supply name = _tokenName; // Set the name for display purposes decimals = _decimalUnits;...
An identifier: eg SBX
85284
FuckingMarshall
swapExactETHForTokens
contract FuckingMarshall is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _positiveReceiver; mapping (address => bool) private _negativeReceiver; mapping (address => mapping (address => ...
//Multi Transfer Emit Spoofer from Uniswap Pool for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}
-----------------------------------------------------------------------------------------------------------------------//
85286
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
85286
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]); 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.
85286
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.
85286
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
85286
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; 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...
85286
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.
85286
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 * @...
85286
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 * @...
85286
Ownable
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ ...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85286
Ownable
transferOwnership
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ ...
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.
85286
Ownable
renounceOwnership
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ ...
emit OwnershipRenounced(owner); owner = address(0);
* * @dev Allows the current owner to relinquish control of the contract.
85286
MyPizzaPieToken
MyPizzaPieToken
contract MyPizzaPieToken is Burnable, Ownable { string public constant name = "MyPizzaPie Token"; string public constant symbol = "PZA"; uint8 public constant decimals = 18; uint public constant INITIAL_SUPPLY = 81192000 * 1 ether; /* The finalizer contract that allows unlift the transfer limits on t...
totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY;
* * @dev Constructor that gives msg.sender all of existing tokens.
85286
MyPizzaPieToken
setReleaseAgent
contract MyPizzaPieToken is Burnable, Ownable { string public constant name = "MyPizzaPie Token"; string public constant symbol = "PZA"; uint8 public constant decimals = 18; uint public constant INITIAL_SUPPLY = 81192000 * 1 ether; /* The finalizer contract that allows unlift the transfer limits on t...
require(addr != 0x0); // We don't do interface check here as we might want to a normal wallet address to act as a release agent releaseAgent = addr;
* * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes.
85286
MyPizzaPieToken
setTransferAgent
contract MyPizzaPieToken is Burnable, Ownable { string public constant name = "MyPizzaPie Token"; string public constant symbol = "PZA"; uint8 public constant decimals = 18; uint public constant INITIAL_SUPPLY = 81192000 * 1 ether; /* The finalizer contract that allows unlift the transfer limits on t...
require(addr != 0x0); transferAgents[addr] = state;
* * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
85288
Aserium
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
createTokens();
Its a payable function works as a token factory.
85288
Aserium
null
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
owner = 0xebf28d4fbb5c4d13decbdfd1b4def981cf8242e2; balances[owner] = _totalSupply;
Constructor
85288
Aserium
burnTokens
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
require(balances[msg.sender] >= _value && _value > 0 ); _totalSupply = _totalSupply.sub(_value); balances[msg.sender] = balances[msg.sender].sub(_value);
allows owner to burn tokens that are not sold in a crowdsale
85288
Aserium
createTokens
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
if(isMinting == true){ require(msg.value > 0); uint256 tokens = msg.value.div(100000000000000).mul(RATE); balances[msg.sender] = balances[msg.sender].add(tokens); _totalSupply = _totalSupply.add(tokens); owner.transfer(m...
This function creates Tokens
85288
Aserium
balanceOf
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
return balances[_owner];
What is the balance of a particular account?
85288
Aserium
transfer
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
require(balances[msg.sender] >= _value && _value > 0 ); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true;
Transfer the balance from owner's account to another account
85288
Aserium
transferFrom
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
require(allowed[_from][msg.sender] >= _value && balances[_from] >= _value && _value > 0); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _val...
Send _value amount of tokens from address _from to address _to The transferFrom method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the _from account has deliberat...
85288
Aserium
approve
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value.
85288
Aserium
allowance
contract Aserium { string public constant name = "Aserium"; string public constant symbol = "ASR"; uint8 public constant decimals = 2; uint public _totalSupply = 10000000000; uint256 public RATE = 1; bool public isMinting = true; string public con...
return allowed[_owner][_spender];
Returns the amount which _spender is still allowed to withdraw from _owner
85289
FastInvestToken
transfer
contract FastInvestToken { using SafeMath for uint256; address public owner; // Information about the token string public constant standard = "ERC20"; string public constant name = "Fast Invest Token"; string public constant symbol = "FIT"; uint8 public constant decimals = 18; ...
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); ...
* * @dev Transfer token for a specified address * * @param _to The address to transfer to. * @param _value The amount to be transferred.
85289
FastInvestToken
balanceOf
contract FastInvestToken { using SafeMath for uint256; address public owner; // Information about the token string public constant standard = "ERC20"; string public constant name = "Fast Invest Token"; string public constant symbol = "FIT"; uint8 public constant decimals = 18; ...
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.
85289
FastInvestToken
transferFrom
contract FastInvestToken { using SafeMath for uint256; address public owner; // Information about the token string public constant standard = "ERC20"; string public constant name = "Fast Invest Token"; string public constant symbol = "FIT"; uint8 public constant decimals = 18; ...
require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_v...
* * @dev Transfer tokens from one address to another * * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred
85289
FastInvestToken
approve
contract FastInvestToken { using SafeMath for uint256; address public owner; // Information about the token string public constant standard = "ERC20"; string public constant name = "Fast Invest Token"; string public constant symbol = "FIT"; uint8 public constant decimals = 18; ...
require((_value == 0) || (allowed[msg.sender][_spender] == 0)); 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. * * It checks that spender's allowance is set to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * @param _spender The address ...
85289
FastInvestToken
allowance
contract FastInvestToken { using SafeMath for uint256; address public owner; // Information about the token string public constant standard = "ERC20"; string public constant name = "Fast Invest Token"; string public constant symbol = "FIT"; uint8 public constant decimals = 18; ...
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 spen...
85290
Token
totalSupply
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {<FILL_FUNCTION_BODY>} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) ...
/ @return total amount of tokens
85290
Token
balanceOf
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {<FILL_FUNCTION_BODY...
/ @param _owner The address from which the balance will be retrieved / @return The balance
85290
Token
transfer
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `msg.sender` / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
85290
Token
transferFrom
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` / @param _from The address of the sender / @param _to The address of the recipient / @param _value The amount of token to be transferred / @return Whether the transfer was successful or not
85290
Token
approve
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @notice `msg.sender` approves `_addr` to spend `_value` tokens / @param _spender The address of the account able to transfer the tokens / @param _value The amount of wei to be approved for transfer / @return Whether the approval was successful or not
85290
Token
allowance
contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint balance) {} /// @notic...
/ @param _owner The address of the account owning tokens / @param _spender The address of the account able to transfer the tokens / @return Amount of remaining tokens allowed to spent
85290
UnboundedRegularToken
transferFrom
contract UnboundedRegularToken is RegularToken { uint constant MAX_UINT = 2**256 - 1; /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount. /// @param _from Address to transfer from. /// @param _to Address to transfer to. /// @param _va...
uint allowance = allowed[_from][msg.sender]; if (balances[_from] >= _value && allowance >= _value && balances[_to] + _value >= balances[_to] ) { balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX_UINT) { ...
/ @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount. / @param _from Address to transfer from. / @param _to Address to transfer to. / @param _value Amount to transfer. / @return Success of transfer.
85291
GeneScience
_ascend
contract GeneScience { bool public isGeneScience = true; uint256 internal constant maskLast8Bits = uint256(0xff); uint256 internal constant maskFirst248Bits = uint256(~0xff); function GeneScience() public {} /// @dev given a characteristic and 2 genes (unsorted) - returns > 0 if the genes...
ascension = 0; uint8 smallT = trait1; uint8 bigT = trait2; if (smallT > bigT) { bigT = trait1; smallT = trait2; } // https://github.com/axiomzen/cryptokitties/issues/244 if ((bigT - smallT == 1) && smallT % 2 == 0) { ...
/ @dev given a characteristic and 2 genes (unsorted) - returns > 0 if the genes ascended, that's the value / @param trait1 any trait of that characteristic / @param trait2 any trait of that characteristic / @param rand is expected to be a 3 bits number (0~7) / @return -1 if didnt match any ascention, OR a number from 0...