comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.4.24;
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
}
function sub(uint a, uint b) internal pure returns (uint c) {
}
function mul(uint a, uint b) internal pure returns (uint c) {
}
function div(uint a, uint b) internal pure returns (uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Ownership contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
// transfer Ownership to other address
function transferOwnership(address _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and an
// initial fixed supply
// ----------------------------------------------------------------------------
contract ElectriqNetwork is ERC20Interface, Owned {
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public RATE;
uint public DENOMINATOR;
bool public isStopped = false;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Mint(address indexed to, uint256 amount);
event ChangeRate(uint256 amount);
modifier onlyWhenRunning {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ----------------------------------------------------------------------------
// It invokes when someone sends ETH to this contract address
// ----------------------------------------------------------------------------
function() public payable {
}
// ----------------------------------------------------------------------------
// Low level token purchase function
// tokens are transferred to user
// ETH are transferred to current owner
// ----------------------------------------------------------------------------
function getTokens() onlyWhenRunning public payable {
require(msg.value > 0);
uint tokens = msg.value.mul(RATE).div(DENOMINATOR);
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].add(tokens);
balances[owner] = balances[owner].sub(tokens);
emit Transfer(owner, msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
}
// ------------------------------------------------------------------------
// 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)
// _spender The address which will spend the funds.
// _addedValue The amount of tokens to increase the allowance by.
// ------------------------------------------------------------------------
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
// ------------------------------------------------------------------------
// 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)
// _spender The address which will spend the funds.
// _subtractedValue The amount of tokens to decrease the allowance by.
// ------------------------------------------------------------------------
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
// ------------------------------------------------------------------------
// Change the ETH to IO rate
// ------------------------------------------------------------------------
function changeRate(uint256 _rate) public onlyOwner {
}
// ------------------------------------------------------------------------
// Function to mint tokens
// _to The address that will receive the minted tokens.
// _amount The amount of tokens to mint.
// A boolean that indicates if the operation was successful.
// ------------------------------------------------------------------------
function mint(address _to, uint256 _amount) onlyOwner public returns (bool) {
}
// ------------------------------------------------------------------------
// function to stop the ICO
// ------------------------------------------------------------------------
function stopICO() onlyOwner public {
}
// ------------------------------------------------------------------------
// function to resume ICO
// ------------------------------------------------------------------------
function resumeICO() onlyOwner public {
}
}
| balances[owner]>=tokens | 279,339 | balances[owner]>=tokens |
null | pragma solidity ^0.4.21;
/*
* Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply);
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance);
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success);
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success);
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success);
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) constant
public returns (uint256 remaining);
/**
* Logged when tokens were transferred from one owner to another.
*
* @param _from address of the owner, tokens were transferred from
* @param _to address of the owner, tokens were transferred to
* @param _value number of tokens transferred
*/
event Transfer (address indexed _from, address indexed _to, uint256 _value);
/**
* Logged when owner approved his tokens to be transferred by some spender.
*
* @param _owner owner who approved his tokens to be transferred
* @param _spender spender who were allowed to transfer the tokens belonging
* to the owner
* @param _value number of tokens belonging to the owner, approved to be
* transferred by the spender
*/
event Approval (
address indexed _owner, address indexed _spender, uint256 _value);
}
/*
* Safe Math Smart Contract. Copyright © 2016–2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* Provides methods to safely add, subtract and multiply uint256 numbers.
*/
contract SafeMath {
uint256 constant private MAX_UINT256 =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
/**
* Add two uint256 values, throw in case of overflow.
*
* @param x first value to add
* @param y second value to add
* @return x + y
*/
function safeAdd (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Subtract one uint256 value from another, throw in case of underflow.
*
* @param x value to subtract from
* @param y value to subtract
* @return x - y
*/
function safeSub (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Multiply two uint256 values, throw in case of overflow.
*
* @param x first value to multiply
* @param y second value to multiply
* @return x * y
*/
function safeMul (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () public {
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Get number of tokens currently belonging to given owner and available for transfer.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function transferrableBalanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
require(<FILL_ME>)
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
if (!hasAccount[_to]) {
hasAccount[_to] = true;
accountList.push(_to);
}
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
}
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) public constant
returns (uint256 remaining) {
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from address of token holders to a boolean to indicate if they have
* already been added to the system.
*/
mapping (address => bool) internal hasAccount;
/**
* List of available accounts.
*/
address [] internal accountList;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
/**
* Mapping from addresses of token holds which cannot be spent until released.
*/
mapping (address => uint256) internal holds;
}
/**
* Ponder token smart contract.
*/
contract PonderAirdropToken is AbstractToken {
/**
* Address of the owner of this smart contract.
*/
mapping (address => bool) private owners;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new Ponder token smart contract, with given number of tokens issued
* and given to msg.sender, and make msg.sender the owner of this smart
* contract.
*/
function PonderAirdropToken () public {
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply) {
}
/**
* Get name of this token.
*
* @return name of this token
*/
function name () public pure returns (string result) {
}
/**
* Get symbol of this token.
*
* @return symbol of this token
*/
function symbol () public pure returns (string result) {
}
/**
* Get number of decimals for this token.
*
* @return number of decimals for this token
*/
function decimals () public pure returns (uint8 result) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance, this method
* receives assumed current allowance value as an argument. If actual
* allowance differs from an assumed one, this method just returns false.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _currentValue assumed number of tokens currently allowed to be
* transferred
* @param _newValue number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _currentValue, uint256 _newValue)
public returns (bool success) {
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _address of new or existing owner of the smart contract
* @param _value boolean stating if the _address should be an owner or not
*/
function setOwner (address _address, bool _value) public {
}
/**
* Initialize the token holders by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
*/
function initAccounts (address [] _to, uint256 [] _value) public {
}
/**
* Initialize the token holders and hold amounts by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
* @param _holds number of tokens to hold from transferring
*/
function initAccounts (address [] _to, uint256 [] _value, uint256 [] _holds) public {
}
/**
* Set the number of tokens to hold from transferring for a list of
* token holders.
*
* @param _account list of account holders
* @param _value list of token amounts to hold
*/
function setHolds (address [] _account, uint256 [] _value) public {
}
/**
* Get the number of account holders (for owner use)
*
* @return uint256
*/
function getNumAccounts () public constant returns (uint256 count) {
}
/**
* Get a list of account holder eth addresses (for owner use)
*
* @param _start index of the account holder list
* @param _count of items to return
* @return array of addresses
*/
function getAccounts (uint256 _start, uint256 _count) public constant returns (address [] addresses){
}
/**
* Freeze token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
}
/**
* Unfreeze token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Kill the token.
*/
function kill() public {
}
}
| transferrableBalanceOf(msg.sender)>=_value | 279,378 | transferrableBalanceOf(msg.sender)>=_value |
null | pragma solidity ^0.4.21;
/*
* Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply);
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance);
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success);
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success);
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success);
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) constant
public returns (uint256 remaining);
/**
* Logged when tokens were transferred from one owner to another.
*
* @param _from address of the owner, tokens were transferred from
* @param _to address of the owner, tokens were transferred to
* @param _value number of tokens transferred
*/
event Transfer (address indexed _from, address indexed _to, uint256 _value);
/**
* Logged when owner approved his tokens to be transferred by some spender.
*
* @param _owner owner who approved his tokens to be transferred
* @param _spender spender who were allowed to transfer the tokens belonging
* to the owner
* @param _value number of tokens belonging to the owner, approved to be
* transferred by the spender
*/
event Approval (
address indexed _owner, address indexed _spender, uint256 _value);
}
/*
* Safe Math Smart Contract. Copyright © 2016–2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* Provides methods to safely add, subtract and multiply uint256 numbers.
*/
contract SafeMath {
uint256 constant private MAX_UINT256 =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
/**
* Add two uint256 values, throw in case of overflow.
*
* @param x first value to add
* @param y second value to add
* @return x + y
*/
function safeAdd (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Subtract one uint256 value from another, throw in case of underflow.
*
* @param x value to subtract from
* @param y value to subtract
* @return x - y
*/
function safeSub (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Multiply two uint256 values, throw in case of overflow.
*
* @param x first value to multiply
* @param y second value to multiply
* @return x * y
*/
function safeMul (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () public {
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Get number of tokens currently belonging to given owner and available for transfer.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function transferrableBalanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
require(<FILL_ME>)
require (transferrableBalanceOf(_from) >= _value);
allowances [_from][msg.sender] =
safeSub (allowances [_from][msg.sender], _value);
if (_value > 0 && _from != _to) {
accounts [_from] = safeSub (accounts [_from], _value);
if (!hasAccount[_to]) {
hasAccount[_to] = true;
accountList.push(_to);
}
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) public constant
returns (uint256 remaining) {
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from address of token holders to a boolean to indicate if they have
* already been added to the system.
*/
mapping (address => bool) internal hasAccount;
/**
* List of available accounts.
*/
address [] internal accountList;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
/**
* Mapping from addresses of token holds which cannot be spent until released.
*/
mapping (address => uint256) internal holds;
}
/**
* Ponder token smart contract.
*/
contract PonderAirdropToken is AbstractToken {
/**
* Address of the owner of this smart contract.
*/
mapping (address => bool) private owners;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new Ponder token smart contract, with given number of tokens issued
* and given to msg.sender, and make msg.sender the owner of this smart
* contract.
*/
function PonderAirdropToken () public {
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply) {
}
/**
* Get name of this token.
*
* @return name of this token
*/
function name () public pure returns (string result) {
}
/**
* Get symbol of this token.
*
* @return symbol of this token
*/
function symbol () public pure returns (string result) {
}
/**
* Get number of decimals for this token.
*
* @return number of decimals for this token
*/
function decimals () public pure returns (uint8 result) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance, this method
* receives assumed current allowance value as an argument. If actual
* allowance differs from an assumed one, this method just returns false.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _currentValue assumed number of tokens currently allowed to be
* transferred
* @param _newValue number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _currentValue, uint256 _newValue)
public returns (bool success) {
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _address of new or existing owner of the smart contract
* @param _value boolean stating if the _address should be an owner or not
*/
function setOwner (address _address, bool _value) public {
}
/**
* Initialize the token holders by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
*/
function initAccounts (address [] _to, uint256 [] _value) public {
}
/**
* Initialize the token holders and hold amounts by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
* @param _holds number of tokens to hold from transferring
*/
function initAccounts (address [] _to, uint256 [] _value, uint256 [] _holds) public {
}
/**
* Set the number of tokens to hold from transferring for a list of
* token holders.
*
* @param _account list of account holders
* @param _value list of token amounts to hold
*/
function setHolds (address [] _account, uint256 [] _value) public {
}
/**
* Get the number of account holders (for owner use)
*
* @return uint256
*/
function getNumAccounts () public constant returns (uint256 count) {
}
/**
* Get a list of account holder eth addresses (for owner use)
*
* @param _start index of the account holder list
* @param _count of items to return
* @return array of addresses
*/
function getAccounts (uint256 _start, uint256 _count) public constant returns (address [] addresses){
}
/**
* Freeze token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
}
/**
* Unfreeze token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Kill the token.
*/
function kill() public {
}
}
| allowances[_from][msg.sender]>=_value | 279,378 | allowances[_from][msg.sender]>=_value |
null | pragma solidity ^0.4.21;
/*
* Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply);
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance);
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success);
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success);
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success);
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) constant
public returns (uint256 remaining);
/**
* Logged when tokens were transferred from one owner to another.
*
* @param _from address of the owner, tokens were transferred from
* @param _to address of the owner, tokens were transferred to
* @param _value number of tokens transferred
*/
event Transfer (address indexed _from, address indexed _to, uint256 _value);
/**
* Logged when owner approved his tokens to be transferred by some spender.
*
* @param _owner owner who approved his tokens to be transferred
* @param _spender spender who were allowed to transfer the tokens belonging
* to the owner
* @param _value number of tokens belonging to the owner, approved to be
* transferred by the spender
*/
event Approval (
address indexed _owner, address indexed _spender, uint256 _value);
}
/*
* Safe Math Smart Contract. Copyright © 2016–2017 by ABDK Consulting.
* Author: Mikhail Vladimirov <[email protected]>
*/
/**
* Provides methods to safely add, subtract and multiply uint256 numbers.
*/
contract SafeMath {
uint256 constant private MAX_UINT256 =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
/**
* Add two uint256 values, throw in case of overflow.
*
* @param x first value to add
* @param y second value to add
* @return x + y
*/
function safeAdd (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Subtract one uint256 value from another, throw in case of underflow.
*
* @param x value to subtract from
* @param y value to subtract
* @return x - y
*/
function safeSub (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
/**
* Multiply two uint256 values, throw in case of overflow.
*
* @param x first value to multiply
* @param y second value to multiply
* @return x * y
*/
function safeMul (uint256 x, uint256 y)
pure internal
returns (uint256 z) {
}
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () public {
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Get number of tokens currently belonging to given owner and available for transfer.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function transferrableBalanceOf (address _owner) public constant returns (uint256 balance) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
require (allowances [_from][msg.sender] >= _value);
require(<FILL_ME>)
allowances [_from][msg.sender] =
safeSub (allowances [_from][msg.sender], _value);
if (_value > 0 && _from != _to) {
accounts [_from] = safeSub (accounts [_from], _value);
if (!hasAccount[_to]) {
hasAccount[_to] = true;
accountList.push(_to);
}
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance (address _owner, address _spender) public constant
returns (uint256 remaining) {
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from address of token holders to a boolean to indicate if they have
* already been added to the system.
*/
mapping (address => bool) internal hasAccount;
/**
* List of available accounts.
*/
address [] internal accountList;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
/**
* Mapping from addresses of token holds which cannot be spent until released.
*/
mapping (address => uint256) internal holds;
}
/**
* Ponder token smart contract.
*/
contract PonderAirdropToken is AbstractToken {
/**
* Address of the owner of this smart contract.
*/
mapping (address => bool) private owners;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new Ponder token smart contract, with given number of tokens issued
* and given to msg.sender, and make msg.sender the owner of this smart
* contract.
*/
function PonderAirdropToken () public {
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply () public constant returns (uint256 supply) {
}
/**
* Get name of this token.
*
* @return name of this token
*/
function name () public pure returns (string result) {
}
/**
* Get symbol of this token.
*
* @return symbol of this token
*/
function symbol () public pure returns (string result) {
}
/**
* Get number of decimals for this token.
*
* @return number of decimals for this token
*/
function decimals () public pure returns (uint8 result) {
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer (address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom (address _from, address _to, uint256 _value)
public returns (bool success) {
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance, this method
* receives assumed current allowance value as an argument. If actual
* allowance differs from an assumed one, this method just returns false.
*
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _currentValue assumed number of tokens currently allowed to be
* transferred
* @param _newValue number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _currentValue, uint256 _newValue)
public returns (bool success) {
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _address of new or existing owner of the smart contract
* @param _value boolean stating if the _address should be an owner or not
*/
function setOwner (address _address, bool _value) public {
}
/**
* Initialize the token holders by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
*/
function initAccounts (address [] _to, uint256 [] _value) public {
}
/**
* Initialize the token holders and hold amounts by contract owner
*
* @param _to addresses to allocate token for
* @param _value number of tokens to be allocated
* @param _holds number of tokens to hold from transferring
*/
function initAccounts (address [] _to, uint256 [] _value, uint256 [] _holds) public {
}
/**
* Set the number of tokens to hold from transferring for a list of
* token holders.
*
* @param _account list of account holders
* @param _value list of token amounts to hold
*/
function setHolds (address [] _account, uint256 [] _value) public {
}
/**
* Get the number of account holders (for owner use)
*
* @return uint256
*/
function getNumAccounts () public constant returns (uint256 count) {
}
/**
* Get a list of account holder eth addresses (for owner use)
*
* @param _start index of the account holder list
* @param _count of items to return
* @return array of addresses
*/
function getAccounts (uint256 _start, uint256 _count) public constant returns (address [] addresses){
}
/**
* Freeze token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
}
/**
* Unfreeze token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Kill the token.
*/
function kill() public {
}
}
| transferrableBalanceOf(_from)>=_value | 279,378 | transferrableBalanceOf(_from)>=_value |
"token not whitelisted" | //"SPDX-License-Identifier: UNLICENSED"
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract LockUp is Ownable, ReentrancyGuard {
using SafeMath for uint256;
event Deposit(
address indexed _addr,
address indexed _token,
uint256 timestamp,
uint256 amount
);
event Withdrawal(
address indexed _addr,
address indexed _token,
uint256 timestamp,
uint256 amount
);
event Initialized(
address indexed _owner,
uint256 _startDate,
uint256 _endDate
);
event TokenWhitelisted(address indexed _owner, address indexed _token);
bool public isInitialized = false;
uint256 public startDate;
uint256 public endDate;
mapping(address => bool) public whitelisted;
mapping(address => mapping(address => uint256)) public info;
function whitelistToken(address token) external onlyOwner {
}
function initialize(uint256 endDateInSeconds) external onlyOwner {
}
function deposit(address token) external nonReentrant {
require(isInitialized, "contract not initialized");
require(<FILL_ME>)
require(block.timestamp < endDate, "lock period is over");
uint256 balance = IERC20(token).balanceOf(msg.sender);
uint256 remaining = balance.mul(100).div(10000);
uint256 lockAmount = balance.sub(remaining);
SafeERC20.safeTransferFrom(
IERC20(token),
msg.sender,
address(this),
lockAmount
);
info[msg.sender][token] = info[msg.sender][token].add(lockAmount);
emit Deposit(msg.sender, token, block.timestamp, lockAmount);
}
function withdraw(address token) external nonReentrant() {
}
}
| whitelisted[token]==true,"token not whitelisted" | 279,483 | whitelisted[token]==true |
"no assets were previously locked" | //"SPDX-License-Identifier: UNLICENSED"
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract LockUp is Ownable, ReentrancyGuard {
using SafeMath for uint256;
event Deposit(
address indexed _addr,
address indexed _token,
uint256 timestamp,
uint256 amount
);
event Withdrawal(
address indexed _addr,
address indexed _token,
uint256 timestamp,
uint256 amount
);
event Initialized(
address indexed _owner,
uint256 _startDate,
uint256 _endDate
);
event TokenWhitelisted(address indexed _owner, address indexed _token);
bool public isInitialized = false;
uint256 public startDate;
uint256 public endDate;
mapping(address => bool) public whitelisted;
mapping(address => mapping(address => uint256)) public info;
function whitelistToken(address token) external onlyOwner {
}
function initialize(uint256 endDateInSeconds) external onlyOwner {
}
function deposit(address token) external nonReentrant {
}
function withdraw(address token) external nonReentrant() {
require(endDate < block.timestamp, "token still locked up");
require(<FILL_ME>)
SafeERC20.safeTransfer(
IERC20(token),
msg.sender,
info[msg.sender][token]
);
emit Withdrawal(
msg.sender,
token,
block.timestamp,
info[msg.sender][token]
);
info[msg.sender][token] = 0;
}
}
| info[msg.sender][token]>0,"no assets were previously locked" | 279,483 | info[msg.sender][token]>0 |
'you can only enter once' | /**
*Submitted for verification at Etherscan.io on 2020-12-16
*/
pragma solidity ^0.7.0;
// SPDX-License-Identifier: MIT
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
}
}
contract SecretSanta {
using SafeMath for uint;
address payable public owner;
uint public amountMinimumToPlay;
uint public fee;
uint public basepercent = 100;
// Thursday 24 December 2020 04:20:00
uint public christmaseve = 1608783600;
// Friday 25 December 2020 04:20:00
uint public christmasday = 1608870000;
struct Santa {
address payable wallet;
uint amount;
}
Santa[] santas;
Santa[] assignedSantas;
mapping(address => uint) allSantas;
event NewSanta(
uint indexed _now,
address indexed _wallet,
uint _amount
);
event AssignSantas(
uint indexed _now,
uint _overallSantas,
uint _overallFunds
);
event PlayFinish(
uint indexed _now,
bool _finish
);
constructor(
uint amountMinimumToPlayArg
) {
}
/* Deposit a gift for someone and become a sekret vitalik ! */
function enter() payable external {
require(msg.value >= amountMinimumToPlay, 'gift the min amount to become a secret santa');
require(<FILL_ME>)
require(block.timestamp <= christmaseve, 'you are to late to the christmas party!');
uint fee_amount = calcFee(msg.value);
uint value = msg.value.sub(fee_amount);
Santa memory santa = Santa({
wallet: msg.sender,
amount: value
});
santas.push(santa);
allSantas[msg.sender] = value;
emit NewSanta(block.timestamp, msg.sender, msg.value);
}
/* When the right time has come anyone can call this function
- This function will pay out all assigned santas !
- Will selfdestruct the contract and transfer the fees to sekretvitalik.eth
*/
function finishPlay() public payable {
}
/* Public view functions */
function getOverallSantas() view public returns (uint) {
}
function getOverallFunds() public view returns (uint overallFunds) {
}
function checkPlayer(address payable playerAddress) public view returns (bool checkResult, uint checkAmount) {
}
function checkSender() public view returns (bool checkResult, uint checkAmount) {
}
/* Owner only functions */
function setOwner (address payable newOwner) external onlyOwner {
}
// Just in case there is a problem and we need to change dates */
function setchristmasday (uint newDay) external onlyOwner {
}
// Just in case there is a problem and we need to change dates
function setchristmaseve (uint newDay) external onlyOwner {
}
function assignSantas() external onlyOwner {
}
/* Internal functions */
function shuffleSantas() internal view returns(Santa[] memory shuffledSantas) {
}
function random(uint seed, uint n) internal view returns (uint256) {
}
function calcFee(uint _value) internal view returns(uint) {
}
function destruct() onlyOwner internal {
}
modifier onlyOwner {
}
}
| allSantas[msg.sender]==uint(0x0),'you can only enter once' | 279,509 | allSantas[msg.sender]==uint(0x0) |
"TokenSwapV2: phase doesn't exist" | pragma solidity ^0.8.0;
contract TokenSwapV2 is Ownable {
event PriceFeedUpdated(address addr);
event AdminWalletUpdated(address addr);
event TokenWithdrawed(uint256 amount);
event PhaseCreated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken, uint256 startTime, uint256 endTime);
event PhaseTimeUpdated(uint256 phaseId, uint256 startTime, uint256 endTime);
event LockInfoUpdated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime);
event SaleInfoUpdated(uint256 phaseId, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken);
event Swapped(uint256 phaseId, address account, uint256 ethDeposited, uint256 ethRefunded, uint256 tokenSold, uint256 tokenLocked, int ethPrice);
event TokenClaimed(uint256 phaseId, address account, uint256 amount);
uint256 private constant ONE_HUNDRED_PERCENT = 10000; // 100%
IERC20 private _token;
AggregatorV3Interface private _priceFeed;
address private _adminWallet;
struct ReferralCodeInfo {
uint128 amount; // ETH
uint128 numSwap;
}
// Mapping referral code to statistics information
mapping(string => ReferralCodeInfo) private _referralCodes;
struct PhaseInfo {
uint128 lockPercentage;
uint128 lockReleaseTime;
uint128 minDeposit;
uint128 pricePerToken; // 100000000 <=> 1 USD
uint128 startTime;
uint128 endTime;
uint128 totalLocked;
uint128 totalSold;
uint128 totalSupply;
}
uint256 private _totalPhases;
// Mapping phase id to phase information
mapping(uint256 => PhaseInfo) private _phases;
uint256 private _totalLockBalance;
// Mapping phase id to user address and locked balance information
mapping(uint256 => mapping(address => uint256)) private _lockBalances;
/**
* @dev Throws if phase doesn't exist
*/
modifier phaseExist(uint256 phaseId) {
require(<FILL_ME>)
_;
}
/**
* @dev Sets initial values
*/
constructor(address token, address priceFeed, address adminWallet)
{
}
/**
* @dev Returns smart contract information
*/
function getContractInfo()
external
view
returns (address, address, uint256, uint256, uint256)
{
}
/**
* @dev Updates price feed
*/
function updatePriceFeed(address priceFeed)
external
onlyOwner
{
}
/**
* @dev Updates admin wallet address where contains ETH user deposited
* to smart contract for swapping
*/
function updateAdminWallet(address adminWallet)
external
onlyOwner
{
}
/**
* @dev Withdraws token out of this smart contract and transfer to
* admin wallet
*
* Admin can withdraw all tokens that includes locked token of user in case emergency
*/
function withdrawAllFund(uint256 amount)
external
onlyOwner
{
}
/**
* @dev Creates new phase
*/
function createPhase(uint128 lockPercentage, uint128 lockReleaseTime, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken, uint128 startTime, uint128 endTime)
external
onlyOwner
{
}
/**
* @dev Updates lock information
*/
function updateLockInfo(uint256 phaseId, uint128 lockPercentage, uint128 lockReleaseTime)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates sale information
*/
function updateSaleInfo(uint256 phaseId, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates phase time
*/
function updatePhaseTime(uint256 phaseId, uint128 startTime, uint128 endTime)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Returns phase information
*/
function getPhase(uint256 phaseId)
external
view
returns (PhaseInfo memory)
{
}
/**
* @dev Returns phases information
* @param filter 1: active, 2: ended, 3: all
*/
function getPhases(uint256 phaseFrom, uint256 phaseTo, uint256 filter)
external
view
returns (uint256[] memory, PhaseInfo[] memory)
{
}
/**
* @dev Swaps ETH to token
*/
function swap(uint256 phaseId, string memory referralCode)
external
payable
{
}
/**
* @dev Returns token balance of user in smart contract that includes
* claimable and unclaimable
*/
function getUserBalance(address account, uint256 phaseFrom, uint256 phaseTo)
external
view
returns (uint256, uint256)
{
}
/**
* @dev Claims the remainning token after lock time end
*/
function claimToken(uint256 phaseFrom, uint256 phaseTo)
external
{
}
/**
* @dev Returns referral code information
*/
function getReferralCodeInfo(string memory referralCode)
external
view
returns (ReferralCodeInfo memory)
{
}
/**
* @dev Returns ETH/USD price
*/
function getEtherPrice()
external
view
returns (int)
{
}
}
| _phases[phaseId].totalSupply>0,"TokenSwapV2: phase doesn't exist" | 279,552 | _phases[phaseId].totalSupply>0 |
"TokenSwapV2: time is invalid" | pragma solidity ^0.8.0;
contract TokenSwapV2 is Ownable {
event PriceFeedUpdated(address addr);
event AdminWalletUpdated(address addr);
event TokenWithdrawed(uint256 amount);
event PhaseCreated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken, uint256 startTime, uint256 endTime);
event PhaseTimeUpdated(uint256 phaseId, uint256 startTime, uint256 endTime);
event LockInfoUpdated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime);
event SaleInfoUpdated(uint256 phaseId, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken);
event Swapped(uint256 phaseId, address account, uint256 ethDeposited, uint256 ethRefunded, uint256 tokenSold, uint256 tokenLocked, int ethPrice);
event TokenClaimed(uint256 phaseId, address account, uint256 amount);
uint256 private constant ONE_HUNDRED_PERCENT = 10000; // 100%
IERC20 private _token;
AggregatorV3Interface private _priceFeed;
address private _adminWallet;
struct ReferralCodeInfo {
uint128 amount; // ETH
uint128 numSwap;
}
// Mapping referral code to statistics information
mapping(string => ReferralCodeInfo) private _referralCodes;
struct PhaseInfo {
uint128 lockPercentage;
uint128 lockReleaseTime;
uint128 minDeposit;
uint128 pricePerToken; // 100000000 <=> 1 USD
uint128 startTime;
uint128 endTime;
uint128 totalLocked;
uint128 totalSold;
uint128 totalSupply;
}
uint256 private _totalPhases;
// Mapping phase id to phase information
mapping(uint256 => PhaseInfo) private _phases;
uint256 private _totalLockBalance;
// Mapping phase id to user address and locked balance information
mapping(uint256 => mapping(address => uint256)) private _lockBalances;
/**
* @dev Throws if phase doesn't exist
*/
modifier phaseExist(uint256 phaseId) {
}
/**
* @dev Sets initial values
*/
constructor(address token, address priceFeed, address adminWallet)
{
}
/**
* @dev Returns smart contract information
*/
function getContractInfo()
external
view
returns (address, address, uint256, uint256, uint256)
{
}
/**
* @dev Updates price feed
*/
function updatePriceFeed(address priceFeed)
external
onlyOwner
{
}
/**
* @dev Updates admin wallet address where contains ETH user deposited
* to smart contract for swapping
*/
function updateAdminWallet(address adminWallet)
external
onlyOwner
{
}
/**
* @dev Withdraws token out of this smart contract and transfer to
* admin wallet
*
* Admin can withdraw all tokens that includes locked token of user in case emergency
*/
function withdrawAllFund(uint256 amount)
external
onlyOwner
{
}
/**
* @dev Creates new phase
*/
function createPhase(uint128 lockPercentage, uint128 lockReleaseTime, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken, uint128 startTime, uint128 endTime)
external
onlyOwner
{
}
/**
* @dev Updates lock information
*/
function updateLockInfo(uint256 phaseId, uint128 lockPercentage, uint128 lockReleaseTime)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates sale information
*/
function updateSaleInfo(uint256 phaseId, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates phase time
*/
function updatePhaseTime(uint256 phaseId, uint128 startTime, uint128 endTime)
external
onlyOwner
phaseExist(phaseId)
{
PhaseInfo storage phase = _phases[phaseId];
if (startTime != 0) {
phase.startTime = startTime;
}
if (endTime != 0) {
phase.endTime = endTime;
}
require(<FILL_ME>)
emit PhaseTimeUpdated(phaseId, startTime, endTime);
}
/**
* @dev Returns phase information
*/
function getPhase(uint256 phaseId)
external
view
returns (PhaseInfo memory)
{
}
/**
* @dev Returns phases information
* @param filter 1: active, 2: ended, 3: all
*/
function getPhases(uint256 phaseFrom, uint256 phaseTo, uint256 filter)
external
view
returns (uint256[] memory, PhaseInfo[] memory)
{
}
/**
* @dev Swaps ETH to token
*/
function swap(uint256 phaseId, string memory referralCode)
external
payable
{
}
/**
* @dev Returns token balance of user in smart contract that includes
* claimable and unclaimable
*/
function getUserBalance(address account, uint256 phaseFrom, uint256 phaseTo)
external
view
returns (uint256, uint256)
{
}
/**
* @dev Claims the remainning token after lock time end
*/
function claimToken(uint256 phaseFrom, uint256 phaseTo)
external
{
}
/**
* @dev Returns referral code information
*/
function getReferralCodeInfo(string memory referralCode)
external
view
returns (ReferralCodeInfo memory)
{
}
/**
* @dev Returns ETH/USD price
*/
function getEtherPrice()
external
view
returns (int)
{
}
}
| (startTime==0||startTime>block.timestamp)&&phase.startTime<phase.endTime,"TokenSwapV2: time is invalid" | 279,552 | (startTime==0||startTime>block.timestamp)&&phase.startTime<phase.endTime |
"TokenSwapV2: balance isn't enough" | pragma solidity ^0.8.0;
contract TokenSwapV2 is Ownable {
event PriceFeedUpdated(address addr);
event AdminWalletUpdated(address addr);
event TokenWithdrawed(uint256 amount);
event PhaseCreated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken, uint256 startTime, uint256 endTime);
event PhaseTimeUpdated(uint256 phaseId, uint256 startTime, uint256 endTime);
event LockInfoUpdated(uint256 phaseId, uint256 lockPercentage, uint256 lockReleaseTime);
event SaleInfoUpdated(uint256 phaseId, uint256 minDeposit, uint256 totalSupply, uint256 pricePerToken);
event Swapped(uint256 phaseId, address account, uint256 ethDeposited, uint256 ethRefunded, uint256 tokenSold, uint256 tokenLocked, int ethPrice);
event TokenClaimed(uint256 phaseId, address account, uint256 amount);
uint256 private constant ONE_HUNDRED_PERCENT = 10000; // 100%
IERC20 private _token;
AggregatorV3Interface private _priceFeed;
address private _adminWallet;
struct ReferralCodeInfo {
uint128 amount; // ETH
uint128 numSwap;
}
// Mapping referral code to statistics information
mapping(string => ReferralCodeInfo) private _referralCodes;
struct PhaseInfo {
uint128 lockPercentage;
uint128 lockReleaseTime;
uint128 minDeposit;
uint128 pricePerToken; // 100000000 <=> 1 USD
uint128 startTime;
uint128 endTime;
uint128 totalLocked;
uint128 totalSold;
uint128 totalSupply;
}
uint256 private _totalPhases;
// Mapping phase id to phase information
mapping(uint256 => PhaseInfo) private _phases;
uint256 private _totalLockBalance;
// Mapping phase id to user address and locked balance information
mapping(uint256 => mapping(address => uint256)) private _lockBalances;
/**
* @dev Throws if phase doesn't exist
*/
modifier phaseExist(uint256 phaseId) {
}
/**
* @dev Sets initial values
*/
constructor(address token, address priceFeed, address adminWallet)
{
}
/**
* @dev Returns smart contract information
*/
function getContractInfo()
external
view
returns (address, address, uint256, uint256, uint256)
{
}
/**
* @dev Updates price feed
*/
function updatePriceFeed(address priceFeed)
external
onlyOwner
{
}
/**
* @dev Updates admin wallet address where contains ETH user deposited
* to smart contract for swapping
*/
function updateAdminWallet(address adminWallet)
external
onlyOwner
{
}
/**
* @dev Withdraws token out of this smart contract and transfer to
* admin wallet
*
* Admin can withdraw all tokens that includes locked token of user in case emergency
*/
function withdrawAllFund(uint256 amount)
external
onlyOwner
{
}
/**
* @dev Creates new phase
*/
function createPhase(uint128 lockPercentage, uint128 lockReleaseTime, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken, uint128 startTime, uint128 endTime)
external
onlyOwner
{
}
/**
* @dev Updates lock information
*/
function updateLockInfo(uint256 phaseId, uint128 lockPercentage, uint128 lockReleaseTime)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates sale information
*/
function updateSaleInfo(uint256 phaseId, uint128 minDeposit, uint128 totalSupply, uint128 pricePerToken)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Updates phase time
*/
function updatePhaseTime(uint256 phaseId, uint128 startTime, uint128 endTime)
external
onlyOwner
phaseExist(phaseId)
{
}
/**
* @dev Returns phase information
*/
function getPhase(uint256 phaseId)
external
view
returns (PhaseInfo memory)
{
}
/**
* @dev Returns phases information
* @param filter 1: active, 2: ended, 3: all
*/
function getPhases(uint256 phaseFrom, uint256 phaseTo, uint256 filter)
external
view
returns (uint256[] memory, PhaseInfo[] memory)
{
}
/**
* @dev Swaps ETH to token
*/
function swap(uint256 phaseId, string memory referralCode)
external
payable
{
PhaseInfo storage phase = _phases[phaseId];
require(block.timestamp >= phase.startTime && block.timestamp < phase.endTime, "TokenSwapV2: not in swapping time");
require(msg.value >= phase.minDeposit, "TokenSwapV2: deposit amount isn't enough");
uint256 remain = phase.totalSupply - phase.totalSold;
require(remain > 0, "TokenSwapV2: total supply isn't enough");
(, int ethPrice,,,) = _priceFeed.latestRoundData();
uint256 amount = msg.value * uint256(ethPrice) / phase.pricePerToken;
uint refund;
// Calculates redundant money
if (amount > remain) {
refund = (amount - remain) * phase.pricePerToken / uint256(ethPrice);
amount = remain;
}
require(<FILL_ME>)
// Refunds redundant money for user
if (refund > 0) {
payable(_msgSender()).transfer(refund);
}
// Transfers money to admin wallet
payable(_adminWallet).transfer(msg.value - refund);
// Calculates number of tokens that will be locked
uint256 locked = amount * phase.lockPercentage / ONE_HUNDRED_PERCENT;
// Transfers token for user
_token.transfer(_msgSender(), amount - locked);
if (locked > 0) {
_totalLockBalance += locked;
_lockBalances[phaseId][_msgSender()] += locked;
phase.totalLocked += uint128(locked);
}
phase.totalSold += uint128(amount);
// Manages referral codes
ReferralCodeInfo storage referral = _referralCodes[referralCode];
referral.amount += uint128(msg.value - refund);
referral.numSwap++;
emit Swapped(phaseId, _msgSender(), msg.value, refund, amount, locked, ethPrice);
}
/**
* @dev Returns token balance of user in smart contract that includes
* claimable and unclaimable
*/
function getUserBalance(address account, uint256 phaseFrom, uint256 phaseTo)
external
view
returns (uint256, uint256)
{
}
/**
* @dev Claims the remainning token after lock time end
*/
function claimToken(uint256 phaseFrom, uint256 phaseTo)
external
{
}
/**
* @dev Returns referral code information
*/
function getReferralCodeInfo(string memory referralCode)
external
view
returns (ReferralCodeInfo memory)
{
}
/**
* @dev Returns ETH/USD price
*/
function getEtherPrice()
external
view
returns (int)
{
}
}
| amount<=(_token.balanceOf(address(this))-_totalLockBalance),"TokenSwapV2: balance isn't enough" | 279,552 | amount<=(_token.balanceOf(address(this))-_totalLockBalance) |
null | /** @title Trebit Token
* An ERC20-compliant token.
*/
contract TrebitRefundToken is StandardToken, Ownable, BurnableToken {
using SafeMath for uint256;
string public name = "TCO - Refund Project Coin";
string public symbol = "TCO-R";
uint256 public decimals = 18;
// global token transfer lock
bool public globalTokenTransferLock;
// mapping that provides address based lock. default at the time of issueance
// is locked, and will not be transferrable until explicit unlock call for
// the address.
mapping( address => bool ) public lockedStatusAddress;
event GlobalLocked();
event GlobalUnlocked();
event Locked(address lockedAddress);
event Unlocked(address unlockedaddress);
// Check for global lock status to be unlocked
modifier checkGlobalTokenTransferLock {
require(<FILL_ME>)
_;
}
// Check for address lock to be unlocked
modifier checkAddressLock {
}
constructor() public {
}
function setGlobalTokenTransferLock(bool locked) public
onlyOwner
returns (bool)
{
}
/**
* @dev Allows token issuer to lock token transfer for an address.
* @param target Target address to lock token transfer.
*/
function lockAddress(address target) public
onlyOwner
{
}
/**
* @dev Allows token issuer to unlock token transfer for an address.
* @param target Target address to unlock token transfer.
*/
function unlockAddress(address target) public
onlyOwner
{
}
/** @dev Transfer `_value` token to `_to` from `msg.sender`, on the condition
* that global token lock and individual address lock in the `msg.sender`
* accountare both released.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
* @return Whether the transfer was successful or not.
*/
function transfer(address _to, uint256 _value)
public
checkGlobalTokenTransferLock
checkAddressLock
returns (bool) {
}
/**
* @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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
checkGlobalTokenTransferLock
checkAddressLock
returns (bool)
{
}
}
| !globalTokenTransferLock | 279,553 | !globalTokenTransferLock |
null | /** @title Trebit Token
* An ERC20-compliant token.
*/
contract TrebitRefundToken is StandardToken, Ownable, BurnableToken {
using SafeMath for uint256;
string public name = "TCO - Refund Project Coin";
string public symbol = "TCO-R";
uint256 public decimals = 18;
// global token transfer lock
bool public globalTokenTransferLock;
// mapping that provides address based lock. default at the time of issueance
// is locked, and will not be transferrable until explicit unlock call for
// the address.
mapping( address => bool ) public lockedStatusAddress;
event GlobalLocked();
event GlobalUnlocked();
event Locked(address lockedAddress);
event Unlocked(address unlockedaddress);
// Check for global lock status to be unlocked
modifier checkGlobalTokenTransferLock {
}
// Check for address lock to be unlocked
modifier checkAddressLock {
require(<FILL_ME>)
_;
}
constructor() public {
}
function setGlobalTokenTransferLock(bool locked) public
onlyOwner
returns (bool)
{
}
/**
* @dev Allows token issuer to lock token transfer for an address.
* @param target Target address to lock token transfer.
*/
function lockAddress(address target) public
onlyOwner
{
}
/**
* @dev Allows token issuer to unlock token transfer for an address.
* @param target Target address to unlock token transfer.
*/
function unlockAddress(address target) public
onlyOwner
{
}
/** @dev Transfer `_value` token to `_to` from `msg.sender`, on the condition
* that global token lock and individual address lock in the `msg.sender`
* accountare both released.
* @param _to The address of the recipient.
* @param _value The amount of token to be transferred.
* @return Whether the transfer was successful or not.
*/
function transfer(address _to, uint256 _value)
public
checkGlobalTokenTransferLock
checkAddressLock
returns (bool) {
}
/**
* @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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
checkGlobalTokenTransferLock
checkAddressLock
returns (bool)
{
}
}
| !lockedStatusAddress[msg.sender] | 279,553 | !lockedStatusAddress[msg.sender] |
null | pragma solidity 0.4.15;
contract Ambi2 {
function claimFor(address _address, address _owner) returns(bool);
function hasRole(address _from, bytes32 _role, address _to) constant returns(bool);
function isOwner(address _node, address _owner) constant returns(bool);
}
contract Ambi2Enabled {
Ambi2 ambi2;
modifier onlyRole(bytes32 _role) {
}
// Perform only after claiming the node, or claim in the same tx.
function setupAmbi2(Ambi2 _ambi2) returns(bool) {
}
}
contract Ambi2EnabledFull is Ambi2Enabled {
// Setup and claim atomically.
function setupAmbi2(Ambi2 _ambi2) returns(bool) {
}
}
contract AssetProxyInterface {
function transferFromWithReference(address _from, address _to, uint _value, string _reference) returns(bool);
}
contract DeviceDataStorage is Ambi2EnabledFull {
uint fee;
address feeReceiver;
AssetProxyInterface public assetProxy;
struct Storage {
address device;
bytes32 description;
uint number;
string additionalInfo;
}
mapping (address => uint) public recordId;
mapping (address => mapping (uint => Storage)) public recording;
event DataWasRecorded(address device, uint id, bytes32 description, uint number, string additionalInfo);
function setAssetProxy(AssetProxyInterface _assetProxy) onlyRole('admin') returns(bool) {
}
function setFeeRecieverValue(uint _fee, address _feeReceiver) onlyRole('admin') returns(bool) {
}
function recordInfo(bytes32 _description, uint _number, string _additionalInfo) returns(bool) {
require(<FILL_ME>)
recording[msg.sender][recordId[msg.sender]].device = msg.sender;
recording[msg.sender][recordId[msg.sender]].description = _description;
recording[msg.sender][recordId[msg.sender]].number = _number;
recording[msg.sender][recordId[msg.sender]].additionalInfo = _additionalInfo;
DataWasRecorded(msg.sender, recordId[msg.sender], _description, _number, _additionalInfo);
recordId[msg.sender]++;
return true;
}
function deleteRecording(uint _id) returns(bool) {
}
function getRecording(address _device, uint _id) constant returns(address, bytes32, uint, string) {
}
}
| assetProxy.transferFromWithReference(msg.sender,feeReceiver,fee,'storage') | 279,610 | assetProxy.transferFromWithReference(msg.sender,feeReceiver,fee,'storage') |
"The entry already exists" | pragma solidity ^0.5.10;
/*
@author Agustin Aguilar <[email protected]>
*/
library AddressMinHeap {
using AddressMinHeap for AddressMinHeap.Heap;
struct Heap {
uint256[] entries;
mapping(address => uint256) index;
}
function initialize(Heap storage _heap) internal {
}
function encode(address _addr, uint256 _value) internal pure returns (uint256 _entry) {
}
function decode(uint256 _entry) internal pure returns (address _addr, uint256 _value) {
}
function decodeAddress(uint256 _entry) internal pure returns (address _addr) {
}
function top(Heap storage _heap) internal view returns(address, uint256) {
}
function has(Heap storage _heap, address _addr) internal view returns (bool) {
}
function size(Heap storage _heap) internal view returns (uint256) {
}
function entry(Heap storage _heap, uint256 _i) internal view returns (address, uint256) {
}
// RemoveMax pops off the root element of the heap (the highest value here) and rebalances the heap
function popTop(Heap storage _heap) internal returns(address _addr, uint256 _value) {
}
// Inserts adds in a value to our heap.
function insert(Heap storage _heap, address _addr, uint256 _value) internal {
require(<FILL_ME>)
// Add the value to the end of our array
uint256 encoded = encode(_addr, _value);
_heap.entries.push(encoded);
// Start at the end of the array
uint256 currentIndex = _heap.entries.length - 1;
// Bubble Up
currentIndex = _heap.bubbleUp(currentIndex, encoded);
// Update index
_heap.index[_addr] = currentIndex;
}
function update(Heap storage _heap, address _addr, uint256 _value) internal {
}
function bubbleUp(Heap storage _heap, uint256 _ind, uint256 _val) internal returns (uint256 ind) {
}
function bubbleDown(Heap storage _heap, uint256 _ind, uint256 _val) internal returns (uint256 ind) {
}
}
| _heap.index[_addr]==0,"The entry already exists" | 279,616 | _heap.index[_addr]==0 |
null | // BLOCKCLOUT is a social DeFi network for cryptocurrency enthusiasts
// https://blockclout.com
// https://blockclout.com/staking
// https://discord.gg/HDc2U5M
// https://t.me/blockcloutENG
// https://reddit.com/r/blockcloutENG
// https://medium.com/@blockclout
pragma solidity ^ 0.4.26;
library SafeMath {
function mul(
uint256 a,
uint256 b
)
internal
pure
returns(uint256 c)
{
}
function div(
uint256 a,
uint256 b
)
internal
pure
returns(uint256)
{
}
function sub(
uint256 a,
uint256 b
)
internal
pure
returns(uint256)
{
}
function add(
uint256 a,
uint256 b
)
internal
pure
returns(uint256 c)
{
}
}
contract IERC20 {
function totalSupply()
external
view
returns(uint256);
function balanceOf(
address account
)
external
view
returns(uint256);
function transfer(
address recipient,
uint256 amount
)
external
returns(bool);
function allowance(
address owner,
address spender
)
external
view
returns(uint256);
function approve(
address spender,
uint256 amount
)
external returns(bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
)
external returns(bool);
}
contract BlockStake {
mapping(address => bool) internal ambassadors_;
uint256 constant internal ambassadorMaxPurchase_ = 1000000e18;
mapping(address => uint256) internal ambassadorAccumulatedQuota_;
bool public onlyAmbassadors = true;
uint256 ACTIVATION_TIME = now;
modifier antiEarlyWhale(
uint256 _amountOfERC20,
address _customerAddress
)
{
if (now >= ACTIVATION_TIME) {
onlyAmbassadors = false;
}
if (onlyAmbassadors) {
require(<FILL_ME>)
ambassadorAccumulatedQuota_[_customerAddress] =
SafeMath.add(ambassadorAccumulatedQuota_[_customerAddress], _amountOfERC20);
_;
} else {
onlyAmbassadors = false;
_;
}
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
event onDistribute(
address indexed customerAddress,
uint256 price
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingERC20,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ERC20Earned,
uint timestamp
);
event onReinvestment(
address indexed customerAddress,
uint256 ERC20Reinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ERC20Withdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "BlockStake";
string public symbol = "BLOCK";
uint8 constant public decimals = 18;
uint256 internal entryFee_ = 5;
uint256 internal exitFee_ = 15;
uint256 internal referralFee_ = 10;
uint256 internal maintenanceFee_ = 5;
address internal maintenanceAddress;
uint256 constant internal magnitude = 2 ** 64;
mapping(address => uint256) public tokenBalanceLedger_;
mapping(address => uint256) public referralBalance_;
mapping(address => uint256) public totalReferralEarnings_;
mapping(address => int256) public payoutsTo_;
mapping(address => uint256) public invested_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
IERC20 erc20;
constructor() public {
}
function checkAndTransfer(
uint256 _amount
)
private
{
}
function buy(
uint256 _amount,
address _referredBy
)
public
returns(uint256)
{
}
function buyFor(
uint256 _amount,
address _customerAddress,
address _referredBy
)
public
returns(uint256)
{
}
function() payable public {
}
function reinvest()
onlyDivis
public
{
}
function exit() external {
}
function withdraw()
onlyDivis
public
{
}
function sell(
uint256 _amountOfERC20s
)
onlyTokenHolders
public
{
}
function transfer(
address _toAddress,
uint256 _amountOfERC20s
)
onlyTokenHolders
external
returns(bool)
{
}
function totalERC20Balance()
public
view
returns(uint256)
{
}
function totalSupply()
public
view
returns(uint256)
{
}
function myTokens()
public
view
returns(uint256)
{
}
function myDividends(
bool _includeReferralBonus
)
public
view
returns(uint256)
{
}
function balanceOf(
address _customerAddress
)
public
view
returns(uint256)
{
}
function dividendsOf(
address _customerAddress
)
public
view
returns(uint256)
{
}
function sellPrice()
public
view
returns(uint256)
{
}
function buyPrice()
public
view
returns(uint256)
{
}
function getInvested()
public
view
returns(uint256)
{
}
function totalReferralEarnings(
address _client
)
public
view
returns(uint256)
{
}
function referralBalance(
address _client
)
public
view
returns(uint256)
{
}
function purchaseTokens(
address _referredBy,
address _customerAddress,
uint256 _incomingERC20
)
internal
antiEarlyWhale(_incomingERC20, _customerAddress)
returns(uint256)
{
}
function multiData()
public
view
returns(
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
}
| (ambassadors_[_customerAddress]==true&&(ambassadorAccumulatedQuota_[_customerAddress]+_amountOfERC20)<=ambassadorMaxPurchase_) | 279,621 | (ambassadors_[_customerAddress]==true&&(ambassadorAccumulatedQuota_[_customerAddress]+_amountOfERC20)<=ambassadorMaxPurchase_) |
"Must have less than 31 mice staked!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
require(!paused);
require(<FILL_ME>)
for (uint256 i = 0; i < tokenIds.length; i++) {
require(
IERC721(nftAddress).ownerOf(tokenIds[i]) == msg.sender &&
tokenIdToStaker[tokenIds[i]] == nullAddress,
"Token must be stakable by you!"
);
IERC721(nftAddress).transferFrom(
msg.sender,
address(this),
tokenIds[i]
);
stakerToTokenIds[msg.sender].push(tokenIds[i]);
tokenIdToTimeStamp[tokenIds[i]] = block.timestamp;
tokenIdToStaker[tokenIds[i]] = msg.sender;
}
}
function unstakeAll() public {
}
function unstakeByIds(uint256[] memory tokenIds) public {
}
function claimByTokenId(uint256 tokenId) public {
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| stakerToTokenIds[msg.sender].length+tokenIds.length<=MAX_WALLET_STAKED,"Must have less than 31 mice staked!" | 279,623 | stakerToTokenIds[msg.sender].length+tokenIds.length<=MAX_WALLET_STAKED |
"Token must be stakable by you!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
require(!paused);
require(
stakerToTokenIds[msg.sender].length + tokenIds.length <=
MAX_WALLET_STAKED,
"Must have less than 31 mice staked!"
);
for (uint256 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
IERC721(nftAddress).transferFrom(
msg.sender,
address(this),
tokenIds[i]
);
stakerToTokenIds[msg.sender].push(tokenIds[i]);
tokenIdToTimeStamp[tokenIds[i]] = block.timestamp;
tokenIdToStaker[tokenIds[i]] = msg.sender;
}
}
function unstakeAll() public {
}
function unstakeByIds(uint256[] memory tokenIds) public {
}
function claimByTokenId(uint256 tokenId) public {
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| IERC721(nftAddress).ownerOf(tokenIds[i])==msg.sender&&tokenIdToStaker[tokenIds[i]]==nullAddress,"Token must be stakable by you!" | 279,623 | IERC721(nftAddress).ownerOf(tokenIds[i])==msg.sender&&tokenIdToStaker[tokenIds[i]]==nullAddress |
"Must have at least one token staked!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
}
function unstakeAll() public {
require(<FILL_ME>)
uint256 totalRewards = 0;
for (uint256 i = stakerToTokenIds[msg.sender].length; i > 0; i--) {
uint256 tokenId = stakerToTokenIds[msg.sender][i - 1];
IERC721(nftAddress).transferFrom(
address(this),
msg.sender,
tokenId
);
totalRewards =
totalRewards +
((block.timestamp - tokenIdToTimeStamp[tokenId]) *
EMISSIONS_RATE);
removeTokenIdFromStaker(msg.sender, tokenId);
tokenIdToStaker[tokenId] = nullAddress;
}
_mint(msg.sender, totalRewards);
}
function unstakeByIds(uint256[] memory tokenIds) public {
}
function claimByTokenId(uint256 tokenId) public {
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| stakerToTokenIds[msg.sender].length>0,"Must have at least one token staked!" | 279,623 | stakerToTokenIds[msg.sender].length>0 |
"Message Sender was not original staker!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
}
function unstakeAll() public {
}
function unstakeByIds(uint256[] memory tokenIds) public {
uint256 totalRewards = 0;
for (uint256 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
IERC721(nftAddress).transferFrom(
address(this),
msg.sender,
tokenIds[i]
);
totalRewards =
totalRewards +
((block.timestamp - tokenIdToTimeStamp[tokenIds[i]]) *
EMISSIONS_RATE);
removeTokenIdFromStaker(msg.sender, tokenIds[i]);
tokenIdToStaker[tokenIds[i]] = nullAddress;
}
_mint(msg.sender, totalRewards);
}
function claimByTokenId(uint256 tokenId) public {
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| tokenIdToStaker[tokenIds[i]]==msg.sender,"Message Sender was not original staker!" | 279,623 | tokenIdToStaker[tokenIds[i]]==msg.sender |
"Token is not claimable by you!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
}
function unstakeAll() public {
}
function unstakeByIds(uint256[] memory tokenIds) public {
}
function claimByTokenId(uint256 tokenId) public {
require(<FILL_ME>)
require(block.timestamp < CLAIM_END_TIME, "Claim period is over!");
_mint(
msg.sender,
((block.timestamp - tokenIdToTimeStamp[tokenId]) * EMISSIONS_RATE)
);
tokenIdToTimeStamp[tokenId] = block.timestamp;
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| tokenIdToStaker[tokenId]==msg.sender,"Token is not claimable by you!" | 279,623 | tokenIdToStaker[tokenId]==msg.sender |
"Token is not staked!" | pragma solidity ^0.8.0;
contract Bambooze is ERC20Burnable, Ownable {
using SafeMath for uint256;
bool public paused = false;
uint256 public MAX_WALLET_STAKED = 10;
uint256 public EMISSIONS_RATE = 11574070000000;
uint256 public CLAIM_END_TIME = 1734013200;
address nullAddress = 0x0000000000000000000000000000000000000000;
address public nftAddress;
//Mapping of mouse to timestamp
mapping(uint256 => uint256) internal tokenIdToTimeStamp;
//Mapping of mouse to staker
mapping(uint256 => address) internal tokenIdToStaker;
//Mapping of staker to mice
mapping(address => uint256[]) internal stakerToTokenIds;
constructor() ERC20("Bambooze", "BAMB") {
}
function setNftAddress(address _nftAddress) public onlyOwner {
}
function pause(bool _value) public onlyOwner {
}
function getTokensStaked(address staker)
public
view
returns (uint256[] memory)
{
}
function remove(address staker, uint256 index) internal {
}
function removeTokenIdFromStaker(address staker, uint256 tokenId) internal {
}
function stakeByIds(uint256[] memory tokenIds) public {
}
function unstakeAll() public {
}
function unstakeByIds(uint256[] memory tokenIds) public {
}
function claimByTokenId(uint256 tokenId) public {
}
function claimAll() public {
}
function getAllRewards(address staker) public view returns (uint256) {
}
function getRewardsByTokenId(uint256 tokenId)
public
view
returns (uint256)
{
require(<FILL_ME>)
uint256 secondsStaked = block.timestamp - tokenIdToTimeStamp[tokenId];
return secondsStaked * EMISSIONS_RATE;
}
function getStaker(uint256 tokenId) public view returns (address) {
}
}
| tokenIdToStaker[tokenId]!=nullAddress,"Token is not staked!" | 279,623 | tokenIdToStaker[tokenId]!=nullAddress |
"different token" | pragma solidity 0.6.8;
/**
* @notice YEarn's style vault which earns yield for a specific token.
*/
contract Vault is ERC20 {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
IERC20 public token;
address public governance;
address public strategy;
event Deposited(address indexed user, address indexed token, uint256 amount, uint256 shareAmount);
event Withdrawn(address indexed user, address indexed token, uint256 amount, uint256 shareAmount);
constructor(address _token) public
ERC20(
string(abi.encodePacked("ACoconut ", ERC20(_token).name())),
string(abi.encodePacked("ac", ERC20(_token).symbol()))
)
{
}
/**
* @dev Returns the total balance in both vault and strategy.
*/
function balance() public view returns (uint256) {
}
/**
* @dev Updates the govenance address.
*/
function setGovernance(address _governance) public {
}
/**
* @dev Updates the active strategy of the vault.
*/
function setStrategy(address _strategy) public {
require(msg.sender == governance, "not governance");
// This also ensures that _strategy must be a valid strategy contract.
require(<FILL_ME>)
// If the vault has an existing strategy, withdraw all funds from it.
if (strategy != address(0x0)) {
IStrategy(strategy).withdrawAll();
}
strategy = _strategy;
// Starts earning once a new strategy is set.
earn();
}
/**
* @dev Starts earning and deposits all current balance into strategy.
*/
function earn() public {
}
/**
* @dev Deposits all balance to the vault.
*/
function depositAll() public virtual {
}
/**
* @dev Deposit some balance to the vault.
*/
function deposit(uint256 _amount) public virtual {
}
/**
* @dev Withdraws all balance out of the vault.
*/
function withdrawAll() public virtual {
}
/**
* @dev Withdraws some balance out of the vault.
*/
function withdraw(uint256 _shares) public virtual {
}
/**
* @dev Used to salvage any token deposited into the vault by mistake.
* @param _tokenAddress Token address to salvage.
* @param _amount Amount of token to salvage.
*/
function salvage(address _tokenAddress, uint256 _amount) public {
}
/**
* @dev Returns the number of vault token per share is worth.
*/
function getPricePerFullShare() public view returns (uint256) {
}
}
| address(token)==IStrategy(_strategy).want(),"different token" | 279,721 | address(token)==IStrategy(_strategy).want() |
"Address provided is an invalid agent" | pragma solidity 0.5.7;
/**
* @title UpgradeableToken
* @dev UpgradeableToken is A token which allows its holders to migrate their tokens to an future version
* This contract should be overridden in the future as more functionality is needed
*/
contract UpgradeableToken is CappedBurnableToken, ERC20Pausable, Ownable {
/** The next contract where the tokens will be migrated. */
address private _upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 private _totalUpgraded = 0;
/** Set to true if we have an upgrade agent and we're ready to update tokens */
bool private _upgradeReady = false;
/** Somebody has upgraded some of his tokens. */
event Upgrade(address indexed _from, address indexed _to, uint256 _amount);
/** New upgrade agent available. */
event UpgradeAgentSet(address agent);
/**
* @dev Modifier to check if upgrading is allowed
*/
modifier upgradeAllowed() {
}
/**
* @dev Modifier to check if setting upgrade agent is allowed for owner
*/
modifier upgradeAgentAllowed() {
}
/**
* @dev Allow the token holder to upgrade some of their tokens to a new contract.
* @param amount An amount to upgrade to the next contract
*/
function upgrade(uint256 amount) public upgradeAllowed whenPaused {
}
/**
* @dev Set an upgrade agent that handles transition of tokens from this contract
* @param agent Sets the address of the UpgradeAgent (new token)
*/
function setUpgradeAgent(address agent) external onlyOwner whenPaused upgradeAgentAllowed {
require(agent != address(0), "Upgrade agent can not be at address 0");
UpgradeAgent upgradeAgent = UpgradeAgent(agent);
// Basic validation for target contract
require(<FILL_ME>)
require(upgradeAgent.originalSupply() == cap(), "Upgrade agent should have the same supply");
_upgradeAgent = agent;
_upgradeReady = true;
emit UpgradeAgentSet(agent);
}
}
| upgradeAgent.isUpgradeAgent()==true,"Address provided is an invalid agent" | 279,863 | upgradeAgent.isUpgradeAgent()==true |
"Upgrade agent should have the same supply" | pragma solidity 0.5.7;
/**
* @title UpgradeableToken
* @dev UpgradeableToken is A token which allows its holders to migrate their tokens to an future version
* This contract should be overridden in the future as more functionality is needed
*/
contract UpgradeableToken is CappedBurnableToken, ERC20Pausable, Ownable {
/** The next contract where the tokens will be migrated. */
address private _upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 private _totalUpgraded = 0;
/** Set to true if we have an upgrade agent and we're ready to update tokens */
bool private _upgradeReady = false;
/** Somebody has upgraded some of his tokens. */
event Upgrade(address indexed _from, address indexed _to, uint256 _amount);
/** New upgrade agent available. */
event UpgradeAgentSet(address agent);
/**
* @dev Modifier to check if upgrading is allowed
*/
modifier upgradeAllowed() {
}
/**
* @dev Modifier to check if setting upgrade agent is allowed for owner
*/
modifier upgradeAgentAllowed() {
}
/**
* @dev Allow the token holder to upgrade some of their tokens to a new contract.
* @param amount An amount to upgrade to the next contract
*/
function upgrade(uint256 amount) public upgradeAllowed whenPaused {
}
/**
* @dev Set an upgrade agent that handles transition of tokens from this contract
* @param agent Sets the address of the UpgradeAgent (new token)
*/
function setUpgradeAgent(address agent) external onlyOwner whenPaused upgradeAgentAllowed {
require(agent != address(0), "Upgrade agent can not be at address 0");
UpgradeAgent upgradeAgent = UpgradeAgent(agent);
// Basic validation for target contract
require(upgradeAgent.isUpgradeAgent() == true, "Address provided is an invalid agent");
require(<FILL_ME>)
_upgradeAgent = agent;
_upgradeReady = true;
emit UpgradeAgentSet(agent);
}
}
| upgradeAgent.originalSupply()==cap(),"Upgrade agent should have the same supply" | 279,863 | upgradeAgent.originalSupply()==cap() |
"Mint price is not correct" | /*
( ) ( ( * ( (
)\ ) ( /( ( * ) * ) )\ ) )\ ) ( ` ( )\ ) )\ )
(()/( )\()) )\ ` ) /(` ) /( ( (()/( ( (()/( )\))( )\ (()/((()/(
/(_))((_)\((((_)( ( )(_))( )(_)))\ /(_)))\ /(_)) ((_)()\((((_)( /(_))/(_))
(_)) _((_))\ _ )\ (_(_())(_(_())((_) (_)) ((_)(_))_ (_()((_))\ _ )\ (_)) (_))
/ __| | || |(_)_\(_)|_ _||_ _|| __|| _ \| __|| \ | \/ |(_)_\(_)| _ \/ __|
\__ \ | __ | / _ \ | | | | | _| | /| _| | |) | | |\/| | / _ \ | _/\__ \
|___/ |_||_|/_/ \_\ |_| |_| |___||_|_\|___||___/ |_| |_|/_/ \_\ |_| |___/
a blitmap derivative.
@author fishboy
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import {IBlitmap} from "../interfaces/IBlitmap.sol";
import {BlitmapHelper} from '../libraries/BlitmapHelper.sol';
import {Base64} from '../libraries/Base64.sol';
contract Shattered is ERC721, ReentrancyGuard, Ownable {
using BytesLib for bytes;
using Counters for Counters.Counter;
uint8 private constant TOP_LEFT = 1;
uint8 private constant TOP_RIGHT = 2;
uint8 private constant BOTTOM_LEFT = 3;
uint8 private constant BOTTOM_RIGHT = 4;
uint256 private constant PRICE = 0.002 ether;
uint256 private maxSupply;
bool public live;
Counters.Counter private supply;
Counters.Counter private forgedSupply;
IBlitmap private blitmapContract;
uint256 private blitmapSupply;
mapping(uint256 => AllPieces) tokenPieces;
mapping(uint256 => BlitmapPieces) usedPieces;
event PieceMinted(uint256 blitTokenId);
string[32] private lookup = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10',
'11', '12', '13', '14', '15', '16', '17', '18', '19',
'20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
'30', '31'
];
struct BlitmapPieces {
uint256[] corners;
bool exists;
}
struct Piece {
uint256 tid;
uint256 corner;
bool exists;
}
struct AllPieces {
Piece topLeft;
Piece topRight;
Piece bottomLeft;
Piece bottomRight;
Piece single;
}
constructor(address blitmapAddr) ERC721("Shattered Maps", "SMAPS") {
}
function setLive(bool status) public onlyOwner {
}
function totalMinted() public view returns (uint256) {
}
function withdraw() public onlyOwner {
}
function getNextPieceId() private returns (uint256) {
}
function getNextForgedId() private returns (uint256) {
}
function getPiece(bytes memory tokenData, uint256 startAt, uint256 pad) private pure returns (bytes memory) {
}
function getRect(string memory x, string memory y, string memory color) private pure returns (string memory) {
}
function getCornerStart(uint corner) private pure returns (uint) {
}
function getCornerOffset(uint corner) private pure returns (uint) {
}
function getCornerString(uint256 corner) private pure returns (string memory) {
}
function removeCorner(uint256 cornerIndex, uint256[] memory corners) private pure returns (uint256[] memory) {
}
function line(bytes1 data, uint256 x, uint256 y, string[4] memory colors) private view returns (string memory) {
}
// @dev credit to blitmap contract for this clever implementation
function draw(uint256 startX, uint256 startY, uint256 limit, bytes memory tokenData, string[4] memory colors) private view returns (string memory) {
}
function tokenDataOf(uint256 tokenId) public view returns (bytes memory) {
}
function tokenAttributes(uint256 tokenId) public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) {
}
function mintPiece(uint256 tokenId, uint256 blitTokenId) private {
}
function mintMany(uint256[] memory ids) public payable nonReentrant {
require(live == true, 'Minting must be live');
require(<FILL_ME>)
require(ids.length <= 8, "Can only mint 8 max at a time.");
for (uint256 i = 0; i < ids.length; i++) {
mintPiece(getNextPieceId(), ids[i]);
}
}
function forge(uint256 firstId, uint256 secondId, uint256 thirdId, uint256 fourthId) public nonReentrant {
}
// via https://stackoverflow.com/a/65707309/424107
// @dev credit again to the blitmap contract
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| ids.length*PRICE==msg.value,"Mint price is not correct" | 279,877 | ids.length*PRICE==msg.value |
'First selection must be top left corner' | /*
( ) ( ( * ( (
)\ ) ( /( ( * ) * ) )\ ) )\ ) ( ` ( )\ ) )\ )
(()/( )\()) )\ ` ) /(` ) /( ( (()/( ( (()/( )\))( )\ (()/((()/(
/(_))((_)\((((_)( ( )(_))( )(_)))\ /(_)))\ /(_)) ((_)()\((((_)( /(_))/(_))
(_)) _((_))\ _ )\ (_(_())(_(_())((_) (_)) ((_)(_))_ (_()((_))\ _ )\ (_)) (_))
/ __| | || |(_)_\(_)|_ _||_ _|| __|| _ \| __|| \ | \/ |(_)_\(_)| _ \/ __|
\__ \ | __ | / _ \ | | | | | _| | /| _| | |) | | |\/| | / _ \ | _/\__ \
|___/ |_||_|/_/ \_\ |_| |_| |___||_|_\|___||___/ |_| |_|/_/ \_\ |_| |___/
a blitmap derivative.
@author fishboy
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import {IBlitmap} from "../interfaces/IBlitmap.sol";
import {BlitmapHelper} from '../libraries/BlitmapHelper.sol';
import {Base64} from '../libraries/Base64.sol';
contract Shattered is ERC721, ReentrancyGuard, Ownable {
using BytesLib for bytes;
using Counters for Counters.Counter;
uint8 private constant TOP_LEFT = 1;
uint8 private constant TOP_RIGHT = 2;
uint8 private constant BOTTOM_LEFT = 3;
uint8 private constant BOTTOM_RIGHT = 4;
uint256 private constant PRICE = 0.002 ether;
uint256 private maxSupply;
bool public live;
Counters.Counter private supply;
Counters.Counter private forgedSupply;
IBlitmap private blitmapContract;
uint256 private blitmapSupply;
mapping(uint256 => AllPieces) tokenPieces;
mapping(uint256 => BlitmapPieces) usedPieces;
event PieceMinted(uint256 blitTokenId);
string[32] private lookup = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10',
'11', '12', '13', '14', '15', '16', '17', '18', '19',
'20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
'30', '31'
];
struct BlitmapPieces {
uint256[] corners;
bool exists;
}
struct Piece {
uint256 tid;
uint256 corner;
bool exists;
}
struct AllPieces {
Piece topLeft;
Piece topRight;
Piece bottomLeft;
Piece bottomRight;
Piece single;
}
constructor(address blitmapAddr) ERC721("Shattered Maps", "SMAPS") {
}
function setLive(bool status) public onlyOwner {
}
function totalMinted() public view returns (uint256) {
}
function withdraw() public onlyOwner {
}
function getNextPieceId() private returns (uint256) {
}
function getNextForgedId() private returns (uint256) {
}
function getPiece(bytes memory tokenData, uint256 startAt, uint256 pad) private pure returns (bytes memory) {
}
function getRect(string memory x, string memory y, string memory color) private pure returns (string memory) {
}
function getCornerStart(uint corner) private pure returns (uint) {
}
function getCornerOffset(uint corner) private pure returns (uint) {
}
function getCornerString(uint256 corner) private pure returns (string memory) {
}
function removeCorner(uint256 cornerIndex, uint256[] memory corners) private pure returns (uint256[] memory) {
}
function line(bytes1 data, uint256 x, uint256 y, string[4] memory colors) private view returns (string memory) {
}
// @dev credit to blitmap contract for this clever implementation
function draw(uint256 startX, uint256 startY, uint256 limit, bytes memory tokenData, string[4] memory colors) private view returns (string memory) {
}
function tokenDataOf(uint256 tokenId) public view returns (bytes memory) {
}
function tokenAttributes(uint256 tokenId) public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) {
}
function mintPiece(uint256 tokenId, uint256 blitTokenId) private {
}
function mintMany(uint256[] memory ids) public payable nonReentrant {
}
function forge(uint256 firstId, uint256 secondId, uint256 thirdId, uint256 fourthId) public nonReentrant {
require(msg.sender == ownerOf(firstId), 'Piece not owned');
require(msg.sender == ownerOf(secondId), 'Piece not owned');
require(msg.sender == ownerOf(thirdId), 'Piece not owned');
require(msg.sender == ownerOf(fourthId), 'Piece not owned');
require(<FILL_ME>)
require(tokenPieces[secondId].single.corner == TOP_RIGHT, 'Second selection must be top right corner');
require(tokenPieces[thirdId].single.corner == BOTTOM_LEFT, 'Third selection must be bottom left corner');
require(tokenPieces[fourthId].single.corner == BOTTOM_RIGHT, 'Fourth selection must be bottom right corner');
AllPieces memory allPieces = AllPieces(
tokenPieces[firstId].single,
tokenPieces[secondId].single,
tokenPieces[thirdId].single,
tokenPieces[fourthId].single,
Piece(0, 0, false)
);
uint256 tokenId = getNextForgedId();
tokenPieces[tokenId] = allPieces;
_burn(firstId);
_burn(secondId);
_burn(thirdId);
_burn(fourthId);
_safeMint(msg.sender, tokenId);
}
// via https://stackoverflow.com/a/65707309/424107
// @dev credit again to the blitmap contract
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| tokenPieces[firstId].single.corner==TOP_LEFT,'First selection must be top left corner' | 279,877 | tokenPieces[firstId].single.corner==TOP_LEFT |
'Second selection must be top right corner' | /*
( ) ( ( * ( (
)\ ) ( /( ( * ) * ) )\ ) )\ ) ( ` ( )\ ) )\ )
(()/( )\()) )\ ` ) /(` ) /( ( (()/( ( (()/( )\))( )\ (()/((()/(
/(_))((_)\((((_)( ( )(_))( )(_)))\ /(_)))\ /(_)) ((_)()\((((_)( /(_))/(_))
(_)) _((_))\ _ )\ (_(_())(_(_())((_) (_)) ((_)(_))_ (_()((_))\ _ )\ (_)) (_))
/ __| | || |(_)_\(_)|_ _||_ _|| __|| _ \| __|| \ | \/ |(_)_\(_)| _ \/ __|
\__ \ | __ | / _ \ | | | | | _| | /| _| | |) | | |\/| | / _ \ | _/\__ \
|___/ |_||_|/_/ \_\ |_| |_| |___||_|_\|___||___/ |_| |_|/_/ \_\ |_| |___/
a blitmap derivative.
@author fishboy
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import {IBlitmap} from "../interfaces/IBlitmap.sol";
import {BlitmapHelper} from '../libraries/BlitmapHelper.sol';
import {Base64} from '../libraries/Base64.sol';
contract Shattered is ERC721, ReentrancyGuard, Ownable {
using BytesLib for bytes;
using Counters for Counters.Counter;
uint8 private constant TOP_LEFT = 1;
uint8 private constant TOP_RIGHT = 2;
uint8 private constant BOTTOM_LEFT = 3;
uint8 private constant BOTTOM_RIGHT = 4;
uint256 private constant PRICE = 0.002 ether;
uint256 private maxSupply;
bool public live;
Counters.Counter private supply;
Counters.Counter private forgedSupply;
IBlitmap private blitmapContract;
uint256 private blitmapSupply;
mapping(uint256 => AllPieces) tokenPieces;
mapping(uint256 => BlitmapPieces) usedPieces;
event PieceMinted(uint256 blitTokenId);
string[32] private lookup = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10',
'11', '12', '13', '14', '15', '16', '17', '18', '19',
'20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
'30', '31'
];
struct BlitmapPieces {
uint256[] corners;
bool exists;
}
struct Piece {
uint256 tid;
uint256 corner;
bool exists;
}
struct AllPieces {
Piece topLeft;
Piece topRight;
Piece bottomLeft;
Piece bottomRight;
Piece single;
}
constructor(address blitmapAddr) ERC721("Shattered Maps", "SMAPS") {
}
function setLive(bool status) public onlyOwner {
}
function totalMinted() public view returns (uint256) {
}
function withdraw() public onlyOwner {
}
function getNextPieceId() private returns (uint256) {
}
function getNextForgedId() private returns (uint256) {
}
function getPiece(bytes memory tokenData, uint256 startAt, uint256 pad) private pure returns (bytes memory) {
}
function getRect(string memory x, string memory y, string memory color) private pure returns (string memory) {
}
function getCornerStart(uint corner) private pure returns (uint) {
}
function getCornerOffset(uint corner) private pure returns (uint) {
}
function getCornerString(uint256 corner) private pure returns (string memory) {
}
function removeCorner(uint256 cornerIndex, uint256[] memory corners) private pure returns (uint256[] memory) {
}
function line(bytes1 data, uint256 x, uint256 y, string[4] memory colors) private view returns (string memory) {
}
// @dev credit to blitmap contract for this clever implementation
function draw(uint256 startX, uint256 startY, uint256 limit, bytes memory tokenData, string[4] memory colors) private view returns (string memory) {
}
function tokenDataOf(uint256 tokenId) public view returns (bytes memory) {
}
function tokenAttributes(uint256 tokenId) public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) {
}
function mintPiece(uint256 tokenId, uint256 blitTokenId) private {
}
function mintMany(uint256[] memory ids) public payable nonReentrant {
}
function forge(uint256 firstId, uint256 secondId, uint256 thirdId, uint256 fourthId) public nonReentrant {
require(msg.sender == ownerOf(firstId), 'Piece not owned');
require(msg.sender == ownerOf(secondId), 'Piece not owned');
require(msg.sender == ownerOf(thirdId), 'Piece not owned');
require(msg.sender == ownerOf(fourthId), 'Piece not owned');
require(tokenPieces[firstId].single.corner == TOP_LEFT, 'First selection must be top left corner');
require(<FILL_ME>)
require(tokenPieces[thirdId].single.corner == BOTTOM_LEFT, 'Third selection must be bottom left corner');
require(tokenPieces[fourthId].single.corner == BOTTOM_RIGHT, 'Fourth selection must be bottom right corner');
AllPieces memory allPieces = AllPieces(
tokenPieces[firstId].single,
tokenPieces[secondId].single,
tokenPieces[thirdId].single,
tokenPieces[fourthId].single,
Piece(0, 0, false)
);
uint256 tokenId = getNextForgedId();
tokenPieces[tokenId] = allPieces;
_burn(firstId);
_burn(secondId);
_burn(thirdId);
_burn(fourthId);
_safeMint(msg.sender, tokenId);
}
// via https://stackoverflow.com/a/65707309/424107
// @dev credit again to the blitmap contract
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| tokenPieces[secondId].single.corner==TOP_RIGHT,'Second selection must be top right corner' | 279,877 | tokenPieces[secondId].single.corner==TOP_RIGHT |
'Third selection must be bottom left corner' | /*
( ) ( ( * ( (
)\ ) ( /( ( * ) * ) )\ ) )\ ) ( ` ( )\ ) )\ )
(()/( )\()) )\ ` ) /(` ) /( ( (()/( ( (()/( )\))( )\ (()/((()/(
/(_))((_)\((((_)( ( )(_))( )(_)))\ /(_)))\ /(_)) ((_)()\((((_)( /(_))/(_))
(_)) _((_))\ _ )\ (_(_())(_(_())((_) (_)) ((_)(_))_ (_()((_))\ _ )\ (_)) (_))
/ __| | || |(_)_\(_)|_ _||_ _|| __|| _ \| __|| \ | \/ |(_)_\(_)| _ \/ __|
\__ \ | __ | / _ \ | | | | | _| | /| _| | |) | | |\/| | / _ \ | _/\__ \
|___/ |_||_|/_/ \_\ |_| |_| |___||_|_\|___||___/ |_| |_|/_/ \_\ |_| |___/
a blitmap derivative.
@author fishboy
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import {IBlitmap} from "../interfaces/IBlitmap.sol";
import {BlitmapHelper} from '../libraries/BlitmapHelper.sol';
import {Base64} from '../libraries/Base64.sol';
contract Shattered is ERC721, ReentrancyGuard, Ownable {
using BytesLib for bytes;
using Counters for Counters.Counter;
uint8 private constant TOP_LEFT = 1;
uint8 private constant TOP_RIGHT = 2;
uint8 private constant BOTTOM_LEFT = 3;
uint8 private constant BOTTOM_RIGHT = 4;
uint256 private constant PRICE = 0.002 ether;
uint256 private maxSupply;
bool public live;
Counters.Counter private supply;
Counters.Counter private forgedSupply;
IBlitmap private blitmapContract;
uint256 private blitmapSupply;
mapping(uint256 => AllPieces) tokenPieces;
mapping(uint256 => BlitmapPieces) usedPieces;
event PieceMinted(uint256 blitTokenId);
string[32] private lookup = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10',
'11', '12', '13', '14', '15', '16', '17', '18', '19',
'20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
'30', '31'
];
struct BlitmapPieces {
uint256[] corners;
bool exists;
}
struct Piece {
uint256 tid;
uint256 corner;
bool exists;
}
struct AllPieces {
Piece topLeft;
Piece topRight;
Piece bottomLeft;
Piece bottomRight;
Piece single;
}
constructor(address blitmapAddr) ERC721("Shattered Maps", "SMAPS") {
}
function setLive(bool status) public onlyOwner {
}
function totalMinted() public view returns (uint256) {
}
function withdraw() public onlyOwner {
}
function getNextPieceId() private returns (uint256) {
}
function getNextForgedId() private returns (uint256) {
}
function getPiece(bytes memory tokenData, uint256 startAt, uint256 pad) private pure returns (bytes memory) {
}
function getRect(string memory x, string memory y, string memory color) private pure returns (string memory) {
}
function getCornerStart(uint corner) private pure returns (uint) {
}
function getCornerOffset(uint corner) private pure returns (uint) {
}
function getCornerString(uint256 corner) private pure returns (string memory) {
}
function removeCorner(uint256 cornerIndex, uint256[] memory corners) private pure returns (uint256[] memory) {
}
function line(bytes1 data, uint256 x, uint256 y, string[4] memory colors) private view returns (string memory) {
}
// @dev credit to blitmap contract for this clever implementation
function draw(uint256 startX, uint256 startY, uint256 limit, bytes memory tokenData, string[4] memory colors) private view returns (string memory) {
}
function tokenDataOf(uint256 tokenId) public view returns (bytes memory) {
}
function tokenAttributes(uint256 tokenId) public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) {
}
function mintPiece(uint256 tokenId, uint256 blitTokenId) private {
}
function mintMany(uint256[] memory ids) public payable nonReentrant {
}
function forge(uint256 firstId, uint256 secondId, uint256 thirdId, uint256 fourthId) public nonReentrant {
require(msg.sender == ownerOf(firstId), 'Piece not owned');
require(msg.sender == ownerOf(secondId), 'Piece not owned');
require(msg.sender == ownerOf(thirdId), 'Piece not owned');
require(msg.sender == ownerOf(fourthId), 'Piece not owned');
require(tokenPieces[firstId].single.corner == TOP_LEFT, 'First selection must be top left corner');
require(tokenPieces[secondId].single.corner == TOP_RIGHT, 'Second selection must be top right corner');
require(<FILL_ME>)
require(tokenPieces[fourthId].single.corner == BOTTOM_RIGHT, 'Fourth selection must be bottom right corner');
AllPieces memory allPieces = AllPieces(
tokenPieces[firstId].single,
tokenPieces[secondId].single,
tokenPieces[thirdId].single,
tokenPieces[fourthId].single,
Piece(0, 0, false)
);
uint256 tokenId = getNextForgedId();
tokenPieces[tokenId] = allPieces;
_burn(firstId);
_burn(secondId);
_burn(thirdId);
_burn(fourthId);
_safeMint(msg.sender, tokenId);
}
// via https://stackoverflow.com/a/65707309/424107
// @dev credit again to the blitmap contract
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| tokenPieces[thirdId].single.corner==BOTTOM_LEFT,'Third selection must be bottom left corner' | 279,877 | tokenPieces[thirdId].single.corner==BOTTOM_LEFT |
'Fourth selection must be bottom right corner' | /*
( ) ( ( * ( (
)\ ) ( /( ( * ) * ) )\ ) )\ ) ( ` ( )\ ) )\ )
(()/( )\()) )\ ` ) /(` ) /( ( (()/( ( (()/( )\))( )\ (()/((()/(
/(_))((_)\((((_)( ( )(_))( )(_)))\ /(_)))\ /(_)) ((_)()\((((_)( /(_))/(_))
(_)) _((_))\ _ )\ (_(_())(_(_())((_) (_)) ((_)(_))_ (_()((_))\ _ )\ (_)) (_))
/ __| | || |(_)_\(_)|_ _||_ _|| __|| _ \| __|| \ | \/ |(_)_\(_)| _ \/ __|
\__ \ | __ | / _ \ | | | | | _| | /| _| | |) | | |\/| | / _ \ | _/\__ \
|___/ |_||_|/_/ \_\ |_| |_| |___||_|_\|___||___/ |_| |_|/_/ \_\ |_| |___/
a blitmap derivative.
@author fishboy
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import {IBlitmap} from "../interfaces/IBlitmap.sol";
import {BlitmapHelper} from '../libraries/BlitmapHelper.sol';
import {Base64} from '../libraries/Base64.sol';
contract Shattered is ERC721, ReentrancyGuard, Ownable {
using BytesLib for bytes;
using Counters for Counters.Counter;
uint8 private constant TOP_LEFT = 1;
uint8 private constant TOP_RIGHT = 2;
uint8 private constant BOTTOM_LEFT = 3;
uint8 private constant BOTTOM_RIGHT = 4;
uint256 private constant PRICE = 0.002 ether;
uint256 private maxSupply;
bool public live;
Counters.Counter private supply;
Counters.Counter private forgedSupply;
IBlitmap private blitmapContract;
uint256 private blitmapSupply;
mapping(uint256 => AllPieces) tokenPieces;
mapping(uint256 => BlitmapPieces) usedPieces;
event PieceMinted(uint256 blitTokenId);
string[32] private lookup = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10',
'11', '12', '13', '14', '15', '16', '17', '18', '19',
'20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
'30', '31'
];
struct BlitmapPieces {
uint256[] corners;
bool exists;
}
struct Piece {
uint256 tid;
uint256 corner;
bool exists;
}
struct AllPieces {
Piece topLeft;
Piece topRight;
Piece bottomLeft;
Piece bottomRight;
Piece single;
}
constructor(address blitmapAddr) ERC721("Shattered Maps", "SMAPS") {
}
function setLive(bool status) public onlyOwner {
}
function totalMinted() public view returns (uint256) {
}
function withdraw() public onlyOwner {
}
function getNextPieceId() private returns (uint256) {
}
function getNextForgedId() private returns (uint256) {
}
function getPiece(bytes memory tokenData, uint256 startAt, uint256 pad) private pure returns (bytes memory) {
}
function getRect(string memory x, string memory y, string memory color) private pure returns (string memory) {
}
function getCornerStart(uint corner) private pure returns (uint) {
}
function getCornerOffset(uint corner) private pure returns (uint) {
}
function getCornerString(uint256 corner) private pure returns (string memory) {
}
function removeCorner(uint256 cornerIndex, uint256[] memory corners) private pure returns (uint256[] memory) {
}
function line(bytes1 data, uint256 x, uint256 y, string[4] memory colors) private view returns (string memory) {
}
// @dev credit to blitmap contract for this clever implementation
function draw(uint256 startX, uint256 startY, uint256 limit, bytes memory tokenData, string[4] memory colors) private view returns (string memory) {
}
function tokenDataOf(uint256 tokenId) public view returns (bytes memory) {
}
function tokenAttributes(uint256 tokenId) public view returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function tokenSvgDataOf(uint256 tokenId) public view returns (string memory) {
}
function mintPiece(uint256 tokenId, uint256 blitTokenId) private {
}
function mintMany(uint256[] memory ids) public payable nonReentrant {
}
function forge(uint256 firstId, uint256 secondId, uint256 thirdId, uint256 fourthId) public nonReentrant {
require(msg.sender == ownerOf(firstId), 'Piece not owned');
require(msg.sender == ownerOf(secondId), 'Piece not owned');
require(msg.sender == ownerOf(thirdId), 'Piece not owned');
require(msg.sender == ownerOf(fourthId), 'Piece not owned');
require(tokenPieces[firstId].single.corner == TOP_LEFT, 'First selection must be top left corner');
require(tokenPieces[secondId].single.corner == TOP_RIGHT, 'Second selection must be top right corner');
require(tokenPieces[thirdId].single.corner == BOTTOM_LEFT, 'Third selection must be bottom left corner');
require(<FILL_ME>)
AllPieces memory allPieces = AllPieces(
tokenPieces[firstId].single,
tokenPieces[secondId].single,
tokenPieces[thirdId].single,
tokenPieces[fourthId].single,
Piece(0, 0, false)
);
uint256 tokenId = getNextForgedId();
tokenPieces[tokenId] = allPieces;
_burn(firstId);
_burn(secondId);
_burn(thirdId);
_burn(fourthId);
_safeMint(msg.sender, tokenId);
}
// via https://stackoverflow.com/a/65707309/424107
// @dev credit again to the blitmap contract
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| tokenPieces[fourthId].single.corner==BOTTOM_RIGHT,'Fourth selection must be bottom right corner' | 279,877 | tokenPieces[fourthId].single.corner==BOTTOM_RIGHT |
null | pragma solidity ^0.7.5;
contract BonkToken is ERC20Burnable, ERC20Snapshot, Ownable, AccessControl, Drainer {
using SafeMath for uint;
bytes32 public constant SNAPSHOT_ROLE = keccak256("SNAPSHOT_ROLE");
bytes32 public constant WHITELIST_TRANSFER_ROLE = keccak256("WHITELIST_TRANSFER_ROLE");
bool public transfersEnabled = false;
constructor(
string memory _name,
string memory _symbol,
uint _initialSupplyWithoutDecimals
)
ERC20(_name, _symbol)
{
}
function snapshot()
public
returns (uint)
{
}
function enableTransfers()
external
onlyOwner
{
}
function transferAndCall(address _to, uint _tokens, bytes calldata _data)
external
returns (bool)
{
transfer(_to, _tokens);
uint32 _size;
assembly {
_size := extcodesize(_to)
}
if (_size > 0) {
require(<FILL_ME>)
}
return true;
}
function drainTokens(address _token, address _beneficiary, uint _amount)
public
override
{
}
function _beforeTokenTransfer(address _from, address _to, uint _amount)
internal
virtual
override(ERC20, ERC20Snapshot)
{
}
}
| ICallable(_to).tokenCallback(msg.sender,_tokens,_data) | 279,886 | ICallable(_to).tokenCallback(msg.sender,_tokens,_data) |
"Transfers disabled" | pragma solidity ^0.7.5;
contract BonkToken is ERC20Burnable, ERC20Snapshot, Ownable, AccessControl, Drainer {
using SafeMath for uint;
bytes32 public constant SNAPSHOT_ROLE = keccak256("SNAPSHOT_ROLE");
bytes32 public constant WHITELIST_TRANSFER_ROLE = keccak256("WHITELIST_TRANSFER_ROLE");
bool public transfersEnabled = false;
constructor(
string memory _name,
string memory _symbol,
uint _initialSupplyWithoutDecimals
)
ERC20(_name, _symbol)
{
}
function snapshot()
public
returns (uint)
{
}
function enableTransfers()
external
onlyOwner
{
}
function transferAndCall(address _to, uint _tokens, bytes calldata _data)
external
returns (bool)
{
}
function drainTokens(address _token, address _beneficiary, uint _amount)
public
override
{
}
function _beforeTokenTransfer(address _from, address _to, uint _amount)
internal
virtual
override(ERC20, ERC20Snapshot)
{
require(<FILL_ME>)
super._beforeTokenTransfer(_from, _to, _amount);
}
}
| transfersEnabled||hasRole(WHITELIST_TRANSFER_ROLE,msg.sender),"Transfers disabled" | 279,886 | transfersEnabled||hasRole(WHITELIST_TRANSFER_ROLE,msg.sender) |
'Beneficiary already owns max allowed mints' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ToadRunnerzBase.sol";
import "./lib/String.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract ToadRunnerz is ToadRunnerzBase {
using SafeMath for uint256;
mapping(bytes4 => bool) internal supportedInterfaces;
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ToadRunnerzBase(_name, _symbol, _operator, _baseURI, _toadAddress, _arcadeAddress) {}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function issueToken(address _beneficiary, string calldata _gameId)
external
payable {
require(<FILL_ME>)
_issueToken(_beneficiary, _gameId);
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
* @param _nbrOfTokens - Number of tokens to mint
*/
function issueTokens(address _beneficiary, string calldata _gameId, uint256 _nbrOfTokens)
external
payable {
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function _issueToken(address _beneficiary, string memory _gameId) internal {
}
/**
* @dev Internal function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param _tokenId - uint256 ID of the token to set as its URI
* @param _uri - string URI to assign
*/
function _setTokenURI(uint256 _tokenId, string memory _uri) internal {
}
/**
* @dev Burns the speficied token.
* @param tokenId - token id
*/
function burn(uint256 tokenId) external onlyAllowed {
}
}
| allowed[msg.sender]||balanceOf(_beneficiary)+1<=MAX_ALLOWED,'Beneficiary already owns max allowed mints' | 279,907 | allowed[msg.sender]||balanceOf(_beneficiary)+1<=MAX_ALLOWED |
"Ether value sent is not correct" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ToadRunnerzBase.sol";
import "./lib/String.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract ToadRunnerz is ToadRunnerzBase {
using SafeMath for uint256;
mapping(bytes4 => bool) internal supportedInterfaces;
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ToadRunnerzBase(_name, _symbol, _operator, _baseURI, _toadAddress, _arcadeAddress) {}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function issueToken(address _beneficiary, string calldata _gameId)
external
payable {
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
* @param _nbrOfTokens - Number of tokens to mint
*/
function issueTokens(address _beneficiary, string calldata _gameId, uint256 _nbrOfTokens)
external
payable {
bytes32 key = getGameKey(_gameId);
require(<FILL_ME>)
require(
allowed[msg.sender]
|| balance(_beneficiary) + _nbrOfTokens <= MAX_ALLOWED,
'Beneficiary already owns max allowed mints'
);
for(uint i = 0; i < _nbrOfTokens; i++) {
_issueToken(_beneficiary, _gameId);
}
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function _issueToken(address _beneficiary, string memory _gameId) internal {
}
/**
* @dev Internal function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param _tokenId - uint256 ID of the token to set as its URI
* @param _uri - string URI to assign
*/
function _setTokenURI(uint256 _tokenId, string memory _uri) internal {
}
/**
* @dev Burns the speficied token.
* @param tokenId - token id
*/
function burn(uint256 tokenId) external onlyAllowed {
}
}
| allowed[msg.sender]?msg.value>=0:_nbrOfTokens>0&&collectionPrice[key].mul(_nbrOfTokens)<=msg.value,"Ether value sent is not correct" | 279,907 | allowed[msg.sender]?msg.value>=0:_nbrOfTokens>0&&collectionPrice[key].mul(_nbrOfTokens)<=msg.value |
'Beneficiary already owns max allowed mints' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ToadRunnerzBase.sol";
import "./lib/String.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract ToadRunnerz is ToadRunnerzBase {
using SafeMath for uint256;
mapping(bytes4 => bool) internal supportedInterfaces;
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ToadRunnerzBase(_name, _symbol, _operator, _baseURI, _toadAddress, _arcadeAddress) {}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function issueToken(address _beneficiary, string calldata _gameId)
external
payable {
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
* @param _nbrOfTokens - Number of tokens to mint
*/
function issueTokens(address _beneficiary, string calldata _gameId, uint256 _nbrOfTokens)
external
payable {
bytes32 key = getGameKey(_gameId);
require(
allowed[msg.sender]
? msg.value >= 0
: _nbrOfTokens > 0 && collectionPrice[key].mul(_nbrOfTokens) <= msg.value,
"Ether value sent is not correct"
);
require(<FILL_ME>)
for(uint i = 0; i < _nbrOfTokens; i++) {
_issueToken(_beneficiary, _gameId);
}
}
/**
* @dev Issue a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _gameId - token game
*/
function _issueToken(address _beneficiary, string memory _gameId) internal {
}
/**
* @dev Internal function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param _tokenId - uint256 ID of the token to set as its URI
* @param _uri - string URI to assign
*/
function _setTokenURI(uint256 _tokenId, string memory _uri) internal {
}
/**
* @dev Burns the speficied token.
* @param tokenId - token id
*/
function burn(uint256 tokenId) external onlyAllowed {
}
}
| allowed[msg.sender]||balance(_beneficiary)+_nbrOfTokens<=MAX_ALLOWED,'Beneficiary already owns max allowed mints' | 279,907 | allowed[msg.sender]||balance(_beneficiary)+_nbrOfTokens<=MAX_ALLOWED |
"Only an `allowed` address can call this method" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
require(<FILL_ME>)
_;
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| allowed[msg.sender],"Only an `allowed` address can call this method" | 279,908 | allowed[msg.sender] |
"You should set a different value" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
require(_operator != address(0), "Invalid address");
require(<FILL_ME>)
allowed[_operator] = _allowed;
emit Allowed(_operator, _allowed);
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| allowed[_operator]!=_allowed,"You should set a different value" | 279,908 | allowed[_operator]!=_allowed |
"Can not modify an existing game" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
bytes32 key = getGameKey(_gameId);
require(<FILL_ME>)
require(_maxIssuance > 0, "Max issuance should be greater than 0");
maxIssuance[key] = _maxIssuance;
collectionPrice[key] = _price;
gameURIs[key] = _gameURI;
games.push(_gameId);
emit AddGame(key, _gameId, _maxIssuance, _price, _gameURI);
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| maxIssuance[key]==0,"Can not modify an existing game" | 279,908 | maxIssuance[key]==0 |
"Game exhausted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
require(
_issuedId > 0 && _issuedId <= maxIssuance[_gameIdKey],
"Invalid issued id"
);
require(<FILL_ME>)
require(
allowed[msg.sender]
? msg.value >= 0
: collectionPrice[_gameIdKey] <= msg.value,
"Ether value sent is not correct"
);
require (
!isPremint
? true
: allowed[msg.sender]
? true
: (t.balanceOf(_beneficiary) > 0 || a.balanceOf(_beneficiary) > 0),
"Beneficiary is not owner of a Cryptoadz or ArcadeNFT"
);
// Mint erc721 token
super._mint(_beneficiary, _tokenId);
// Increase issuance
issued[_gameIdKey] = issued[_gameIdKey] + 1;
tokenTracker = tokenTracker + 1;
// Log
emit Issue(_beneficiary, _tokenId, _gameIdKey, _gameId, _issuedId);
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| issued[_gameIdKey]<maxIssuance[_gameIdKey],"Game exhausted" | 279,908 | issued[_gameIdKey]<maxIssuance[_gameIdKey] |
"Ether value sent is not correct" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
require(
_issuedId > 0 && _issuedId <= maxIssuance[_gameIdKey],
"Invalid issued id"
);
require(
issued[_gameIdKey] < maxIssuance[_gameIdKey],
"Game exhausted"
);
require(<FILL_ME>)
require (
!isPremint
? true
: allowed[msg.sender]
? true
: (t.balanceOf(_beneficiary) > 0 || a.balanceOf(_beneficiary) > 0),
"Beneficiary is not owner of a Cryptoadz or ArcadeNFT"
);
// Mint erc721 token
super._mint(_beneficiary, _tokenId);
// Increase issuance
issued[_gameIdKey] = issued[_gameIdKey] + 1;
tokenTracker = tokenTracker + 1;
// Log
emit Issue(_beneficiary, _tokenId, _gameIdKey, _gameId, _issuedId);
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| allowed[msg.sender]?msg.value>=0:collectionPrice[_gameIdKey]<=msg.value,"Ether value sent is not correct" | 279,908 | allowed[msg.sender]?msg.value>=0:collectionPrice[_gameIdKey]<=msg.value |
"Beneficiary is not owner of a Cryptoadz or ArcadeNFT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./lib/String.sol";
interface ToadChecker {
function balanceOf(address owner) external view returns(uint256);
}
interface ArcadeChecker {
function balanceOf(address owner) external view returns(uint256);
}
abstract contract ToadRunnerzBase is Ownable, ERC721Enumerable {
using String for bytes32;
using String for uint256;
mapping(bytes32 => uint256) internal maxIssuance;
mapping(bytes32 => uint256) internal issued;
mapping(uint256 => string) internal _tokenPaths;
mapping(address => bool) internal allowed;
mapping(bytes32 => string) internal gameURIs;
mapping(bytes32 => uint256) internal collectionPrice;
ToadChecker internal t;
ArcadeChecker internal a;
string[] internal games;
string internal baseURI;
bool internal isPremint = true;
uint256 internal MAX_ALLOWED = 1;
uint256 internal tokenTracker = 0;
event BaseURI(string _oldBaseURI, string _newBaseURI);
event Allowed(address indexed _operator, bool _allowed);
event Premint(bool _isPremint);
event AddGame(
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _maxIssuance,
uint256 _price,
string gameURI
);
event Issue(
address indexed _beneficiary,
uint256 indexed _tokenId,
bytes32 indexed _gameIdKey,
string _gameId,
uint256 _issuedId
);
event CollectionIssuance(
bytes32 _key,
uint256 _issuance
);
event CollectionPrice(
bytes32 _gameKey,
uint256 _price
);
event GameURI(
bytes32 _gameKey,
string _uri
);
event MaxAllowed(uint256 allowed);
event Complete();
/**
* @dev Create the contract.
* @param _name - name of the contract
* @param _symbol - symbol of the contract
* @param _operator - Address allowed to mint tokens
* @param _baseURI - base URI for token URIs
*/
constructor(
string memory _name,
string memory _symbol,
address _operator,
string memory _baseURI,
address _toadAddress,
address _arcadeAddress
) ERC721(_name, _symbol) {
}
modifier onlyAllowed() {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the price for
* @param _price - price for the collection
*/
function setCollectionPrice(bytes32 _gameKey, uint256 _price)
external
onlyAllowed {
}
/**
* @dev Set price for collection.
* @param _gameKey - gameKey to set the uri for
* @param _uri - uri for the game collection
*/
function setGameURI(bytes32 _gameKey, string memory _uri)
external
onlyAllowed {
}
/**
* @dev Set Base URI.
* @param _baseURI - base URI for token URIs
*/
function setBaseURI(string memory _baseURI) public onlyOwner {
}
/**
* @dev Set allowed account to issue tokens.
* @param _operator - Address allowed to issue tokens
* @param _allowed - Whether is allowed or not
*/
function setAllowed(address _operator, bool _allowed) public onlyOwner {
}
/**
* @dev Set collection issuance
* @param _key - Game key for collection
*/
function setCollectionIssuance(bytes32 _key, uint256 _issuance) external onlyAllowed {
}
/**
* @dev Set max allowed mints
* @param _allowed - Number of allowed mints
*/
function setMaxAllowed(uint256 _allowed) external onlyAllowed {
}
/**
* @dev Set premint
* @param _isPremint - value to set
*/
function setPremint(bool _isPremint) external onlyAllowed {
}
/**
* @dev Get collection issuance
* @param _key - Game key for collection
*/
function getMaxIssuance(bytes32 _key) external view onlyAllowed returns(uint256) {
}
/**
* @dev Return url for contract metadata
* @return contract URI
*/
function contractURI() public pure returns (string memory) {
}
/**
* @dev Withdraw all ether from this contract
*/
function withdraw() onlyOwner public {
}
/**
* @dev Returns an URI for a given token ID.
* Throws if the token ID does not exist. May return an empty string.
* @param _tokenId - uint256 ID of the token queried
* @return token URI
* This will point to specific issue of the game, e.g. #2 with some attributes if needed?
*/
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory) {
}
/**
* @dev Add a new game to the collection.
* @notice that this method allows gameIds of any size. It should be used
* if a gameId is greater than 32 bytes
* @param _gameId - game id
* @param _maxIssuance - total supply for the game
* @param _price - price for the game
*/
function addGame(string memory _gameId, uint256 _maxIssuance, uint256 _price, string memory _gameURI)
external
onlyOwner {
}
/**
* @dev Get keccak256 of a gameId.
* @param _gameId - token game
* @return bytes32 keccak256 of the gameId
*/
function getGameKey(string memory _gameId) public pure returns (bytes32) {
}
/**
* @dev Get issued for certain gameId
* @param _gameId - token game
* @return uint256 of the issuance of that game
*/
function getIssued(string memory _gameId) external view returns (uint256) {
}
/**
* @dev Mint a new NFT of the specified kind.
* @notice that will throw if kind has reached its maximum or is invalid
* @param _beneficiary - owner of the token
* @param _tokenId - token
* @param _gameIdKey - game key
* @param _gameId - token game
* @param _issuedId - issued id
*/
function _mint(
address _beneficiary,
uint256 _tokenId,
bytes32 _gameIdKey,
string memory _gameId,
uint256 _issuedId
) internal {
require(
_issuedId > 0 && _issuedId <= maxIssuance[_gameIdKey],
"Invalid issued id"
);
require(
issued[_gameIdKey] < maxIssuance[_gameIdKey],
"Game exhausted"
);
require(
allowed[msg.sender]
? msg.value >= 0
: collectionPrice[_gameIdKey] <= msg.value,
"Ether value sent is not correct"
);
require(<FILL_ME>)
// Mint erc721 token
super._mint(_beneficiary, _tokenId);
// Increase issuance
issued[_gameIdKey] = issued[_gameIdKey] + 1;
tokenTracker = tokenTracker + 1;
// Log
emit Issue(_beneficiary, _tokenId, _gameIdKey, _gameId, _issuedId);
}
/** @notice Enumerate NFTs assigned to an owner
* @dev Throws if `_index` >= `balanceOf(_owner)` or if
* `_owner` is the zero address, representing invalid NFTs.
* @param _owner An address where we are interested in NFTs owned by them
* @param _index A counter less than `balanceOf(_owner)`
* @return The token identifier for the `_index`th NFT assigned to `_owner`,
* (sort order not specified)
*/
function tokenOfOwner(address _owner, uint256 _index)
external
view
returns (uint256) {
}
/**
* @notice Count all NFTs assigned to an owner
* @dev NFTs assigned to the zero address are considered invalid, and this
* function throws for queries about the zero address.
* @param _owner An address for whom to query the balance
* @return The number of NFTs owned by `_owner`, possibly zero
*/
function balance(address _owner) public view returns (uint256) {
}
}
| !isPremint?true:allowed[msg.sender]?true:(t.balanceOf(_beneficiary)>0||a.balanceOf(_beneficiary)>0),"Beneficiary is not owner of a Cryptoadz or ArcadeNFT" | 279,908 | !isPremint?true:allowed[msg.sender]?true:(t.balanceOf(_beneficiary)>0||a.balanceOf(_beneficiary)>0) |
null | pragma solidity ^0.5.11;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface USDContract{
function sendFunds() external payable;
function ethPricerAddress() external view returns (address);
function multiplier() external view returns (uint256);
function assetContracts(address input) external view returns (bool);
function USDtrade(address sender,uint amount) external;
function primary() external view returns (address);
}
contract USDable {
address payable private _USDcontractaddress = 0x7c0AFD49D40Ec308d49E2926E5c99B037d54EE7e;
function USDcontractaddress() internal view returns (address){
}
function setUSDcontractaddress(address payable input) public {
require(msg.sender == USDContract(USDcontractaddress()).primary(), "Secondary: caller is not the primary account");
require(input != address(this));
require(<FILL_ME>)
require(input != msg.sender);
require(input != address(0));
require(msg.sender == USDContract(input).primary());
_USDcontractaddress = input;
}
modifier onlyUSDContract() {
}
function sendFunds(uint amount) internal {
}
function ethPricerAddress() internal view returns (address) {
}
function multiplier() internal view returns (uint256) {
}
function assetContracts(address input) internal view returns (bool) {
}
function USDtrade(address sender,uint amount) internal {
}
}
contract Secondary is USDable{
modifier onlyPrimary() {
}
function primary() internal view returns (address) {
}
}
interface EthPricer{
function ethUpper() external view returns (uint256);
function ethLower() external view returns (uint256);
}
contract EthPriceable is Secondary{
function ethUpper() internal view returns (uint256) {
}
function ethLower() internal view returns (uint256) {
}
}
interface AssetPricer{
function updateAssetPrice() external payable returns (bytes32);
function Fee() external returns (uint256);
function assetUpper(bool isShort) external view returns (uint256);
function assetLower(bool isShort) external view returns (uint256);
function updateGasPrice() external;
}
contract AssetPriceable is Secondary{
using SafeMath for uint256;
address payable private _assetPricerAddress;
bool constant private _isShort = false;
function setAssetPricerAddress(address payable input) public onlyPrimary {
}
modifier onlyAssetPricer() {
}
function Fee() internal returns (uint256) {
}
function assetUpper() internal view returns (uint256) {
}
function assetLower() internal view returns (uint256) {
}
function updateAssetPrice() internal returns (bytes32) {
}
function assetPricerAddress() public view onlyUSDContract returns (address) {
}
function isShort() public view onlyUSDContract returns (bool) {
}
}
contract ERC20 is IERC20, EthPriceable, AssetPriceable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 value) internal {
}
function _approve(address owner, address spender, uint256 value) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface token {
function balanceOf(address input) external returns (uint256);
function transfer(address input, uint amount) external;
}
contract AssetToken is ERC20, ERC20Detailed {
mapping(bytes32=>customer) private Customers;
struct customer {
address myAddress;
uint256 valuesent;
}
constructor () public ERC20Detailed("Onyx S&P 500", "OSPV", 18) {
}
function () external payable {
}
function assetPriceUpdated(bytes32 customerId, bool marketOpen) public onlyAssetPricer {
}
function AssetMint(address to, uint256 valuesent) public {
}
function AssetBurn(address to, uint256 valuesent) public onlyPrimary{
}
function getStuckTokens(address _tokenAddress) public {
}
function getLostFunds() public onlyPrimary {
}
}
| !assetContracts(input) | 280,010 | !assetContracts(input) |
"Amount sent is too small" | pragma solidity ^0.5.11;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface USDContract{
function sendFunds() external payable;
function ethPricerAddress() external view returns (address);
function multiplier() external view returns (uint256);
function assetContracts(address input) external view returns (bool);
function USDtrade(address sender,uint amount) external;
function primary() external view returns (address);
}
contract USDable {
address payable private _USDcontractaddress = 0x7c0AFD49D40Ec308d49E2926E5c99B037d54EE7e;
function USDcontractaddress() internal view returns (address){
}
function setUSDcontractaddress(address payable input) public {
}
modifier onlyUSDContract() {
}
function sendFunds(uint amount) internal {
}
function ethPricerAddress() internal view returns (address) {
}
function multiplier() internal view returns (uint256) {
}
function assetContracts(address input) internal view returns (bool) {
}
function USDtrade(address sender,uint amount) internal {
}
}
contract Secondary is USDable{
modifier onlyPrimary() {
}
function primary() internal view returns (address) {
}
}
interface EthPricer{
function ethUpper() external view returns (uint256);
function ethLower() external view returns (uint256);
}
contract EthPriceable is Secondary{
function ethUpper() internal view returns (uint256) {
}
function ethLower() internal view returns (uint256) {
}
}
interface AssetPricer{
function updateAssetPrice() external payable returns (bytes32);
function Fee() external returns (uint256);
function assetUpper(bool isShort) external view returns (uint256);
function assetLower(bool isShort) external view returns (uint256);
function updateGasPrice() external;
}
contract AssetPriceable is Secondary{
using SafeMath for uint256;
address payable private _assetPricerAddress;
bool constant private _isShort = false;
function setAssetPricerAddress(address payable input) public onlyPrimary {
}
modifier onlyAssetPricer() {
}
function Fee() internal returns (uint256) {
}
function assetUpper() internal view returns (uint256) {
}
function assetLower() internal view returns (uint256) {
}
function updateAssetPrice() internal returns (bytes32) {
}
function assetPricerAddress() public view onlyUSDContract returns (address) {
}
function isShort() public view onlyUSDContract returns (bool) {
}
}
contract ERC20 is IERC20, EthPriceable, AssetPriceable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(recipient != USDcontractaddress(), "You can only send tokens to their own contract!");
if(recipient == address(this)){
require(<FILL_ME>)
_burn(sender,amount);
USDtrade(sender,amount);
}else{
require(!assetContracts(recipient), "You can only send tokens to their own contract!");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 value) internal {
}
function _approve(address owner, address spender, uint256 value) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface token {
function balanceOf(address input) external returns (uint256);
function transfer(address input, uint amount) external;
}
contract AssetToken is ERC20, ERC20Detailed {
mapping(bytes32=>customer) private Customers;
struct customer {
address myAddress;
uint256 valuesent;
}
constructor () public ERC20Detailed("Onyx S&P 500", "OSPV", 18) {
}
function () external payable {
}
function assetPriceUpdated(bytes32 customerId, bool marketOpen) public onlyAssetPricer {
}
function AssetMint(address to, uint256 valuesent) public {
}
function AssetBurn(address to, uint256 valuesent) public onlyPrimary{
}
function getStuckTokens(address _tokenAddress) public {
}
function getLostFunds() public onlyPrimary {
}
}
| amount>(Fee().mul(ethUpper())).div(assetLower()),"Amount sent is too small" | 280,010 | amount>(Fee().mul(ethUpper())).div(assetLower()) |
"You can only send tokens to their own contract!" | pragma solidity ^0.5.11;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface USDContract{
function sendFunds() external payable;
function ethPricerAddress() external view returns (address);
function multiplier() external view returns (uint256);
function assetContracts(address input) external view returns (bool);
function USDtrade(address sender,uint amount) external;
function primary() external view returns (address);
}
contract USDable {
address payable private _USDcontractaddress = 0x7c0AFD49D40Ec308d49E2926E5c99B037d54EE7e;
function USDcontractaddress() internal view returns (address){
}
function setUSDcontractaddress(address payable input) public {
}
modifier onlyUSDContract() {
}
function sendFunds(uint amount) internal {
}
function ethPricerAddress() internal view returns (address) {
}
function multiplier() internal view returns (uint256) {
}
function assetContracts(address input) internal view returns (bool) {
}
function USDtrade(address sender,uint amount) internal {
}
}
contract Secondary is USDable{
modifier onlyPrimary() {
}
function primary() internal view returns (address) {
}
}
interface EthPricer{
function ethUpper() external view returns (uint256);
function ethLower() external view returns (uint256);
}
contract EthPriceable is Secondary{
function ethUpper() internal view returns (uint256) {
}
function ethLower() internal view returns (uint256) {
}
}
interface AssetPricer{
function updateAssetPrice() external payable returns (bytes32);
function Fee() external returns (uint256);
function assetUpper(bool isShort) external view returns (uint256);
function assetLower(bool isShort) external view returns (uint256);
function updateGasPrice() external;
}
contract AssetPriceable is Secondary{
using SafeMath for uint256;
address payable private _assetPricerAddress;
bool constant private _isShort = false;
function setAssetPricerAddress(address payable input) public onlyPrimary {
}
modifier onlyAssetPricer() {
}
function Fee() internal returns (uint256) {
}
function assetUpper() internal view returns (uint256) {
}
function assetLower() internal view returns (uint256) {
}
function updateAssetPrice() internal returns (bytes32) {
}
function assetPricerAddress() public view onlyUSDContract returns (address) {
}
function isShort() public view onlyUSDContract returns (bool) {
}
}
contract ERC20 is IERC20, EthPriceable, AssetPriceable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(recipient != USDcontractaddress(), "You can only send tokens to their own contract!");
if(recipient == address(this)){
require(amount > (Fee().mul(ethUpper())).div(assetLower()), "Amount sent is too small");
_burn(sender,amount);
USDtrade(sender,amount);
}else{
require(<FILL_ME>)
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
}
function _burn(address account, uint256 value) internal {
}
function _approve(address owner, address spender, uint256 value) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface token {
function balanceOf(address input) external returns (uint256);
function transfer(address input, uint amount) external;
}
contract AssetToken is ERC20, ERC20Detailed {
mapping(bytes32=>customer) private Customers;
struct customer {
address myAddress;
uint256 valuesent;
}
constructor () public ERC20Detailed("Onyx S&P 500", "OSPV", 18) {
}
function () external payable {
}
function assetPriceUpdated(bytes32 customerId, bool marketOpen) public onlyAssetPricer {
}
function AssetMint(address to, uint256 valuesent) public {
}
function AssetBurn(address to, uint256 valuesent) public onlyPrimary{
}
function getStuckTokens(address _tokenAddress) public {
}
function getLostFunds() public onlyPrimary {
}
}
| !assetContracts(recipient),"You can only send tokens to their own contract!" | 280,010 | !assetContracts(recipient) |
"ERR_NOT_FORGE" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
require(<FILL_ME>)
_;
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _mint_forges[msg.sender],"ERR_NOT_FORGE" | 280,094 | _mint_forges[msg.sender] |
"ERR_NOT_FORGE" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
require(<FILL_ME>)
_;
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _burn_forges[msg.sender],"ERR_NOT_FORGE" | 280,094 | _burn_forges[msg.sender] |
"ERR_NOT_BOUND" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
require(<FILL_ME>)
return _records[token].denorm;
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _records[token].bound,"ERR_NOT_BOUND" | 280,094 | _records[token].bound |
"ERR_NOT_BOUND" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
Record storage record = _records[token];
require(<FILL_ME>)
return record.balance;
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| record.bound,"ERR_NOT_BOUND" | 280,094 | record.bound |
"ERR_NOT_BOUND" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
for (uint256 i = 0; i < tokens.length; i++){
require(<FILL_ME>)
_setDesiredDenorm(tokens[i], Denorms[i]);
}
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _records[tokens[i]].bound,"ERR_NOT_BOUND" | 280,094 | _records[tokens[i]].bound |
"ERR_OUT_NOT_READY" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
require(minAmountsOut.length == _tokens.length, "ERR_ARR_LEN");
uint256 dynasetTotal = totalSupply();
uint256 ratio = bdiv(dynasetAmountIn, dynasetTotal);
require(ratio != 0, "ERR_MATH_APPROX");
_pulldynasetShare(msg.sender, dynasetAmountIn);
_burndynasetShare(dynasetAmountIn);
for (uint256 i = 0; i < minAmountsOut.length; i++) {
address t = _tokens[i];
Record memory record = _records[t];
if (record.ready) {
uint256 tokenAmountOut = bmul(ratio, record.balance);
require(tokenAmountOut != 0, "ERR_MATH_APPROX");
require(tokenAmountOut >= minAmountsOut[i], "ERR_LIMIT_OUT");
_records[t].balance = bsub(record.balance, tokenAmountOut);
emit LOG_EXIT(msg.sender, t, tokenAmountOut);
_pushUnderlying(t, msg.sender, tokenAmountOut);
}else{
require(<FILL_ME>)
}
}
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| minAmountsOut[i]==0,"ERR_OUT_NOT_READY" | 280,094 | minAmountsOut[i]==0 |
"ERR_NOT_BOUND" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
require(<FILL_ME>)
require(_records[_tokenOut].bound, "ERR_NOT_BOUND");
//next we need to allow the uniswapv2 router to spend the token we just sent to this contract
//by calling IERC20 approve you allow the uniswap contract to spend the tokens in this contract
IERC20(_tokenIn).approve(UNISWAP_V2_ROUTER, _amountIn);
//path is an array of addresses.
//this path array will have 3 addresses [tokenIn, WETH, tokenOut]
//the if statement below takes into account if token in or token out is WETH. then the path is only 2 addresses
address[] memory path;
if (_tokenIn == WETH || _tokenOut == WETH) {
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
} else {
path = new address[](3);
path[0] = _tokenIn;
path[1] = WETH;
path[2] = _tokenOut;
}
//then we will call swapExactTokensForTokens
//for the deadline we will pass in block.timestamp
//the deadline is the latest time the trade is valid for
IUniswapV2Router(UNISWAP_V2_ROUTER).swapExactTokensForTokens(
_amountIn,
_amountOutMin,
path,
address(this),
block.timestamp
);
uint256 balance_in = IERC20(_tokenIn).balanceOf(address(this));
uint256 balance_out = IERC20(_tokenOut).balanceOf(address(this));
_records[_tokenIn].balance = balance_in;
_records[_tokenOut].balance = balance_out;
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _records[_tokenIn].bound,"ERR_NOT_BOUND" | 280,094 | _records[_tokenIn].bound |
"ERR_NOT_BOUND" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
require(_records[_tokenIn].bound, "ERR_NOT_BOUND");
require(<FILL_ME>)
//next we need to allow the uniswapv2 router to spend the token we just sent to this contract
//by calling IERC20 approve you allow the uniswap contract to spend the tokens in this contract
IERC20(_tokenIn).approve(UNISWAP_V2_ROUTER, _amountIn);
//path is an array of addresses.
//this path array will have 3 addresses [tokenIn, WETH, tokenOut]
//the if statement below takes into account if token in or token out is WETH. then the path is only 2 addresses
address[] memory path;
if (_tokenIn == WETH || _tokenOut == WETH) {
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
} else {
path = new address[](3);
path[0] = _tokenIn;
path[1] = WETH;
path[2] = _tokenOut;
}
//then we will call swapExactTokensForTokens
//for the deadline we will pass in block.timestamp
//the deadline is the latest time the trade is valid for
IUniswapV2Router(UNISWAP_V2_ROUTER).swapExactTokensForTokens(
_amountIn,
_amountOutMin,
path,
address(this),
block.timestamp
);
uint256 balance_in = IERC20(_tokenIn).balanceOf(address(this));
uint256 balance_out = IERC20(_tokenOut).balanceOf(address(this));
_records[_tokenIn].balance = balance_in;
_records[_tokenOut].balance = balance_out;
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _records[_tokenOut].bound,"ERR_NOT_BOUND" | 280,094 | _records[_tokenOut].bound |
"forge already added" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
require(<FILL_ME>)
_mint_forges[_mintForge] = true;
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| !_mint_forges[_mintForge],"forge already added" | 280,094 | !_mint_forges[_mintForge] |
"forge already added" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
require(<FILL_ME>)
_burn_forges[_burnForge] = true;
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| !_burn_forges[_burnForge],"forge already added" | 280,094 | !_burn_forges[_burnForge] |
"not forge " | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
require(<FILL_ME>)
delete _mint_forges[_mintForge];
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _mint_forges[_mintForge],"not forge " | 280,094 | _mint_forges[_mintForge] |
"not forge " | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/* ========== Internal Inheritance ========== */
import "./DToken.sol";
import "./BMath.sol";
/* ========== Internal Interfaces ========== */
import "./interfaces/IDynaset.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAgregator.sol";
/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol
This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.
Subject to the GPL-3.0 license
*************************************************************************************************/
contract Dynaset is DToken, BMath, IDynaset {
/* ========== EVENTS ========== */
/** @dev Emitted when tokens are swapped. */
event LOG_SWAP(
address indexed tokenIn,
address indexed tokenOut,
uint256 Amount
);
/** @dev Emitted when underlying tokens are deposited for dynaset tokens. */
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
/** @dev Emitted when dynaset tokens are burned for underlying. */
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
/** @dev Emitted when a token's weight updates. */
event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);
/* ========== Modifiers ========== */
modifier _logs_() {
}
modifier _lock_ {
}
modifier _viewlock_() {
}
modifier _control_ {
}
modifier _digital_asset_managers_ {
}
modifier _mint_forge_ {
}
modifier _burn_forge_ {
}
/* uniswap addresses*/
//address of the uniswap v2 router
address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
//address of the oneInch v3 aggregation router
address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/* ========== Storage ========== */
bool internal _mutex;
// Account with CONTROL role. Able to modify the swap fee,
// adjust token weights, bind and unbind tokens and lock
// public swaps & joins.
address internal _controller;
address internal _digital_asset_manager;
mapping(address =>bool) internal _mint_forges;
mapping(address =>bool) internal _burn_forges;
// Array of underlying tokens in the dynaset.
address[] internal _tokens;
// Internal records of the dynaset's underlying tokens
mapping(address => Record) internal _records;
// Total denormalized weight of the dynaset.
uint256 internal _totalWeight;
constructor() public {
}
/* ========== Controls ========== */
/**
* @dev Sets the controller address and the token name & symbol.
*
* Note: This saves on storage costs for multi-step dynaset deployment.
*
* @param controller Controller of the dynaset
* @param name Name of the dynaset token
* @param symbol Symbol of the dynaset token
*/
function configure(
address controller,//admin
address dam,//digital asset manager
string calldata name,
string calldata symbol
) external override _control_{
}
/**
* @dev Sets up the initial assets for the pool.
*
* Note: `tokenProvider` must have approved the pool to transfer the
* corresponding `balances` of `tokens`.
*
* @param tokens Underlying tokens to initialize the pool with
* @param balances Initial balances to transfer
* @param denorms Initial denormalized weights for the tokens
* @param tokenProvider Address to transfer the balances from
*/
function initialize(
address[] calldata tokens,
uint256[] calldata balances,
uint96[] calldata denorms,
address tokenProvider
)
external
override
_control_
{
}
/**
* @dev Get all bound tokens.
*/
function getCurrentTokens()
public
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the list of tokens which have a desired weight above 0.
* Tokens with a desired weight of 0 are set to be phased out of the dynaset.
*/
function getCurrentDesiredTokens()
external
view
override
returns (address[] memory tokens)
{
}
/**
* @dev Returns the denormalized weight of a bound token.
*/
function getDenormalizedWeight(address token)
external
view
override
returns (uint256/* denorm */)
{
}
function getNormalizedWeight(address token)
external
view
_viewlock_
returns (uint)
{
}
/**
* @dev Get the total denormalized weight of the dynaset.
*/
function getTotalDenormalizedWeight()
external
view
override
returns (uint256)
{
}
/**
* @dev Returns the stored balance of a bound token.
*/
function getBalance(address token) external view override returns (uint256) {
}
/**
* @dev Sets the desired weights for the pool tokens, which
* will be adjusted over time as they are swapped.
*
* Note: This does not check for duplicate tokens or that the total
* of the desired weights is equal to the target total weight (25).
* Those assumptions should be met in the controller. Further, the
* provided tokens should only include the tokens which are not set
* for removal.
*/
function reweighTokens(
address[] calldata tokens,
uint96[] calldata Denorms
)
external
override
_lock_
_control_
{
}
// Absorb any tokens that have been sent to this contract into the dynaset
function updateAfterSwap(address _tokenIn,address _tokenOut) external _digital_asset_managers_{
}
/* ========== Liquidity Provider Actions ========== */
/*
* @dev Mint new dynaset tokens by providing the proportional amount of each
* underlying token's balance relative to the proportion of dynaset tokens minted.
*
*
* @param dynasetAmountOut Amount of dynaset tokens to mint
* @param maxAmountsIn Maximum amount of each token to pay in the same
* order as the dynaset's _tokens list.
*/
function joinDynaset(uint256 _amount) external override _mint_forge_{
}
function _joinDynaset(uint256 dynasetAmountOut, uint256[] memory maxAmountsIn)
internal
//external
//override
{
}
/*
* @dev Burns `dynasetAmountIn` dynaset tokens in exchange for the amounts of each
* underlying token's balance proportional to the ratio of tokens burned to
* total dynaset supply. The amount of each token transferred to the caller must
* be greater than or equal to the associated minimum output amount from the
* `minAmountsOut` array.
*
* @param dynasetAmountIn Exact amount of dynaset tokens to burn
* @param minAmountsOut Minimum amount of each token to receive, in the same
* order as the dynaset's _tokens list.
*/
function exitDynaset(uint256 _amount) external override _burn_forge_ {
}
function _exitDynaset(uint256 dynasetAmountIn, uint256[] memory minAmountsOut)
internal
{
}
/* ========== Other ========== */
/**
* @dev Absorb any tokens that have been sent to the dynaset.
* If the token is not bound, it will be sent to the unbound
* token handler.
*/
/* ========== Token Swaps ========== */
function ApproveOneInch(address token,uint256 amount) external _digital_asset_managers_ {
}
function swapUniswap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin)
external
_digital_asset_managers_
{
}
//swap using oneinch api
function swapOneInch(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
bytes32[] calldata _data)
external
_digital_asset_managers_
{
}
function swapOneInchUniV3(
address _tokenIn,
address _tokenOut,
uint256 amount,
uint256 minReturn,
uint256[] calldata _pools)
external
_digital_asset_managers_
{
}
/* ========== Config Queries ========== */
function setMintForge(address _mintForge) external _control_ returns(address) {
}
function setBurnForge(address _burnForge) external _control_ returns(address) {
}
function removeMintForge(address _mintForge) external _control_ returns(address) {
}
function removeBurnForge(address _burnForge) external _control_ returns(address) {
require(<FILL_ME>)
delete _burn_forges[_burnForge];
}
/**
* @dev Returns the controller address.
*/
function getController() external view override returns (address) {
}
/* ========== Token Queries ========== */
/**
* @dev Check if a token is bound to the dynaset.
*/
function isBound(address t) external view override returns (bool) {
}
/**
* @dev Get the number of tokens bound to the dynaset.
*/
function getNumTokens() external view override returns (uint256) {
}
/**
* @dev Returns the record for a token bound to the dynaset.
*/
function getTokenRecord(address token)
external
view
override
returns (Record memory record)
{
}
/* ========== Price Queries ========== */
function _setDesiredDenorm(address token, uint96 Denorm) internal {
}
/* ========== dynaset Share Internal Functions ========== */
function _pulldynasetShare(address from, uint256 amount) internal {
}
function _pushdynasetShare(address to, uint256 amount) internal {
}
function _mintdynasetShare(uint256 amount) internal {
}
function _burndynasetShare(uint256 amount) internal {
}
/* ========== Underlying Token Internal Functions ========== */
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(
address erc20,
address from,
uint256 amount
) internal {
}
function _pushUnderlying(
address erc20,
address to,
uint256 amount
) internal {
}
function withdrawAnyTokens(address token,uint256 amount)
external
_control_ {
}
/* ========== Token Management Internal Functions ========== */
/**
* @dev Handles weight changes and initialization of an
* input token.
*
* If the token is not initialized and the new balance is
* still below the minimum, this will not do anything.
*
* If the token is not initialized but the new balance will
* bring the token above the minimum balance, this will
* mark the token as initialized, remove the minimum
* balance and set the weight to the minimum weight plus
* 1%.
*
*
* @param token Address of the input token
* and weight if the token was uninitialized.
*/
function _updateInputToken(
address token,
uint256 realBalance
)
internal
{
}
/* ========== Token Query Internal Functions ========== */
/**
* @dev Get the record for a token which is being swapped in.
* The token must be bound to the dynaset. If the token is not
* initialized (meaning it does not have the minimum balance)
* this function will return the actual balance of the token
* which the dynaset holds, but set the record's balance and weight
* to the token's minimum balance and the dynaset's minimum weight.
* This allows the token swap to be priced correctly even if the
* dynaset does not own any of the tokens.
*/
function _getInputToken(address token)
internal
view
returns (Record memory record, uint256 realBalance)
{
}
function calcTokensForAmount(uint256 _amount)
external
view
returns (address[] memory tokens, uint256[] memory amounts)
{
}
}
| _burn_forges[_burnForge],"not forge " | 280,094 | _burn_forges[_burnForge] |
"Not Whitelisted" | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./external/Ownable.sol";
import "./interface/IERC20Metadata.sol";
import "./interface/IBondingCalculator.sol";
import "./library/SafeMath.sol";
import "./library/SafeERC20.sol";
import "./library/FixedPoint.sol";
contract SwapBondDepository is Ownable, ReentrancyGuard {
using FixedPoint for *;
using SafeERC20 for IERC20;
using SafeMath for uint;
/* ======== EVENTS ======== */
event BondCreated( uint deposit, uint indexed payout, uint indexed expires, uint indexed priceInUSD );
event BondRedeemed( address indexed recipient, uint payout, uint remaining );
event BondPriceChanged( uint indexed priceInUSD, uint indexed internalPrice, uint indexed debtRatio );
event ControlVariableAdjustment( uint initialBCV, uint newBCV, uint adjustment, bool addition );
/* ======== STATE VARIABLES ======== */
address public immutable SWAP; // token given as payment for bond
address public immutable principal; // token used to create bond
address public immutable treasury; // mints SWAP when receives principal
address public immutable DAO; // receives profit share from bond
bool public immutable isLiquidityBond; // LP and Reserve bonds are treated slightly different
address public immutable bondCalculator; // calculates value of LP tokens
address private pairAddressSwap;
address private pairAddressPrinciple;
Terms public terms; // stores terms for new bonds
Adjust public adjustment; // stores adjustment to BCV data
mapping( uint => mapping(address => Bond)) public bondInfo; // stores bond information for depositors
mapping( address => bool ) public whitelist; // stores whitelist for minters
uint public totalDebt; // total value of outstanding bonds; used for pricing
uint public lastDecay; // reference timestamp for debt decay
uint public constant CONTROL_VARIABLE_PRECISION = 10_000;
/* ======== STRUCTS ======== */
// Info for creating new bonds
struct Terms {
uint controlVariable; // scaling variable for price, in hundreths
uint[] vestingTerm; // in time
uint minimumPrice; // vs principal value
uint maxPayout; // in thousandths of a %. i.e. 500 = 0.5%
uint[] fee; // as % of bond payout, in hundreths. ( 500 = 5% = 0.05 for every 1 paid)
uint maxDebt; // 9 decimal debt ratio, max % total supply created as debt
}
// Info for bond holder
struct Bond {
uint payout; // SWAP remaining to be paid
uint vesting; // Time left to vest
uint lastTimestamp; // Last interaction
uint pricePaid; // In USDT, for front end viewing
}
// Info for incremental adjustments to control variable
struct Adjust {
bool add; // addition or subtraction
uint rate; // increment
uint target; // BCV when adjustment finished
uint buffer; // minimum length (in blocks) between adjustments
uint lastTimestamp; // block when last adjustment made
}
/* ======== INITIALIZATION ======== */
constructor (
address _SWAP,
address _principal,
address _treasury,
address _DAO,
address _bondCalculator,
address _pairAddressSwap,
address _pairAddressPrinciple
) {
}
/**
* @notice whitelist modifier
*/
modifier onlyWhitelisted() {
require(<FILL_ME>)
_;
}
/**
* @notice contract checker modifier
*/
modifier notContract(address _addr) {
}
/**
* @notice update whitelist
* @param _target address
* @param _value bool
*/
function updateWhitelist(address _target, bool _value) external onlyOwner {
}
/**
* @notice update pair address
* @param _pair address
*/
function updatePairAddress(address _pair, bool _swap) external onlyOwner {
}
/**
* @notice update whitelistfor multiple addresses
* @param _target address[]
* @param _value bool[]
*/
function updateBatchWhitelist(address[] calldata _target, bool[] calldata _value) external onlyOwner {
}
/**
* @notice initializes bond parameters
* @param _controlVariable uint
* @param _vestingTerm uint
* @param _minimumPrice uint
* @param _maxPayout uint
* @param _fee uint
* @param _maxDebt uint
* @param _initialDebt uint
*/
function initializeBondTerms(
uint _controlVariable,
uint[] calldata _vestingTerm,
uint _minimumPrice,
uint _maxPayout,
uint[] calldata _fee,
uint _maxDebt,
uint _initialDebt
) external onlyOwner {
}
/* ======== POLICY FUNCTIONS ======== */
enum PARAMETER { VESTING, PAYOUT, FEE, DEBT }
/**
* @notice set parameters for new bonds
* @param _parameter PARAMETER
* @param _input uint
*/
function setBondTerms ( PARAMETER _parameter, uint _input, uint _term ) external onlyOwner {
}
/**
* @notice set control variable adjustment
* @param _addition bool
* @param _increment uint
* @param _target uint
* @param _buffer uint
*/
function setAdjustment (
bool _addition,
uint _increment,
uint _target,
uint _buffer
) external onlyOwner {
}
/* ======== USER FUNCTIONS ======== */
/**
* @notice deposit bond
* @param _amount uint
* @param _maxPrice uint
* @param _depositor address
* @return uint
*/
function deposit(
uint _amount,
uint _maxPrice,
address _depositor,
uint _term
) external onlyWhitelisted nonReentrant notContract(_msgSender()) returns ( uint ) {
}
/**
* @notice redeem bond for user
* @param _recipient address
* @return uint
*/
function redeem( address _recipient, uint _term ) external onlyWhitelisted nonReentrant notContract(_msgSender()) returns ( uint ) {
}
/* ======== INTERNAL HELPER FUNCTIONS ======== */
/**
* @notice allow user to payout automatically
* @param _amount uint
* @return uint
*/
function sendTo( address _recipient, uint _amount ) internal returns ( uint ) {
}
/**
* @notice makes incremental adjustment to control variable
*/
function adjust() internal {
}
/**
* @notice reduce total debt
*/
function decayDebt() internal {
}
/* ======== VIEW FUNCTIONS ======== */
/**
* @notice contract checker viewer
*/
function isContract(address _addr) private view returns (bool){
}
/**
* @notice determine maximum bond size
* @return uint
*/
function maxPayout() public view returns ( uint ) {
}
/**
* @notice calculate current bond premium
* @return price_ uint
*/
function bondPrice() internal view returns ( uint price_ ) {
}
/**
* @notice calculate current bond price and remove floor if above
* @return price_ uint
*/
function _bondPrice() internal returns ( uint price_ ) {
}
/**
* @notice returns SWAP valuation of asset
* @param _token address
* @param _amount uint256
* @return value_ uint256
*/
function tokenValue(address _token, uint256 _amount) internal view returns (uint256 value_) {
}
/**
* @notice converts bond price to DAI value
* @return price_ uint
*/
function bondPriceInUSD(uint _term) public view returns ( uint price_ ) {
}
/**
* @notice calculate current ratio of debt to SWAP supply
* @return debtRatio_ uint
*/
function debtRatio() public view returns ( uint debtRatio_ ) {
}
/**
* @notice calculate debt factoring in decay
* @return uint
*/
function currentDebt() public view returns ( uint ) {
}
/**
* @notice calculate how far into vesting a depositor is
* @param _depositor address
* @return percentVested_ uint
*/
function percentVestedFor( address _depositor, uint _term ) public view returns ( uint percentVested_ ) {
}
/**
* @notice calculate amount of SWAP available for claim by depositor
* @param _depositor address
* @return pendingPayout_ uint
*/
function pendingPayoutFor( address _depositor, uint _term ) external view returns ( uint pendingPayout_ ) {
}
/* ======= AUXILLIARY ======= */
/**
* @notice allow anyone to send lost tokens (excluding principal or SWAP) to the DAO
* @return bool
*/
function recoverLostToken( address _token ) external returns ( bool ) {
}
}
| whitelist[_msgSender()],"Not Whitelisted" | 280,104 | whitelist[_msgSender()] |
"Contract address" | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./external/Ownable.sol";
import "./interface/IERC20Metadata.sol";
import "./interface/IBondingCalculator.sol";
import "./library/SafeMath.sol";
import "./library/SafeERC20.sol";
import "./library/FixedPoint.sol";
contract SwapBondDepository is Ownable, ReentrancyGuard {
using FixedPoint for *;
using SafeERC20 for IERC20;
using SafeMath for uint;
/* ======== EVENTS ======== */
event BondCreated( uint deposit, uint indexed payout, uint indexed expires, uint indexed priceInUSD );
event BondRedeemed( address indexed recipient, uint payout, uint remaining );
event BondPriceChanged( uint indexed priceInUSD, uint indexed internalPrice, uint indexed debtRatio );
event ControlVariableAdjustment( uint initialBCV, uint newBCV, uint adjustment, bool addition );
/* ======== STATE VARIABLES ======== */
address public immutable SWAP; // token given as payment for bond
address public immutable principal; // token used to create bond
address public immutable treasury; // mints SWAP when receives principal
address public immutable DAO; // receives profit share from bond
bool public immutable isLiquidityBond; // LP and Reserve bonds are treated slightly different
address public immutable bondCalculator; // calculates value of LP tokens
address private pairAddressSwap;
address private pairAddressPrinciple;
Terms public terms; // stores terms for new bonds
Adjust public adjustment; // stores adjustment to BCV data
mapping( uint => mapping(address => Bond)) public bondInfo; // stores bond information for depositors
mapping( address => bool ) public whitelist; // stores whitelist for minters
uint public totalDebt; // total value of outstanding bonds; used for pricing
uint public lastDecay; // reference timestamp for debt decay
uint public constant CONTROL_VARIABLE_PRECISION = 10_000;
/* ======== STRUCTS ======== */
// Info for creating new bonds
struct Terms {
uint controlVariable; // scaling variable for price, in hundreths
uint[] vestingTerm; // in time
uint minimumPrice; // vs principal value
uint maxPayout; // in thousandths of a %. i.e. 500 = 0.5%
uint[] fee; // as % of bond payout, in hundreths. ( 500 = 5% = 0.05 for every 1 paid)
uint maxDebt; // 9 decimal debt ratio, max % total supply created as debt
}
// Info for bond holder
struct Bond {
uint payout; // SWAP remaining to be paid
uint vesting; // Time left to vest
uint lastTimestamp; // Last interaction
uint pricePaid; // In USDT, for front end viewing
}
// Info for incremental adjustments to control variable
struct Adjust {
bool add; // addition or subtraction
uint rate; // increment
uint target; // BCV when adjustment finished
uint buffer; // minimum length (in blocks) between adjustments
uint lastTimestamp; // block when last adjustment made
}
/* ======== INITIALIZATION ======== */
constructor (
address _SWAP,
address _principal,
address _treasury,
address _DAO,
address _bondCalculator,
address _pairAddressSwap,
address _pairAddressPrinciple
) {
}
/**
* @notice whitelist modifier
*/
modifier onlyWhitelisted() {
}
/**
* @notice contract checker modifier
*/
modifier notContract(address _addr) {
require(<FILL_ME>)
_;
}
/**
* @notice update whitelist
* @param _target address
* @param _value bool
*/
function updateWhitelist(address _target, bool _value) external onlyOwner {
}
/**
* @notice update pair address
* @param _pair address
*/
function updatePairAddress(address _pair, bool _swap) external onlyOwner {
}
/**
* @notice update whitelistfor multiple addresses
* @param _target address[]
* @param _value bool[]
*/
function updateBatchWhitelist(address[] calldata _target, bool[] calldata _value) external onlyOwner {
}
/**
* @notice initializes bond parameters
* @param _controlVariable uint
* @param _vestingTerm uint
* @param _minimumPrice uint
* @param _maxPayout uint
* @param _fee uint
* @param _maxDebt uint
* @param _initialDebt uint
*/
function initializeBondTerms(
uint _controlVariable,
uint[] calldata _vestingTerm,
uint _minimumPrice,
uint _maxPayout,
uint[] calldata _fee,
uint _maxDebt,
uint _initialDebt
) external onlyOwner {
}
/* ======== POLICY FUNCTIONS ======== */
enum PARAMETER { VESTING, PAYOUT, FEE, DEBT }
/**
* @notice set parameters for new bonds
* @param _parameter PARAMETER
* @param _input uint
*/
function setBondTerms ( PARAMETER _parameter, uint _input, uint _term ) external onlyOwner {
}
/**
* @notice set control variable adjustment
* @param _addition bool
* @param _increment uint
* @param _target uint
* @param _buffer uint
*/
function setAdjustment (
bool _addition,
uint _increment,
uint _target,
uint _buffer
) external onlyOwner {
}
/* ======== USER FUNCTIONS ======== */
/**
* @notice deposit bond
* @param _amount uint
* @param _maxPrice uint
* @param _depositor address
* @return uint
*/
function deposit(
uint _amount,
uint _maxPrice,
address _depositor,
uint _term
) external onlyWhitelisted nonReentrant notContract(_msgSender()) returns ( uint ) {
}
/**
* @notice redeem bond for user
* @param _recipient address
* @return uint
*/
function redeem( address _recipient, uint _term ) external onlyWhitelisted nonReentrant notContract(_msgSender()) returns ( uint ) {
}
/* ======== INTERNAL HELPER FUNCTIONS ======== */
/**
* @notice allow user to payout automatically
* @param _amount uint
* @return uint
*/
function sendTo( address _recipient, uint _amount ) internal returns ( uint ) {
}
/**
* @notice makes incremental adjustment to control variable
*/
function adjust() internal {
}
/**
* @notice reduce total debt
*/
function decayDebt() internal {
}
/* ======== VIEW FUNCTIONS ======== */
/**
* @notice contract checker viewer
*/
function isContract(address _addr) private view returns (bool){
}
/**
* @notice determine maximum bond size
* @return uint
*/
function maxPayout() public view returns ( uint ) {
}
/**
* @notice calculate current bond premium
* @return price_ uint
*/
function bondPrice() internal view returns ( uint price_ ) {
}
/**
* @notice calculate current bond price and remove floor if above
* @return price_ uint
*/
function _bondPrice() internal returns ( uint price_ ) {
}
/**
* @notice returns SWAP valuation of asset
* @param _token address
* @param _amount uint256
* @return value_ uint256
*/
function tokenValue(address _token, uint256 _amount) internal view returns (uint256 value_) {
}
/**
* @notice converts bond price to DAI value
* @return price_ uint
*/
function bondPriceInUSD(uint _term) public view returns ( uint price_ ) {
}
/**
* @notice calculate current ratio of debt to SWAP supply
* @return debtRatio_ uint
*/
function debtRatio() public view returns ( uint debtRatio_ ) {
}
/**
* @notice calculate debt factoring in decay
* @return uint
*/
function currentDebt() public view returns ( uint ) {
}
/**
* @notice calculate how far into vesting a depositor is
* @param _depositor address
* @return percentVested_ uint
*/
function percentVestedFor( address _depositor, uint _term ) public view returns ( uint percentVested_ ) {
}
/**
* @notice calculate amount of SWAP available for claim by depositor
* @param _depositor address
* @return pendingPayout_ uint
*/
function pendingPayoutFor( address _depositor, uint _term ) external view returns ( uint pendingPayout_ ) {
}
/* ======= AUXILLIARY ======= */
/**
* @notice allow anyone to send lost tokens (excluding principal or SWAP) to the DAO
* @return bool
*/
function recoverLostToken( address _token ) external returns ( bool ) {
}
}
| !isContract(_addr),"Contract address" | 280,104 | !isContract(_addr) |
null | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
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 transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(<FILL_ME>)
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, _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
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @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.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @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 _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @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 _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
contract MintableToken is StandardToken {
/**
* @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.
*/
function mint(
address _to,
uint256 _amount
)
public
onlyOwner
returns (bool)
{
}
}
contract VIE is StandardToken, BurnableToken, MintableToken {
// Constants
string public constant name = "Viecology";
string public constant symbol = "VIE";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1899000000 * (10 ** uint256(decimals));
address constant holder = 0xBC878377b22FADD7Edcd7e6CCB6334038a4Ef8Ec;
constructor() public {
}
function() external payable {
}
}
| locked[_from]<=balances[_from].sub(_value) | 280,131 | locked[_from]<=balances[_from].sub(_value) |
"add: existing pool?" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./KokoToken.sol";
contract KOKOFarm is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 entryTimestamp;
//
// We do some fancy math here. Basically, any point in time, the amount of KOKOs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accKOKOPerShare) - user.rewardDebt
//
// Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
// 1. The pool's `accKOKOPerShare` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
}
// Info of each pool.
struct PoolInfo {
IERC20 lpToken; // Address of LP token contract.
uint256 allocPoint; // How many allocation points assigned to this pool. KOKOs to distribute per block.
uint256 lastRewardBlock; // Last block number that KOKOs distribution occurs.
uint256 accKOKOPerShare; // Accumulated KOKOs per share, times 1e12.
}
// The KOKO TOKEN!
KokoToken public koko;
// Dev address.
address public devaddr;
// Block number when bonus KOKO period ends.
uint256 public bonusEndBlock;
// KOKO tokens created per block.
uint256 public kokoPerBlock;
// Bonus muliplier for early koko makers.
uint256 public constant BONUS_MULTIPLIER = 10;
// Info of each pool.
PoolInfo[] public poolInfo;
// Info of each user that stakes LP tokens.
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// store pending KOKOs
mapping(address => uint256) public pendingKokoes;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
// The block number when KOKO mining starts.
uint256 public startBlock;
// the time period at which the users should be able to unlock
uint256 public lockPeriod;
// stableccoin fees accumulated
uint256 public feesAccumulated;
// mapping of allowed pool tokens
mapping(IERC20 => bool) public supportedPools;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(
address indexed user,
uint256 indexed pid,
uint256 amount
);
constructor(
address _devaddr,
uint256 _kokoPerBlock,
uint256 _startBlock,
uint256 _bonusEndBlock,
uint256 _lockPeriod
) {
}
modifier validatePool(uint256 _pid) {
}
// function to get number of users in the pool
function poolLength() external view returns (uint256) {
}
// Add a new lp to the pool. Can only be called by the owner.
// XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function checkPoolDuplicate(IERC20 _lpToken) public {
require(<FILL_ME>)
}
function add(
uint256 _allocPoint,
IERC20 _lpToken,
bool _withUpdate
) public onlyOwner {
}
// Update the given pool's KOKO allocation point. Can only be called by the owner.
function set(
uint256 _pid,
uint256 _allocPoint,
bool _withUpdate
) public onlyOwner {
}
// Return reward multiplier over the given _from to _to block.
function getMultiplier(uint256 _from, uint256 _to)
public
view
returns (uint256)
{
}
// View function to see pending KOKOs on frontend.
function pendingKOKO(uint256 _pid, address _user)
external
view
returns (uint256)
{
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public validatePool(_pid) {
}
// Deposit LP tokens to KOKOFarm for KOKO allocation.
function deposit(uint256 _pid, uint256 _amount) public validatePool(_pid) {
}
// Withdraw LP tokens from KOKOFarm.
function withdraw(uint256 _pid, uint256 _amount) public validatePool(_pid) {
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public {
}
// Safe koko transfer function, just in case if rounding error causes pool to not have enough KOKOs.
function safeKOKOTransfer(address _to, uint256 _amount) internal {
}
// Update dev address by the previous dev.
function dev(address _devaddr) public {
}
function addKokoAddress(address _kokoTokenAddr) public {
}
function changeLockPeriod(uint256 _newLockPeriod) public {
}
function changeFeesAccumulated(uint256 _newFees) public {
}
}
| supportedPools[_lpToken]==false,"add: existing pool?" | 280,141 | supportedPools[_lpToken]==false |
"already added" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./KokoToken.sol";
contract KOKOFarm is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
uint256 entryTimestamp;
//
// We do some fancy math here. Basically, any point in time, the amount of KOKOs
// entitled to a user but is pending to be distributed is:
//
// pending reward = (user.amount * pool.accKOKOPerShare) - user.rewardDebt
//
// Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
// 1. The pool's `accKOKOPerShare` (and `lastRewardBlock`) gets updated.
// 2. User receives the pending reward sent to his/her address.
// 3. User's `amount` gets updated.
// 4. User's `rewardDebt` gets updated.
}
// Info of each pool.
struct PoolInfo {
IERC20 lpToken; // Address of LP token contract.
uint256 allocPoint; // How many allocation points assigned to this pool. KOKOs to distribute per block.
uint256 lastRewardBlock; // Last block number that KOKOs distribution occurs.
uint256 accKOKOPerShare; // Accumulated KOKOs per share, times 1e12.
}
// The KOKO TOKEN!
KokoToken public koko;
// Dev address.
address public devaddr;
// Block number when bonus KOKO period ends.
uint256 public bonusEndBlock;
// KOKO tokens created per block.
uint256 public kokoPerBlock;
// Bonus muliplier for early koko makers.
uint256 public constant BONUS_MULTIPLIER = 10;
// Info of each pool.
PoolInfo[] public poolInfo;
// Info of each user that stakes LP tokens.
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// store pending KOKOs
mapping(address => uint256) public pendingKokoes;
// Total allocation poitns. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
// The block number when KOKO mining starts.
uint256 public startBlock;
// the time period at which the users should be able to unlock
uint256 public lockPeriod;
// stableccoin fees accumulated
uint256 public feesAccumulated;
// mapping of allowed pool tokens
mapping(IERC20 => bool) public supportedPools;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(
address indexed user,
uint256 indexed pid,
uint256 amount
);
constructor(
address _devaddr,
uint256 _kokoPerBlock,
uint256 _startBlock,
uint256 _bonusEndBlock,
uint256 _lockPeriod
) {
}
modifier validatePool(uint256 _pid) {
}
// function to get number of users in the pool
function poolLength() external view returns (uint256) {
}
// Add a new lp to the pool. Can only be called by the owner.
// XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function checkPoolDuplicate(IERC20 _lpToken) public {
}
function add(
uint256 _allocPoint,
IERC20 _lpToken,
bool _withUpdate
) public onlyOwner {
}
// Update the given pool's KOKO allocation point. Can only be called by the owner.
function set(
uint256 _pid,
uint256 _allocPoint,
bool _withUpdate
) public onlyOwner {
}
// Return reward multiplier over the given _from to _to block.
function getMultiplier(uint256 _from, uint256 _to)
public
view
returns (uint256)
{
}
// View function to see pending KOKOs on frontend.
function pendingKOKO(uint256 _pid, address _user)
external
view
returns (uint256)
{
}
// Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public {
}
// Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public validatePool(_pid) {
}
// Deposit LP tokens to KOKOFarm for KOKO allocation.
function deposit(uint256 _pid, uint256 _amount) public validatePool(_pid) {
}
// Withdraw LP tokens from KOKOFarm.
function withdraw(uint256 _pid, uint256 _amount) public validatePool(_pid) {
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public {
}
// Safe koko transfer function, just in case if rounding error causes pool to not have enough KOKOs.
function safeKOKOTransfer(address _to, uint256 _amount) internal {
}
// Update dev address by the previous dev.
function dev(address _devaddr) public {
}
function addKokoAddress(address _kokoTokenAddr) public {
require(msg.sender == devaddr, "dev: wut?");
require(<FILL_ME>)
koko = KokoToken(_kokoTokenAddr);
}
function changeLockPeriod(uint256 _newLockPeriod) public {
}
function changeFeesAccumulated(uint256 _newFees) public {
}
}
| address(koko)==address(0),"already added" | 280,141 | address(koko)==address(0) |
"not enough gas for consumer" | contract DummyVRF {
LinkTokenInterface public LINK;
event RandomnessRequest(address indexed sender, bytes32 indexed keyHash, uint256 indexed seed);
constructor(address linkAddress) public {
}
function onTokenTransfer(address sender, uint256 fee, bytes memory _data)
public
{
}
function callBackWithRandomness(
bytes32 requestId,
uint256 randomness,
address consumerContract
) public {
VRFConsumerBase v;
bytes memory resp = abi.encodeWithSelector(v.rawFulfillRandomness.selector, requestId, randomness);
uint256 b = 206000;
require(<FILL_ME>)
(bool success,) = consumerContract.call(resp);
}
}
| gasleft()>=b,"not enough gas for consumer" | 280,172 | gasleft()>=b |
"onlyMinter: caller is no right to mint" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./IERC20.sol";
import "./SafeERC20.sol";
import "./EnumerableSet.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
import "./TenetToken.sol";
import "./TenetMine.sol";
// Tenet is the master of TEN. He can make TEN and he is a fair guy.
contract Tenet is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount;
uint256 rewardTokenDebt;
uint256 rewardTenDebt;
uint256 lastBlockNumber;
uint256 freezeBlocks;
uint256 freezeTen;
}
// Info of each pool.
struct PoolSettingInfo{
address lpToken;
address tokenAddr;
address projectAddr;
uint256 tokenAmount;
uint256 startBlock;
uint256 endBlock;
uint256 tokenPerBlock;
uint256 tokenBonusEndBlock;
uint256 tokenBonusMultipler;
}
struct PoolInfo {
uint256 lastRewardBlock;
uint256 lpTokenTotalAmount;
uint256 accTokenPerShare;
uint256 accTenPerShare;
uint256 userCount;
uint256 amount;
uint256 rewardTenDebt;
uint256 mineTokenAmount;
}
struct TenPoolInfo {
uint256 lastRewardBlock;
uint256 accTenPerShare;
uint256 allocPoint;
uint256 lpTokenTotalAmount;
}
TenetToken public ten;
TenetMine public tenMineCalc;
IERC20 public lpTokenTen;
address public devaddr;
uint256 public devaddrAmount;
uint256 public modifyAllocPointPeriod;
uint256 public lastModifyAllocPointBlock;
uint256 public totalAllocPoint;
uint256 public devWithdrawStartBlock;
uint256 public addpoolfee;
uint256 public bonusAllocPointBlock;
uint256 public minProjectUserCount;
uint256 public updateBlock;
uint256 public constant MINLPTOKEN_AMOUNT = 10000000000;
uint256 public constant PERSHARERATE = 1000000000000;
PoolInfo[] public poolInfo;
PoolSettingInfo[] public poolSettingInfo;
TenPoolInfo public tenProjectPool;
TenPoolInfo public tenUserPool;
mapping (uint256 => mapping (address => UserInfo)) public userInfo;
mapping (address => UserInfo) public userInfoUserPool;
mapping (address => bool) public tenMintRightAddr;
event AddPool(address indexed user, uint256 indexed pid, uint256 tokenAmount,uint256 lpTenAmount);
event Deposit(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event DepositFrom(address indexed user, uint256 indexed pid, uint256 amount,address from,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event MineLPToken(address indexed user, uint256 indexed pid, uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event DepositLPTen(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event WithdrawLPTen(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event MineLPTen(address indexed user, uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
event DevWithdraw(address indexed user, uint256 amount);
constructor(
TenetToken _ten,
TenetMine _tenMineCalc,
IERC20 _lpTen,
address _devaddr,
uint256 _allocPointProject,
uint256 _allocPointUser,
uint256 _devWithdrawStartBlock,
uint256 _modifyAllocPointPeriod,
uint256 _bonusAllocPointBlock,
uint256 _minProjectUserCount
) public {
}
modifier onlyMinter() {
require(<FILL_ME>)
_;
}
function poolLength() external view returns (uint256) {
}
function set_tenMintRightAddr(address _addr,bool isHaveRight) public onlyOwner {
}
function tenMint(address _toAddr,uint256 _amount) public onlyMinter {
}
function set_tenetToken(TenetToken _ten) public onlyOwner {
}
function set_tenNewOwner(address _tenNewOwner) public onlyOwner {
}
function set_tenetLPToken(IERC20 _lpTokenTen) public onlyOwner {
}
function set_tenetMine(TenetMine _tenMineCalc) public onlyOwner {
}
function set_updateContract(uint256 _updateBlock) public onlyOwner {
}
function set_addPoolFee(uint256 _addpoolfee) public onlyOwner {
}
function set_devWithdrawStartBlock(uint256 _devWithdrawStartBlock) public onlyOwner {
}
function set_allocPoint(uint256 _allocPointProject,uint256 _allocPointUser,uint256 _modifyAllocPointPeriod) public onlyOwner {
}
function set_bonusAllocPointBlock(uint256 _bonusAllocPointBlock) public onlyOwner {
}
function set_minProjectUserCount(uint256 _minProjectUserCount) public onlyOwner {
}
function add(address _lpToken,
address _tokenAddr,
uint256 _tokenAmount,
uint256 _startBlock,
uint256 _endBlockOffset,
uint256 _tokenPerBlock,
uint256 _tokenBonusEndBlockOffset,
uint256 _tokenBonusMultipler,
uint256 _lpTenAmount) public {
}
function updateAllocPoint() public {
}
// Update reward variables of the given pool to be up-to-date.
function _minePoolTen(TenPoolInfo storage tenPool) internal {
}
function _withdrawProjectTenPool(PoolInfo storage pool) internal returns (uint256 pending){
}
function _updateProjectTenPoolAmount(PoolInfo storage pool,uint256 _amount,uint256 amountType) internal{
}
function depositTenByProject(uint256 _pid,uint256 _amount) public {
}
function withdrawTenByProject(uint256 _pid,uint256 _amount) public {
}
function _updatePoolUserInfo(uint256 accTenPerShare,UserInfo storage user,uint256 _freezeBlocks,uint256 _freezeTen,uint256 _amount,uint256 _amountType) internal {
}
function _calcFreezeTen(UserInfo storage user,uint256 accTenPerShare) internal view returns (uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function _withdrawUserTenPool(address userAddr,UserInfo storage user) internal returns (uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function depositTenByUser(uint256 _amount) public {
}
function withdrawTenByUser(uint256 _amount) public {
}
function mineLPTen() public {
}
function depositTenByUserFrom(address _from,uint256 _amount) public {
}
function _minePoolToken(PoolInfo storage pool,PoolSettingInfo storage poolSetting) internal {
}
function _withdrawTokenPool(address userAddr,PoolInfo storage pool,UserInfo storage user,PoolSettingInfo storage poolSetting)
internal returns (uint256 pendingToken,uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function _updateTokenPoolUser(uint256 accTokenPerShare,uint256 accTenPerShare,UserInfo storage user,uint256 _freezeBlocks,uint256 _freezeTen,uint256 _amount,uint256 _amountType)
internal {
}
function depositLPToken(uint256 _pid, uint256 _amount) public {
}
function withdrawLPToken(uint256 _pid, uint256 _amount) public {
}
function mineLPToken(uint256 _pid) public {
}
function depositLPTokenFrom(address _from,uint256 _pid, uint256 _amount) public {
}
function dev(address _devaddr) public {
}
function devWithdraw(uint256 _amount) public {
}
function safeTenTransfer(address _to, uint256 _amount) internal {
}
}
| tenMintRightAddr[msg.sender]==true,"onlyMinter: caller is no right to mint" | 280,185 | tenMintRightAddr[msg.sender]==true |
"add: token amount invalid" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./IERC20.sol";
import "./SafeERC20.sol";
import "./EnumerableSet.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
import "./TenetToken.sol";
import "./TenetMine.sol";
// Tenet is the master of TEN. He can make TEN and he is a fair guy.
contract Tenet is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Info of each user.
struct UserInfo {
uint256 amount;
uint256 rewardTokenDebt;
uint256 rewardTenDebt;
uint256 lastBlockNumber;
uint256 freezeBlocks;
uint256 freezeTen;
}
// Info of each pool.
struct PoolSettingInfo{
address lpToken;
address tokenAddr;
address projectAddr;
uint256 tokenAmount;
uint256 startBlock;
uint256 endBlock;
uint256 tokenPerBlock;
uint256 tokenBonusEndBlock;
uint256 tokenBonusMultipler;
}
struct PoolInfo {
uint256 lastRewardBlock;
uint256 lpTokenTotalAmount;
uint256 accTokenPerShare;
uint256 accTenPerShare;
uint256 userCount;
uint256 amount;
uint256 rewardTenDebt;
uint256 mineTokenAmount;
}
struct TenPoolInfo {
uint256 lastRewardBlock;
uint256 accTenPerShare;
uint256 allocPoint;
uint256 lpTokenTotalAmount;
}
TenetToken public ten;
TenetMine public tenMineCalc;
IERC20 public lpTokenTen;
address public devaddr;
uint256 public devaddrAmount;
uint256 public modifyAllocPointPeriod;
uint256 public lastModifyAllocPointBlock;
uint256 public totalAllocPoint;
uint256 public devWithdrawStartBlock;
uint256 public addpoolfee;
uint256 public bonusAllocPointBlock;
uint256 public minProjectUserCount;
uint256 public updateBlock;
uint256 public constant MINLPTOKEN_AMOUNT = 10000000000;
uint256 public constant PERSHARERATE = 1000000000000;
PoolInfo[] public poolInfo;
PoolSettingInfo[] public poolSettingInfo;
TenPoolInfo public tenProjectPool;
TenPoolInfo public tenUserPool;
mapping (uint256 => mapping (address => UserInfo)) public userInfo;
mapping (address => UserInfo) public userInfoUserPool;
mapping (address => bool) public tenMintRightAddr;
event AddPool(address indexed user, uint256 indexed pid, uint256 tokenAmount,uint256 lpTenAmount);
event Deposit(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event DepositFrom(address indexed user, uint256 indexed pid, uint256 amount,address from,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event MineLPToken(address indexed user, uint256 indexed pid, uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingToken,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event DepositLPTen(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event WithdrawLPTen(address indexed user, uint256 indexed pid, uint256 amount,uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event MineLPTen(address indexed user, uint256 penddingTen,uint256 freezeTen,uint256 freezeBlocks);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
event DevWithdraw(address indexed user, uint256 amount);
constructor(
TenetToken _ten,
TenetMine _tenMineCalc,
IERC20 _lpTen,
address _devaddr,
uint256 _allocPointProject,
uint256 _allocPointUser,
uint256 _devWithdrawStartBlock,
uint256 _modifyAllocPointPeriod,
uint256 _bonusAllocPointBlock,
uint256 _minProjectUserCount
) public {
}
modifier onlyMinter() {
}
function poolLength() external view returns (uint256) {
}
function set_tenMintRightAddr(address _addr,bool isHaveRight) public onlyOwner {
}
function tenMint(address _toAddr,uint256 _amount) public onlyMinter {
}
function set_tenetToken(TenetToken _ten) public onlyOwner {
}
function set_tenNewOwner(address _tenNewOwner) public onlyOwner {
}
function set_tenetLPToken(IERC20 _lpTokenTen) public onlyOwner {
}
function set_tenetMine(TenetMine _tenMineCalc) public onlyOwner {
}
function set_updateContract(uint256 _updateBlock) public onlyOwner {
}
function set_addPoolFee(uint256 _addpoolfee) public onlyOwner {
}
function set_devWithdrawStartBlock(uint256 _devWithdrawStartBlock) public onlyOwner {
}
function set_allocPoint(uint256 _allocPointProject,uint256 _allocPointUser,uint256 _modifyAllocPointPeriod) public onlyOwner {
}
function set_bonusAllocPointBlock(uint256 _bonusAllocPointBlock) public onlyOwner {
}
function set_minProjectUserCount(uint256 _minProjectUserCount) public onlyOwner {
}
function add(address _lpToken,
address _tokenAddr,
uint256 _tokenAmount,
uint256 _startBlock,
uint256 _endBlockOffset,
uint256 _tokenPerBlock,
uint256 _tokenBonusEndBlockOffset,
uint256 _tokenBonusMultipler,
uint256 _lpTenAmount) public {
if(_startBlock == 0){
_startBlock = block.number;
}
require(block.number <= _startBlock, "add: startBlock invalid");
require(_endBlockOffset >= _tokenBonusEndBlockOffset, "add: bonusEndBlockOffset invalid");
require(<FILL_ME>)
if(updateBlock > 0){
require(block.number <= updateBlock, "add: updateBlock invalid");
}
IERC20(_tokenAddr).transferFrom(msg.sender,address(this), _tokenAmount);
if(addpoolfee > 0){
ten.transferFrom(msg.sender,address(this), addpoolfee);
ten.burn(address(this),addpoolfee);
}
uint256 pid = poolInfo.length;
poolSettingInfo.push(PoolSettingInfo({
lpToken: _lpToken,
tokenAddr: _tokenAddr,
projectAddr: msg.sender,
tokenAmount:_tokenAmount,
startBlock: _startBlock,
endBlock: _startBlock + _endBlockOffset,
tokenPerBlock: _tokenPerBlock,
tokenBonusEndBlock: _startBlock + _tokenBonusEndBlockOffset,
tokenBonusMultipler: _tokenBonusMultipler
}));
poolInfo.push(PoolInfo({
lastRewardBlock: block.number > _startBlock ? block.number : _startBlock,
accTokenPerShare: 0,
accTenPerShare: 0,
lpTokenTotalAmount: 0,
userCount: 0,
amount: 0,
rewardTenDebt: 0,
mineTokenAmount: 0
}));
if(_lpTenAmount>MINLPTOKEN_AMOUNT){
depositTenByProject(pid,_lpTenAmount);
}
emit AddPool(msg.sender, pid, _tokenAmount,_lpTenAmount);
}
function updateAllocPoint() public {
}
// Update reward variables of the given pool to be up-to-date.
function _minePoolTen(TenPoolInfo storage tenPool) internal {
}
function _withdrawProjectTenPool(PoolInfo storage pool) internal returns (uint256 pending){
}
function _updateProjectTenPoolAmount(PoolInfo storage pool,uint256 _amount,uint256 amountType) internal{
}
function depositTenByProject(uint256 _pid,uint256 _amount) public {
}
function withdrawTenByProject(uint256 _pid,uint256 _amount) public {
}
function _updatePoolUserInfo(uint256 accTenPerShare,UserInfo storage user,uint256 _freezeBlocks,uint256 _freezeTen,uint256 _amount,uint256 _amountType) internal {
}
function _calcFreezeTen(UserInfo storage user,uint256 accTenPerShare) internal view returns (uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function _withdrawUserTenPool(address userAddr,UserInfo storage user) internal returns (uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function depositTenByUser(uint256 _amount) public {
}
function withdrawTenByUser(uint256 _amount) public {
}
function mineLPTen() public {
}
function depositTenByUserFrom(address _from,uint256 _amount) public {
}
function _minePoolToken(PoolInfo storage pool,PoolSettingInfo storage poolSetting) internal {
}
function _withdrawTokenPool(address userAddr,PoolInfo storage pool,UserInfo storage user,PoolSettingInfo storage poolSetting)
internal returns (uint256 pendingToken,uint256 pendingTen,uint256 freezeBlocks,uint256 freezeTen){
}
function _updateTokenPoolUser(uint256 accTokenPerShare,uint256 accTenPerShare,UserInfo storage user,uint256 _freezeBlocks,uint256 _freezeTen,uint256 _amount,uint256 _amountType)
internal {
}
function depositLPToken(uint256 _pid, uint256 _amount) public {
}
function withdrawLPToken(uint256 _pid, uint256 _amount) public {
}
function mineLPToken(uint256 _pid) public {
}
function depositLPTokenFrom(address _from,uint256 _pid, uint256 _amount) public {
}
function dev(address _devaddr) public {
}
function devWithdraw(uint256 _amount) public {
}
function safeTenTransfer(address _to, uint256 _amount) internal {
}
}
| tenMineCalc.getMultiplier(_startBlock,_startBlock+_endBlockOffset,_startBlock+_endBlockOffset,_startBlock+_tokenBonusEndBlockOffset,_tokenBonusMultipler).mul(_tokenPerBlock)<=_tokenAmount,"add: token amount invalid" | 280,185 | tenMineCalc.getMultiplier(_startBlock,_startBlock+_endBlockOffset,_startBlock+_endBlockOffset,_startBlock+_tokenBonusEndBlockOffset,_tokenBonusMultipler).mul(_tokenPerBlock)<=_tokenAmount |
null | pragma solidity ^0.4.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
function Pausable() public {}
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused returns (bool) {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused returns (bool) {
}
}
contract TokenSale is Pausable {
using SafeMath for uint256;
ProofTokenInterface public proofToken;
uint256 public totalWeiRaised;
uint256 public tokensMinted;
uint256 public totalSupply;
uint256 public contributors;
uint256 public decimalsMultiplier;
uint256 public startTime;
uint256 public endTime;
uint256 public remainingTokens;
uint256 public allocatedTokens;
bool public finalized;
bool public proofTokensAllocated;
uint256 public constant BASE_PRICE_IN_WEI = 88000000000000000;
uint256 public constant PUBLIC_TOKENS = 1181031 * (10 ** 18);
uint256 public constant TOTAL_PRESALE_TOKENS = 112386712924725508802400;
uint256 public constant TOKENS_ALLOCATED_TO_PROOF = 1181031 * (10 ** 18);
address public constant PROOF_MULTISIG = 0x99892Ac6DA1b3851167Cb959fE945926bca89f09;
uint256 public tokenCap = PUBLIC_TOKENS - TOTAL_PRESALE_TOKENS;
uint256 public cap = tokenCap / (10 ** 18);
uint256 public weiCap = cap * BASE_PRICE_IN_WEI;
uint256 public firstCheckpointPrice = (BASE_PRICE_IN_WEI * 85) / 100;
uint256 public secondCheckpointPrice = (BASE_PRICE_IN_WEI * 90) / 100;
uint256 public thirdCheckpointPrice = (BASE_PRICE_IN_WEI * 95) / 100;
uint256 public firstCheckpoint = (weiCap * 5) / 100;
uint256 public secondCheckpoint = (weiCap * 10) / 100;
uint256 public thirdCheckpoint = (weiCap * 20) / 100;
bool public started = false;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event NewClonedToken(address indexed _cloneToken);
event OnTransfer(address _from, address _to, uint _amount);
event OnApprove(address _owner, address _spender, uint _amount);
event LogInt(string _name, uint256 _value);
event Finalized();
function TokenSale(
address _tokenAddress,
uint256 _startTime,
uint256 _endTime) public {
}
/**
* High level token purchase function
*/
function() public payable {
}
/**
* Low level token purchase function
* @param _beneficiary will receive the tokens.
*/
function buyTokens(address _beneficiary) public payable whenNotPaused whenNotFinalized {
}
/**
* Get the price in wei for current premium
* @return price
*/
function getPriceInWei() constant public returns (uint256) {
}
/**
* Forwards funds to the tokensale wallet
*/
function forwardFunds() internal {
}
/**
* Validates the purchase (period, minimum amount, within cap)
* @return {bool} valid
*/
function validPurchase() internal constant returns (bool) {
}
/**
* Returns the total Proof token supply
* @return total supply {uint256}
*/
function totalSupply() public constant returns (uint256) {
}
/**
* Returns token holder Proof Token balance
* @param _owner {address}
* @return token balance {uint256}
*/
function balanceOf(address _owner) public constant returns (uint256) {
}
/**
* Change the Proof Token controller
* @param _newController {address}
*/
function changeController(address _newController) public {
require(<FILL_ME>)
proofToken.transferControl(_newController);
}
function enableTransfers() public {
}
function lockTransfers() public onlyOwner {
}
function enableMasterTransfers() public onlyOwner {
}
function lockMasterTransfers() public onlyOwner {
}
function isContract(address _addr) constant internal returns(bool) {
}
/**
* Allocates Proof tokens to the given Proof Token wallet
*/
function allocateProofTokens() public onlyOwner whenNotFinalized {
}
/**
* Finalize the token sale (can only be called by owner)
*/
function finalize() public onlyOwner {
}
function forceStart() public onlyOwner {
}
modifier whenNotFinalized() {
}
}
contract Controllable {
address public controller;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
*/
function Controllable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyController() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newController The address to transfer ownership to.
*/
function transferControl(address newController) public onlyController {
}
}
contract ProofTokenInterface is Controllable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
event ClaimedTokens(address indexed _token, address indexed _owner, uint _amount);
event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock);
event Approval(address indexed _owner, address indexed _spender, uint256 _amount);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public constant returns (uint);
function totalSupplyAt(uint _blockNumber) public constant returns(uint);
function balanceOf(address _owner) public constant returns (uint256 balance);
function balanceOfAt(address _owner, uint _blockNumber) public constant returns (uint);
function transfer(address _to, uint256 _amount) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
function approveAndCall(address _spender, uint256 _amount, bytes _extraData) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
function mint(address _owner, uint _amount) public returns (bool);
function importPresaleBalances(address[] _addresses, uint256[] _balances, address _presaleAddress) public returns (bool);
function lockPresaleBalances() public returns (bool);
function finishMinting() public returns (bool);
function enableTransfers(bool _value) public;
function enableMasterTransfers(bool _value) public;
function createCloneToken(uint _snapshotBlock, string _cloneTokenName, string _cloneTokenSymbol) public returns (address);
}
| isContract(_newController) | 280,242 | isContract(_newController) |
"not-enough-fund" | pragma solidity ^0.8.0;
contract RaizerEscrow is Ownable {
struct Swap {
address swapper;
address token;
uint256 amount;
}
mapping(bytes16 => Swap) public swaps;
event Deposit(bytes16 indexed swapId, address indexed sender, address token, uint256 amount);
event Withdraw(address indexed to, address token, uint256 amount);
function deposit(bytes16 swapId, address token, uint256 amount) public payable {
require(<FILL_ME>)
require(amount > 0, "deposit-zero-amount");
ERC20(token).transferFrom(msg.sender, address(this), amount);
swaps[swapId] = Swap(msg.sender, token, amount);
emit Deposit(swapId, msg.sender, token, amount);
}
function depositWithPermit(bytes16 swapId, address token, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
}
function withdraw(address payable to, address token) public onlyOwner {
}
}
| ERC20(token).allowance(msg.sender,address(this))>=amount,"not-enough-fund" | 280,389 | ERC20(token).allowance(msg.sender,address(this))>=amount |
"Purchase would exceed max supply for sale." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint.");
require(<FILL_ME>)
require(STARCHANT_PRICE * numberOfTokens <= msg.value, "Ether value sent is not correct");
require(_publicListClaimed[msg.sender] + numberOfTokens <= publicListMaxMint, 'You cannot mint this many.');
_publicListClaimed[msg.sender] += numberOfTokens;
for (uint i = 0; i < numberOfTokens; i++) {
uint256 tokenId = RESERVED_STARCHANTS + totalSaleSupply + 1;
totalSaleSupply += 1;
_safeMint(msg.sender, tokenId);
}
payable(_splitter).transfer(msg.value);
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| totalSaleSupply+numberOfTokens<=PUBLIC_STARCHANTS,"Purchase would exceed max supply for sale." | 280,509 | totalSaleSupply+numberOfTokens<=PUBLIC_STARCHANTS |
"Ether value sent is not correct" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint.");
require(totalSaleSupply + numberOfTokens <= PUBLIC_STARCHANTS, "Purchase would exceed max supply for sale.");
require(<FILL_ME>)
require(_publicListClaimed[msg.sender] + numberOfTokens <= publicListMaxMint, 'You cannot mint this many.');
_publicListClaimed[msg.sender] += numberOfTokens;
for (uint i = 0; i < numberOfTokens; i++) {
uint256 tokenId = RESERVED_STARCHANTS + totalSaleSupply + 1;
totalSaleSupply += 1;
_safeMint(msg.sender, tokenId);
}
payable(_splitter).transfer(msg.value);
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| STARCHANT_PRICE*numberOfTokens<=msg.value,"Ether value sent is not correct" | 280,509 | STARCHANT_PRICE*numberOfTokens<=msg.value |
'You cannot mint this many.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint.");
require(totalSaleSupply + numberOfTokens <= PUBLIC_STARCHANTS, "Purchase would exceed max supply for sale.");
require(STARCHANT_PRICE * numberOfTokens <= msg.value, "Ether value sent is not correct");
require(<FILL_ME>)
_publicListClaimed[msg.sender] += numberOfTokens;
for (uint i = 0; i < numberOfTokens; i++) {
uint256 tokenId = RESERVED_STARCHANTS + totalSaleSupply + 1;
totalSaleSupply += 1;
_safeMint(msg.sender, tokenId);
}
payable(_splitter).transfer(msg.value);
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| _publicListClaimed[msg.sender]+numberOfTokens<=publicListMaxMint,'You cannot mint this many.' | 280,509 | _publicListClaimed[msg.sender]+numberOfTokens<=publicListMaxMint |
"The address hash does not match the signed hash." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
require(_verify(hash, signature), "This hash's signature is invalid.");
require(<FILL_ME>)
require(totalSaleSupply + numberOfTokens <= PUBLIC_STARCHANTS, "Purchase would exceed max supply for sale.");
require(STARCHANT_PRICE * numberOfTokens <= msg.value, "Ether value sent is not correct");
require(_allowListClaimed[msg.sender] + numberOfTokens <= allowListMaxMint, 'You cannot mint this many.');
_allowListClaimed[msg.sender] += numberOfTokens;
for (uint i = 0; i < numberOfTokens; i++) {
uint256 tokenId = RESERVED_STARCHANTS + totalSaleSupply + 1;
totalSaleSupply += 1;
_safeMint(msg.sender, tokenId);
}
payable(_splitter).transfer(msg.value);
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| _hash(msg.sender)==hash,"The address hash does not match the signed hash." | 280,509 | _hash(msg.sender)==hash |
'All tokens have been minted.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
require(<FILL_ME>)
require(totalReservedSupply + tokenIds.length <= RESERVED_STARCHANTS, 'Not enough tokens left in reserve.');
for(uint256 i = 0; i < tokenIds.length; i++) {
require(tokenIds[i] != 0, "0 token does not exist");
totalReservedSupply += 1;
_safeMint(msg.sender, tokenIds[i]);
}
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| totalSupply()<MAX_STARCHANT,'All tokens have been minted.' | 280,509 | totalSupply()<MAX_STARCHANT |
'Not enough tokens left in reserve.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
require(totalSupply() < MAX_STARCHANT, 'All tokens have been minted.');
require(<FILL_ME>)
for(uint256 i = 0; i < tokenIds.length; i++) {
require(tokenIds[i] != 0, "0 token does not exist");
totalReservedSupply += 1;
_safeMint(msg.sender, tokenIds[i]);
}
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| totalReservedSupply+tokenIds.length<=RESERVED_STARCHANTS,'Not enough tokens left in reserve.' | 280,509 | totalReservedSupply+tokenIds.length<=RESERVED_STARCHANTS |
"0 token does not exist" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import '@openzeppelin/contracts/utils/Strings.sol';
import "hardhat/console.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract StarChant is ERC721, ERC721URIStorage, Ownable, ERC721Burnable, VRFConsumerBase {
using Strings for uint256;
using ECDSA for bytes32;
PaymentSplitter private _splitter;
mapping (uint256 => string) private _tokenURIs;
uint256 public MAX_STARCHANT;
uint256 public RESERVED_STARCHANTS;
uint256 public PUBLIC_STARCHANTS;
uint256 public STARCHANT_PRICE = 0.10 ether;
uint256 public allowListMaxMint;
uint256 public publicListMaxMint;
uint256 public totalReservedSupply = 0;
uint256 public totalSaleSupply = 0;
bool public saleIsActive = false;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _publicListClaimed;
string public prefix = "StarChant Presale Verification:";
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
bytes32 internal keyHash;
uint256 internal fee;
uint256 public randomSeed;
struct chainlinkParams {
address vrfCoordinator;
address linkAddress;
bytes32 keyHash;
}
constructor(address[] memory payees, uint256[] memory shares, uint256 _starChantsReserved, uint256 _starChantsForSale, uint256 _allowListMaxMint, uint256 _publicListMaxMint, chainlinkParams memory _chainlinkParams)
ERC721("STARCHANT", "STARCHANT")
VRFConsumerBase(
_chainlinkParams.vrfCoordinator, // VRF Coordinator
_chainlinkParams.linkAddress // LINK Token
) {
}
/**
* Requests randomness
*/
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
}
/**
* Callback function used by VRF Coordinator
*/
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
}
function setAllowListMaxMint(uint256 _allowListMaxMint) external onlyOwner {
}
function setPublicListMaxMint(uint256 _publicListMaxMint) external onlyOwner {
}
function allowListClaimedBy(address owner) external view returns (uint256){
}
function publicListClaimedBy(address owner) external view returns (uint256){
}
function flipSaleState() public onlyOwner {
}
function totalSupply() public view returns (uint) {
}
function release(address payable account) public virtual onlyOwner {
}
function _hash(address _address)
internal view returns (bytes32)
{
}
function setPrefix(string memory _prefix) public onlyOwner {
}
function _verify(bytes32 hash, bytes memory signature) internal view returns (bool) {
}
function _recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
}
function mintPublic(uint256 numberOfTokens) public payable {
}
function mintWhitelist(bytes32 hash, bytes memory signature, uint256 numberOfTokens) public payable {
}
function mintReserved(uint256[] calldata tokenIds) external onlyOwner {
require(totalSupply() < MAX_STARCHANT, 'All tokens have been minted.');
require(totalReservedSupply + tokenIds.length <= RESERVED_STARCHANTS, 'Not enough tokens left in reserve.');
for(uint256 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
totalReservedSupply += 1;
_safeMint(msg.sender, tokenIds[i]);
}
}
receive() external payable {
}
fallback() external payable {
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
}
}
| tokenIds[i]!=0,"0 token does not exist" | 280,509 | tokenIds[i]!=0 |
null | pragma solidity ^0.4.21;
contract ERC20 {
function totalSupply() public view returns (uint256 totalSup);
function balanceOf(address _owner) public view returns (uint256 balance);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function approve(address _spender, uint256 _value) public returns (bool success);
function transfer(address _to, uint256 _value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ERC223 {
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
}
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public;
}
contract WXC is ERC223, ERC20 {
using SafeMath for uint256;
uint public constant _totalSupply = 2100000000e18;
//starting supply of Token
string public constant symbol = "WXC";
string public constant name = "WIIX Coin";
uint8 public constant decimals = 18;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public{
}
function totalSupply() public view returns (uint256 totalSup) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success){
}
function isContract(address _from) private view returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remain) {
}
function () public payable {
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| !isContract(_to) | 280,514 | !isContract(_to) |
null | pragma solidity ^0.4.21;
contract ERC20 {
function totalSupply() public view returns (uint256 totalSup);
function balanceOf(address _owner) public view returns (uint256 balance);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function approve(address _spender, uint256 _value) public returns (bool success);
function transfer(address _to, uint256 _value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ERC223 {
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
}
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public;
}
contract WXC is ERC223, ERC20 {
using SafeMath for uint256;
uint public constant _totalSupply = 2100000000e18;
//starting supply of Token
string public constant symbol = "WXC";
string public constant name = "WIIX Coin";
uint8 public constant decimals = 18;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public{
}
function totalSupply() public view returns (uint256 totalSup) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success){
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ERC223ReceivingContract(_to).tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
function isContract(address _from) private view returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remain) {
}
function () public payable {
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| isContract(_to) | 280,514 | isContract(_to) |
null | pragma solidity ^0.4.21;
contract ERC20 {
function totalSupply() public view returns (uint256 totalSup);
function balanceOf(address _owner) public view returns (uint256 balance);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function approve(address _spender, uint256 _value) public returns (bool success);
function transfer(address _to, uint256 _value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract ERC223 {
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
}
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public;
}
contract WXC is ERC223, ERC20 {
using SafeMath for uint256;
uint public constant _totalSupply = 2100000000e18;
//starting supply of Token
string public constant symbol = "WXC";
string public constant name = "WIIX Coin";
uint8 public constant decimals = 18;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
constructor() public{
}
function totalSupply() public view returns (uint256 totalSup) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
function transfer(address _to, uint256 _value) public returns (bool success) {
}
function transfer(address _to, uint256 _value, bytes _data) public returns (bool success){
}
function isContract(address _from) private view returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(<FILL_ME>)
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, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remain) {
}
function () public payable {
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| balances[_from]>=_value&&_value>0 | 280,514 | balances[_from]>=_value&&_value>0 |
"_account is not blacklisted" | contract CompliantToken is ModularMintableToken {
// In order to deposit USD and receive newly minted UniversalUSD, or to burn UniversalUSD to
// redeem it for USD, users must first go through a KYC/AML check (which includes proving they
// control their ethereum address using AddressValidation.sol).
bytes32 public constant HAS_PASSED_KYC_AML = "hasPassedKYC/AML";
// Redeeming ("burning") UniversalUSD tokens for USD requires a separate flag since
// users must not only be KYC/AML'ed but must also have bank information on file.
bytes32 public constant CAN_BURN = "canBurn";
// Addresses can also be blacklisted, preventing them from sending or receiving
// UniversalUSD. This can be used to prevent the use of UniversalUSD by bad actors in
// accordance with law enforcement. See [TrueCoin Terms of Use](https://www.trusttoken.com/UniversalUSD/terms-of-use)
bytes32 public constant IS_BLACKLISTED = "isBlacklisted";
event WipeBlacklistedAccount(address indexed account, uint256 balance);
event SetRegistry(address indexed registry);
/**
* @dev Point to the registry that contains all compliance related data
@param _registry The address of the registry instance
*/
function setRegistry(Registry _registry) public onlyOwner {
}
function _burnAllArgs(address _burner, uint256 _value) internal {
}
// Destroy the tokens owned by a blacklisted account
function wipeBlacklistedAccount(address _account) public onlyOwner {
require(<FILL_ME>)
uint256 oldValue = balanceOf(_account);
balances.setBalance(_account, 0);
totalSupply_ = totalSupply_.sub(oldValue);
emit WipeBlacklistedAccount(_account, oldValue);
emit Transfer(_account, address(0), oldValue);
}
}
| registry.hasAttribute(_account,IS_BLACKLISTED),"_account is not blacklisted" | 280,557 | registry.hasAttribute(_account,IS_BLACKLISTED) |
"Only the admin can do this" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./AvidlinesCore.sol";
uint256 constant TOTAL_MAX = 500;
uint256 constant TOTAL_PUBLIC_MAX = 425;
uint256 constant MAX_PRICE = 2*10**18; //init auction price 2 eth
uint256 constant MIN_PRICE = 0;
uint256 constant AUCTION_DURATION = 5*60*1; //~1h in blocks
uint256 constant ADMIN_SHARE = 80; // in percentage
uint256 constant FP_SHARE = 10;
uint256 constant GEN_SHARE = 10;
uint32 constant PRECISION = 10*6;
contract AvidlinesMinter is Pausable {
using SafeMath for uint256;
address internal coreAddress;
address internal adminAddress;
address internal fpAddress;
address internal GLYPH_CONTRACT;
uint256 public totalTokenMints;
mapping(uint256 => bool) public isGlyphAllowed;
uint256[] private _allWhitelisted;
mapping(uint256 => uint256) private _allWhitelistedIndex;
uint256 public pendingFpWithdrawals;
uint256 public pendingAdminWithdrawals;
mapping(uint256 => uint256) public pendingGlyphTokenWithdrawals;
uint256 public auctionStart = 0;
bool public auctionStarted = false;
event MintFromToken(address indexed from, uint256 tokenId);
event WhitelistedGlyph(uint256 tokenId);
event RemovedWhitelistedGlyph(uint256 tokenId);
modifier onlyAdmin() {
require(<FILL_ME>)
_;
}
constructor(address core, address admin, address glyphContract) {
}
function pause() public onlyAdmin {
}
function unpause() public onlyAdmin {
}
function setFpAdress(address _fpAddress) public onlyAdmin {
}
function currentPrice() public view returns (uint256) {
}
function whitelist(uint256 tokenId) public {
}
function removeWhitelist(uint256 tokenId) public {
}
function allowedGlyphsCount() public view returns (uint256) {
}
function allowedGlyphs(uint256 index) public view returns (uint256) {
}
function _addTokenToWhitelistEnumeration(uint256 tokenId) private {
}
function fpWithdrawal() public {
}
function adminWithdrawal() public {
}
function generatorWithdrawal(uint256 tokenId) public {
}
function _removeTokenFromWhitelistEnumeration(uint256 tokenId) private {
}
function startAuction() public whenNotPaused onlyAdmin{
}
function mintFromGlyph(uint256 tokenId) payable public whenNotPaused {
}
}
| _msgSender()==adminAddress,"Only the admin can do this" | 280,565 | _msgSender()==adminAddress |
"token already whitelisted" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./AvidlinesCore.sol";
uint256 constant TOTAL_MAX = 500;
uint256 constant TOTAL_PUBLIC_MAX = 425;
uint256 constant MAX_PRICE = 2*10**18; //init auction price 2 eth
uint256 constant MIN_PRICE = 0;
uint256 constant AUCTION_DURATION = 5*60*1; //~1h in blocks
uint256 constant ADMIN_SHARE = 80; // in percentage
uint256 constant FP_SHARE = 10;
uint256 constant GEN_SHARE = 10;
uint32 constant PRECISION = 10*6;
contract AvidlinesMinter is Pausable {
using SafeMath for uint256;
address internal coreAddress;
address internal adminAddress;
address internal fpAddress;
address internal GLYPH_CONTRACT;
uint256 public totalTokenMints;
mapping(uint256 => bool) public isGlyphAllowed;
uint256[] private _allWhitelisted;
mapping(uint256 => uint256) private _allWhitelistedIndex;
uint256 public pendingFpWithdrawals;
uint256 public pendingAdminWithdrawals;
mapping(uint256 => uint256) public pendingGlyphTokenWithdrawals;
uint256 public auctionStart = 0;
bool public auctionStarted = false;
event MintFromToken(address indexed from, uint256 tokenId);
event WhitelistedGlyph(uint256 tokenId);
event RemovedWhitelistedGlyph(uint256 tokenId);
modifier onlyAdmin() {
}
constructor(address core, address admin, address glyphContract) {
}
function pause() public onlyAdmin {
}
function unpause() public onlyAdmin {
}
function setFpAdress(address _fpAddress) public onlyAdmin {
}
function currentPrice() public view returns (uint256) {
}
function whitelist(uint256 tokenId) public {
require(<FILL_ME>)
address owner = IERC721(GLYPH_CONTRACT).ownerOf(tokenId);
require(owner == msg.sender, "Caller should own the tokenId");
isGlyphAllowed[tokenId] = true;
_addTokenToWhitelistEnumeration(tokenId);
emit WhitelistedGlyph(tokenId);
}
function removeWhitelist(uint256 tokenId) public {
}
function allowedGlyphsCount() public view returns (uint256) {
}
function allowedGlyphs(uint256 index) public view returns (uint256) {
}
function _addTokenToWhitelistEnumeration(uint256 tokenId) private {
}
function fpWithdrawal() public {
}
function adminWithdrawal() public {
}
function generatorWithdrawal(uint256 tokenId) public {
}
function _removeTokenFromWhitelistEnumeration(uint256 tokenId) private {
}
function startAuction() public whenNotPaused onlyAdmin{
}
function mintFromGlyph(uint256 tokenId) payable public whenNotPaused {
}
}
| !isGlyphAllowed[tokenId],"token already whitelisted" | 280,565 | !isGlyphAllowed[tokenId] |
"token is not whitelisted" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./AvidlinesCore.sol";
uint256 constant TOTAL_MAX = 500;
uint256 constant TOTAL_PUBLIC_MAX = 425;
uint256 constant MAX_PRICE = 2*10**18; //init auction price 2 eth
uint256 constant MIN_PRICE = 0;
uint256 constant AUCTION_DURATION = 5*60*1; //~1h in blocks
uint256 constant ADMIN_SHARE = 80; // in percentage
uint256 constant FP_SHARE = 10;
uint256 constant GEN_SHARE = 10;
uint32 constant PRECISION = 10*6;
contract AvidlinesMinter is Pausable {
using SafeMath for uint256;
address internal coreAddress;
address internal adminAddress;
address internal fpAddress;
address internal GLYPH_CONTRACT;
uint256 public totalTokenMints;
mapping(uint256 => bool) public isGlyphAllowed;
uint256[] private _allWhitelisted;
mapping(uint256 => uint256) private _allWhitelistedIndex;
uint256 public pendingFpWithdrawals;
uint256 public pendingAdminWithdrawals;
mapping(uint256 => uint256) public pendingGlyphTokenWithdrawals;
uint256 public auctionStart = 0;
bool public auctionStarted = false;
event MintFromToken(address indexed from, uint256 tokenId);
event WhitelistedGlyph(uint256 tokenId);
event RemovedWhitelistedGlyph(uint256 tokenId);
modifier onlyAdmin() {
}
constructor(address core, address admin, address glyphContract) {
}
function pause() public onlyAdmin {
}
function unpause() public onlyAdmin {
}
function setFpAdress(address _fpAddress) public onlyAdmin {
}
function currentPrice() public view returns (uint256) {
}
function whitelist(uint256 tokenId) public {
}
function removeWhitelist(uint256 tokenId) public {
require(<FILL_ME>)
address owner = IERC721(GLYPH_CONTRACT).ownerOf(tokenId);
require(owner == msg.sender, "Caller should own the tokenId");
isGlyphAllowed[tokenId] = false;
_removeTokenFromWhitelistEnumeration(tokenId);
emit RemovedWhitelistedGlyph(tokenId);
}
function allowedGlyphsCount() public view returns (uint256) {
}
function allowedGlyphs(uint256 index) public view returns (uint256) {
}
function _addTokenToWhitelistEnumeration(uint256 tokenId) private {
}
function fpWithdrawal() public {
}
function adminWithdrawal() public {
}
function generatorWithdrawal(uint256 tokenId) public {
}
function _removeTokenFromWhitelistEnumeration(uint256 tokenId) private {
}
function startAuction() public whenNotPaused onlyAdmin{
}
function mintFromGlyph(uint256 tokenId) payable public whenNotPaused {
}
}
| isGlyphAllowed[tokenId],"token is not whitelisted" | 280,565 | isGlyphAllowed[tokenId] |
"Account has no funds to claim" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./AvidlinesCore.sol";
uint256 constant TOTAL_MAX = 500;
uint256 constant TOTAL_PUBLIC_MAX = 425;
uint256 constant MAX_PRICE = 2*10**18; //init auction price 2 eth
uint256 constant MIN_PRICE = 0;
uint256 constant AUCTION_DURATION = 5*60*1; //~1h in blocks
uint256 constant ADMIN_SHARE = 80; // in percentage
uint256 constant FP_SHARE = 10;
uint256 constant GEN_SHARE = 10;
uint32 constant PRECISION = 10*6;
contract AvidlinesMinter is Pausable {
using SafeMath for uint256;
address internal coreAddress;
address internal adminAddress;
address internal fpAddress;
address internal GLYPH_CONTRACT;
uint256 public totalTokenMints;
mapping(uint256 => bool) public isGlyphAllowed;
uint256[] private _allWhitelisted;
mapping(uint256 => uint256) private _allWhitelistedIndex;
uint256 public pendingFpWithdrawals;
uint256 public pendingAdminWithdrawals;
mapping(uint256 => uint256) public pendingGlyphTokenWithdrawals;
uint256 public auctionStart = 0;
bool public auctionStarted = false;
event MintFromToken(address indexed from, uint256 tokenId);
event WhitelistedGlyph(uint256 tokenId);
event RemovedWhitelistedGlyph(uint256 tokenId);
modifier onlyAdmin() {
}
constructor(address core, address admin, address glyphContract) {
}
function pause() public onlyAdmin {
}
function unpause() public onlyAdmin {
}
function setFpAdress(address _fpAddress) public onlyAdmin {
}
function currentPrice() public view returns (uint256) {
}
function whitelist(uint256 tokenId) public {
}
function removeWhitelist(uint256 tokenId) public {
}
function allowedGlyphsCount() public view returns (uint256) {
}
function allowedGlyphs(uint256 index) public view returns (uint256) {
}
function _addTokenToWhitelistEnumeration(uint256 tokenId) private {
}
function fpWithdrawal() public {
}
function adminWithdrawal() public {
}
function generatorWithdrawal(uint256 tokenId) public {
require(msg.sender == IERC721(GLYPH_CONTRACT).ownerOf(tokenId), "Only the token owner account can withdrawl");
require(<FILL_ME>)
uint amount = pendingGlyphTokenWithdrawals[tokenId];
pendingGlyphTokenWithdrawals[tokenId] = 0;
if (address(this).balance < amount)
amount = address(this).balance;
payable(msg.sender).transfer(amount);
}
function _removeTokenFromWhitelistEnumeration(uint256 tokenId) private {
}
function startAuction() public whenNotPaused onlyAdmin{
}
function mintFromGlyph(uint256 tokenId) payable public whenNotPaused {
}
}
| pendingGlyphTokenWithdrawals[tokenId]>0,"Account has no funds to claim" | 280,565 | pendingGlyphTokenWithdrawals[tokenId]>0 |
"Auction already started" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./AvidlinesCore.sol";
uint256 constant TOTAL_MAX = 500;
uint256 constant TOTAL_PUBLIC_MAX = 425;
uint256 constant MAX_PRICE = 2*10**18; //init auction price 2 eth
uint256 constant MIN_PRICE = 0;
uint256 constant AUCTION_DURATION = 5*60*1; //~1h in blocks
uint256 constant ADMIN_SHARE = 80; // in percentage
uint256 constant FP_SHARE = 10;
uint256 constant GEN_SHARE = 10;
uint32 constant PRECISION = 10*6;
contract AvidlinesMinter is Pausable {
using SafeMath for uint256;
address internal coreAddress;
address internal adminAddress;
address internal fpAddress;
address internal GLYPH_CONTRACT;
uint256 public totalTokenMints;
mapping(uint256 => bool) public isGlyphAllowed;
uint256[] private _allWhitelisted;
mapping(uint256 => uint256) private _allWhitelistedIndex;
uint256 public pendingFpWithdrawals;
uint256 public pendingAdminWithdrawals;
mapping(uint256 => uint256) public pendingGlyphTokenWithdrawals;
uint256 public auctionStart = 0;
bool public auctionStarted = false;
event MintFromToken(address indexed from, uint256 tokenId);
event WhitelistedGlyph(uint256 tokenId);
event RemovedWhitelistedGlyph(uint256 tokenId);
modifier onlyAdmin() {
}
constructor(address core, address admin, address glyphContract) {
}
function pause() public onlyAdmin {
}
function unpause() public onlyAdmin {
}
function setFpAdress(address _fpAddress) public onlyAdmin {
}
function currentPrice() public view returns (uint256) {
}
function whitelist(uint256 tokenId) public {
}
function removeWhitelist(uint256 tokenId) public {
}
function allowedGlyphsCount() public view returns (uint256) {
}
function allowedGlyphs(uint256 index) public view returns (uint256) {
}
function _addTokenToWhitelistEnumeration(uint256 tokenId) private {
}
function fpWithdrawal() public {
}
function adminWithdrawal() public {
}
function generatorWithdrawal(uint256 tokenId) public {
}
function _removeTokenFromWhitelistEnumeration(uint256 tokenId) private {
}
function startAuction() public whenNotPaused onlyAdmin{
require(<FILL_ME>)
auctionStart = block.number;
auctionStarted = true;
}
function mintFromGlyph(uint256 tokenId) payable public whenNotPaused {
}
}
| !auctionStarted,"Auction already started" | 280,565 | !auctionStarted |
"Can not mint more than max supply" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CoolMonstaz is ERC721, Ownable {
uint256 private _totalSupply;
uint256 private _maxSupply = 1111;
uint256 public price = 0.06 ether;
bool public publicsaleActive = true;
bool public presaleActive = true;
mapping(address => uint8) public presaleMints;
uint256 public presaleMintLimit = 6;
address private _wallet1 = 0xa9A35A8D65f94f27C5d9E78B984748BCa9AD5191;
address private _wallet2 = 0x071FE7b23b21eDAf0A8eBD89c0dDa3462F978e3A;
address private _wallet3 = 0x9dcE3e4Bd1913e759835D630cC6E7Eb6b591473E;
address private _wallet4 = 0x64eB967bF4A84c9109769e91B9bAea9eED938005;
address private _wallet5 = 0x97508bEE24D335B2D4F4173c4Ec27d4ED1098cF5;
string public provenanceHash;
string public baseURI;
constructor() ERC721("Cool Monstaz", "MSTZ") {}
function mintPublicsale(uint256 count) external payable {
require(msg.sender == tx.origin, "Reverted");
require(publicsaleActive, "Public sale is not active");
require(<FILL_ME>)
require(count > 0 && count <= 40, "Out of per transaction mint limit");
require(msg.value >= count * price, "Insufficient payment");
if (presaleActive) {
require(presaleMints[msg.sender] + count <= presaleMintLimit, "Per wallet mint limit");
}
for (uint256 i = 0; i < count; i++) {
_totalSupply++;
_mint(msg.sender, _totalSupply);
presaleMints[msg.sender]++;
}
distributePayment();
}
function distributePayment() internal {
}
function mintGiveaway() external onlyOwner {
}
function activatePublicsale() external onlyOwner {
}
function completePublicsale() external onlyOwner {
}
function togglePresale() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setProvenanceHash(string memory newProvenanceHash) public onlyOwner {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function maxSupply() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function activeMintingDetails() public view returns (string memory publicOrPresale, uint8 round) {
}
event PublicsaleActivated();
event PublicsaleCompleted();
event PriceUpdated(uint256 price);
}
| _totalSupply+count<=_maxSupply,"Can not mint more than max supply" | 280,586 | _totalSupply+count<=_maxSupply |
"Per wallet mint limit" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CoolMonstaz is ERC721, Ownable {
uint256 private _totalSupply;
uint256 private _maxSupply = 1111;
uint256 public price = 0.06 ether;
bool public publicsaleActive = true;
bool public presaleActive = true;
mapping(address => uint8) public presaleMints;
uint256 public presaleMintLimit = 6;
address private _wallet1 = 0xa9A35A8D65f94f27C5d9E78B984748BCa9AD5191;
address private _wallet2 = 0x071FE7b23b21eDAf0A8eBD89c0dDa3462F978e3A;
address private _wallet3 = 0x9dcE3e4Bd1913e759835D630cC6E7Eb6b591473E;
address private _wallet4 = 0x64eB967bF4A84c9109769e91B9bAea9eED938005;
address private _wallet5 = 0x97508bEE24D335B2D4F4173c4Ec27d4ED1098cF5;
string public provenanceHash;
string public baseURI;
constructor() ERC721("Cool Monstaz", "MSTZ") {}
function mintPublicsale(uint256 count) external payable {
require(msg.sender == tx.origin, "Reverted");
require(publicsaleActive, "Public sale is not active");
require(_totalSupply + count <= _maxSupply, "Can not mint more than max supply");
require(count > 0 && count <= 40, "Out of per transaction mint limit");
require(msg.value >= count * price, "Insufficient payment");
if (presaleActive) {
require(<FILL_ME>)
}
for (uint256 i = 0; i < count; i++) {
_totalSupply++;
_mint(msg.sender, _totalSupply);
presaleMints[msg.sender]++;
}
distributePayment();
}
function distributePayment() internal {
}
function mintGiveaway() external onlyOwner {
}
function activatePublicsale() external onlyOwner {
}
function completePublicsale() external onlyOwner {
}
function togglePresale() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setProvenanceHash(string memory newProvenanceHash) public onlyOwner {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function maxSupply() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function activeMintingDetails() public view returns (string memory publicOrPresale, uint8 round) {
}
event PublicsaleActivated();
event PublicsaleCompleted();
event PriceUpdated(uint256 price);
}
| presaleMints[msg.sender]+count<=presaleMintLimit,"Per wallet mint limit" | 280,586 | presaleMints[msg.sender]+count<=presaleMintLimit |
"Presale is active" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CoolMonstaz is ERC721, Ownable {
uint256 private _totalSupply;
uint256 private _maxSupply = 1111;
uint256 public price = 0.06 ether;
bool public publicsaleActive = true;
bool public presaleActive = true;
mapping(address => uint8) public presaleMints;
uint256 public presaleMintLimit = 6;
address private _wallet1 = 0xa9A35A8D65f94f27C5d9E78B984748BCa9AD5191;
address private _wallet2 = 0x071FE7b23b21eDAf0A8eBD89c0dDa3462F978e3A;
address private _wallet3 = 0x9dcE3e4Bd1913e759835D630cC6E7Eb6b591473E;
address private _wallet4 = 0x64eB967bF4A84c9109769e91B9bAea9eED938005;
address private _wallet5 = 0x97508bEE24D335B2D4F4173c4Ec27d4ED1098cF5;
string public provenanceHash;
string public baseURI;
constructor() ERC721("Cool Monstaz", "MSTZ") {}
function mintPublicsale(uint256 count) external payable {
}
function distributePayment() internal {
}
function mintGiveaway() external onlyOwner {
}
function activatePublicsale() external onlyOwner {
require(<FILL_ME>)
publicsaleActive = true;
emit PublicsaleActivated();
}
function completePublicsale() external onlyOwner {
}
function togglePresale() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setProvenanceHash(string memory newProvenanceHash) public onlyOwner {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function maxSupply() public view returns (uint256) {
}
function totalSupply() public view returns (uint256) {
}
function activeMintingDetails() public view returns (string memory publicOrPresale, uint8 round) {
}
event PublicsaleActivated();
event PublicsaleCompleted();
event PriceUpdated(uint256 price);
}
| !presaleActive,"Presale is active" | 280,586 | !presaleActive |
null | pragma solidity ^0.4.24;
contract owned {
address public owner;
function owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
}
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
}
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
}
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
}
function assert(bool assertion) internal {
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 is SafeMath {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(<FILL_ME>)
// Save this for an assertion in the future
uint previousBalances = SafeMath.safeAdd(balanceOf[_from], balanceOf[_to]);
balanceOf[_from] = SafeMath.safeSub(balanceOf[_from], _value); // Subtract from the sender
balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(SafeMath.safeAdd(balanceOf[_from], balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
}
}
/******************************************/
/* GASS TOKEN STARTS HERE */
/******************************************/
contract GASSToken is owned, TokenERC20 {
/// The full name of the GASSToken token.
string public constant tokenName = "GASS";
/// Symbol of the GASSToken token.
string public constant tokenSymbol = "GASS";
uint256 public initialSupply = 1000000000;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function GASSToken() TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
}
}
| SafeMath.safeAdd(balanceOf[_to],_value)>balanceOf[_to] | 280,655 | SafeMath.safeAdd(balanceOf[_to],_value)>balanceOf[_to] |
"Sent ETH value is incorrect." | pragma solidity ^0.8.0;
/*
$$$$$$\ $$\ $$\
$$ __$$\ $$ |\__|
$$ / \__|$$\ $$\ $$$$$$\ $$$$$$\ $$$$$$$ |$$\ $$$$$$\ $$$$$$$\
$$ |$$$$\ $$ | $$ | \____$$\ $$ __$$\ $$ __$$ |$$ | \____$$\ $$ __$$\
$$ |\_$$ |$$ | $$ | $$$$$$$ |$$ | \__|$$ / $$ |$$ | $$$$$$$ |$$ | $$ |
$$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ | $$ |$$ |$$ __$$ |$$ | $$ |
\$$$$$$ |\$$$$$$ |\$$$$$$$ |$$ | \$$$$$$$ |$$ |\$$$$$$$ |$$ | $$ |
\______/ \______/ \_______|\__| \_______|\__| \_______|\__| \__|
$$\ $$\
$$ | $$ |
$$ |$$ / $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\
$$$$$ / $$ __$$\ $$ __$$\ $$ __$$\ \____$$ |
$$ $$< $$ / $$ |$$ | $$ |$$ / $$ | $$$$ _/
$$ |\$$\ $$ | $$ |$$ | $$ |$$ | $$ | $$ _/
$$ | \$$\\$$$$$$ |$$ | $$ |\$$$$$$$ |$$$$$$$$\
\__| \__|\______/ \__| \__| \____$$ |\________|
$$\ $$ |
\$$$$$$ |
\______/
*/
contract GuardianKongz is ERC721Enumerable, ReentrancyGuard, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
bool public presaleMintIsActive = false;
bool public mintIsActive = false;
uint256 public maxSupply = 5000;
uint256 public maxMintAmount = 2;
uint256 public mintPrice = 80000000000000000; // 0.08 ETH
uint256 public presaleMintPrice = 60000000000000000; // 0.06 ETH
address public signatureAddress;
// constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setMintCost(uint256 _newPrice) public onlyOwner() {
}
function setPresaleMintCost(uint256 _newPrice) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setSignatureAddress(address _importantAddress) public onlyOwner {
}
function flipMintState() public onlyOwner {
}
function flipPresaleMintState() public onlyOwner {
}
function withdraw() public onlyOwner {
}
// mint
function devMint(uint256 numberOfTokens) public onlyOwner {
}
function mint(uint256 numberOfTokens) public payable nonReentrant {
require(mintIsActive, "Public mint is not active at the moment. Be patient.");
require(numberOfTokens > 0, "Number of tokens can not be less than or equal to 0.");
require(totalSupply() + numberOfTokens <= maxSupply, "Purchase would exceed max supply.");
require(numberOfTokens <= 10, "Can only mint up to 10 per transaction.");
require(<FILL_ME>)
for (uint i = 0; i < numberOfTokens; i++) {
_safeMint(_msgSender(), totalSupply() + 1);
}
}
function presaleMint(bytes memory sig, uint256 numberOfTokens) public payable nonReentrant {
}
//verify signature
function isValidData(address _walletAddress, bytes memory sig) public view returns(bool){
}
function recoverSigner(bytes32 message, bytes memory sig)
public
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
public
pure
returns (uint8, bytes32, bytes32)
{
}
}
| mintPrice*numberOfTokens==msg.value,"Sent ETH value is incorrect." | 280,727 | mintPrice*numberOfTokens==msg.value |
"Sent ETH value is incorrect." | pragma solidity ^0.8.0;
/*
$$$$$$\ $$\ $$\
$$ __$$\ $$ |\__|
$$ / \__|$$\ $$\ $$$$$$\ $$$$$$\ $$$$$$$ |$$\ $$$$$$\ $$$$$$$\
$$ |$$$$\ $$ | $$ | \____$$\ $$ __$$\ $$ __$$ |$$ | \____$$\ $$ __$$\
$$ |\_$$ |$$ | $$ | $$$$$$$ |$$ | \__|$$ / $$ |$$ | $$$$$$$ |$$ | $$ |
$$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ | $$ |$$ |$$ __$$ |$$ | $$ |
\$$$$$$ |\$$$$$$ |\$$$$$$$ |$$ | \$$$$$$$ |$$ |\$$$$$$$ |$$ | $$ |
\______/ \______/ \_______|\__| \_______|\__| \_______|\__| \__|
$$\ $$\
$$ | $$ |
$$ |$$ / $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\
$$$$$ / $$ __$$\ $$ __$$\ $$ __$$\ \____$$ |
$$ $$< $$ / $$ |$$ | $$ |$$ / $$ | $$$$ _/
$$ |\$$\ $$ | $$ |$$ | $$ |$$ | $$ | $$ _/
$$ | \$$\\$$$$$$ |$$ | $$ |\$$$$$$$ |$$$$$$$$\
\__| \__|\______/ \__| \__| \____$$ |\________|
$$\ $$ |
\$$$$$$ |
\______/
*/
contract GuardianKongz is ERC721Enumerable, ReentrancyGuard, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
bool public presaleMintIsActive = false;
bool public mintIsActive = false;
uint256 public maxSupply = 5000;
uint256 public maxMintAmount = 2;
uint256 public mintPrice = 80000000000000000; // 0.08 ETH
uint256 public presaleMintPrice = 60000000000000000; // 0.06 ETH
address public signatureAddress;
// constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setMintCost(uint256 _newPrice) public onlyOwner() {
}
function setPresaleMintCost(uint256 _newPrice) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setSignatureAddress(address _importantAddress) public onlyOwner {
}
function flipMintState() public onlyOwner {
}
function flipPresaleMintState() public onlyOwner {
}
function withdraw() public onlyOwner {
}
// mint
function devMint(uint256 numberOfTokens) public onlyOwner {
}
function mint(uint256 numberOfTokens) public payable nonReentrant {
}
function presaleMint(bytes memory sig, uint256 numberOfTokens) public payable nonReentrant {
require(presaleMintIsActive, "Presale mint is not active at the moment. Be patient.");
require(numberOfTokens > 0, "Number of tokens can not be less than or equal to 0.");
require(totalSupply() + numberOfTokens <= maxSupply, "Purchase would exceed max supply.");
require(numberOfTokens <= maxMintAmount, "Can only mint up to 2 per transaction.");
require(<FILL_ME>)
require(balanceOf(msg.sender) + numberOfTokens <= maxMintAmount, "Can only mint up to 2 per wallet.");
require(isValidData(msg.sender, sig), "You are not whitelisted");
for (uint i = 0; i < numberOfTokens; i++) {
_safeMint(_msgSender(), totalSupply() + 1);
}
}
//verify signature
function isValidData(address _walletAddress, bytes memory sig) public view returns(bool){
}
function recoverSigner(bytes32 message, bytes memory sig)
public
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
public
pure
returns (uint8, bytes32, bytes32)
{
}
}
| presaleMintPrice*numberOfTokens==msg.value,"Sent ETH value is incorrect." | 280,727 | presaleMintPrice*numberOfTokens==msg.value |
"Can only mint up to 2 per wallet." | pragma solidity ^0.8.0;
/*
$$$$$$\ $$\ $$\
$$ __$$\ $$ |\__|
$$ / \__|$$\ $$\ $$$$$$\ $$$$$$\ $$$$$$$ |$$\ $$$$$$\ $$$$$$$\
$$ |$$$$\ $$ | $$ | \____$$\ $$ __$$\ $$ __$$ |$$ | \____$$\ $$ __$$\
$$ |\_$$ |$$ | $$ | $$$$$$$ |$$ | \__|$$ / $$ |$$ | $$$$$$$ |$$ | $$ |
$$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ | $$ |$$ |$$ __$$ |$$ | $$ |
\$$$$$$ |\$$$$$$ |\$$$$$$$ |$$ | \$$$$$$$ |$$ |\$$$$$$$ |$$ | $$ |
\______/ \______/ \_______|\__| \_______|\__| \_______|\__| \__|
$$\ $$\
$$ | $$ |
$$ |$$ / $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\
$$$$$ / $$ __$$\ $$ __$$\ $$ __$$\ \____$$ |
$$ $$< $$ / $$ |$$ | $$ |$$ / $$ | $$$$ _/
$$ |\$$\ $$ | $$ |$$ | $$ |$$ | $$ | $$ _/
$$ | \$$\\$$$$$$ |$$ | $$ |\$$$$$$$ |$$$$$$$$\
\__| \__|\______/ \__| \__| \____$$ |\________|
$$\ $$ |
\$$$$$$ |
\______/
*/
contract GuardianKongz is ERC721Enumerable, ReentrancyGuard, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
bool public presaleMintIsActive = false;
bool public mintIsActive = false;
uint256 public maxSupply = 5000;
uint256 public maxMintAmount = 2;
uint256 public mintPrice = 80000000000000000; // 0.08 ETH
uint256 public presaleMintPrice = 60000000000000000; // 0.06 ETH
address public signatureAddress;
// constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setMintCost(uint256 _newPrice) public onlyOwner() {
}
function setPresaleMintCost(uint256 _newPrice) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setSignatureAddress(address _importantAddress) public onlyOwner {
}
function flipMintState() public onlyOwner {
}
function flipPresaleMintState() public onlyOwner {
}
function withdraw() public onlyOwner {
}
// mint
function devMint(uint256 numberOfTokens) public onlyOwner {
}
function mint(uint256 numberOfTokens) public payable nonReentrant {
}
function presaleMint(bytes memory sig, uint256 numberOfTokens) public payable nonReentrant {
require(presaleMintIsActive, "Presale mint is not active at the moment. Be patient.");
require(numberOfTokens > 0, "Number of tokens can not be less than or equal to 0.");
require(totalSupply() + numberOfTokens <= maxSupply, "Purchase would exceed max supply.");
require(numberOfTokens <= maxMintAmount, "Can only mint up to 2 per transaction.");
require(presaleMintPrice * numberOfTokens == msg.value, "Sent ETH value is incorrect.");
require(<FILL_ME>)
require(isValidData(msg.sender, sig), "You are not whitelisted");
for (uint i = 0; i < numberOfTokens; i++) {
_safeMint(_msgSender(), totalSupply() + 1);
}
}
//verify signature
function isValidData(address _walletAddress, bytes memory sig) public view returns(bool){
}
function recoverSigner(bytes32 message, bytes memory sig)
public
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
public
pure
returns (uint8, bytes32, bytes32)
{
}
}
| balanceOf(msg.sender)+numberOfTokens<=maxMintAmount,"Can only mint up to 2 per wallet." | 280,727 | balanceOf(msg.sender)+numberOfTokens<=maxMintAmount |
"You are not whitelisted" | pragma solidity ^0.8.0;
/*
$$$$$$\ $$\ $$\
$$ __$$\ $$ |\__|
$$ / \__|$$\ $$\ $$$$$$\ $$$$$$\ $$$$$$$ |$$\ $$$$$$\ $$$$$$$\
$$ |$$$$\ $$ | $$ | \____$$\ $$ __$$\ $$ __$$ |$$ | \____$$\ $$ __$$\
$$ |\_$$ |$$ | $$ | $$$$$$$ |$$ | \__|$$ / $$ |$$ | $$$$$$$ |$$ | $$ |
$$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ | $$ |$$ |$$ __$$ |$$ | $$ |
\$$$$$$ |\$$$$$$ |\$$$$$$$ |$$ | \$$$$$$$ |$$ |\$$$$$$$ |$$ | $$ |
\______/ \______/ \_______|\__| \_______|\__| \_______|\__| \__|
$$\ $$\
$$ | $$ |
$$ |$$ / $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$$\
$$$$$ / $$ __$$\ $$ __$$\ $$ __$$\ \____$$ |
$$ $$< $$ / $$ |$$ | $$ |$$ / $$ | $$$$ _/
$$ |\$$\ $$ | $$ |$$ | $$ |$$ | $$ | $$ _/
$$ | \$$\\$$$$$$ |$$ | $$ |\$$$$$$$ |$$$$$$$$\
\__| \__|\______/ \__| \__| \____$$ |\________|
$$\ $$ |
\$$$$$$ |
\______/
*/
contract GuardianKongz is ERC721Enumerable, ReentrancyGuard, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
bool public presaleMintIsActive = false;
bool public mintIsActive = false;
uint256 public maxSupply = 5000;
uint256 public maxMintAmount = 2;
uint256 public mintPrice = 80000000000000000; // 0.08 ETH
uint256 public presaleMintPrice = 60000000000000000; // 0.06 ETH
address public signatureAddress;
// constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setMintCost(uint256 _newPrice) public onlyOwner() {
}
function setPresaleMintCost(uint256 _newPrice) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setSignatureAddress(address _importantAddress) public onlyOwner {
}
function flipMintState() public onlyOwner {
}
function flipPresaleMintState() public onlyOwner {
}
function withdraw() public onlyOwner {
}
// mint
function devMint(uint256 numberOfTokens) public onlyOwner {
}
function mint(uint256 numberOfTokens) public payable nonReentrant {
}
function presaleMint(bytes memory sig, uint256 numberOfTokens) public payable nonReentrant {
require(presaleMintIsActive, "Presale mint is not active at the moment. Be patient.");
require(numberOfTokens > 0, "Number of tokens can not be less than or equal to 0.");
require(totalSupply() + numberOfTokens <= maxSupply, "Purchase would exceed max supply.");
require(numberOfTokens <= maxMintAmount, "Can only mint up to 2 per transaction.");
require(presaleMintPrice * numberOfTokens == msg.value, "Sent ETH value is incorrect.");
require(balanceOf(msg.sender) + numberOfTokens <= maxMintAmount, "Can only mint up to 2 per wallet.");
require(<FILL_ME>)
for (uint i = 0; i < numberOfTokens; i++) {
_safeMint(_msgSender(), totalSupply() + 1);
}
}
//verify signature
function isValidData(address _walletAddress, bytes memory sig) public view returns(bool){
}
function recoverSigner(bytes32 message, bytes memory sig)
public
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
public
pure
returns (uint8, bytes32, bytes32)
{
}
}
| isValidData(msg.sender,sig),"You are not whitelisted" | 280,727 | isValidData(msg.sender,sig) |
"ath already has nft" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
abstract contract IOriginNftUpgradeable is
ERC721URIStorageUpgradeable,
OwnableUpgradeable
{
uint256 m_token_id;
mapping(uint256 => uint256) m_token_to_athlete;
mapping(uint256 => uint256) m_athlete_to_token;
address m_approved_caller;
function __IOriginNftUpgradeable_init(
string memory _name,
string memory _symbol
) internal onlyInitializing {
}
function __IOriginNftUpgradeable_init_unchained(
string memory _name,
string memory _symbol
) internal onlyInitializing {
}
modifier allowedCaller() {
}
function setApprovalForCaller(address _operator)
external
virtual
onlyOwner
{
}
function getTokenCount() external view virtual returns (uint256) {
}
function getAthleteForToken(uint256 _token_id)
public
view
virtual
returns (uint256)
{
}
event OriginNftMinted(
address indexed athlete_wallet,
uint256 indexed athlete_id,
uint256 indexed token_id
);
function mintOriginNft(
string calldata _signature_uri,
uint256 _on_chain_ath_id,
address _athlete
) public virtual allowedCaller {
// checks: athlete does not already have an origin nft
require(<FILL_ME>)
// effects: new token id
m_token_id++;
console.log(
"In[mintOriginNft] _on_chain_ath_id[%d] m_token_id[%d]",
_on_chain_ath_id,
m_token_id
);
// effects: update map(s)
m_token_to_athlete[m_token_id] = _on_chain_ath_id;
m_athlete_to_token[_on_chain_ath_id] = m_token_id;
// interaction: mint new token to athlete
_mint(_athlete, m_token_id);
assert(ownerOf(m_token_id) == _athlete);
// interaction: set the uri of athletes signature
_setTokenURI(m_token_id, _signature_uri);
// emit event with new token id
emit OriginNftMinted(_athlete, _on_chain_ath_id, m_token_id);
}
}
| m_athlete_to_token[_on_chain_ath_id]==0,"ath already has nft" | 280,776 | m_athlete_to_token[_on_chain_ath_id]==0 |
'Max supply exceeded' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import '@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
contract JpegGallery is EIP712, ERC721Enumerable, ERC721Burnable, ERC721Pausable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
// Constants
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant PURCHASE_LIMIT = 10;
uint256 public constant PRICE = 0.069 ether;
// Variables
bool public whitelistIsOpen = false;
bool public saleIsOpen = false;
string private tokenBaseURI = '';
mapping(address => uint8) private allowList;
// Events
event SetBaseURI(string indexed _baseURI);
event CreateJpeg(uint256 indexed id);
constructor(string memory name, string memory symbol, string memory version, string memory baseURI)
ERC721(name, symbol)
EIP712(name, version)
{
}
function mint(address to, uint256 amount) external payable {
uint256 total = totalSupply();
require(saleIsOpen, 'Sale is not open');
require(total < MAX_SUPPLY, 'Max supply exceeded');
require(<FILL_ME>)
require(amount > 0, 'Amount must be greater than 0');
require(amount <= PURCHASE_LIMIT, 'Max purchase limit exceeded');
require(msg.value >= PRICE.mul(amount), 'Incorrect ether value sent');
for (uint256 i; i < amount; i++) {
uint id = totalSupply();
_safeMint(to, id);
emit CreateJpeg(id);
}
}
function whitelistMint(uint8 amount) external payable {
}
function setWhitelist(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function setWhitelistState(bool isOpen) external onlyOwner {
}
function setSaleState(bool isOpen) external onlyOwner {
}
function gift(address[] calldata to) external onlyOwner {
}
function pause(bool pauseContract) public onlyOwner {
}
function withdrawAll() external payable onlyOwner {
}
function walletOfOwner(address owner) public view returns (uint256[] memory) {
}
function _baseURI() internal view virtual override(ERC721) returns (string memory) {
}
function setBaseURI(string memory URI) public onlyOwner {
}
function _hash(address account, string memory name) internal view returns (bytes32) {
}
function verify(address account, uint256 id, string calldata name, bytes calldata signature) external view returns (bool) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| total+amount<=MAX_SUPPLY,'Max supply exceeded' | 280,849 | total+amount<=MAX_SUPPLY |
'Max supply exceeded' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import '@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
contract JpegGallery is EIP712, ERC721Enumerable, ERC721Burnable, ERC721Pausable, Ownable {
using Strings for uint256;
using SafeMath for uint256;
// Constants
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant PURCHASE_LIMIT = 10;
uint256 public constant PRICE = 0.069 ether;
// Variables
bool public whitelistIsOpen = false;
bool public saleIsOpen = false;
string private tokenBaseURI = '';
mapping(address => uint8) private allowList;
// Events
event SetBaseURI(string indexed _baseURI);
event CreateJpeg(uint256 indexed id);
constructor(string memory name, string memory symbol, string memory version, string memory baseURI)
ERC721(name, symbol)
EIP712(name, version)
{
}
function mint(address to, uint256 amount) external payable {
}
function whitelistMint(uint8 amount) external payable {
}
function setWhitelist(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function setWhitelistState(bool isOpen) external onlyOwner {
}
function setSaleState(bool isOpen) external onlyOwner {
}
function gift(address[] calldata to) external onlyOwner {
uint256 total = totalSupply();
require(total < MAX_SUPPLY, 'Max supply exceeded');
require(<FILL_ME>)
for(uint256 i; i < to.length; i++) {
uint id = totalSupply();
_safeMint(to[i], id);
emit CreateJpeg(id);
}
}
function pause(bool pauseContract) public onlyOwner {
}
function withdrawAll() external payable onlyOwner {
}
function walletOfOwner(address owner) public view returns (uint256[] memory) {
}
function _baseURI() internal view virtual override(ERC721) returns (string memory) {
}
function setBaseURI(string memory URI) public onlyOwner {
}
function _hash(address account, string memory name) internal view returns (bytes32) {
}
function verify(address account, uint256 id, string calldata name, bytes calldata signature) external view returns (bool) {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| total+to.length<=MAX_SUPPLY,'Max supply exceeded' | 280,849 | total+to.length<=MAX_SUPPLY |
"Can't mint more than max supply" | /*
Mint your $BTFD Chads at btfdchads.quest
and join our discord: https://t.co/XaFH8pJaMK
Also check:
https://www.btfd.quest/
https://twitter.com/btfd_eth
https://t.me/BTFDeth
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract BTFDchads is ERC721Enumerable, Ownable {
using Address for address;
// Starting and stopping sale and presale
bool public saleActive = false;
bool public presaleActive = false;
// Price of each token
uint256 public price = 0.045 ether;
// Maximum limit of tokens that can ever exist
uint256 constant MAX_SUPPLY = 6969;
// The base link that leads to the image / video of the token
string public baseTokenURI;
// List of addresses that have a number of reserved tokens for presale
mapping (address => uint256) public presaleReserved;
constructor (string memory newBaseURI) ERC721 ("BTFD Chads", "BTFD Chads") {
}
// Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead
function _baseURI() internal view virtual override returns (string memory) {
}
// See which address owns which tokens
function tokensOfOwner(address addr) public view returns(uint256[] memory) {
}
// Exclusive presale minting
function mintPresale(uint256 _amount) public payable {
uint256 supply = totalSupply();
uint256 reservedAmt = presaleReserved[msg.sender];
require( presaleActive, "Presale isn't active" );
require( reservedAmt > 0, "No tokens reserved for your address" );
require( _amount <= reservedAmt, "Can't mint more than reserved" );
require(<FILL_ME>)
require( msg.value == price * _amount, "Wrong amount of ETH sent" );
presaleReserved[msg.sender] = reservedAmt - _amount;
for(uint256 i; i < _amount; i++){
_safeMint( msg.sender, supply + i );
}
}
// Standard mint function
function mintToken(uint256 _amount) public payable {
}
// Edit reserved presale spots
function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner {
}
// Start and stop presale
function setPresaleActive(bool val) public onlyOwner {
}
// Start and stop sale
function setSaleActive(bool val) public onlyOwner {
}
// Set new baseURI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Set a different price in case ETH changes drastically
function setPrice(uint256 newPrice) public onlyOwner {
}
// Withdraw funds from contract for the team
function withdraw() public payable onlyOwner {
}
}
| supply+_amount<=MAX_SUPPLY,"Can't mint more than max supply" | 280,851 | supply+_amount<=MAX_SUPPLY |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
require(balanceOf[msg.sender] >= _value);
require(<FILL_ME>)
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
tempLockedAddress[_to] = _unlockTime;
emit Transfer(msg.sender, _to, _value);
emit TempLockedAddress(_to, _unlockTime);
return true;
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
}
function transfer(address _to, uint256 _value) public isValidAddress
{
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| balanceOf[_to]+(_value)>=balanceOf[_to] | 280,961 | balanceOf[_to]+(_value)>=balanceOf[_to] |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
require(ICO_startingTime < block.timestamp && ICO_closingTime > block.timestamp);
require(<FILL_ME>)
uint256 tokenValue;
tokenValue = (msg.value).mul(tokenReward);
require(balanceOf[owner] >= tokenValue);
require(balanceOf[msg.sender].add(tokenValue) >= balanceOf[msg.sender]);
emit Deposit(msg.sender, msg.value, status);
balanceOf[owner] -= tokenValue;
balanceOf[msg.sender] += tokenValue;
emit Transfer(owner, msg.sender, tokenValue);
}
function transfer(address _to, uint256 _value) public isValidAddress
{
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| !depositLock | 280,961 | !depositLock |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
require(ICO_startingTime < block.timestamp && ICO_closingTime > block.timestamp);
require(!depositLock);
uint256 tokenValue;
tokenValue = (msg.value).mul(tokenReward);
require(<FILL_ME>)
require(balanceOf[msg.sender].add(tokenValue) >= balanceOf[msg.sender]);
emit Deposit(msg.sender, msg.value, status);
balanceOf[owner] -= tokenValue;
balanceOf[msg.sender] += tokenValue;
emit Transfer(owner, msg.sender, tokenValue);
}
function transfer(address _to, uint256 _value) public isValidAddress
{
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| balanceOf[owner]>=tokenValue | 280,961 | balanceOf[owner]>=tokenValue |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
require(ICO_startingTime < block.timestamp && ICO_closingTime > block.timestamp);
require(!depositLock);
uint256 tokenValue;
tokenValue = (msg.value).mul(tokenReward);
require(balanceOf[owner] >= tokenValue);
require(<FILL_ME>)
emit Deposit(msg.sender, msg.value, status);
balanceOf[owner] -= tokenValue;
balanceOf[msg.sender] += tokenValue;
emit Transfer(owner, msg.sender, tokenValue);
}
function transfer(address _to, uint256 _value) public isValidAddress
{
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| balanceOf[msg.sender].add(tokenValue)>=balanceOf[msg.sender] | 280,961 | balanceOf[msg.sender].add(tokenValue)>=balanceOf[msg.sender] |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
}
function transfer(address _to, uint256 _value) public isValidAddress
{
require(<FILL_ME>)
require(tempLockedAddress[msg.sender] < block.timestamp);
require(!blockedAddress[msg.sender] && !blockedAddress[_to]);
require(balanceOf[msg.sender] >= _value);
require((balanceOf[_to].add(_value)) >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| allowedAddress[msg.sender]||transferLock==false | 280,961 | allowedAddress[msg.sender]||transferLock==false |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
}
function transfer(address _to, uint256 _value) public isValidAddress
{
require(allowedAddress[msg.sender] || transferLock == false);
require(<FILL_ME>)
require(!blockedAddress[msg.sender] && !blockedAddress[_to]);
require(balanceOf[msg.sender] >= _value);
require((balanceOf[_to].add(_value)) >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| tempLockedAddress[msg.sender]<block.timestamp | 280,961 | tempLockedAddress[msg.sender]<block.timestamp |
null | pragma solidity ^0.4.20;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
library safeMath
{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
}
}
contract Event
{
event Transfer(address indexed from, address indexed to, uint256 value);
event Deposit(address indexed sender, uint256 amount , string status);
event TokenBurn(address indexed from, uint256 value);
event TokenAdd(address indexed from, uint256 value);
event Set_Status(string changedStatus);
event Set_TokenReward(uint256 changedTokenReward);
event Set_TimeStamp(uint256 ICO_startingTime, uint256 ICO_closingTime);
event WithdrawETH(uint256 amount);
event BlockedAddress(address blockedAddress);
event TempLockedAddress(address tempLockAddress, uint256 unlockTime);
}
contract Variable
{
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public owner;
string public status;
uint256 internal _decimals;
uint256 internal tokenReward;
uint256 internal ICO_startingTime;
uint256 internal ICO_closingTime;
bool internal transferLock;
bool internal depositLock;
mapping (address => bool) public allowedAddress;
mapping (address => bool) public blockedAddress;
mapping (address => uint256) public tempLockedAddress;
address withdraw_wallet;
mapping (address => uint256) public balanceOf;
constructor() public
{
}
}
contract Modifiers is Variable
{
modifier isOwner
{
}
modifier isValidAddress
{
}
}
contract Set is Variable, Modifiers, Event
{
function setStatus(string _status) public isOwner returns(bool success)
{
}
function setTokenReward(uint256 _tokenReward) public isOwner returns(bool success)
{
}
function setTimeStamp(uint256 _ICO_startingTime,uint256 _ICO_closingTime) public isOwner returns(bool success)
{
}
function setTransferLock(bool _transferLock) public isOwner returns(bool success)
{
}
function setDepositLock(bool _depositLock) public isOwner returns(bool success)
{
}
function setTimeStampStatus(uint256 _ICO_startingTime, uint256 _ICO_closingTime, string _status) public isOwner returns(bool success)
{
}
}
contract manageAddress is Variable, Modifiers, Event
{
function add_allowedAddress(address _address) public isOwner
{
}
function add_blockedAddress(address _address) public isOwner
{
}
function delete_allowedAddress(address _address) public isOwner
{
}
function delete_blockedAddress(address _address) public isOwner
{
}
}
contract Get is Variable, Modifiers
{
function get_tokenTime() public view returns(uint256 start, uint256 stop)
{
}
function get_transferLock() public view returns(bool)
{
}
function get_depositLock() public view returns(bool)
{
}
function get_tokenReward() public view returns(uint256)
{
}
}
contract Admin is Variable, Modifiers, Event
{
function admin_transfer_tempLockAddress(address _to, uint256 _value, uint256 _unlockTime) public isOwner returns(bool success)
{
}
function admin_transferFrom(address _from, address _to, uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenBurn(uint256 _value) public isOwner returns(bool success)
{
}
function admin_tokenAdd(uint256 _value) public isOwner returns(bool success)
{
}
function admin_renewLockedAddress(address _address, uint256 _unlockTime) public isOwner returns(bool success)
{
}
}
contract GMB is Variable, Event, Get, Set, Admin, manageAddress
{
using safeMath for uint256;
function() payable public
{
}
function transfer(address _to, uint256 _value) public isValidAddress
{
require(allowedAddress[msg.sender] || transferLock == false);
require(tempLockedAddress[msg.sender] < block.timestamp);
require(<FILL_ME>)
require(balanceOf[msg.sender] >= _value);
require((balanceOf[_to].add(_value)) >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
}
function ETH_withdraw(uint256 amount) public isOwner returns(bool)
{
}
}
| !blockedAddress[msg.sender]&&!blockedAddress[_to] | 280,961 | !blockedAddress[msg.sender]&&!blockedAddress[_to] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.