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
85379
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.
85379
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.
85379
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
85379
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 this ...
85379
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.
85379
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 * @param ...
85379
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...
uint256 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 * @param ...
85379
MintableToken
mint
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _;...
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.
85379
MintableToken
finishMinting
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _;...
mintingFinished = true; emit MintFinished(); return true;
* * @dev Function to stop minting new tokens. * @return True if the operation was successful.
85379
Crowdsale
null
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
require(_wallet != address(0)); wallet = _wallet;
* * @param _wallet Address where collected funds will be forwarded to
85379
Crowdsale
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
buyTokens(msg.sender);
----------------------------------------- Crowdsale external interface ----------------------------------------- * * @dev fallback function ***DO NOT OVERRIDE***
85379
Crowdsale
buyTokens
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); emit TokenPurc...
* * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase
85379
Crowdsale
_preValidatePurchase
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
require(_beneficiary != address(0)); require(_weiAmount != 0);
----------------------------------------- Internal interface (extensible) ----------------------------------------- * * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the ...
85379
Crowdsale
_postValidatePurchase
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
// optional override
* * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase
85379
Crowdsale
_deliverTokens
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
token.safeTransfer(_beneficiary, _tokenAmount);
* * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted
85379
Crowdsale
_processPurchase
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
_deliverTokens(_beneficiary, _tokenAmount);
* * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased
85379
Crowdsale
_updatePurchasingState
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
// optional override
* * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase
85379
Crowdsale
_getTokenAmount
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
return _weiAmount.mul(rate);
* * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount
85379
Crowdsale
_forwardFunds
contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and i...
wallet.transfer(msg.value);
* * @dev Determines how ETH is stored/forwarded on purchases.
85379
TimedCrowdsale
null
contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { // solium-disable-next-line security/no-block-members require(block.timestamp >= ...
// solium-disable-next-line security/no-block-members require(_openingTime >= block.timestamp); require(_closingTime >= _openingTime); openingTime = _openingTime; closingTime = _closingTime;
* * @dev Constructor, takes crowdsale opening and closing times. * @param _openingTime Crowdsale opening time * @param _closingTime Crowdsale closing time
85379
TimedCrowdsale
hasClosed
contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { // solium-disable-next-line security/no-block-members require(block.timestamp >= ...
// solium-disable-next-line security/no-block-members return block.timestamp > closingTime;
* * @dev Checks whether the period in which the crowdsale is open has already elapsed. * @return Whether crowdsale period has elapsed
85379
TimedCrowdsale
_preValidatePurchase
contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { // solium-disable-next-line security/no-block-members require(block.timestamp >= ...
super._preValidatePurchase(_beneficiary, _weiAmount);
* * @dev Extend parent behavior requiring to be within contributing period * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed
85379
MintedCrowdsale
_deliverTokens
contract MintedCrowdsale is Crowdsale { /** * @dev Overrides delivery by minting tokens upon purchase. * @param _beneficiary Token purchaser * @param _tokenAmount Number of tokens to be minted */ function _deliverTokens( address _beneficiary, uint256 _tokenAmount ) internal ...
require(MintableToken(token).mint(_beneficiary, _tokenAmount));
* * @dev Overrides delivery by minting tokens upon purchase. * @param _beneficiary Token purchaser * @param _tokenAmount Number of tokens to be minted
85379
PostDeliveryCrowdsale
withdrawTokens
contract PostDeliveryCrowdsale is TimedCrowdsale { using SafeMath for uint256; mapping(address => uint256) public balances; /** * @dev Withdraw tokens only after crowdsale ends. */ function withdrawTokens() public {<FILL_FUNCTION_BODY>} /** * @dev Overrides parent by storing balances in...
require(hasClosed()); uint256 amount = balances[msg.sender]; require(amount > 0); balances[msg.sender] = 0; _deliverTokens(msg.sender, amount);
* * @dev Withdraw tokens only after crowdsale ends.
85379
PostDeliveryCrowdsale
_processPurchase
contract PostDeliveryCrowdsale is TimedCrowdsale { using SafeMath for uint256; mapping(address => uint256) public balances; /** * @dev Withdraw tokens only after crowdsale ends. */ function withdrawTokens() public { require(hasClosed()); uint256 amount = balances[msg.sender]; requ...
balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount);
* * @dev Overrides parent by storing balances instead of issuing tokens right away. * @param _beneficiary Token purchaser * @param _tokenAmount Amount of tokens purchased
85379
FinalizableCrowdsale
finalize
contract FinalizableCrowdsale is TimedCrowdsale, Ownable { using SafeMath for uint256; bool public isFinalized = false; event Finalized(); /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finali...
require(!isFinalized); require(token != address(0x0)); require(hasClosed()); finalization(); emit Finalized(); isFinalized = true;
* * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function.
85379
FinalizableCrowdsale
finalization
contract FinalizableCrowdsale is TimedCrowdsale, Ownable { using SafeMath for uint256; bool public isFinalized = false; event Finalized(); /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finali...
* * @dev Can be overridden to add finalization logic. The overriding function * should call super.finalization() to ensure the chain of finalization is * executed entirely.
85379
CappedTokenCrowdsale
null
contract CappedTokenCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public tokenCap; uint256 public tokensSold; /** * @dev Constructor, takes maximum amount of tokens to be sold in the crowdsale. * @param _tokenCap Max amount of tokens to be sold */ constructor(uint256 _toke...
require(_tokenCap > 0); tokenCap = _tokenCap;
* * @dev Constructor, takes maximum amount of tokens to be sold in the crowdsale. * @param _tokenCap Max amount of tokens to be sold
85379
CappedTokenCrowdsale
tokenCapReached
contract CappedTokenCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public tokenCap; uint256 public tokensSold; /** * @dev Constructor, takes maximum amount of tokens to be sold in the crowdsale. * @param _tokenCap Max amount of tokens to be sold */ constructor(uint256 _toke...
return tokensSold >= tokenCap;
* * @dev Checks whether the cap has been reached. * @return Whether the cap was reached
85379
CappedTokenCrowdsale
_preValidatePurchase
contract CappedTokenCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public tokenCap; uint256 public tokensSold; /** * @dev Constructor, takes maximum amount of tokens to be sold in the crowdsale. * @param _tokenCap Max amount of tokens to be sold */ constructor(uint256 _toke...
super._preValidatePurchase(_beneficiary, _weiAmount); require(!tokenCapReached());
* * @dev Extend parent behavior requiring purchase to respect the token cap. * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed
85379
CappedTokenCrowdsale
_processPurchase
contract CappedTokenCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public tokenCap; uint256 public tokensSold; /** * @dev Constructor, takes maximum amount of tokens to be sold in the crowdsale. * @param _tokenCap Max amount of tokens to be sold */ constructor(uint256 _toke...
tokensSold = tokensSold.add(_tokenAmount); super._processPurchase(_beneficiary, _tokenAmount);
* * @dev Overrides parent to increase the number of tokensSold. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased
85379
IncreasingTokenPriceCrowdsale
null
contract IncreasingTokenPriceCrowdsale is TimedCrowdsale { using SafeMath for uint256; uint256 public initialRate; uint256 public finalRate; /** * @dev Constructor, takes initial and final rates of wei contributed per token. * @param _initialRate Number of wei it costs for one token at the star...
require(_finalRate >= _initialRate); require(_initialRate > 0); initialRate = _initialRate; finalRate = _finalRate;
* * @dev Constructor, takes initial and final rates of wei contributed per token. * @param _initialRate Number of wei it costs for one token at the start of the crowdsale * @param _finalRate Number of wei it costs for one token at the end of the crowdsale
85379
IncreasingTokenPriceCrowdsale
getCurrentRate
contract IncreasingTokenPriceCrowdsale is TimedCrowdsale { using SafeMath for uint256; uint256 public initialRate; uint256 public finalRate; /** * @dev Constructor, takes initial and final rates of wei contributed per token. * @param _initialRate Number of wei it costs for one token at the star...
// solium-disable-next-line security/no-block-members uint256 elapsedTime = block.timestamp.sub(openingTime); uint256 timeRange = closingTime.sub(openingTime); uint256 rateRange = finalRate.sub(initialRate); return initialRate.add(elapsedTime.mul(rateRange).div(timeRange));
* * @dev Returns the rate of wei per token at the present time. * @return The number of wei it costs for one token at a given time
85379
IncreasingTokenPriceCrowdsale
_getTokenAmount
contract IncreasingTokenPriceCrowdsale is TimedCrowdsale { using SafeMath for uint256; uint256 public initialRate; uint256 public finalRate; /** * @dev Constructor, takes initial and final rates of wei contributed per token. * @param _initialRate Number of wei it costs for one token at the star...
uint256 currentRate = getCurrentRate(); return _weiAmount.div(currentRate);
* * @dev Overrides parent method taking into account variable rate. * @param _weiAmount The value in wei to be converted into tokens * @return The number of tokens _weiAmount wei will buy at present time
85379
FOIChainCrowdsale
null
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
* * @dev Constructor, creates crowdsale contract with wallet to send funds to, * an opening and closing time, an initialRate and finalRate, and a token cap.
85379
FOIChainCrowdsale
updateTokenAddress
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
require(!isFinalized); require(_token.owner() == address(this)); token = _token;
* * @dev Allows the owner to update the address of the to-be-written FOI token contract. * When the pre-sale is over, this contract will mint the tokens for people who purchased * in the pre-sale. * Make sure that this contract is the owner of the token contract. * @param _token The address of the F...
85379
FOIChainCrowdsale
_preValidatePurchase
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
super._preValidatePurchase(_beneficiary, _weiAmount); uint256 currentRate = getCurrentRate(); uint256 tokenAmount = _weiAmount.div(currentRate); require(tokenAmount > 0);
* * @dev Validate that enough ether was sent to buy at least one token. * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei sent to the contract
85379
FOIChainCrowdsale
getTokenAmount
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
return _getTokenAmount(_weiAmount);
* * @dev Public function for getting the number of tokens _weiAmount contributed would purchase. * @param _weiAmount Amount of wei sent to the contract * @return Number of tokens _weiAmount contributed would purchase
85379
FOIChainCrowdsale
_getTokenAmount
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
uint256 tokenAmount = super._getTokenAmount(_weiAmount); uint256 unsold = unsoldTokens(); if(tokenAmount > unsold) { tokenAmount = unsold; } return tokenAmount;
* * @dev Overrides parent method taking into account the token cap. * @param _weiAmount Amount of wei sent to the contract * @return Number of tokens _weiAmount contributed would purchase
85379
FOIChainCrowdsale
unsoldTokens
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
return tokenCap.sub(tokensSold);
* * @dev Calculates how many tokens have not been sold in the pre-sale * @return Number of tokens that have not been sold in the pre-sale.
85379
FOIChainCrowdsale
getBalance
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
return balances[_user];
* * @dev Gets the balance of the specified address. * @param _user The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address.
85379
FOIChainCrowdsale
_processPurchase
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
super._processPurchase(_beneficiary, _tokenAmount); uint256 currentRate = getCurrentRate(); uint256 weiSpent = currentRate.mul(_tokenAmount); uint256 weiAmount = msg.value; uint256 refund = weiAmount.sub(weiSpent); if(refund > 0) { weiRaised = weiRaised.sub(refund)...
* * @dev Overrides parent to calculate how much extra wei was sent, and issues a refund. * @param _beneficiary Token purchaser * @param _tokenAmount Amount of tokens purchased
85379
FOIChainCrowdsale
_forwardFunds
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
wallet.transfer(address(this).balance);
* * @dev Overrides parent to forward the complete balance to the wallet. * This contract should never contain any ether.
85379
FOIChainCrowdsale
withdrawTokens
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
require(isFinalized); super.withdrawTokens();
* * @dev Overrides parent to only allow withdraws after the pre-sale has been finalized.
85379
FOIChainCrowdsale
finalization
contract FOIChainCrowdsale is TimedCrowdsale, MintedCrowdsale, IncreasingTokenPriceCrowdsale, PostDeliveryCrowdsale, CappedTokenCrowdsale, FinalizableCrowdsale { using SafeMath for uint256; address constant internal walletAddress = 0x870c6bd22325673D28d9a5da465dFef3073AB3E7; uint256 constant internal start...
uint256 reserve = 50000; uint256 remaining = tokenCap.sub(tokensSold).add(reserve); balances[wallet] = balances[wallet].add(remaining); super.finalization();
* * @dev Overrides parent to perform custom finalization logic. * After the pre-sale is over, 50,000 tokens will be allocated to the FOI organization * to support the on-going development of the FOI smart contract and web app front end. * Note that any unsold tokens will also be allocated to the FOI org...
85381
Context
null
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal {<FILL_FUNCTION_BODY>} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal v...
Empty internal constructor, to prevent people from mistakenly deploying an instance of this contract, which should be used via inheritance.
85381
Context
_msgSender
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (addres...
return msg.sender;
solhint-disable-previous-line no-empty-blocks
85381
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.
85381
Ownable
owner
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
return _owner;
* * @dev Returns the address of the current owner.
85381
Ownable
isOwner
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
return _msgSender() == _owner;
* * @dev Returns true if the caller is the current owner.
85381
Ownable
renounceOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
emit OwnershipTransferred(_owner, address(0)); _owner = address(0);
* * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the ...
85381
Ownable
transferOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
_transferOwnership(newOwner);
* * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner.
85381
Ownable
_transferOwnership
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner;
* * @dev Transfers ownership of the contract to a new account (`newOwner`).
85381
MonthlyTokenVesting
null
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
require( beneficiary != address(0), "TokenVesting: beneficiary is the zero address" ); require(duration > 0, "TokenVesting: duration is 0"); // if announced as releaser - should implement interface require( !beneficiaryIsReleaser || IReleaser(beneficiary).isReleaser(), ...
* * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * beneficiary, gradually in a linear fashion until start + duration. By then all * of the balance will have vested. * @param beneficiary address of the beneficiary to whom vested tokens are transferred * @param clif...
85381
MonthlyTokenVesting
beneficiary
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _beneficiary;
* * @return the beneficiary of the tokens.
85381
MonthlyTokenVesting
cliff
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _cliff;
* * @return the cliff time of the token vesting.
85381
MonthlyTokenVesting
start
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _start;
* * @return the start time of the token vesting.
85381
MonthlyTokenVesting
duration
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _duration;
* * @return the duration of the token vesting.
85381
MonthlyTokenVesting
released
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _released[token];
* * @return the amount of the token released.
85381
MonthlyTokenVesting
claim
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
require(_start > 0, "TokenVesting: start is not set"); uint256 unreleased = _releasableAmount(token); require(unreleased > 0, "TokenVesting: no tokens are due"); _released[address(token)] = _released[address(token)].add(unreleased); token.safeTransfer(_beneficiary, unreleased); if...
* * @notice Transfers vested tokens to beneficiary. * @param token ERC20 token which is being vested
85381
MonthlyTokenVesting
_releasableAmount
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
return _vestedAmount(token).sub(_released[address(token)]);
* * @dev Calculates the amount that has already vested but hasn't been released yet. * @param token ERC20 token which is being vested
85381
MonthlyTokenVesting
_vestedAmount
contract MonthlyTokenVesting is IReleaser, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; event TokensReleased(address token, uint256 amount); address public _beneficiary; bool public _beneficiaryIsReleaser; // Durations and timestamps are expressed in UNIX time, the same unit...
uint256 currentBalance = token.balanceOf(address(this)); uint256 totalBalance = currentBalance.add(_released[address(token)]); if (block.timestamp < _cliff) { return 0; } else if (block.timestamp >= _cliff.add(_duration)) { return totalBalance; } else { uint256 elapsed =...
* * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested
85384
Context
_msgSender
contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) {<FILL_FUNCTION_BODY>} }
return msg.sender;
solhint-disable-previous-line no-empty-blocks
85385
StandardToken
transfer
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
require(_to != address(0)); require(balances[msg.sender] >= _value && balances[_to].add(_value) >= balances[_to]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return...
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
85385
StandardToken
balanceOf
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
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.
85385
StandardToken
transferFrom
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
require(_to != address(0)); 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 Transfer(_from, _to, _...
* * @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
85385
StandardToken
approve
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
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...
85385
StandardToken
allowance
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
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.
85385
StandardToken
increaseApproval
contract StandardToken is Token { using SafeMath for uint256; mapping(address => mapping (address => uint256)) internal allowed; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amoun...
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
85386
LetsBreakThings
deposit
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable {<FILL_FUNCTION_BODY>} // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _prox...
Fallback function
85386
LetsBreakThings
null
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public {<FILL_FUNCTION_BODY>} /// create events to log everything as...
creator = msg.sender; creatorproxy = _proxy;
constructor
85386
LetsBreakThings
getBlockHash
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
// blockHash() for later versions logBlockDetails(); logGasDetails(); logGasDetails(); logSenderDetails(); return block.blockhash(_blockNumber);
deprecated in version 0.4.22 and replaced by blockhash(uint blockNumber).
85386
LetsBreakThings
logSenderDetails
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
emit txSenderDetails(msg.sender, tx.origin);
/ @dev Emits details about the origin of a transaction. / @dev This includes sender and tx origin
85386
LetsBreakThings
logGasDetails
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
emit gasDetails(msg.gas, tx.gasprice, block.gaslimit); // gasLeft() in later versions
/ @dev logs the gas, gasprice and block gaslimit
85386
LetsBreakThings
logBlockDetails
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
emit blockDetails(block.coinbase, block.difficulty, block.number, block.timestamp);
/ @dev logs the coinbase difficulty number and timestamp for the block
85386
LetsBreakThings
checkBalanceSendEth
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
require(creator == msg.sender, "unauthorized"); /// log balance at the start checkBalance(_recipient); /// transfer recipient smallest unit possible /// solium-disable-next-line _recipient.transfer(1); /// log balance che...
/ @dev Test function number 1
85386
LetsBreakThings
checkBalance
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
uint256 balance = address(_target).balance; emit balanceLog(_target, balance); return balance;
/ @dev internal function to check balance for an address and emit log event
85386
LetsBreakThings
verifyBlockHash
contract LetsBreakThings { address public creator; address public creatorproxy; // Fallback function function deposit() public payable { } // constructor constructor(address _proxy) public { creator = msg.sender; creatorproxy = _proxy; } ...
bytes32 hash1 = keccak256(_hash); bytes32 hash2 = getBlockHash(_blockNumber); return(hash1, hash2) ;
/ @dev lets verify some block hashes against each other on chain
85387
Ownable
null
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as th...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85387
FlokiSanta
null
contract FlokiSanta is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => boo...
to recieve ETH from uniswapV2Router when swaping
85387
FlokiSanta
_tokenTransfer
contract FlokiSanta is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => boo...
if (!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!...
this method is responsible for taking all fee, if takeFee is true
85388
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() {<FILL_FUNCTION_BODY>} /** ...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
85388
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() { 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.
85388
PricingStrategy
isPricingStrategy
contract PricingStrategy { address public tier; /** Interface declaration. */ function isPricingStrategy() public constant returns (bool) {<FILL_FUNCTION_BODY>} /** Self check if all references are correctly set. * * Checks that pricing strategy matches crowdsale parameters. */ function...
return true;
* Interface declaration.
85388
PricingStrategy
isSane
contract PricingStrategy { address public tier; /** Interface declaration. */ function isPricingStrategy() public constant returns (bool) { return true; } /** Self check if all references are correctly set. * * Checks that pricing strategy matches crowdsale parameters. */ functi...
return true;
* Self check if all references are correctly set. * * Checks that pricing strategy matches crowdsale parameters.
85388
PricingStrategy
isPresalePurchase
contract PricingStrategy { address public tier; /** Interface declaration. */ function isPricingStrategy() public constant returns (bool) { return true; } /** Self check if all references are correctly set. * * Checks that pricing strategy matches crowdsale parameters. */ functi...
return false;
* * @dev Pricing tells if this is a presale purchase or not. @param purchaser Address of the purchaser @return False by default, true if a presale purchaser
85388
FlatPricingExt
calculatePrice
contract FlatPricingExt is PricingStrategy, Ownable { using SafeMathLibExt for uint; /* How many weis one token costs */ uint public oneTokenInWei; // Crowdsale rate has been changed event RateChanged(uint newOneTokenInWei); modifier onlyTier() { if (msg.sender != address(tier)) throw; ...
uint multiplier = 10 ** decimals; return value.times(multiplier) / oneTokenInWei;
* * Calculate the current price for buy in amount. *
85389
Ownable
transferOwnership
contract Ownable is OwnableData { // E1: OK event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } // F1 - F9: OK // C1 - C21: OK function transf...
if (direct) { // Checks require(newOwner != address(0) || renounce, "Ownable: zero address"); // Effects emit OwnershipTransferred(owner, newOwner); owner = newOwner; } else { // Effects pendingOwner = newOwner; ...
F1 - F9: OK C1 - C21: OK
85389
Ownable
claimOwnership
contract Ownable is OwnableData { // E1: OK event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } // F1 - F9: OK // C1 - C21: OK function transf...
address _pendingOwner = pendingOwner; // Checks require(msg.sender == _pendingOwner, "Ownable: caller != pending owner"); // Effects emit OwnershipTransferred(owner, _pendingOwner); owner = _pendingOwner; pendingOwner = address(0);
F1 - F9: OK C1 - C21: OK
85392
safeSend
doSafeSend
contract safeSend { bool private txMutex3847834; // we want to be able to call outside contracts (e.g. the admin proxy contract) // but reentrency is bad, so here's a mutex. function doSafeSend(address toAddr, uint amount) internal {<FILL_FUNCTION_BODY>} function doSafeSendWData(address toA...
doSafeSendWData(toAddr, "", amount);
we want to be able to call outside contracts (e.g. the admin proxy contract) but reentrency is bad, so here's a mutex.
85392
CanReclaimToken
reclaimToken
contract CanReclaimToken is owned { /** * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract */ function reclaimToken(ERC20Interface token) external only_owner {<FILL_FUNCTION_BODY>} }
uint256 balance = token.balanceOf(this); require(token.approve(owner, balance));
* * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract
85392
hasAdmins
incAdminEpoch
contract hasAdmins is owned { mapping (uint => mapping (address => bool)) admins; uint public currAdminEpoch = 0; bool public adminsDisabledForever = false; address[] adminLog; event AdminAdded(address indexed newAdmin); event AdminRemoved(address indexed oldAdmin); event AdminEpoch...
currAdminEpoch++; admins[currAdminEpoch][msg.sender] = true; emit AdminEpochInc();
safety feature if admins go bad or something
85392
hasAdmins
disableAdminForever
contract hasAdmins is owned { mapping (uint => mapping (address => bool)) admins; uint public currAdminEpoch = 0; bool public adminsDisabledForever = false; address[] adminLog; event AdminAdded(address indexed newAdmin); event AdminRemoved(address indexed oldAdmin); event AdminEpoch...
currAdminEpoch++; adminsDisabledForever = true; emit AdminDisabledForever();
this is internal so contracts can all it, but not exposed anywhere in this contract.
85392
EnsOwnerProxy
null
contract EnsOwnerProxy is hasAdmins { bytes32 public ensNode; ENSIface public ens; PublicResolver public resolver; /** * @param _ensNode The node to administer * @param _ens The ENS Registrar * @param _resolver The ENS Resolver */ constructor(bytes32 _ensNode, ENSIface...
ensNode = _ensNode; ens = _ens; resolver = _resolver;
* * @param _ensNode The node to administer * @param _ens The ENS Registrar * @param _resolver The ENS Resolver
85392
permissioned
upgradeMe
contract permissioned is owned, hasAdmins { mapping (address => bool) editAllowed; bool public adminLockdown = false; event PermissionError(address editAddr); event PermissionGranted(address editAddr); event PermissionRevoked(address editAddr); event PermissionsUpgraded(address oldSC, ad...
editAllowed[msg.sender] = false; editAllowed[newSC] = true; emit SelfUpgrade(msg.sender, newSC);
always allow SCs to upgrade themselves, even after lockdown
85392
BBFarm
null
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
// this bbFarm requires v5 of BBLib (note: v4 deprecated immediately due to insecure submitProxyVote) // note: even though we can't test for this in coverage, this has stopped me deploying to kovan with the wrong version tho, so I consider it tested :) assert(BBLib.getVersion() == 6); ...
Constructor
85392
BBFarm
_getPayTo
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
return owner;
base SCs
85392
BBFarm
getNamespace
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
return NAMESPACE;
global funcs
85392
BBFarm
getDb
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
// cut off anything above 224 bits (where the namespace goes) return dbs[uint224(ballotId)];
db lookup helper
85392
BBFarm
initBallot
contract BBFarm is BBFarmIface { using BBLib for BBLib.DB; using IxLib for IxIface; // namespaces should be unique for each bbFarm bytes4 constant NAMESPACE = 0x00000001; // last 48 bits uint256 constant BALLOT_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;...
// calculate the ballotId based on the last 224 bits of the specHash. ballotId = uint224(specHash) ^ (uint256(NAMESPACE) << 224); // we need to call the init functions on our libraries getDb(ballotId).init(specHash, packed, ix, bbAdmin, bytes16(uint128(extraData))); nBallot...
Init ballot