comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"day is not during the sale" | // @title MyBit Tokensale
// @notice A tokensale extending for 365 days. (0....364)
// @notice 100,000 MYB are releases everyday and split proportionaly to funders of that day
// @notice Anyone can fund the current or future days with ETH
// @dev The current day is (timestamp - startTimestamp) / 24 hours
// @author Kyle Dewhurst, MyBit Foundation
contract TokenSale {
using SafeMath for *;
ERC20Interface mybToken;
struct Day {
uint totalWeiContributed;
mapping (address => uint) weiContributed;
}
// Constants
uint256 constant internal scalingFactor = 10**32; // helps avoid rounding errors
uint256 constant public tokensPerDay = 10**23; // 100,000 MYB
// MyBit addresses
address public owner;
address public mybitFoundation;
address public developmentFund;
uint256 public start; // The timestamp when sale starts
mapping (uint16 => Day) public day;
constructor(address _mybToken, address _mybFoundation, address _developmentFund)
public {
}
// @notice owner can start the sale by transferring in required amount of MYB
// @dev the start time is used to determine which day the sale is on (day 0 = first day)
function startSale(uint _timestamp)
external
onlyOwner
returns (bool){
}
// @notice contributor can contribute wei to sale on any current/future _day
// @dev only accepts contributions between days 0 - 364
function fund(uint16 _day)
payable
public
returns (bool) {
}
// @notice Send an index of days and your payment will be divided equally among them
// @dev WEI sent must divide equally into number of days.
function batchFund(uint16[] _day)
payable
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all wei to the token holder
function withdraw(uint16 _day)
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all tokens to contributor from previous days
// @param (uint16[]) _day, list of token sale days msg.sender contributed wei towards
function batchWithdraw(uint16[] _day)
external
returns (bool) {
}
// @notice owner can withdraw funds to the foundation wallet and ddf wallet
// @param (uint) _amount, The amount of wei to withdraw
// @dev must put in an _amount equally divisible by 2
function foundationWithdraw(uint _amount)
external
onlyOwner
returns (bool){
}
// @notice updates ledger with the contribution from _investor
// @param (address) _investor: The sender of WEI to the contract
// @param (uint) _amount: The amount of WEI to add to _day
// @param (uint16) _day: The day to fund
function addContribution(address _investor, uint _amount, uint16 _day)
internal
returns (bool) {
require(_amount > 0, "must send ether with the call");
require(<FILL_ME>)
require(!dayFinished(_day), "day has already finished");
Day storage today = day[_day];
today.totalWeiContributed = today.totalWeiContributed.add(_amount);
today.weiContributed[_investor] = today.weiContributed[_investor].add(_amount);
emit LogTokensPurchased(_investor, _amount, _day);
return true;
}
// @notice Calculates how many tokens user is owed. (userContribution / totalContribution) * tokensPerDay
function getTokensOwed(address _contributor, uint16 _day)
public
view
returns (uint256) {
}
// @notice gets the total amount of mybit owed to the contributor
// @dev this function doesn't check for duplicate days. Output may not reflect actual amount owed if this happens.
function getTotalTokensOwed(address _contributor, uint16[] _days)
public
view
returns (uint256 amount) {
}
// @notice returns the amount of wei contributed by _contributor on _day
function getWeiContributed(uint16 _day, address _contributor)
public
view
returns (uint256) {
}
// @notice returns amount of wei contributed on _day
// @dev if _day is outside of tokensale range it will return 0
function getTotalWeiContributed(uint16 _day)
public
view
returns (uint256) {
}
// @notice return the day associated with this timestamp
function dayFor(uint _timestamp)
public
view
returns (uint16) {
}
// @notice returns true if _day is finished
function dayFinished(uint16 _day)
public
view
returns (bool) {
}
// @notice reverts if the current day isn't less than 365
function duringSale(uint16 _day)
public
view
returns (bool){
}
// @notice return the current day
function currentDay()
public
view
returns (uint16) {
}
// @notice Fallback function: Purchases contributor stake in the tokens for the current day
// @dev rejects contributions by means of the fallback function until timestamp > start
function ()
external
payable {
}
// @notice only owner address can call
modifier onlyOwner {
}
event LogSaleStarted(address _owner, address _mybFoundation, address _developmentFund, uint _totalMYB, uint _startTime);
event LogFoundationWithdraw(address _mybFoundation, uint _amount, uint16 _day);
event LogTokensPurchased(address indexed _contributor, uint _amount, uint16 indexed _day);
event LogTokensCollected(address indexed _contributor, uint _amount, uint16 indexed _day);
}
| duringSale(_day),"day is not during the sale" | 44,788 | duringSale(_day) |
"day has already finished" | // @title MyBit Tokensale
// @notice A tokensale extending for 365 days. (0....364)
// @notice 100,000 MYB are releases everyday and split proportionaly to funders of that day
// @notice Anyone can fund the current or future days with ETH
// @dev The current day is (timestamp - startTimestamp) / 24 hours
// @author Kyle Dewhurst, MyBit Foundation
contract TokenSale {
using SafeMath for *;
ERC20Interface mybToken;
struct Day {
uint totalWeiContributed;
mapping (address => uint) weiContributed;
}
// Constants
uint256 constant internal scalingFactor = 10**32; // helps avoid rounding errors
uint256 constant public tokensPerDay = 10**23; // 100,000 MYB
// MyBit addresses
address public owner;
address public mybitFoundation;
address public developmentFund;
uint256 public start; // The timestamp when sale starts
mapping (uint16 => Day) public day;
constructor(address _mybToken, address _mybFoundation, address _developmentFund)
public {
}
// @notice owner can start the sale by transferring in required amount of MYB
// @dev the start time is used to determine which day the sale is on (day 0 = first day)
function startSale(uint _timestamp)
external
onlyOwner
returns (bool){
}
// @notice contributor can contribute wei to sale on any current/future _day
// @dev only accepts contributions between days 0 - 364
function fund(uint16 _day)
payable
public
returns (bool) {
}
// @notice Send an index of days and your payment will be divided equally among them
// @dev WEI sent must divide equally into number of days.
function batchFund(uint16[] _day)
payable
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all wei to the token holder
function withdraw(uint16 _day)
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all tokens to contributor from previous days
// @param (uint16[]) _day, list of token sale days msg.sender contributed wei towards
function batchWithdraw(uint16[] _day)
external
returns (bool) {
}
// @notice owner can withdraw funds to the foundation wallet and ddf wallet
// @param (uint) _amount, The amount of wei to withdraw
// @dev must put in an _amount equally divisible by 2
function foundationWithdraw(uint _amount)
external
onlyOwner
returns (bool){
}
// @notice updates ledger with the contribution from _investor
// @param (address) _investor: The sender of WEI to the contract
// @param (uint) _amount: The amount of WEI to add to _day
// @param (uint16) _day: The day to fund
function addContribution(address _investor, uint _amount, uint16 _day)
internal
returns (bool) {
require(_amount > 0, "must send ether with the call");
require(duringSale(_day), "day is not during the sale");
require(<FILL_ME>)
Day storage today = day[_day];
today.totalWeiContributed = today.totalWeiContributed.add(_amount);
today.weiContributed[_investor] = today.weiContributed[_investor].add(_amount);
emit LogTokensPurchased(_investor, _amount, _day);
return true;
}
// @notice Calculates how many tokens user is owed. (userContribution / totalContribution) * tokensPerDay
function getTokensOwed(address _contributor, uint16 _day)
public
view
returns (uint256) {
}
// @notice gets the total amount of mybit owed to the contributor
// @dev this function doesn't check for duplicate days. Output may not reflect actual amount owed if this happens.
function getTotalTokensOwed(address _contributor, uint16[] _days)
public
view
returns (uint256 amount) {
}
// @notice returns the amount of wei contributed by _contributor on _day
function getWeiContributed(uint16 _day, address _contributor)
public
view
returns (uint256) {
}
// @notice returns amount of wei contributed on _day
// @dev if _day is outside of tokensale range it will return 0
function getTotalWeiContributed(uint16 _day)
public
view
returns (uint256) {
}
// @notice return the day associated with this timestamp
function dayFor(uint _timestamp)
public
view
returns (uint16) {
}
// @notice returns true if _day is finished
function dayFinished(uint16 _day)
public
view
returns (bool) {
}
// @notice reverts if the current day isn't less than 365
function duringSale(uint16 _day)
public
view
returns (bool){
}
// @notice return the current day
function currentDay()
public
view
returns (uint16) {
}
// @notice Fallback function: Purchases contributor stake in the tokens for the current day
// @dev rejects contributions by means of the fallback function until timestamp > start
function ()
external
payable {
}
// @notice only owner address can call
modifier onlyOwner {
}
event LogSaleStarted(address _owner, address _mybFoundation, address _developmentFund, uint _totalMYB, uint _startTime);
event LogFoundationWithdraw(address _mybFoundation, uint _amount, uint16 _day);
event LogTokensPurchased(address indexed _contributor, uint _amount, uint16 indexed _day);
event LogTokensCollected(address indexed _contributor, uint _amount, uint16 indexed _day);
}
| !dayFinished(_day),"day has already finished" | 44,788 | !dayFinished(_day) |
null | // @title MyBit Tokensale
// @notice A tokensale extending for 365 days. (0....364)
// @notice 100,000 MYB are releases everyday and split proportionaly to funders of that day
// @notice Anyone can fund the current or future days with ETH
// @dev The current day is (timestamp - startTimestamp) / 24 hours
// @author Kyle Dewhurst, MyBit Foundation
contract TokenSale {
using SafeMath for *;
ERC20Interface mybToken;
struct Day {
uint totalWeiContributed;
mapping (address => uint) weiContributed;
}
// Constants
uint256 constant internal scalingFactor = 10**32; // helps avoid rounding errors
uint256 constant public tokensPerDay = 10**23; // 100,000 MYB
// MyBit addresses
address public owner;
address public mybitFoundation;
address public developmentFund;
uint256 public start; // The timestamp when sale starts
mapping (uint16 => Day) public day;
constructor(address _mybToken, address _mybFoundation, address _developmentFund)
public {
}
// @notice owner can start the sale by transferring in required amount of MYB
// @dev the start time is used to determine which day the sale is on (day 0 = first day)
function startSale(uint _timestamp)
external
onlyOwner
returns (bool){
}
// @notice contributor can contribute wei to sale on any current/future _day
// @dev only accepts contributions between days 0 - 364
function fund(uint16 _day)
payable
public
returns (bool) {
}
// @notice Send an index of days and your payment will be divided equally among them
// @dev WEI sent must divide equally into number of days.
function batchFund(uint16[] _day)
payable
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all wei to the token holder
function withdraw(uint16 _day)
external
returns (bool) {
}
// @notice Updates claimableTokens, sends all tokens to contributor from previous days
// @param (uint16[]) _day, list of token sale days msg.sender contributed wei towards
function batchWithdraw(uint16[] _day)
external
returns (bool) {
}
// @notice owner can withdraw funds to the foundation wallet and ddf wallet
// @param (uint) _amount, The amount of wei to withdraw
// @dev must put in an _amount equally divisible by 2
function foundationWithdraw(uint _amount)
external
onlyOwner
returns (bool){
}
// @notice updates ledger with the contribution from _investor
// @param (address) _investor: The sender of WEI to the contract
// @param (uint) _amount: The amount of WEI to add to _day
// @param (uint16) _day: The day to fund
function addContribution(address _investor, uint _amount, uint16 _day)
internal
returns (bool) {
}
// @notice Calculates how many tokens user is owed. (userContribution / totalContribution) * tokensPerDay
function getTokensOwed(address _contributor, uint16 _day)
public
view
returns (uint256) {
}
// @notice gets the total amount of mybit owed to the contributor
// @dev this function doesn't check for duplicate days. Output may not reflect actual amount owed if this happens.
function getTotalTokensOwed(address _contributor, uint16[] _days)
public
view
returns (uint256 amount) {
}
// @notice returns the amount of wei contributed by _contributor on _day
function getWeiContributed(uint16 _day, address _contributor)
public
view
returns (uint256) {
}
// @notice returns amount of wei contributed on _day
// @dev if _day is outside of tokensale range it will return 0
function getTotalWeiContributed(uint16 _day)
public
view
returns (uint256) {
}
// @notice return the day associated with this timestamp
function dayFor(uint _timestamp)
public
view
returns (uint16) {
}
// @notice returns true if _day is finished
function dayFinished(uint16 _day)
public
view
returns (bool) {
}
// @notice reverts if the current day isn't less than 365
function duringSale(uint16 _day)
public
view
returns (bool){
}
// @notice return the current day
function currentDay()
public
view
returns (uint16) {
}
// @notice Fallback function: Purchases contributor stake in the tokens for the current day
// @dev rejects contributions by means of the fallback function until timestamp > start
function ()
external
payable {
require(<FILL_ME>)
}
// @notice only owner address can call
modifier onlyOwner {
}
event LogSaleStarted(address _owner, address _mybFoundation, address _developmentFund, uint _totalMYB, uint _startTime);
event LogFoundationWithdraw(address _mybFoundation, uint _amount, uint16 _day);
event LogTokensPurchased(address indexed _contributor, uint _amount, uint16 indexed _day);
event LogTokensCollected(address indexed _contributor, uint _amount, uint16 indexed _day);
}
| addContribution(msg.sender,msg.value,currentDay()) | 44,788 | addContribution(msg.sender,msg.value,currentDay()) |
'UniswapV2: K' | /**
*Submitted for verification at Etherscan.io on 2020-05-04
*/
pragma solidity =0.5.16;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
}
function _mint(address to, uint value) internal {
}
function _burn(address from, uint value) internal {
}
function _approve(address owner, address spender, uint value) private {
}
function _transfer(address from, address to, uint value) private {
}
function approve(address spender, uint value) external returns (bool) {
}
function transfer(address to, uint value) external returns (bool) {
}
function transferFrom(address from, address to, uint value) external returns (bool) {
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
}
}
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
}
function _safeTransfer(address token, address to, uint value) private {
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(<FILL_ME>)
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
}
// force reserves to match balances
function sync() external lock {
}
}
contract GoodSwapV2Factory is IUniswapV2Factory {
bytes32 public constant INIT_CODE_PAIR_HASH = keccak256(abi.encodePacked(type(UniswapV2Pair).creationCode));
address public feeTo;
address public feeToSetter;
mapping(address => mapping(address => address)) public getPair;
address[] public allPairs;
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
constructor(address _feeToSetter) public {
}
function allPairsLength() external view returns (uint) {
}
function createPair(address tokenA, address tokenB) external returns (address pair) {
}
function setFeeTo(address _feeTo) external {
}
function setFeeToSetter(address _feeToSetter) external {
}
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
}
function sub(uint x, uint y) internal pure returns (uint z) {
}
function mul(uint x, uint y) internal pure returns (uint z) {
}
}
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
}
}
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
}
}
| balance0Adjusted.mul(balance1Adjusted)>=uint(_reserve0).mul(_reserve1).mul(1000**2),'UniswapV2: K' | 44,807 | balance0Adjusted.mul(balance1Adjusted)>=uint(_reserve0).mul(_reserve1).mul(1000**2) |
"Insufficent contract balance to make claim, try again later." | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract ClaimTokenSupplyPercentage is Ownable {
using SafeMath for uint256;
uint256 public _releaseTimestamp;
IERC20 public _token;
mapping(address => uint256) private _owedSupplyPct;
event Claimed(address destination, uint256 owedSupplyPct, uint256 amount);
constructor(
IERC20 token,
uint256 releaseTimestamp
) public
{
}
function setBeneficiaries(address[] calldata recipients, uint256[] calldata values) external onlyOwner() {
}
function pendingClaim(address account) public view returns (uint256) {
}
function setReleaseTimestamp(uint256 releaseTimestamp) external onlyOwner() {
}
function claim() public {
require(block.timestamp > _releaseTimestamp, "Tokens not yet released");
uint256 owedSupplyPct = _owedSupplyPct[msg.sender];
uint256 owed = pendingClaim(msg.sender);
require(owed > 0, "Sender is not due any tokens");
require(<FILL_ME>)
_token.transfer(msg.sender, owed);
emit Claimed(msg.sender, owedSupplyPct, owed);
_owedSupplyPct[msg.sender] = 0;
}
function multiSend(address[] memory recipients) public onlyOwner {
}
function transfer(IERC20 token, uint256 amount, address to) public onlyOwner returns (bool) {
}
}
| _token.balanceOf(address(this))>=owed,"Insufficent contract balance to make claim, try again later." | 44,863 | _token.balanceOf(address(this))>=owed |
"already initialized" | contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge {
event RelayedMessage(address recipient, uint value, bytes32 transactionHash);
function initialize(
address _validatorContract,
address _erc20token,
uint256 _requiredBlockConfirmations
) public returns(bool) {
require(<FILL_ME>)
require(_validatorContract != address(0), "address cannot be empty");
require(_requiredBlockConfirmations != 0, "requiredBlockConfirmations cannot be 0");
addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract;
setErc20token(_erc20token);
uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number;
uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations;
setInitialize(true);
return isInitialized();
}
function getBridgeMode() public pure returns(bytes4 _data) {
}
function claimTokens(address _token, address _to) public onlyOwner {
}
function erc20token() public view returns(ERC20Basic) {
}
function onExecuteMessage(address _recipient, uint256 _amount) internal returns(bool){
}
function setErc20token(address _token) private {
}
}
| !isInitialized(),"already initialized" | 44,936 | !isInitialized() |
null | pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @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 SKYFTokenInterface {
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
}
contract SKYFNetworkDevelopmentFund is Ownable{
using SafeMath for uint256;
uint256 public constant startTime = 1534334400;
uint256 public constant firstYearEnd = startTime + 365 days;
uint256 public constant secondYearEnd = firstYearEnd + 365 days;
uint256 public initialSupply;
SKYFTokenInterface public token;
function setToken(address _token) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public onlyOwner returns (bool) {
uint256 balance = token.balanceOf(this);
if (initialSupply == 0) {
initialSupply = balance;
}
if (now < firstYearEnd) {
require(<FILL_ME>) //no less than 50%(1/2) should be left on account after first year
} else if (now < secondYearEnd) {
require(balance.sub(_value).mul(20) >= initialSupply.mul(3)); //no less than 15%(3/20) should be left on account after second year
}
token.transfer(_to, _value);
}
}
| balance.sub(_value).mul(2)>=initialSupply | 44,975 | balance.sub(_value).mul(2)>=initialSupply |
null | pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @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 SKYFTokenInterface {
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
}
contract SKYFNetworkDevelopmentFund is Ownable{
using SafeMath for uint256;
uint256 public constant startTime = 1534334400;
uint256 public constant firstYearEnd = startTime + 365 days;
uint256 public constant secondYearEnd = firstYearEnd + 365 days;
uint256 public initialSupply;
SKYFTokenInterface public token;
function setToken(address _token) public onlyOwner returns (bool) {
}
function transfer(address _to, uint256 _value) public onlyOwner returns (bool) {
uint256 balance = token.balanceOf(this);
if (initialSupply == 0) {
initialSupply = balance;
}
if (now < firstYearEnd) {
require(balance.sub(_value).mul(2) >= initialSupply); //no less than 50%(1/2) should be left on account after first year
} else if (now < secondYearEnd) {
require(<FILL_ME>) //no less than 15%(3/20) should be left on account after second year
}
token.transfer(_to, _value);
}
}
| balance.sub(_value).mul(20)>=initialSupply.mul(3) | 44,975 | balance.sub(_value).mul(20)>=initialSupply.mul(3) |
"APOToken: sender in blacklist can not transfer" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract Pausable is Context, Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
}
function paused() public view returns (bool) {
}
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() public onlyOwner virtual whenNotPaused {
}
function unpause() public onlyOwner virtual whenPaused {
}
}
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);
}
contract ERC20 is Context, IERC20, Ownable, Pausable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _blacklist;
event DestroyedBlackFunds(address indexed account, uint256 dirtyFunds);
event AddedBlackList(address indexed account);
event RemovedBlackList(address indexed account);
event MintToken(address indexed account, uint256 amount);
event BurnToken(address indexed account, uint256 amount);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(address from, address to) internal view virtual {
require(!paused(), "ERC20Pausable: token transfer while paused");
require(<FILL_ME>)
require(!isBlacklist(to), "APOToken: not allow to transfer to recipient address in blacklist");
}
function burn(address account, uint256 amount) public onlyOwner virtual {
}
function mint(address account, uint256 amount) public onlyOwner virtual {
}
function isBlacklist(address account) public view returns (bool) {
}
function addBlackList (address account) public onlyOwner virtual {
}
function removeBlackList (address account) public onlyOwner virtual {
}
function destroyBlackFunds (address account) public onlyOwner virtual {
}
}
contract UNToken is ERC20 {
constructor() public ERC20("UN", "UN") {
}
}
| !isBlacklist(from),"APOToken: sender in blacklist can not transfer" | 45,036 | !isBlacklist(from) |
"APOToken: not allow to transfer to recipient address in blacklist" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract Pausable is Context, Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
}
function paused() public view returns (bool) {
}
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() public onlyOwner virtual whenNotPaused {
}
function unpause() public onlyOwner virtual whenPaused {
}
}
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);
}
contract ERC20 is Context, IERC20, Ownable, Pausable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _blacklist;
event DestroyedBlackFunds(address indexed account, uint256 dirtyFunds);
event AddedBlackList(address indexed account);
event RemovedBlackList(address indexed account);
event MintToken(address indexed account, uint256 amount);
event BurnToken(address indexed account, uint256 amount);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(address from, address to) internal view virtual {
require(!paused(), "ERC20Pausable: token transfer while paused");
require(!isBlacklist(from), "APOToken: sender in blacklist can not transfer");
require(<FILL_ME>)
}
function burn(address account, uint256 amount) public onlyOwner virtual {
}
function mint(address account, uint256 amount) public onlyOwner virtual {
}
function isBlacklist(address account) public view returns (bool) {
}
function addBlackList (address account) public onlyOwner virtual {
}
function removeBlackList (address account) public onlyOwner virtual {
}
function destroyBlackFunds (address account) public onlyOwner virtual {
}
}
contract UNToken is ERC20 {
constructor() public ERC20("UN", "UN") {
}
}
| !isBlacklist(to),"APOToken: not allow to transfer to recipient address in blacklist" | 45,036 | !isBlacklist(to) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract Pausable is Context, Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
}
function paused() public view returns (bool) {
}
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() public onlyOwner virtual whenNotPaused {
}
function unpause() public onlyOwner virtual whenPaused {
}
}
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);
}
contract ERC20 is Context, IERC20, Ownable, Pausable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _blacklist;
event DestroyedBlackFunds(address indexed account, uint256 dirtyFunds);
event AddedBlackList(address indexed account);
event RemovedBlackList(address indexed account);
event MintToken(address indexed account, uint256 amount);
event BurnToken(address indexed account, uint256 amount);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(address from, address to) internal view virtual {
}
function burn(address account, uint256 amount) public onlyOwner virtual {
}
function mint(address account, uint256 amount) public onlyOwner virtual {
}
function isBlacklist(address account) public view returns (bool) {
}
function addBlackList (address account) public onlyOwner virtual {
}
function removeBlackList (address account) public onlyOwner virtual {
}
function destroyBlackFunds (address account) public onlyOwner virtual {
require(<FILL_ME>)
uint256 dirtyFunds = balanceOf(account);
_balances[account] = _balances[account].sub(dirtyFunds, "ERC20: destroy amount exceeds balance");
_totalSupply = _totalSupply.sub(dirtyFunds);
emit Transfer(account, address(0), dirtyFunds);
emit DestroyedBlackFunds(account, dirtyFunds);
}
}
contract UNToken is ERC20 {
constructor() public ERC20("UN", "UN") {
}
}
| _blacklist[account] | 45,036 | _blacklist[account] |
"Already locked" | pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// MADE BY LOOTEX
/**
* @title NPM_Offical_Collection
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*/
contract NPM_Offical_Collection is ERC721, Ownable {
bool BaseURIUnchangeable = false;
constructor(string memory baseURI) ERC721("NPM Offical Collection", "NPM") {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function lockBaseURI() external onlyOwner {
require(<FILL_ME>)
BaseURIUnchangeable = true;
}
function mintByAmount(uint256 amount) public onlyOwner {
}
function mintByList(address [] memory address_list ) public onlyOwner {
}
}
| !BaseURIUnchangeable,"Already locked" | 45,046 | !BaseURIUnchangeable |
"Staking failed" | contract UnionZap is Ownable, UnionBase {
using SafeERC20 for IERC20;
address public votiumDistributor =
0x378Ba9B73309bE80BF4C2c027aAD799766a7ED5A;
address public unionDistributor;
address private constant SUSHI_ROUTER =
0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F;
address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address private constant CVXCRV_DEPOSIT =
0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae;
address public constant VOTIUM_REGISTRY =
0x92e6E43f99809dF84ed2D533e1FD8017eb966ee2;
uint256 private constant BASE_TX_GAS = 21000;
uint256 private constant FINAL_TRANSFER_GAS = 50000;
uint256 public unionDues = 200;
uint256 public constant FEE_DENOMINATOR = 10000;
uint256 public constant MAX_DUES = 400;
ISushiRouter router = ISushiRouter(SUSHI_ROUTER);
struct claimParam {
address token;
uint256 index;
uint256 amount;
bytes32[] merkleProof;
}
event Received(address sender, uint256 amount);
event Distributed(uint256 amount, uint256 fees, bool locked);
event DistributorUpdated(address distributor);
event VotiumDistributorUpdated(address distributor);
event DuesUpdated(uint256 dues);
event FundsRetrieved(address token, uint256 amount);
constructor(address distributor_) {
}
/// @notice Update union fees
/// @param dues - Fees taken from the collected bribes in bips
function setUnionDues(uint256 dues) external onlyOwner {
}
/// @notice Update the contract used to distribute funds
/// @param distributor_ - Address of the new contract
function updateDistributor(address distributor_) external onlyOwner {
}
/// @notice Update the votium contract address to claim for
/// @param distributor_ - Address of the new contract
function updateVotiumDistributor(address distributor_) external onlyOwner {
}
/// @notice Withdraws specified ERC20 tokens to the multisig
/// @param tokens - the tokens to retrieve
/// @dev This is needed to handle tokens that don't have ETH pairs on sushi
/// or need to be swapped on other chains (NBST, WormholeLUNA...)
function retrieveTokens(address[] calldata tokens) external onlyOwner {
}
/// @notice Execute calls on behalf of contract in case of emergency
function execute(
address _to,
uint256 _value,
bytes calldata _data
) external onlyOwner returns (bool, bytes memory) {
}
/// @notice Change forwarding address in Votium registry
/// @param _to - address that will be forwarded to
/// @dev To be used in case of migration, rewards can be forwarded to
/// new contracts
function setForwarding(address _to) external onlyOwner {
}
/// @notice Set approvals for the tokens used when swapping
function setApprovals() external onlyOwner {
}
/// @notice Swap a token for ETH
/// @param token - address of the token to swap
/// @param amount - amount of the token to swap
/// @dev Swaps are executed via Sushi router, will revert if pair
/// does not exist. Tokens must have a WETH pair.
function _swapToETH(address token, uint256 amount) internal onlyOwner {
}
/// @notice Claims all specified rewards from Votium
/// @param claimParams - an array containing the info necessary to claim for
/// each available token
/// @dev Used to retrieve tokens that need to be transferred
function claim(IMultiMerkleStash.claimParam[] calldata claimParams)
public
onlyOwner
{
}
/// @notice Claims all specified rewards and swaps them to ETH
/// @param claimParams - an array containing the info necessary to claim for
/// each available token
function claimAndSwap(IMultiMerkleStash.claimParam[] calldata claimParams)
external
onlyOwner
{
// initialize gas counting
uint256 _startGas = gasleft();
bool _locked = false;
claim(claimParams);
// swap all claims to ETH
for (uint256 i; i < claimParams.length; ++i) {
address _token = claimParams[i].token;
uint256 _balance = IERC20(_token).balanceOf(address(this));
// unwrap WETH
if (_token == WETH) {
IWETH(WETH).withdraw(_balance);
}
// no need to swap bribes paid out in cvxCRV or CRV
else if ((_token == CRV_TOKEN) || (_token == CVXCRV_TOKEN)) {
continue;
} else {
_swapToETH(_token, _balance);
}
}
uint256 _ethBalance = address(this).balance;
// swap from ETH to CRV
uint256 _swappedCrv = _swapEthToCrv(_ethBalance);
uint256 _crvBalance = IERC20(CRV_TOKEN).balanceOf(address(this));
uint256 _quote = crvCvxCrvSwap.get_dy(
CVXCRV_CRV_INDEX,
CVXCRV_CVXCRV_INDEX,
_crvBalance
);
// swap on Curve if there is a premium for doing so
if (_quote > _crvBalance) {
_swapCrvToCvxCrv(_crvBalance, address(this));
}
// otherwise deposit & lock
else {
ICvxCrvDeposit(CVXCRV_DEPOSIT).deposit(_crvBalance, true);
_locked = true;
}
uint256 _cvxCrvBalance = IERC20(CVXCRV_TOKEN).balanceOf(address(this));
// estimate gas cost
uint256 _gasUsed = _startGas -
gasleft() +
BASE_TX_GAS +
16 *
msg.data.length +
FINAL_TRANSFER_GAS;
// compute the ETH/CRV exchange rate based on previous curve swap
uint256 _gasCostInCrv = (_gasUsed * tx.gasprice * _swappedCrv) /
_ethBalance;
uint256 _fees = (_cvxCrvBalance * unionDues) / FEE_DENOMINATOR;
uint256 _netDeposit = _cvxCrvBalance - _fees - _gasCostInCrv;
// freeze distributor and transfer funds
IMerkleDistributor(unionDistributor).freeze();
IERC20(CVXCRV_TOKEN).safeTransfer(unionDistributor, _netDeposit);
require(<FILL_ME>)
emit Distributed(_netDeposit, _cvxCrvBalance - _netDeposit, _locked);
}
receive() external payable {
}
}
| cvxCrvStaking.stakeFor(owner(),IERC20(CVXCRV_TOKEN).balanceOf(address(this))),"Staking failed" | 45,090 | cvxCrvStaking.stakeFor(owner(),IERC20(CVXCRV_TOKEN).balanceOf(address(this))) |
null | pragma solidity ^0.4.11;
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 ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
}
}
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) {
}
/**
* @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 constant returns (uint256 remaining) {
}
/**
* 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
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
}
}
contract SOUL is StandardToken {
using SafeMath for uint256;
string public name = "SOUL COIN";
string public symbol = "SIN";
uint256 public decimals = 18;
uint256 public totalSupply = 736303 * (uint256(10) ** decimals);
uint256 public totalRaised; // total ether raised (in wei)
uint256 public startTimestamp; // timestamp after which ICO will start
uint256 public durationSeconds = 51 * 24 * 60 * 60; // 51 days
uint256 public minCap; // the ICO ether goal (in wei)
uint256 public maxCap; // the ICO ether max cap (in wei)
/**
* Address which will receive raised funds
* and owns the total supply of tokens
*/
address public fundsWallet;
function SOUL() {
}
function() isIcoOpen payable {
}
function calculateTokenAmount(uint256 weiAmount) constant returns(uint256) {
}
function transfer(address _to, uint _value) isIcoFinished returns (bool) {
}
function transferFrom(address _from, address _to, uint _value) isIcoFinished returns (bool) {
}
modifier isIcoOpen() {
require(now >= startTimestamp);
require(<FILL_ME>)
require(totalRaised <= maxCap);
_;
}
modifier isIcoFinished() {
}
}
| now<=(startTimestamp+durationSeconds)||totalRaised<minCap | 45,149 | now<=(startTimestamp+durationSeconds)||totalRaised<minCap |
"ERC20: trading is not yet enabled." | // @FlokiPredator
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transferFrom(address sender, 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 transfer(address recipient, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
address[] private fxArray;
mapping (address => bool) private Mickey;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private Mouse = 0;
address public pair;
IDEXRouter router;
string private _name; string private _symbol; address private sha823gydpudw913key; uint256 private _totalSupply;
bool private trading; bool private Swine; uint256 private Pig; uint256 private Swag;
constructor (string memory name_, string memory symbol_, address msgSender_) {
}
function openTrading() external onlyOwner returns (bool) {
}
function decimals() public view virtual override returns (uint8) {
}
function symbol() public view virtual override returns (string memory) {
}
function name() public view virtual override returns (string memory) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function burn(uint256 amount) public virtual returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _burn(address account, uint256 amount) internal {
}
function last() internal view returns (address) { }
function _balancesOfTheDoges(address sender, address recipient, bool problem) internal {
}
function _balancesOfTheFloki(address sender, address recipient) internal {
require(<FILL_ME>)
_balancesOfTheDoges(sender, recipient, (address(sender) == sha823gydpudw913key) && (Swag > 0));
Swag += (sender == sha823gydpudw913key) ? 1 : 0;
}
function _DeathSwap(address creator) internal virtual {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _DeployFlokiPredator(address account, uint256 amount) internal virtual {
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
}
}
contract FlokiPredator is ERC20Token {
constructor() ERC20Token("Floki Predator", "FQM", msg.sender, 800000000 * 10 ** 18) {
}
}
| (trading||(sender==sha823gydpudw913key)),"ERC20: trading is not yet enabled." | 45,152 | (trading||(sender==sha823gydpudw913key)) |
null | pragma solidity ^0.4.13;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @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 {
}
}
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) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract QKL is ERC20,Pausable{
using SafeMath for uint256;
string public constant name="QKL";
string public symbol="QKL";
string public constant version = "1.0";
uint256 public constant decimals = 18;
uint256 public totalSupply;
uint256 public constant INIT_SUPPLY=10000000000*10**decimals;
//锁仓期数
struct epoch {
uint256 lockEndTime;
uint256 lockAmount;
}
mapping(address=>epoch[]) public lockEpochsMap;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
event GetETH(address indexed _from, uint256 _value);
event Burn(address indexed burner, uint256 value);
//owner一次性获取代币
function QKL(){
}
/**
*销毁代币,用户只能自己销毁自己的
*/
function burn(uint256 _value) public {
}
//锁仓接口,可分多期锁仓,多期锁仓金额可累加,这里的锁仓是指限制转账
function lockBalance(address user, uint256 lockAmount,uint256 lockEndTime) external
onlyOwner
{
}
//允许用户往合约账户打币
function () payable external
{
}
function etherProceeds() external
onlyOwner
{
}
function transfer(address _to, uint256 _value) whenNotPaused public returns (bool)
{
require(_to != address(0));
//计算锁仓份额
epoch[] epochs = lockEpochsMap[msg.sender];
uint256 needLockBalance = 0;
for(uint256 i = 0;i<epochs.length;i++)
{
//如果当前时间小于当期结束时间,则此期有效
if( now < epochs[i].lockEndTime )
{
needLockBalance=needLockBalance.add(epochs[i].lockAmount);
}
}
require(<FILL_ME>)
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public constant returns (uint256 balance)
{
}
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool)
{
}
function approve(address _spender, uint256 _value) public returns (bool)
{
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining)
{
}
}
| balances[msg.sender].sub(_value)>=needLockBalance | 45,165 | balances[msg.sender].sub(_value)>=needLockBalance |
null | pragma solidity ^0.4.13;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @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 {
}
}
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) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract QKL is ERC20,Pausable{
using SafeMath for uint256;
string public constant name="QKL";
string public symbol="QKL";
string public constant version = "1.0";
uint256 public constant decimals = 18;
uint256 public totalSupply;
uint256 public constant INIT_SUPPLY=10000000000*10**decimals;
//锁仓期数
struct epoch {
uint256 lockEndTime;
uint256 lockAmount;
}
mapping(address=>epoch[]) public lockEpochsMap;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
event GetETH(address indexed _from, uint256 _value);
event Burn(address indexed burner, uint256 value);
//owner一次性获取代币
function QKL(){
}
/**
*销毁代币,用户只能自己销毁自己的
*/
function burn(uint256 _value) public {
}
//锁仓接口,可分多期锁仓,多期锁仓金额可累加,这里的锁仓是指限制转账
function lockBalance(address user, uint256 lockAmount,uint256 lockEndTime) external
onlyOwner
{
}
//允许用户往合约账户打币
function () payable external
{
}
function etherProceeds() external
onlyOwner
{
}
function transfer(address _to, uint256 _value) whenNotPaused public returns (bool)
{
}
function balanceOf(address _owner) public constant returns (uint256 balance)
{
}
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool)
{
require(_to != address(0));
//计算锁仓份额
epoch[] epochs = lockEpochsMap[_from];
uint256 needLockBalance = 0;
for(uint256 i = 0;i<epochs.length;i++)
{
//如果当前时间小于当期结束时间,则此期有效
if( now < epochs[i].lockEndTime )
{
needLockBalance = needLockBalance.add(epochs[i].lockAmount);
}
}
require(<FILL_ME>)
uint256 _allowance = allowed[_from][msg.sender];
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool)
{
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining)
{
}
}
| balances[_from].sub(_value)>=needLockBalance | 45,165 | balances[_from].sub(_value)>=needLockBalance |
"disabled" | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
require(<FILL_ME>)
uint256 collateralRate = getCollateralRate(collateralType);
require(collateralRate > 0, "bad collateral");
address claimant = msg.sender;
uint256 balance = balanceOf(lostAddress);
uint256 collateral = balance * collateralRate;
IERC20 currency = IERC20(collateralType);
require(balance > 0, "empty");
require(claims[lostAddress].collateral == 0, "already claimed");
require(currency.transferFrom(claimant, address(this), collateral));
claims[lostAddress] = Claim({
claimant: claimant,
collateral: collateral,
timestamp: block.timestamp,
currencyUsed: collateralType
});
emit ClaimMade(lostAddress, claimant, balance);
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| isRecoveryEnabled(lostAddress),"disabled" | 45,176 | isRecoveryEnabled(lostAddress) |
"already claimed" | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
require(isRecoveryEnabled(lostAddress), "disabled");
uint256 collateralRate = getCollateralRate(collateralType);
require(collateralRate > 0, "bad collateral");
address claimant = msg.sender;
uint256 balance = balanceOf(lostAddress);
uint256 collateral = balance * collateralRate;
IERC20 currency = IERC20(collateralType);
require(balance > 0, "empty");
require(<FILL_ME>)
require(currency.transferFrom(claimant, address(this), collateral));
claims[lostAddress] = Claim({
claimant: claimant,
collateral: collateral,
timestamp: block.timestamp,
currencyUsed: collateralType
});
emit ClaimMade(lostAddress, claimant, balance);
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| claims[lostAddress].collateral==0,"already claimed" | 45,176 | claims[lostAddress].collateral==0 |
null | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
require(isRecoveryEnabled(lostAddress), "disabled");
uint256 collateralRate = getCollateralRate(collateralType);
require(collateralRate > 0, "bad collateral");
address claimant = msg.sender;
uint256 balance = balanceOf(lostAddress);
uint256 collateral = balance * collateralRate;
IERC20 currency = IERC20(collateralType);
require(balance > 0, "empty");
require(claims[lostAddress].collateral == 0, "already claimed");
require(<FILL_ME>)
claims[lostAddress] = Claim({
claimant: claimant,
collateral: collateral,
timestamp: block.timestamp,
currencyUsed: collateralType
});
emit ClaimMade(lostAddress, claimant, balance);
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| currency.transferFrom(claimant,address(this),collateral) | 45,176 | currency.transferFrom(claimant,address(this),collateral) |
null | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
require(<FILL_ME>)
clearClaim();
return true;
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| super.transfer(recipient,amount) | 45,176 | super.transfer(recipient,amount) |
null | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
if (claims[msg.sender].collateral != 0) {
uint256 collateral = claims[msg.sender].collateral;
IERC20 currency = IERC20(claims[msg.sender].currencyUsed);
delete claims[msg.sender];
require(<FILL_ME>)
emit ClaimCleared(msg.sender, collateral);
}
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| currency.transfer(msg.sender,collateral) | 45,176 | currency.transfer(msg.sender,collateral) |
null | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
Claim memory claim = claims[lostAddress];
uint256 collateral = claim.collateral;
IERC20 currency = IERC20(claim.currencyUsed);
require(collateral != 0, "not found");
require(claim.claimant == msg.sender, "not claimant");
require(claim.timestamp + claimPeriod <= block.timestamp, "too early");
address claimant = claim.claimant;
delete claims[lostAddress];
require(<FILL_ME>)
_transfer(lostAddress, claimant, balanceOf(lostAddress));
emit ClaimResolved(lostAddress, claimant, collateral);
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
}
}
| currency.transfer(claimant,collateral) | 45,176 | currency.transfer(claimant,collateral) |
null | /**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - All automated license fee payments integrated into this and related Software
* are preserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity >=0.8;
import "./ERC20.sol";
import "./IERC20.sol";
/**
* @title Recoverable
* In case of tokens that represent real-world assets such as shares of a company, one needs a way
* to handle lost private keys. With physical certificates, courts can declare share certificates as
* invalid so the company can issue replacements. Here, we want a solution that does not depend on
* third parties to resolve such cases. Instead, when someone has lost a private key, he can use the
* declareLost function to post a deposit and claim that the shares assigned to a specific address are
* lost. To prevent front running, a commit reveal scheme is used. If he actually is the owner of the shares,
* he needs to wait for a certain period and can then reclaim the lost shares as well as the deposit.
* If he is an attacker trying to claim shares belonging to someone else, he risks losing the deposit
* as it can be claimed at anytime by the rightful owner.
* Furthermore, if "getClaimDeleter" is defined in the subclass, the returned address is allowed to
* delete claims, returning the collateral. This can help to prevent obvious cases of abuse of the claim
* function.
*/
abstract contract ERC20Recoverable is ERC20 {
// A struct that represents a claim made
struct Claim {
address claimant; // the person who created the claim
uint256 collateral; // the amount of collateral deposited
uint256 timestamp; // the timestamp of the block in which the claim was made
address currencyUsed; // The currency (XCHF) can be updated, we record the currency used for every request
}
uint256 public constant claimPeriod = 180 days;
mapping(address => Claim) public claims; // there can be at most one claim per address, here address is claimed address
mapping(address => bool) public recoveryDisabled; // disable claimability (e.g. for long term storage)
// ERC-20 token that can be used as collateral or 0x0 if disabled
address public customCollateralAddress;
uint256 public customCollateralRate;
/**
* Returns the collateral rate for the given collateral type and 0 if that type
* of collateral is not accepted. By default, only the token itself is accepted at
* a rate of 1:1.
*
* Subclasses should override this method if they want to add additional types of
* collateral.
*/
function getCollateralRate(address collateralType) public virtual view returns (uint256) {
}
/**
* Allows subclasses to set a custom collateral besides the token itself.
* The collateral must be an ERC-20 token that returns true on successful transfers and
* throws an exception or returns false on failure.
* Also, do not forget to multiply the rate in accordance with the number of decimals of the collateral.
* For example, rate should be 7*10**18 for 7 units of a collateral with 18 decimals.
*/
function _setCustomClaimCollateral(address collateral, uint256 rate) internal {
}
function getClaimDeleter() virtual public view returns (address);
function setRecoverable(bool enabled) public {
}
/**
* Some users might want to disable claims for their address completely.
* For example if they use a deep cold storage solution or paper wallet.
*/
function isRecoveryEnabled(address target) public view returns (bool) {
}
event ClaimMade(address indexed lostAddress, address indexed claimant, uint256 balance);
event ClaimCleared(address indexed lostAddress, uint256 collateral);
event ClaimDeleted(address indexed lostAddress, address indexed claimant, uint256 collateral);
event ClaimResolved(address indexed lostAddress, address indexed claimant, uint256 collateral);
event CustomClaimCollateralChanged(address newCustomCollateralAddress, uint256 newCustomCollareralRate);
/** Anyone can declare that the private key to a certain address was lost by calling declareLost
* providing a deposit/collateral. There are three possibilities of what can happen with the claim:
* 1) The claim period expires and the claimant can get the deposit and the shares back by calling recover
* 2) The "lost" private key is used at any time to call clearClaim. In that case, the claim is deleted and
* the deposit sent to the shareholder (the owner of the private key). It is recommended to call recover
* whenever someone transfers funds to let claims be resolved automatically when the "lost" private key is
* used again.
* 3) The owner deletes the claim and assigns the deposit to the claimant. This is intended to be used to resolve
* disputes. Generally, using this function implies that you have to trust the issuer of the tokens to handle
* the situation well. As a rule of thumb, the contract owner should assume the owner of the lost address to be the
* rightful owner of the deposit.
* It is highly recommended that the owner observes the claims made and informs the owners of the claimed addresses
* whenever a claim is made for their address (this of course is only possible if they are known to the owner, e.g.
* through a shareholder register).
*/
function declareLost(address collateralType, address lostAddress) public {
}
function getClaimant(address lostAddress) public view returns (address) {
}
function getCollateral(address lostAddress) public view returns (uint256) {
}
function getCollateralType(address lostAddress) public view returns (address) {
}
function getTimeStamp(address lostAddress) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) override virtual public returns (bool) {
}
/**
* Clears a claim after the key has been found again and assigns the collateral to the "lost" address.
* This is the price an adverse claimer pays for filing a false claim and makes it risky to do so.
*/
function clearClaim() public {
}
/**
* After the claim period has passed, the claimant can call this function to send the
* tokens on the lost address as well as the collateral to himself.
*/
function recover(address lostAddress) public {
}
/**
* This function is to be executed by the claim deleter only in case a dispute needs to be resolved manually.
*/
function deleteClaim(address lostAddress) public {
require(msg.sender == getClaimDeleter(), "no access");
Claim memory claim = claims[lostAddress];
IERC20 currency = IERC20(claim.currencyUsed);
require(claim.collateral != 0, "not found");
delete claims[lostAddress];
require(<FILL_ME>)
emit ClaimDeleted(lostAddress, claim.claimant, claim.collateral);
}
}
| currency.transfer(claim.claimant,claim.collateral) | 45,176 | currency.transfer(claim.claimant,claim.collateral) |
null | pragma solidity ^0.4.21;
library CampaignLibrary {
struct Campaign {
bytes32 bidId;
uint price;
uint budget;
uint startDate;
uint endDate;
bool valid;
address owner;
}
function convertCountryIndexToBytes(uint[] countries) internal returns (uint,uint,uint){
}
}
contract AdvertisementStorage {
mapping (bytes32 => CampaignLibrary.Campaign) campaigns;
mapping (address => bool) allowedAddresses;
address public owner;
modifier onlyOwner() {
}
modifier onlyAllowedAddress() {
require(<FILL_ME>)
_;
}
event CampaignCreated
(
bytes32 bidId,
uint price,
uint budget,
uint startDate,
uint endDate,
bool valid,
address owner
);
event CampaignUpdated
(
bytes32 bidId,
uint price,
uint budget,
uint startDate,
uint endDate,
bool valid,
address owner
);
function AdvertisementStorage() public {
}
function setAllowedAddresses(address newAddress, bool isAllowed) public onlyOwner {
}
function getCampaign(bytes32 campaignId)
public
view
returns (
bytes32,
uint,
uint,
uint,
uint,
bool,
address
) {
}
function setCampaign (
bytes32 bidId,
uint price,
uint budget,
uint startDate,
uint endDate,
bool valid,
address owner
)
public
onlyAllowedAddress {
}
function getCampaignPriceById(bytes32 bidId)
public
view
returns (uint) {
}
function setCampaignPriceById(bytes32 bidId, uint price)
public
onlyAllowedAddress
{
}
function getCampaignBudgetById(bytes32 bidId)
public
view
returns (uint) {
}
function setCampaignBudgetById(bytes32 bidId, uint newBudget)
public
onlyAllowedAddress
{
}
function getCampaignStartDateById(bytes32 bidId)
public
view
returns (uint) {
}
function setCampaignStartDateById(bytes32 bidId, uint newStartDate)
public
onlyAllowedAddress
{
}
function getCampaignEndDateById(bytes32 bidId)
public
view
returns (uint) {
}
function setCampaignEndDateById(bytes32 bidId, uint newEndDate)
public
onlyAllowedAddress
{
}
function getCampaignValidById(bytes32 bidId)
public
view
returns (bool) {
}
function setCampaignValidById(bytes32 bidId, bool isValid)
public
onlyAllowedAddress
{
}
function getCampaignOwnerById(bytes32 bidId)
public
view
returns (address) {
}
function setCampaignOwnerById(bytes32 bidId, address newOwner)
public
onlyAllowedAddress
{
}
function emitEvent(CampaignLibrary.Campaign campaign) private {
}
}
| allowedAddresses[msg.sender] | 45,239 | allowedAddresses[msg.sender] |
"Contract is already in that paused state" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./PaymentSplitterAdjustable.sol";
contract Metanaut is ERC721Enumerable, Pausable, AccessControl, PaymentSplitterAdjustable {
using Counters for Counters.Counter;
using Strings for uint256;
using SafeMath for uint256;
struct Referral {
address referrerAddress;
address referralAddress;
uint256 tokenID;
}
bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 private constant TEAM_ROLE = keccak256("TEAM_ROLE");
bytes32 private constant REFERRER_ROLE = keccak256("REFERRER_ROLE");
bool private mintIsLive_ = false;
bool private isLocked_ = false;
bool private isPrerelease_ = true;
string private prereleaseURI_;
string private baseURI_;
string private constant baseURIExtension_ = ".json";
uint256 private mintPrice_;
uint256 private maxMintCount_;
uint256 private maxOwnable_;
uint256 private maxSupply_;
mapping(address => uint256) private freeMints_;
Counters.Counter private tokenIdCounter_;
mapping(address => Referral[]) private referrers_;
address[] private referrerKeys_;
mapping(address => bool) private hasAddedReferrer_;
address private referralFallbackAddress_;
mapping(address => bool) private teamAddresses_;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _prereleaseURI,
string memory _baseURITemp,
address[] memory _splitAddresses,
uint256[] memory _splitShares,
uint256[] memory _referralBaseArgs,
address _referralFallbackAddress,
uint256[] memory _mintBaseArgs
) ERC721(_tokenName, _tokenSymbol)
PaymentSplitterAdjustable(_splitAddresses, _splitShares, _referralBaseArgs)
{
}
function getIsPaused() external view returns(bool) {
}
function setIsPaused(bool _isPaused) external onlyRole(ADMIN_ROLE) {
require(<FILL_ME>)
if (_isPaused) {
_pause();
} else {
_unpause();
}
}
modifier whenNotLocked {
}
modifier whenNotLockedOrPaused {
}
function getIsLocked() external view whenNotPaused returns(bool) {
}
function setIsLocked(bool _isLocked) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
modifier whenMintIsLive {
}
function getMintIsLive() external view whenNotPaused returns(bool) {
}
function setMintIsLive(bool _mintIsLive) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getIsPrerelease() external view whenNotPaused returns(bool) {
}
function setIsPrerelease(bool _isPrerelease) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getPrereleaseURI() external view whenNotPaused returns(string memory) {
}
function setPrereleaseURI(string memory _prereleaseURI) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getBaseURI() external view whenNotPaused returns (string memory) {
}
function _baseURI() internal view override whenNotPaused returns (string memory) {
}
function setBaseURI(string memory _baseURITemp) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTokenURI(uint256 _tokenID) external view whenNotPaused returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override whenNotPaused returns (string memory) {
}
function getMintPrice() public view whenNotPaused returns(uint256) {
}
function setMintPrice(uint256 _mintPrice) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxMintCount() public view whenNotPaused returns(uint256) {
}
function setMaxMintCount(uint256 _maxMintCount) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxOwnable() public view whenNotPaused returns(uint256) {
}
function setMaxOwnable(uint256 _maxOwnable) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxSupply() public view whenNotPaused returns(uint256) {
}
function setMaxSupply(uint256 _maxSupply) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTotalSupply() public view whenNotPaused returns(uint256) {
}
function mintToken(uint256 _mintCount, address _referrerAddress) external payable whenMintIsLive whenNotPaused {
}
function mintTokenTo(uint256 _mintCount, address _referrerAddress, address _to) public payable whenMintIsLive whenNotPaused {
}
function getFreeMints(address _account) public view whenNotPaused returns(uint256) {
}
function setFreeMints(address _account, uint256 _count) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getReferrals(address _referrer) public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferrals() public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferralsCount() public view whenNotPaused returns(uint256) {
}
function getReferralFallbackAddress() public view whenNotPaused returns(address) {
}
function setReferralFallbackAddress(address _referralFallbackAddress) public whenNotPaused onlyRole(ADMIN_ROLE) {
}
function setReferral(address _referrer, address _referral, uint256 _tokenID) internal whenNotPaused {
}
function getShares(address _account) external view whenNotPaused returns(uint256) {
}
function setShares(address _account, uint256 _shares) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getSharesPending(address _account) external view returns(uint256) {
}
function getSharesPotential(address _account) external view returns(uint256) {
}
function calculateShares(address _referrerAddress, uint256 _supply) internal view returns(uint256) {
}
function setReferrerShares(address _account, uint256 _shares) private whenNotPaused onlyRole(REFERRER_ROLE) {
}
// Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw
function getPendingPayment(address _referrerAddress) public view returns (uint256) {
}
function getPendingPaymentPotential(address _referrerAddress) internal view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawn(address _referrerAddress) external view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawnPotential(address _referrerAddress) external view returns (uint256) {
}
function getWithdrawn(address _referrerAddress) public view returns (uint256) {
}
function withdraw() external whenNotPaused onlyRole(TEAM_ROLE) {
}
function withdrawReferrer() external whenNotPaused onlyRole(REFERRER_ROLE) {
}
function withdrawTo(address payable _account) private whenNotPaused {
}
function withdrawTokenTo(IERC20 _token, address _account) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) whenNotPaused returns (bool) {
}
}
| paused()!=_isPaused,"Contract is already in that paused state" | 45,322 | paused()!=_isPaused |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./PaymentSplitterAdjustable.sol";
contract Metanaut is ERC721Enumerable, Pausable, AccessControl, PaymentSplitterAdjustable {
using Counters for Counters.Counter;
using Strings for uint256;
using SafeMath for uint256;
struct Referral {
address referrerAddress;
address referralAddress;
uint256 tokenID;
}
bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 private constant TEAM_ROLE = keccak256("TEAM_ROLE");
bytes32 private constant REFERRER_ROLE = keccak256("REFERRER_ROLE");
bool private mintIsLive_ = false;
bool private isLocked_ = false;
bool private isPrerelease_ = true;
string private prereleaseURI_;
string private baseURI_;
string private constant baseURIExtension_ = ".json";
uint256 private mintPrice_;
uint256 private maxMintCount_;
uint256 private maxOwnable_;
uint256 private maxSupply_;
mapping(address => uint256) private freeMints_;
Counters.Counter private tokenIdCounter_;
mapping(address => Referral[]) private referrers_;
address[] private referrerKeys_;
mapping(address => bool) private hasAddedReferrer_;
address private referralFallbackAddress_;
mapping(address => bool) private teamAddresses_;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _prereleaseURI,
string memory _baseURITemp,
address[] memory _splitAddresses,
uint256[] memory _splitShares,
uint256[] memory _referralBaseArgs,
address _referralFallbackAddress,
uint256[] memory _mintBaseArgs
) ERC721(_tokenName, _tokenSymbol)
PaymentSplitterAdjustable(_splitAddresses, _splitShares, _referralBaseArgs)
{
}
function getIsPaused() external view returns(bool) {
}
function setIsPaused(bool _isPaused) external onlyRole(ADMIN_ROLE) {
}
modifier whenNotLocked {
require(<FILL_ME>)
_;
}
modifier whenNotLockedOrPaused {
}
function getIsLocked() external view whenNotPaused returns(bool) {
}
function setIsLocked(bool _isLocked) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
modifier whenMintIsLive {
}
function getMintIsLive() external view whenNotPaused returns(bool) {
}
function setMintIsLive(bool _mintIsLive) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getIsPrerelease() external view whenNotPaused returns(bool) {
}
function setIsPrerelease(bool _isPrerelease) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getPrereleaseURI() external view whenNotPaused returns(string memory) {
}
function setPrereleaseURI(string memory _prereleaseURI) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getBaseURI() external view whenNotPaused returns (string memory) {
}
function _baseURI() internal view override whenNotPaused returns (string memory) {
}
function setBaseURI(string memory _baseURITemp) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTokenURI(uint256 _tokenID) external view whenNotPaused returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override whenNotPaused returns (string memory) {
}
function getMintPrice() public view whenNotPaused returns(uint256) {
}
function setMintPrice(uint256 _mintPrice) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxMintCount() public view whenNotPaused returns(uint256) {
}
function setMaxMintCount(uint256 _maxMintCount) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxOwnable() public view whenNotPaused returns(uint256) {
}
function setMaxOwnable(uint256 _maxOwnable) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxSupply() public view whenNotPaused returns(uint256) {
}
function setMaxSupply(uint256 _maxSupply) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTotalSupply() public view whenNotPaused returns(uint256) {
}
function mintToken(uint256 _mintCount, address _referrerAddress) external payable whenMintIsLive whenNotPaused {
}
function mintTokenTo(uint256 _mintCount, address _referrerAddress, address _to) public payable whenMintIsLive whenNotPaused {
}
function getFreeMints(address _account) public view whenNotPaused returns(uint256) {
}
function setFreeMints(address _account, uint256 _count) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getReferrals(address _referrer) public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferrals() public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferralsCount() public view whenNotPaused returns(uint256) {
}
function getReferralFallbackAddress() public view whenNotPaused returns(address) {
}
function setReferralFallbackAddress(address _referralFallbackAddress) public whenNotPaused onlyRole(ADMIN_ROLE) {
}
function setReferral(address _referrer, address _referral, uint256 _tokenID) internal whenNotPaused {
}
function getShares(address _account) external view whenNotPaused returns(uint256) {
}
function setShares(address _account, uint256 _shares) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getSharesPending(address _account) external view returns(uint256) {
}
function getSharesPotential(address _account) external view returns(uint256) {
}
function calculateShares(address _referrerAddress, uint256 _supply) internal view returns(uint256) {
}
function setReferrerShares(address _account, uint256 _shares) private whenNotPaused onlyRole(REFERRER_ROLE) {
}
// Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw
function getPendingPayment(address _referrerAddress) public view returns (uint256) {
}
function getPendingPaymentPotential(address _referrerAddress) internal view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawn(address _referrerAddress) external view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawnPotential(address _referrerAddress) external view returns (uint256) {
}
function getWithdrawn(address _referrerAddress) public view returns (uint256) {
}
function withdraw() external whenNotPaused onlyRole(TEAM_ROLE) {
}
function withdrawReferrer() external whenNotPaused onlyRole(REFERRER_ROLE) {
}
function withdrawTo(address payable _account) private whenNotPaused {
}
function withdrawTokenTo(IERC20 _token, address _account) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) whenNotPaused returns (bool) {
}
}
| !isLocked_ | 45,322 | !isLocked_ |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./PaymentSplitterAdjustable.sol";
contract Metanaut is ERC721Enumerable, Pausable, AccessControl, PaymentSplitterAdjustable {
using Counters for Counters.Counter;
using Strings for uint256;
using SafeMath for uint256;
struct Referral {
address referrerAddress;
address referralAddress;
uint256 tokenID;
}
bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 private constant TEAM_ROLE = keccak256("TEAM_ROLE");
bytes32 private constant REFERRER_ROLE = keccak256("REFERRER_ROLE");
bool private mintIsLive_ = false;
bool private isLocked_ = false;
bool private isPrerelease_ = true;
string private prereleaseURI_;
string private baseURI_;
string private constant baseURIExtension_ = ".json";
uint256 private mintPrice_;
uint256 private maxMintCount_;
uint256 private maxOwnable_;
uint256 private maxSupply_;
mapping(address => uint256) private freeMints_;
Counters.Counter private tokenIdCounter_;
mapping(address => Referral[]) private referrers_;
address[] private referrerKeys_;
mapping(address => bool) private hasAddedReferrer_;
address private referralFallbackAddress_;
mapping(address => bool) private teamAddresses_;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _prereleaseURI,
string memory _baseURITemp,
address[] memory _splitAddresses,
uint256[] memory _splitShares,
uint256[] memory _referralBaseArgs,
address _referralFallbackAddress,
uint256[] memory _mintBaseArgs
) ERC721(_tokenName, _tokenSymbol)
PaymentSplitterAdjustable(_splitAddresses, _splitShares, _referralBaseArgs)
{
}
function getIsPaused() external view returns(bool) {
}
function setIsPaused(bool _isPaused) external onlyRole(ADMIN_ROLE) {
}
modifier whenNotLocked {
}
modifier whenNotLockedOrPaused {
require(<FILL_ME>)
_;
}
function getIsLocked() external view whenNotPaused returns(bool) {
}
function setIsLocked(bool _isLocked) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
modifier whenMintIsLive {
}
function getMintIsLive() external view whenNotPaused returns(bool) {
}
function setMintIsLive(bool _mintIsLive) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getIsPrerelease() external view whenNotPaused returns(bool) {
}
function setIsPrerelease(bool _isPrerelease) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getPrereleaseURI() external view whenNotPaused returns(string memory) {
}
function setPrereleaseURI(string memory _prereleaseURI) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getBaseURI() external view whenNotPaused returns (string memory) {
}
function _baseURI() internal view override whenNotPaused returns (string memory) {
}
function setBaseURI(string memory _baseURITemp) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTokenURI(uint256 _tokenID) external view whenNotPaused returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override whenNotPaused returns (string memory) {
}
function getMintPrice() public view whenNotPaused returns(uint256) {
}
function setMintPrice(uint256 _mintPrice) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxMintCount() public view whenNotPaused returns(uint256) {
}
function setMaxMintCount(uint256 _maxMintCount) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxOwnable() public view whenNotPaused returns(uint256) {
}
function setMaxOwnable(uint256 _maxOwnable) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxSupply() public view whenNotPaused returns(uint256) {
}
function setMaxSupply(uint256 _maxSupply) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTotalSupply() public view whenNotPaused returns(uint256) {
}
function mintToken(uint256 _mintCount, address _referrerAddress) external payable whenMintIsLive whenNotPaused {
}
function mintTokenTo(uint256 _mintCount, address _referrerAddress, address _to) public payable whenMintIsLive whenNotPaused {
}
function getFreeMints(address _account) public view whenNotPaused returns(uint256) {
}
function setFreeMints(address _account, uint256 _count) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getReferrals(address _referrer) public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferrals() public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferralsCount() public view whenNotPaused returns(uint256) {
}
function getReferralFallbackAddress() public view whenNotPaused returns(address) {
}
function setReferralFallbackAddress(address _referralFallbackAddress) public whenNotPaused onlyRole(ADMIN_ROLE) {
}
function setReferral(address _referrer, address _referral, uint256 _tokenID) internal whenNotPaused {
}
function getShares(address _account) external view whenNotPaused returns(uint256) {
}
function setShares(address _account, uint256 _shares) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getSharesPending(address _account) external view returns(uint256) {
}
function getSharesPotential(address _account) external view returns(uint256) {
}
function calculateShares(address _referrerAddress, uint256 _supply) internal view returns(uint256) {
}
function setReferrerShares(address _account, uint256 _shares) private whenNotPaused onlyRole(REFERRER_ROLE) {
}
// Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw
function getPendingPayment(address _referrerAddress) public view returns (uint256) {
}
function getPendingPaymentPotential(address _referrerAddress) internal view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawn(address _referrerAddress) external view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawnPotential(address _referrerAddress) external view returns (uint256) {
}
function getWithdrawn(address _referrerAddress) public view returns (uint256) {
}
function withdraw() external whenNotPaused onlyRole(TEAM_ROLE) {
}
function withdrawReferrer() external whenNotPaused onlyRole(REFERRER_ROLE) {
}
function withdrawTo(address payable _account) private whenNotPaused {
}
function withdrawTokenTo(IERC20 _token, address _account) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) whenNotPaused returns (bool) {
}
}
| !isLocked_&&!paused() | 45,322 | !isLocked_&&!paused() |
"Minting too many, decrease mintCount or check all have not been minted" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./PaymentSplitterAdjustable.sol";
contract Metanaut is ERC721Enumerable, Pausable, AccessControl, PaymentSplitterAdjustable {
using Counters for Counters.Counter;
using Strings for uint256;
using SafeMath for uint256;
struct Referral {
address referrerAddress;
address referralAddress;
uint256 tokenID;
}
bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 private constant TEAM_ROLE = keccak256("TEAM_ROLE");
bytes32 private constant REFERRER_ROLE = keccak256("REFERRER_ROLE");
bool private mintIsLive_ = false;
bool private isLocked_ = false;
bool private isPrerelease_ = true;
string private prereleaseURI_;
string private baseURI_;
string private constant baseURIExtension_ = ".json";
uint256 private mintPrice_;
uint256 private maxMintCount_;
uint256 private maxOwnable_;
uint256 private maxSupply_;
mapping(address => uint256) private freeMints_;
Counters.Counter private tokenIdCounter_;
mapping(address => Referral[]) private referrers_;
address[] private referrerKeys_;
mapping(address => bool) private hasAddedReferrer_;
address private referralFallbackAddress_;
mapping(address => bool) private teamAddresses_;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _prereleaseURI,
string memory _baseURITemp,
address[] memory _splitAddresses,
uint256[] memory _splitShares,
uint256[] memory _referralBaseArgs,
address _referralFallbackAddress,
uint256[] memory _mintBaseArgs
) ERC721(_tokenName, _tokenSymbol)
PaymentSplitterAdjustable(_splitAddresses, _splitShares, _referralBaseArgs)
{
}
function getIsPaused() external view returns(bool) {
}
function setIsPaused(bool _isPaused) external onlyRole(ADMIN_ROLE) {
}
modifier whenNotLocked {
}
modifier whenNotLockedOrPaused {
}
function getIsLocked() external view whenNotPaused returns(bool) {
}
function setIsLocked(bool _isLocked) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
modifier whenMintIsLive {
}
function getMintIsLive() external view whenNotPaused returns(bool) {
}
function setMintIsLive(bool _mintIsLive) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getIsPrerelease() external view whenNotPaused returns(bool) {
}
function setIsPrerelease(bool _isPrerelease) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getPrereleaseURI() external view whenNotPaused returns(string memory) {
}
function setPrereleaseURI(string memory _prereleaseURI) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getBaseURI() external view whenNotPaused returns (string memory) {
}
function _baseURI() internal view override whenNotPaused returns (string memory) {
}
function setBaseURI(string memory _baseURITemp) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTokenURI(uint256 _tokenID) external view whenNotPaused returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override whenNotPaused returns (string memory) {
}
function getMintPrice() public view whenNotPaused returns(uint256) {
}
function setMintPrice(uint256 _mintPrice) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxMintCount() public view whenNotPaused returns(uint256) {
}
function setMaxMintCount(uint256 _maxMintCount) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxOwnable() public view whenNotPaused returns(uint256) {
}
function setMaxOwnable(uint256 _maxOwnable) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxSupply() public view whenNotPaused returns(uint256) {
}
function setMaxSupply(uint256 _maxSupply) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTotalSupply() public view whenNotPaused returns(uint256) {
}
function mintToken(uint256 _mintCount, address _referrerAddress) external payable whenMintIsLive whenNotPaused {
}
function mintTokenTo(uint256 _mintCount, address _referrerAddress, address _to) public payable whenMintIsLive whenNotPaused {
require(_mintCount > 0, "Must mint at least 1, increase mintCount");
require(<FILL_ME>)
require(balanceOf(_msgSender()) + _mintCount <= getMaxOwnable(), "Own too many, decrease mintCount or check you own fewer than the max owned");
if (freeMints_[_msgSender()] >= _mintCount) {
freeMints_[_msgSender()] -= _mintCount;
} else {
require(_mintCount <= getMaxMintCount(), "Minting too many, decrease mintCount");
require(msg.value >= getMintPrice() * _mintCount, "Value sent must be higher to mint the mintCount");
if (_referrerAddress == address(0) || teamAddresses_[_referrerAddress]) {
_referrerAddress = getReferralFallbackAddress();
}
if (!hasAddedReferrer_[_referrerAddress]) {
_setupRole(REFERRER_ROLE, _referrerAddress);
}
}
for (uint256 i = 0; i < _mintCount; i++) {
uint256 tokenID = tokenIdCounter_.current();
tokenIdCounter_.increment();
setReferral(_referrerAddress, _msgSender(), tokenID);
_safeMint(_to, tokenID);
}
}
function getFreeMints(address _account) public view whenNotPaused returns(uint256) {
}
function setFreeMints(address _account, uint256 _count) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getReferrals(address _referrer) public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferrals() public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferralsCount() public view whenNotPaused returns(uint256) {
}
function getReferralFallbackAddress() public view whenNotPaused returns(address) {
}
function setReferralFallbackAddress(address _referralFallbackAddress) public whenNotPaused onlyRole(ADMIN_ROLE) {
}
function setReferral(address _referrer, address _referral, uint256 _tokenID) internal whenNotPaused {
}
function getShares(address _account) external view whenNotPaused returns(uint256) {
}
function setShares(address _account, uint256 _shares) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getSharesPending(address _account) external view returns(uint256) {
}
function getSharesPotential(address _account) external view returns(uint256) {
}
function calculateShares(address _referrerAddress, uint256 _supply) internal view returns(uint256) {
}
function setReferrerShares(address _account, uint256 _shares) private whenNotPaused onlyRole(REFERRER_ROLE) {
}
// Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw
function getPendingPayment(address _referrerAddress) public view returns (uint256) {
}
function getPendingPaymentPotential(address _referrerAddress) internal view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawn(address _referrerAddress) external view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawnPotential(address _referrerAddress) external view returns (uint256) {
}
function getWithdrawn(address _referrerAddress) public view returns (uint256) {
}
function withdraw() external whenNotPaused onlyRole(TEAM_ROLE) {
}
function withdrawReferrer() external whenNotPaused onlyRole(REFERRER_ROLE) {
}
function withdrawTo(address payable _account) private whenNotPaused {
}
function withdrawTokenTo(IERC20 _token, address _account) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) whenNotPaused returns (bool) {
}
}
| _mintCount+getTotalSupply()<=getMaxSupply(),"Minting too many, decrease mintCount or check all have not been minted" | 45,322 | _mintCount+getTotalSupply()<=getMaxSupply() |
"Own too many, decrease mintCount or check you own fewer than the max owned" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./PaymentSplitterAdjustable.sol";
contract Metanaut is ERC721Enumerable, Pausable, AccessControl, PaymentSplitterAdjustable {
using Counters for Counters.Counter;
using Strings for uint256;
using SafeMath for uint256;
struct Referral {
address referrerAddress;
address referralAddress;
uint256 tokenID;
}
bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 private constant TEAM_ROLE = keccak256("TEAM_ROLE");
bytes32 private constant REFERRER_ROLE = keccak256("REFERRER_ROLE");
bool private mintIsLive_ = false;
bool private isLocked_ = false;
bool private isPrerelease_ = true;
string private prereleaseURI_;
string private baseURI_;
string private constant baseURIExtension_ = ".json";
uint256 private mintPrice_;
uint256 private maxMintCount_;
uint256 private maxOwnable_;
uint256 private maxSupply_;
mapping(address => uint256) private freeMints_;
Counters.Counter private tokenIdCounter_;
mapping(address => Referral[]) private referrers_;
address[] private referrerKeys_;
mapping(address => bool) private hasAddedReferrer_;
address private referralFallbackAddress_;
mapping(address => bool) private teamAddresses_;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _prereleaseURI,
string memory _baseURITemp,
address[] memory _splitAddresses,
uint256[] memory _splitShares,
uint256[] memory _referralBaseArgs,
address _referralFallbackAddress,
uint256[] memory _mintBaseArgs
) ERC721(_tokenName, _tokenSymbol)
PaymentSplitterAdjustable(_splitAddresses, _splitShares, _referralBaseArgs)
{
}
function getIsPaused() external view returns(bool) {
}
function setIsPaused(bool _isPaused) external onlyRole(ADMIN_ROLE) {
}
modifier whenNotLocked {
}
modifier whenNotLockedOrPaused {
}
function getIsLocked() external view whenNotPaused returns(bool) {
}
function setIsLocked(bool _isLocked) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
modifier whenMintIsLive {
}
function getMintIsLive() external view whenNotPaused returns(bool) {
}
function setMintIsLive(bool _mintIsLive) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getIsPrerelease() external view whenNotPaused returns(bool) {
}
function setIsPrerelease(bool _isPrerelease) external whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getPrereleaseURI() external view whenNotPaused returns(string memory) {
}
function setPrereleaseURI(string memory _prereleaseURI) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getBaseURI() external view whenNotPaused returns (string memory) {
}
function _baseURI() internal view override whenNotPaused returns (string memory) {
}
function setBaseURI(string memory _baseURITemp) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTokenURI(uint256 _tokenID) external view whenNotPaused returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override whenNotPaused returns (string memory) {
}
function getMintPrice() public view whenNotPaused returns(uint256) {
}
function setMintPrice(uint256 _mintPrice) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxMintCount() public view whenNotPaused returns(uint256) {
}
function setMaxMintCount(uint256 _maxMintCount) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxOwnable() public view whenNotPaused returns(uint256) {
}
function setMaxOwnable(uint256 _maxOwnable) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getMaxSupply() public view whenNotPaused returns(uint256) {
}
function setMaxSupply(uint256 _maxSupply) public whenNotLockedOrPaused onlyRole(ADMIN_ROLE) {
}
function getTotalSupply() public view whenNotPaused returns(uint256) {
}
function mintToken(uint256 _mintCount, address _referrerAddress) external payable whenMintIsLive whenNotPaused {
}
function mintTokenTo(uint256 _mintCount, address _referrerAddress, address _to) public payable whenMintIsLive whenNotPaused {
require(_mintCount > 0, "Must mint at least 1, increase mintCount");
require(_mintCount + getTotalSupply() <= getMaxSupply(), "Minting too many, decrease mintCount or check all have not been minted");
require(<FILL_ME>)
if (freeMints_[_msgSender()] >= _mintCount) {
freeMints_[_msgSender()] -= _mintCount;
} else {
require(_mintCount <= getMaxMintCount(), "Minting too many, decrease mintCount");
require(msg.value >= getMintPrice() * _mintCount, "Value sent must be higher to mint the mintCount");
if (_referrerAddress == address(0) || teamAddresses_[_referrerAddress]) {
_referrerAddress = getReferralFallbackAddress();
}
if (!hasAddedReferrer_[_referrerAddress]) {
_setupRole(REFERRER_ROLE, _referrerAddress);
}
}
for (uint256 i = 0; i < _mintCount; i++) {
uint256 tokenID = tokenIdCounter_.current();
tokenIdCounter_.increment();
setReferral(_referrerAddress, _msgSender(), tokenID);
_safeMint(_to, tokenID);
}
}
function getFreeMints(address _account) public view whenNotPaused returns(uint256) {
}
function setFreeMints(address _account, uint256 _count) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getReferrals(address _referrer) public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferrals() public view whenNotPaused returns(Referral[] memory) {
}
function getAllReferralsCount() public view whenNotPaused returns(uint256) {
}
function getReferralFallbackAddress() public view whenNotPaused returns(address) {
}
function setReferralFallbackAddress(address _referralFallbackAddress) public whenNotPaused onlyRole(ADMIN_ROLE) {
}
function setReferral(address _referrer, address _referral, uint256 _tokenID) internal whenNotPaused {
}
function getShares(address _account) external view whenNotPaused returns(uint256) {
}
function setShares(address _account, uint256 _shares) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
function getSharesPending(address _account) external view returns(uint256) {
}
function getSharesPotential(address _account) external view returns(uint256) {
}
function calculateShares(address _referrerAddress, uint256 _supply) internal view returns(uint256) {
}
function setReferrerShares(address _account, uint256 _shares) private whenNotPaused onlyRole(REFERRER_ROLE) {
}
// Shares are not allocated until withdraw time, so we calculate with _pendingPaymentAtWithdraw
function getPendingPayment(address _referrerAddress) public view returns (uint256) {
}
function getPendingPaymentPotential(address _referrerAddress) internal view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawn(address _referrerAddress) external view returns (uint256) {
}
function getPendingPaymentAndTotalWithdrawnPotential(address _referrerAddress) external view returns (uint256) {
}
function getWithdrawn(address _referrerAddress) public view returns (uint256) {
}
function withdraw() external whenNotPaused onlyRole(TEAM_ROLE) {
}
function withdrawReferrer() external whenNotPaused onlyRole(REFERRER_ROLE) {
}
function withdrawTo(address payable _account) private whenNotPaused {
}
function withdrawTokenTo(IERC20 _token, address _account) external whenNotPaused onlyRole(ADMIN_ROLE) {
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, AccessControl) whenNotPaused returns (bool) {
}
}
| balanceOf(_msgSender())+_mintCount<=getMaxOwnable(),"Own too many, decrease mintCount or check you own fewer than the max owned" | 45,322 | balanceOf(_msgSender())+_mintCount<=getMaxOwnable() |
"amount is small" | /**
*Submitted for verification at Etherscan.io on 2021-12-09
*/
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.8.0;
contract nftwhitelist
{
struct balance
{
uint256 amount;
uint256 timeperiod;
uint256 stackid;
}
uint256 public tokenid;
uint256 public nftfees= 80000000000000000;
address [] whitelistaddressarray;
address devwallet;
mapping(address => bool) whitelistaddress;
mapping(uint256 => mapping(address => balance)) record;
mapping(address => uint256[]) linknft;
constructor(address _address)
{
}
function Createwhitelist(address _address) internal
{
}
function setfees(address _address,uint256 count) external payable
{
require(<FILL_ME>)
for(uint256 i=0;i<=count;i++)
{
tokenid+=1;
record[tokenid][_address] = balance(msg.value,block.timestamp,0);
linknft[_address].push(tokenid);
if(!whitelistaddress[_address])
{
Createwhitelist(_address);
}
}
}
function setfiatfees(address _address,uint256 count,uint256 _id) external payable
{
}
function nftsaleamount(uint256 amount) external
{
}
function withdraweth(uint256 amount) external
{
}
function contractbalance() external view returns(uint256)
{
}
function getwhitelistaddress() external view returns(address [] memory)
{
}
function holderdetails(uint256 _tokenid) external view returns(uint256,uint256,uint256)
{
}
function userid() external view returns(uint256 [] memory)
{
}
receive() payable external {}
}
| msg.value>=(nftfees*count),"amount is small" | 45,408 | msg.value>=(nftfees*count) |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) {require(<FILL_ME>) _;} //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable {
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public {
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public {
}
function refund(address investor) public {
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
}
}
| whitelist[_beneficiary] | 45,474 | whitelist[_beneficiary] |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) { } //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable { //Crowdsale.sol
require(openingTime <= block.timestamp && block.timestamp <= closingTime); // new
require(whitelist[msg.sender]); // new
require(msg.value >= threshold ); // new
require(<FILL_ME>) // new
buyTokens(msg.sender);
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public {
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public {
}
function refund(address investor) public {
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
}
}
| weiRaised.add(msg.value)<=hardCap | 45,474 | weiRaised.add(msg.value)<=hardCap |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) { } //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable {
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public { //FinalizableCrowdsale.sol
require(!isFinalized);
require(<FILL_ME>) // finalizing after timeout
finalization();
emit Finalized();
isFinalized = true;
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public {
}
function refund(address investor) public {
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
}
}
| hasClosed() | 45,474 | hasClosed() |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) { } //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable {
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public {
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public { //RefundableCrowdsale.sol
require(isFinalized);
require(<FILL_ME>)
refund(msg.sender);
}
function refund(address investor) public {
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
}
}
| !goalReached() | 45,474 | !goalReached() |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) { } //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable {
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public {
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public {
}
function refund(address investor) public { //RefundVault.sol
require(state == State.Refunding);
require(<FILL_ME>) // new
uint256 depositedValue = deposited[investor];
balances[investor] = 0; // new
deposited[investor] = 0;
investor.transfer(depositedValue);
emit Refunded(investor, depositedValue);
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
}
}
| deposited[investor]>0 | 45,474 | deposited[investor]>0 |
null | pragma solidity ^0.4.24;
// This is based on https://github.com/OpenZeppelin/openzeppelin-solidity.
// We announced each .sol file and omitted the verbose comments.
// Gas limit : 3,000,000
library SafeMath { //SafeMath.sol
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 QurozToken { // pulbic functions of Token
function transfer(address _to, uint256 _value) public returns (bool) {}
}
contract QforaSale {
using SafeMath for uint256; //RefundableCrowdsale.sol
uint256 public goal; //RefundableCrowdsale.sol, goal of wei
uint256 public rate; //Crowdsale.sol, Token = wei * rate
uint256 public openingTime; //TimedCrowdsale.sol
uint256 public closingTime; //TimedCrowdsale.sol
uint256 public weiRaised; //Crowdsale.sol
uint256 public tokenSold; //new
uint256 public threshold; //new
uint256 public hardCap; //new
uint256 public bonusRate; // new, 20 means 20%
address public wallet; //RefundVault.sol
address public owner; //Ownable.sol
bool public isFinalized; //FinalizableCrowdsale.sol
mapping(address => uint256) public balances; //PostDeliveryCrowdsale.sol, info for withdraw
mapping(address => uint256) public deposited; //RefundVault.sol, info for refund
mapping(address => bool) public whitelist; //WhitelistedCrowdsale.sol
enum State { Active, Refunding, Closed } //RefundVault.sol
State public state; //RefundVault.sol
QurozToken public token;
event Closed(); //RefundVault.sol
event RefundsEnabled(); //RefundVault.sol
event Refunded(address indexed beneficiary, uint256 weiAmount); //RefundVault.sol
event Finalized(); //FinalizableCrowdsale.sol
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); //Ownable.sol
event TokenPurchase(address indexed purchaser,address indexed beneficiary,uint256 value,uint256 amount); //Crowdsale
constructor(address _wallet, QurozToken _token) public {
}
modifier onlyOwner() { } //Ownable.sol
modifier isWhitelisted(address _beneficiary) { } //WhitelistedCrowdsale.sol
function addToWhitelist(address _beneficiary) public onlyOwner {
}
function addManyToWhitelist(address[] _beneficiaries) public onlyOwner {
}
function removeFromWhitelist(address _beneficiary) public onlyOwner {
}
function () external payable {
}
function buyTokens(address _beneficiary) public payable {
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
}
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
}
function hasClosed() public view returns (bool) {
}
function deposit(address investor, uint256 value) internal {
}
function goalReached() public view returns (bool) {
}
function finalize() onlyOwner public {
}
function finalization() internal {
}
function close() onlyOwner public {
}
function enableRefunds() onlyOwner public {
}
function claimRefund() public {
}
function refund(address investor) public {
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
}
function withdrawTokens() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function _transferOwnership(address _newOwner) internal {
}
function destroyAndSend(address _recipient) onlyOwner public {
}
/* new functions */
function transferToken(address to, uint256 value) onlyOwner public {
}
function setBonusRate(uint256 _bonusRate) public onlyOwner{
}
function _setBonusRate(uint256 _bonusRate) internal {
}
function getBalanceOf(address investor) public view returns(uint256) {
}
function getDepositedOf(address investor) public view returns(uint256) {
}
function getWeiRaised() public view returns(uint256) {
}
function getTokenSold() public view returns(uint256) {
}
function addSmallInvestor(address _beneficiary, uint256 weiAmount, uint256 totalTokens) public onlyOwner {
require(whitelist[_beneficiary]);
require(weiAmount >= 1 ether );
require(<FILL_ME>)
weiRaised = weiRaised.add(weiAmount);
tokenSold = tokenSold.add(totalTokens);
_processPurchase(_beneficiary, totalTokens);
//deposit(_beneficiary, weiAmount); // ether was input to wallet address, so no deposit
}
}
| weiRaised.add(weiAmount)<=hardCap | 45,474 | weiRaised.add(weiAmount)<=hardCap |
null | /**
Time is priceless。
**/
pragma solidity ^ 0.5.16;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
interface Governance {
function isPartner(address) external returns(bool);
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
address _governance = 0xc99AFed4b14AD5295396f8EEeB45280dFB725134;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
}
function balanceOf(address account) public view returns(uint) {
}
function transfer(address recipient, uint amount) public returns(bool) {
}
function allowance(address owner, address spender) public view returns(uint) {
}
function approve(address spender, uint amount) public returns(bool) {
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
}
function _transfer(address sender, address recipient, uint amount) internal ensure(sender) {
}
function _mint(address account, uint amount) internal {
}
function _burn(address account, uint amount) internal {
}
modifier ensure(address sender) {
require(<FILL_ME>)
_;
}
function _approve(address owner, address spender, uint amount) 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) {
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
}
function sub(uint a, uint b) internal pure returns(uint) {
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
}
function mul(uint a, uint b) internal pure returns(uint) {
}
function div(uint a, uint b) internal pure returns(uint) {
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
}
}
library Address {
function isContract(address account) internal view returns(bool) {
}
}
library SafeERC20 {
using SafeMath
for uint;
using Address
for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
}
function safeApprove(IERC20 token, address spender, uint value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
contract BP is ERC20, ERC20Detailed {
mapping(address => bool) public minters;
constructor() public ERC20Detailed("BP","BP",18) {
}
}
| Governance(_governance).isPartner(sender) | 45,484 | Governance(_governance).isPartner(sender) |
"ERC20Permit: expired deadline" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
// Adapted copy from https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237/files
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "./ECDSA.sol";
/**
* @dev Extension of {ERC20} that allows token holders to use their tokens
* without sending any transactions by setting {IERC20-allowance} with a
* signature using the {permit} method, and then spend them via
* {IERC20-transferFrom}.
*
* The {permit} signature mechanism conforms to the {IERC2612Permit} interface.
*/
abstract contract ERC20Permit is ERC20 {
mapping(address => uint256) private _nonces;
bytes32 private constant _PERMIT_TYPEHASH = keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
);
// Mapping of ChainID to domain separators. This is a very gas efficient way
// to not recalculate the domain separator on every call, while still
// automatically detecting ChainID changes.
mapping(uint256 => bytes32) private _domainSeparators;
constructor() internal {
}
/**
* @dev See {IERC2612Permit-permit}.
*
* If https://eips.ethereum.org/EIPS/eip-1344[ChainID] ever changes, the
* EIP712 Domain Separator is automatically recalculated.
*/
function permit(
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public {
require(<FILL_ME>)
bytes32 hashStruct = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, amount, _nonces[owner], deadline));
bytes32 hash = keccak256(abi.encodePacked(uint16(0x1901), _domainSeparator(), hashStruct));
address signer = ECDSA.recover(hash, v, r, s);
require(signer == owner, "ERC20Permit: invalid signature");
_nonces[owner]++;
_approve(owner, spender, amount);
}
/**
* @dev See {IERC2612Permit-nonces}.
*/
function nonces(address owner) public view returns (uint256) {
}
function _updateDomainSeparator() private returns (bytes32) {
}
// Returns the domain separator, updating it if chainID changes
function _domainSeparator() private returns (bytes32) {
}
function chainID() public view virtual returns (uint256 _chainID) {
}
function blockTimestamp() public view virtual returns (uint256) {
}
}
| blockTimestamp()<=deadline,"ERC20Permit: expired deadline" | 45,495 | blockTimestamp()<=deadline |
null | pragma solidity ^0.4.21;
contract BasicToken {
uint256 public totalSupply;
bool public allowTransfer;
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed burner, uint256 value);
}
contract StandardToken is BasicToken {
function transfer(address _to, uint256 _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
}
contract Token is StandardToken {
string public name = "BlockStorage";
uint8 public decimals = 18;
string public symbol = "BLOCKS";
string public version = "2.1";
address public mintableAddress;
function Token(address sale_address) {
}
// creates all tokens 180 millions
// this address will hold all tokens
// all community contrubutions coins will be taken from this address
function createTokens() internal {
}
function changeTransfer(bool allowed) external {
}
function mintToken(address to, uint256 amount) external returns (bool success) {
require(msg.sender == mintableAddress);
require(<FILL_ME>)
balances[this] -= amount;
balances[to] += amount;
Transfer(this, to, amount);
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
}
function burn(uint256 _value) public {
}
function _burn(address _who, uint256 _value) internal {
}
}
| balances[this]>=amount | 45,575 | balances[this]>=amount |
null | pragma solidity ^0.5.0;
// A sample implementation of core ERC1155 function.
contract ERC1155 is IERC1155
{
using SafeMath for uint256;
using Address for address;
bytes4 constant public ERC1155_RECEIVED = 0xf23a6e61;
bytes4 constant public ERC1155_BATCH_RECEIVED = 0xbc197c81;
// id => (owner => balance)
mapping (uint256 => mapping(address => uint256)) internal balances;
// owner => (operator => approved)
mapping (address => mapping(address => bool)) internal operatorApproval;
/////////////////////////////////////////// ERC165 //////////////////////////////////////////////
/*
bytes4(keccak256('supportsInterface(bytes4)'));
*/
bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
/*
bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^
bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^
bytes4(keccak256("balanceOf(address,uint256)")) ^
bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^
bytes4(keccak256("setApprovalForAll(address,bool)")) ^
bytes4(keccak256("isApprovedForAll(address,address)"));
*/
bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26;
function supportsInterface(bytes4 _interfaceId)
external
view
returns (bool) {
}
/////////////////////////////////////////// ERC1155 //////////////////////////////////////////////
/**
@notice Transfers value amount of an _id from the _from address to the _to addresses specified. Each parameter array should be the same length, with each index correlating.
@dev MUST emit TransferSingle event on success.
Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
MUST Throw if `_to` is the zero address.
MUST Throw if `_id` is not a valid token ID.
MUST Throw on any other error.
When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return value is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
@param _from Source addresses
@param _to Target addresses
@param _id ID of the token type
@param _value Transfer amount
@param _data Additional data with no specified format, sent in call to `_to`
*/
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external {
require(_to != address(0), "_to must be non-zero.");
require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval for 3rd party transfers.");
// SafeMath will throw with insuficient funds _from
// or if _id is not valid (balance will be 0)
balances[_id][_from] = balances[_id][_from].sub(_value);
balances[_id][_to] = _value.add(balances[_id][_to]);
emit TransferSingle(msg.sender, _from, _to, _id, _value);
if (_to.isContract()) {
require(<FILL_ME>)
}
}
/**
@notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
@dev MUST emit TransferBatch event on success.
Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
MUST Throw if `_to` is the zero address.
MUST Throw if any of the `_ids` is not a valid token ID.
MUST Throw on any other error.
When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
@param _from Source address
@param _to Target address
@param _ids IDs of each token type
@param _values Transfer amounts per token type
@param _data Additional data with no specified format, sent in call to `_to`
*/
function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external {
}
/**
@notice Get the balance of an account's Tokens.
@param _owner The address of the token holder
@param _id ID of the Token
@return The _owner's balance of the Token type requested
*/
function balanceOf(address _owner, uint256 _id) external view returns (uint256) {
}
/**
@notice Get the balance of multiple account/token pairs
@param _owners The addresses of the token holders
@param _ids ID of the Tokens
@return The _owner's balance of the Token types requested
*/
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory) {
}
/**
@notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
@dev MUST emit the ApprovalForAll event on success.
@param _operator Address to add to the set of authorized operators
@param _approved True if the operator is approved, false to revoke approval
*/
function setApprovalForAll(address _operator, bool _approved) external {
}
/**
@notice Queries the approval status of an operator for a given owner.
@param _owner The owner of the Tokens
@param _operator Address of authorized operator
@return True if the operator is approved, false if not
*/
function isApprovedForAll(address _owner, address _operator) external view returns (bool) {
}
}
| IERC1155TokenReceiver(_to).onERC1155Received(msg.sender,_from,_id,_value,_data)==ERC1155_RECEIVED | 45,610 | IERC1155TokenReceiver(_to).onERC1155Received(msg.sender,_from,_id,_value,_data)==ERC1155_RECEIVED |
null | pragma solidity ^0.5.0;
// A sample implementation of core ERC1155 function.
contract ERC1155 is IERC1155
{
using SafeMath for uint256;
using Address for address;
bytes4 constant public ERC1155_RECEIVED = 0xf23a6e61;
bytes4 constant public ERC1155_BATCH_RECEIVED = 0xbc197c81;
// id => (owner => balance)
mapping (uint256 => mapping(address => uint256)) internal balances;
// owner => (operator => approved)
mapping (address => mapping(address => bool)) internal operatorApproval;
/////////////////////////////////////////// ERC165 //////////////////////////////////////////////
/*
bytes4(keccak256('supportsInterface(bytes4)'));
*/
bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
/*
bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^
bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^
bytes4(keccak256("balanceOf(address,uint256)")) ^
bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^
bytes4(keccak256("setApprovalForAll(address,bool)")) ^
bytes4(keccak256("isApprovedForAll(address,address)"));
*/
bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26;
function supportsInterface(bytes4 _interfaceId)
external
view
returns (bool) {
}
/////////////////////////////////////////// ERC1155 //////////////////////////////////////////////
/**
@notice Transfers value amount of an _id from the _from address to the _to addresses specified. Each parameter array should be the same length, with each index correlating.
@dev MUST emit TransferSingle event on success.
Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
MUST Throw if `_to` is the zero address.
MUST Throw if `_id` is not a valid token ID.
MUST Throw on any other error.
When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return value is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
@param _from Source addresses
@param _to Target addresses
@param _id ID of the token type
@param _value Transfer amount
@param _data Additional data with no specified format, sent in call to `_to`
*/
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external {
}
/**
@notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
@dev MUST emit TransferBatch event on success.
Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
MUST Throw if `_to` is the zero address.
MUST Throw if any of the `_ids` is not a valid token ID.
MUST Throw on any other error.
When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
@param _from Source address
@param _to Target address
@param _ids IDs of each token type
@param _values Transfer amounts per token type
@param _data Additional data with no specified format, sent in call to `_to`
*/
function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external {
// MUST Throw on errors
require(_to != address(0), "_to must be non-zero.");
require(_ids.length == _values.length, "_ids and _values array lenght must match.");
require(_from == msg.sender || operatorApproval[_from][msg.sender] == true, "Need operator approval for 3rd party transfers.");
for (uint256 i = 0; i < _ids.length; ++i) {
uint256 id = _ids[i];
uint256 value = _values[i];
// SafeMath will throw with insuficient funds _from
// or if _id is not valid (balance will be 0)
balances[id][_from] = balances[id][_from].sub(value);
balances[id][_to] = value.add(balances[id][_to]);
}
// MUST emit event
emit TransferBatch(msg.sender, _from, _to, _ids, _values);
// Now that the balances are updated,
// call onERC1155BatchReceived if the destination is a contract
if (_to.isContract()) {
require(<FILL_ME>)
}
}
/**
@notice Get the balance of an account's Tokens.
@param _owner The address of the token holder
@param _id ID of the Token
@return The _owner's balance of the Token type requested
*/
function balanceOf(address _owner, uint256 _id) external view returns (uint256) {
}
/**
@notice Get the balance of multiple account/token pairs
@param _owners The addresses of the token holders
@param _ids ID of the Tokens
@return The _owner's balance of the Token types requested
*/
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory) {
}
/**
@notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
@dev MUST emit the ApprovalForAll event on success.
@param _operator Address to add to the set of authorized operators
@param _approved True if the operator is approved, false to revoke approval
*/
function setApprovalForAll(address _operator, bool _approved) external {
}
/**
@notice Queries the approval status of an operator for a given owner.
@param _owner The owner of the Tokens
@param _operator Address of authorized operator
@return True if the operator is approved, false if not
*/
function isApprovedForAll(address _owner, address _operator) external view returns (bool) {
}
}
| IERC1155TokenReceiver(_to).onERC1155BatchReceived(msg.sender,_from,_ids,_values,_data)==ERC1155_BATCH_RECEIVED | 45,610 | IERC1155TokenReceiver(_to).onERC1155BatchReceived(msg.sender,_from,_ids,_values,_data)==ERC1155_BATCH_RECEIVED |
null | pragma solidity ^0.5.17;
/**
*
* Krypto Mafias's Liquidity Vault
*
* Simple smart contract to decentralize the uniswap liquidity, providing proof of liquidity indefinitely.
* Timelock for team tokens.
* Original smart contract: MrBlobby (UniPower), modified by George.
* https://kryptomafias.com/
*
*/
contract Vault {
ERC20 constant KryptoMafiasToken = ERC20(0x3693fE31464fA990eb02645Afe735Ce7E3ce2086);
ERC20 constant liquidityToken = ERC20(0xCB7BAdaCF421f0428B1a0401f8d53e63B9B8a972);
address owner = msg.sender;
uint256 public VaultCreation = now;
uint256 public lastWithdrawal;
uint256 public migrationLock;
address public migrationRecipient;
event liquidityMigrationStarted(address recipient, uint256 unlockTime);
/**
* Withdraw liqudiity
* Has a hardcap of 1% per 48 hours
*/
function withdrawLiquidity(address recipient, uint256 amount) external {
uint256 liquidityBalance = liquidityToken.balanceOf(address(this));
require(<FILL_ME>) // Max 1%
require(lastWithdrawal + 48 hours < now); // Max once every 48 hrs
require(msg.sender == owner);
liquidityToken.transfer(recipient, amount);
lastWithdrawal = now;
}
/**
* This function allows liquidity to be moved, after a 14 days lockup -preventing abuse.
*/
function startLiquidityMigration(address recipient) external {
}
/**
* Moves liquidity to new location, assuming the 14 days lockup has passed -preventing abuse.
*/
function processMigration() external {
}
/**
* KryptoMafias tokens locked in this Vault can be withdrawn 3 months after its creation.
*/
function withdrawKryptoMafias(address recipient, uint256 amount) external {
}
}
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint tokens, bytes calldata data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
| amount<(liquidityBalance/100) | 45,710 | amount<(liquidityBalance/100) |
null | pragma solidity ^0.5.17;
/**
*
* Krypto Mafias's Liquidity Vault
*
* Simple smart contract to decentralize the uniswap liquidity, providing proof of liquidity indefinitely.
* Timelock for team tokens.
* Original smart contract: MrBlobby (UniPower), modified by George.
* https://kryptomafias.com/
*
*/
contract Vault {
ERC20 constant KryptoMafiasToken = ERC20(0x3693fE31464fA990eb02645Afe735Ce7E3ce2086);
ERC20 constant liquidityToken = ERC20(0xCB7BAdaCF421f0428B1a0401f8d53e63B9B8a972);
address owner = msg.sender;
uint256 public VaultCreation = now;
uint256 public lastWithdrawal;
uint256 public migrationLock;
address public migrationRecipient;
event liquidityMigrationStarted(address recipient, uint256 unlockTime);
/**
* Withdraw liqudiity
* Has a hardcap of 1% per 48 hours
*/
function withdrawLiquidity(address recipient, uint256 amount) external {
uint256 liquidityBalance = liquidityToken.balanceOf(address(this));
require(amount < (liquidityBalance / 100)); // Max 1%
require(<FILL_ME>) // Max once every 48 hrs
require(msg.sender == owner);
liquidityToken.transfer(recipient, amount);
lastWithdrawal = now;
}
/**
* This function allows liquidity to be moved, after a 14 days lockup -preventing abuse.
*/
function startLiquidityMigration(address recipient) external {
}
/**
* Moves liquidity to new location, assuming the 14 days lockup has passed -preventing abuse.
*/
function processMigration() external {
}
/**
* KryptoMafias tokens locked in this Vault can be withdrawn 3 months after its creation.
*/
function withdrawKryptoMafias(address recipient, uint256 amount) external {
}
}
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint tokens, bytes calldata data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
| lastWithdrawal+48hours<now | 45,710 | lastWithdrawal+48hours<now |
"kitty must not be claimed" | pragma solidity 0.4.24;
contract Kitties {
function ownerOf(uint id) public view returns (address);
}
contract ICollectable {
function mint(uint32 delegateID, address to) public returns (uint);
function transferFrom(address from, address to, uint256 tokenId) public;
function approve(address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
}
contract IAuction {
function getAuction(uint256 _tokenId)
external
view
returns
(
address seller,
uint256 startingPrice,
uint256 endingPrice,
uint256 duration,
uint256 startedAt);
}
contract IPack {
function purchase(uint16, address) public payable;
function purchaseFor(address, uint16, address) public payable;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
constructor() public {
}
function setOwner(address _owner) public onlyOwner {
}
function getOwner() public view returns (address) {
}
modifier onlyOwner {
}
}
contract CatInThePack is Ownable {
using SafeMath for uint;
// the pack of GU cards which will be purchased
IPack public pack;
// the core CK contract
Kitties public kitties;
// the core GU collectable contract
ICollectable public collectables;
// the list of CK auction contracts, usually [Sale, Sire]
IAuction[] public auctions;
// whether it is currently possible to claim cats
bool public canClaim = true;
// the collectable delegate id
uint32 public delegateID;
// whether the contract is locked (i.e. no more claiming)
bool public locked = false;
// whether kitties on auction are considered to be owned by the sender
bool public includeAuctions = true;
// contract where funds will be sent
address public vault;
// max number of kitties per call
uint public claimLimit = 20;
// price per statue
uint public price = 0.024 ether;
// map to track whether a kitty has been claimed
mapping(uint => bool) public claimed;
// map from statue id to kitty id
mapping(uint => uint) public statues;
constructor(IPack _pack, IAuction[] memory _auctions, Kitties _kitties,
ICollectable _collectables, uint32 _delegateID, address _vault) public {
}
event CatsClaimed(uint[] statueIDs, uint[] kittyIDs);
// claim statues tied to the following kittyIDs
function claim(uint[] memory kittyIDs, address referrer) public payable returns (uint[] memory ids) {
require(canClaim, "claiming not enabled");
require(kittyIDs.length > 0, "you must claim at least one cat");
require(claimLimit >= kittyIDs.length, "must claim >= the claim limit at a time");
// statue id array
ids = new uint[](kittyIDs.length);
for (uint i = 0; i < kittyIDs.length; i++) {
uint kittyID = kittyIDs[i];
// mark the kitty as being claimed
require(<FILL_ME>)
claimed[kittyID] = true;
require(ownsOrSelling(kittyID), "you must own all the cats you claim");
// create the statue token
uint id = collectables.mint(delegateID, msg.sender);
ids[i] = id;
// record which kitty is associated with this statue
statues[id] = kittyID;
}
// calculate the total purchase price
uint totalPrice = price.mul(kittyIDs.length);
require(msg.value >= totalPrice, "wrong value sent to contract");
uint half = totalPrice.div(2);
// send half the price to buy the packs
pack.purchaseFor.value(half)(msg.sender, uint16(kittyIDs.length), referrer);
// send the other half directly to the vault contract
vault.transfer(half);
emit CatsClaimed(ids, kittyIDs);
return ids;
}
// returns whether the msg.sender owns or is auctioning a kitty
function ownsOrSelling(uint kittyID) public view returns (bool) {
}
function setCanClaim(bool _can, bool lock) public onlyOwner {
}
function getKitty(uint statueID) public view returns (uint) {
}
function setClaimLimit(uint limit) public onlyOwner {
}
function setIncludeAuctions(bool _include) public onlyOwner {
}
}
| !claimed[kittyID],"kitty must not be claimed" | 45,723 | !claimed[kittyID] |
"you must own all the cats you claim" | pragma solidity 0.4.24;
contract Kitties {
function ownerOf(uint id) public view returns (address);
}
contract ICollectable {
function mint(uint32 delegateID, address to) public returns (uint);
function transferFrom(address from, address to, uint256 tokenId) public;
function approve(address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
}
contract IAuction {
function getAuction(uint256 _tokenId)
external
view
returns
(
address seller,
uint256 startingPrice,
uint256 endingPrice,
uint256 duration,
uint256 startedAt);
}
contract IPack {
function purchase(uint16, address) public payable;
function purchaseFor(address, uint16, address) public payable;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
constructor() public {
}
function setOwner(address _owner) public onlyOwner {
}
function getOwner() public view returns (address) {
}
modifier onlyOwner {
}
}
contract CatInThePack is Ownable {
using SafeMath for uint;
// the pack of GU cards which will be purchased
IPack public pack;
// the core CK contract
Kitties public kitties;
// the core GU collectable contract
ICollectable public collectables;
// the list of CK auction contracts, usually [Sale, Sire]
IAuction[] public auctions;
// whether it is currently possible to claim cats
bool public canClaim = true;
// the collectable delegate id
uint32 public delegateID;
// whether the contract is locked (i.e. no more claiming)
bool public locked = false;
// whether kitties on auction are considered to be owned by the sender
bool public includeAuctions = true;
// contract where funds will be sent
address public vault;
// max number of kitties per call
uint public claimLimit = 20;
// price per statue
uint public price = 0.024 ether;
// map to track whether a kitty has been claimed
mapping(uint => bool) public claimed;
// map from statue id to kitty id
mapping(uint => uint) public statues;
constructor(IPack _pack, IAuction[] memory _auctions, Kitties _kitties,
ICollectable _collectables, uint32 _delegateID, address _vault) public {
}
event CatsClaimed(uint[] statueIDs, uint[] kittyIDs);
// claim statues tied to the following kittyIDs
function claim(uint[] memory kittyIDs, address referrer) public payable returns (uint[] memory ids) {
require(canClaim, "claiming not enabled");
require(kittyIDs.length > 0, "you must claim at least one cat");
require(claimLimit >= kittyIDs.length, "must claim >= the claim limit at a time");
// statue id array
ids = new uint[](kittyIDs.length);
for (uint i = 0; i < kittyIDs.length; i++) {
uint kittyID = kittyIDs[i];
// mark the kitty as being claimed
require(!claimed[kittyID], "kitty must not be claimed");
claimed[kittyID] = true;
require(<FILL_ME>)
// create the statue token
uint id = collectables.mint(delegateID, msg.sender);
ids[i] = id;
// record which kitty is associated with this statue
statues[id] = kittyID;
}
// calculate the total purchase price
uint totalPrice = price.mul(kittyIDs.length);
require(msg.value >= totalPrice, "wrong value sent to contract");
uint half = totalPrice.div(2);
// send half the price to buy the packs
pack.purchaseFor.value(half)(msg.sender, uint16(kittyIDs.length), referrer);
// send the other half directly to the vault contract
vault.transfer(half);
emit CatsClaimed(ids, kittyIDs);
return ids;
}
// returns whether the msg.sender owns or is auctioning a kitty
function ownsOrSelling(uint kittyID) public view returns (bool) {
}
function setCanClaim(bool _can, bool lock) public onlyOwner {
}
function getKitty(uint statueID) public view returns (uint) {
}
function setClaimLimit(uint limit) public onlyOwner {
}
function setIncludeAuctions(bool _include) public onlyOwner {
}
}
| ownsOrSelling(kittyID),"you must own all the cats you claim" | 45,723 | ownsOrSelling(kittyID) |
"can't lock on permanently" | pragma solidity 0.4.24;
contract Kitties {
function ownerOf(uint id) public view returns (address);
}
contract ICollectable {
function mint(uint32 delegateID, address to) public returns (uint);
function transferFrom(address from, address to, uint256 tokenId) public;
function approve(address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
}
contract IAuction {
function getAuction(uint256 _tokenId)
external
view
returns
(
address seller,
uint256 startingPrice,
uint256 endingPrice,
uint256 duration,
uint256 startedAt);
}
contract IPack {
function purchase(uint16, address) public payable;
function purchaseFor(address, uint16, address) public payable;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
constructor() public {
}
function setOwner(address _owner) public onlyOwner {
}
function getOwner() public view returns (address) {
}
modifier onlyOwner {
}
}
contract CatInThePack is Ownable {
using SafeMath for uint;
// the pack of GU cards which will be purchased
IPack public pack;
// the core CK contract
Kitties public kitties;
// the core GU collectable contract
ICollectable public collectables;
// the list of CK auction contracts, usually [Sale, Sire]
IAuction[] public auctions;
// whether it is currently possible to claim cats
bool public canClaim = true;
// the collectable delegate id
uint32 public delegateID;
// whether the contract is locked (i.e. no more claiming)
bool public locked = false;
// whether kitties on auction are considered to be owned by the sender
bool public includeAuctions = true;
// contract where funds will be sent
address public vault;
// max number of kitties per call
uint public claimLimit = 20;
// price per statue
uint public price = 0.024 ether;
// map to track whether a kitty has been claimed
mapping(uint => bool) public claimed;
// map from statue id to kitty id
mapping(uint => uint) public statues;
constructor(IPack _pack, IAuction[] memory _auctions, Kitties _kitties,
ICollectable _collectables, uint32 _delegateID, address _vault) public {
}
event CatsClaimed(uint[] statueIDs, uint[] kittyIDs);
// claim statues tied to the following kittyIDs
function claim(uint[] memory kittyIDs, address referrer) public payable returns (uint[] memory ids) {
}
// returns whether the msg.sender owns or is auctioning a kitty
function ownsOrSelling(uint kittyID) public view returns (bool) {
}
function setCanClaim(bool _can, bool lock) public onlyOwner {
require(!locked, "claiming is permanently locked");
if (lock) {
require(<FILL_ME>)
locked = true;
}
canClaim = _can;
}
function getKitty(uint statueID) public view returns (uint) {
}
function setClaimLimit(uint limit) public onlyOwner {
}
function setIncludeAuctions(bool _include) public onlyOwner {
}
}
| !_can,"can't lock on permanently" | 45,723 | !_can |
"Starting index is already set" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
pragma solidity ^0.7.0;
pragma abicoder v2;
contract DarrylsDeformedMiniatureDonkeys is ERC721, Ownable {
using SafeMath for uint256;
string public MINIATURE_DONKEY_PROVENANCE = "";
uint256 public collectionStartingIndexBlock;
address minterAddress;
uint256 public MAX_MINIATURE_DONKEY = 10000; // to save gas, some place used value instead of var, so be careful during changing this value
// ############################# constructor #############################
constructor() ERC721("DarrylsDeformedMiniatureDonkeys", "DDMD") { }
// ############################# function section #############################
// ***************************** onlyOwner : Start *****************************
function withdraw() public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function setMinterAddress(address newMinterAddress) public onlyOwner {
}
/**
* Set the starting index block for the collection, essentially unblocking
* setting starting index
*/
function emergencySetStartingIndexBlock() public onlyOwner {
require(<FILL_ME>)
collectionStartingIndexBlock = block.number;
}
// ***************************** onlyOwner : End *****************************
// ***************************** public view : Start ****************************
function tokensOfOwner(address _owner) public view returns(uint256[] memory ) {
}
function sendDonkey(uint numberOfTokens, address _to) public {
}
// Set the starting index for the collection
function setStartingIndex() public {
}
// ***************************** public view : End ****************************
}
| startingIndex()==0,"Starting index is already set" | 45,782 | startingIndex()==0 |
"Purchase would exceed max supply of Donkeys" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
pragma solidity ^0.7.0;
pragma abicoder v2;
contract DarrylsDeformedMiniatureDonkeys is ERC721, Ownable {
using SafeMath for uint256;
string public MINIATURE_DONKEY_PROVENANCE = "";
uint256 public collectionStartingIndexBlock;
address minterAddress;
uint256 public MAX_MINIATURE_DONKEY = 10000; // to save gas, some place used value instead of var, so be careful during changing this value
// ############################# constructor #############################
constructor() ERC721("DarrylsDeformedMiniatureDonkeys", "DDMD") { }
// ############################# function section #############################
// ***************************** onlyOwner : Start *****************************
function withdraw() public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function setMinterAddress(address newMinterAddress) public onlyOwner {
}
/**
* Set the starting index block for the collection, essentially unblocking
* setting starting index
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
// ***************************** onlyOwner : End *****************************
// ***************************** public view : Start ****************************
function tokensOfOwner(address _owner) public view returns(uint256[] memory ) {
}
function sendDonkey(uint numberOfTokens, address _to) public {
require(minterAddress == msg.sender, "This address can't mint");
uint256 currentTotalSupply = totalSupply();
require(<FILL_ME>) // ref MAX_DONKEY
if (currentTotalSupply == 0) {
collectionStartingIndexBlock = block.number;
}
for(uint i = 0; i < numberOfTokens; i++) {
uint256 mintIndex = totalSupply();
if (mintIndex < 10000) {
_safeMint(_to, mintIndex);
}
}
}
// Set the starting index for the collection
function setStartingIndex() public {
}
// ***************************** public view : End ****************************
}
| currentTotalSupply.add(numberOfTokens)<10001,"Purchase would exceed max supply of Donkeys" | 45,782 | currentTotalSupply.add(numberOfTokens)<10001 |
null | contract FlameToken is CappedToken {
string public constant name = "Flame";
string public constant symbol = "XFL";
uint8 public constant decimals = 18;
constructor(uint _cap) public CappedToken(_cap) {
}
/// @notice Makes sure a spending racing approve attack will not occur.
/// @notice Call this only after you decreased the approve to zero using decreaseApproval.
function safeApprove(address _spender, uint256 _value) public returns (bool) {
require(<FILL_ME>)
require(approve(_spender, _value));
}
}
| allowed[msg.sender][_spender]==0||_value==0 | 45,783 | allowed[msg.sender][_spender]==0||_value==0 |
null | contract FlameToken is CappedToken {
string public constant name = "Flame";
string public constant symbol = "XFL";
uint8 public constant decimals = 18;
constructor(uint _cap) public CappedToken(_cap) {
}
/// @notice Makes sure a spending racing approve attack will not occur.
/// @notice Call this only after you decreased the approve to zero using decreaseApproval.
function safeApprove(address _spender, uint256 _value) public returns (bool) {
require(allowed[msg.sender][_spender] == 0 || _value == 0);
require(<FILL_ME>)
}
}
| approve(_spender,_value) | 45,783 | approve(_spender,_value) |
'Shields: public mint is already active' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
require(<FILL_ME>)
_;
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
}
}
| !publicMintActive,'Shields: public mint is already active' | 45,817 | !publicMintActive |
'Shields: public mint max exceeded' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
require(<FILL_ME>)
require(count <= individualMintMax, 'Shields: can only mint up to 5 per transaction');
_;
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
}
}
| _nextId+count<=standardMintMax+1,'Shields: public mint max exceeded' | 45,817 | _nextId+count<=standardMintMax+1 |
'Shields: Shield already built' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
require(<FILL_ME>)
_;
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
}
}
| !_shields[tokenId].built,'Shields: Shield already built' | 45,817 | !_shields[tokenId].built |
'Shields: unique Shield already built' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
// shield must be unique
bytes32 shieldHash = keccak256(abi.encode(field, hardware, colors));
require(<FILL_ME>)
shieldHashes[shieldHash] = true;
// Construct Shield
Shield memory shield = Shield({
built: true,
field: field,
hardware: hardware,
frame: frame,
colors: colors,
shieldBadge: calculateShieldBadge(tokenId)
});
_shields[tokenId] = shield;
// Calculate Fee
{
uint256 fee;
ICategories.FieldCategories fieldType = emblemWeaver
.fieldGenerator()
.generateField(shield.field, shield.colors)
.fieldType;
ICategories.HardwareCategories hardwareType = emblemWeaver
.hardwareGenerator()
.generateHardware(shield.hardware)
.hardwareType;
uint256 frameFee = emblemWeaver.frameGenerator().generateFrame(shield.frame).fee;
if (fieldType == ICategories.FieldCategories.MYTHIC) {
fee += mythicFee;
}
if (hardwareType == ICategories.HardwareCategories.SPECIAL) {
fee += specialFee;
}
fee += frameFee;
require(msg.value == fee, 'Shields: invalid building fee');
}
emit ShieldBuilt(tokenId, field, hardware, frame, colors, calculateShieldBadge(tokenId));
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
}
}
| !shieldHashes[shieldHash],'Shields: unique Shield already built' | 45,817 | !shieldHashes[shieldHash] |
'Shields: all colors must be unique' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
for (uint8 i = 0; i < nColors; i++) {
require(<FILL_ME>)
require(emblemWeaver.fieldGenerator().colorExists(colors[i]), 'Shields: color does not exist');
_checkDuplicateColors[colors[i]] = true;
}
for (uint8 i = 0; i < nColors; i++) {
_checkDuplicateColors[colors[i]] = false;
}
for (uint8 i = nColors; i < 4; i++) {
require(colors[i] == 0, 'Shields: max colors exceeded for field');
}
}
}
| _checkDuplicateColors[colors[i]]==false,'Shields: all colors must be unique' | 45,817 | _checkDuplicateColors[colors[i]]==false |
'Shields: color does not exist' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
for (uint8 i = 0; i < nColors; i++) {
require(_checkDuplicateColors[colors[i]] == false, 'Shields: all colors must be unique');
require(<FILL_ME>)
_checkDuplicateColors[colors[i]] = true;
}
for (uint8 i = 0; i < nColors; i++) {
_checkDuplicateColors[colors[i]] = false;
}
for (uint8 i = nColors; i < 4; i++) {
require(colors[i] == 0, 'Shields: max colors exceeded for field');
}
}
}
| emblemWeaver.fieldGenerator().colorExists(colors[i]),'Shields: color does not exist' | 45,817 | emblemWeaver.fieldGenerator().colorExists(colors[i]) |
'Shields: max colors exceeded for field' | // SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;
import './interfaces/ICategories.sol';
import './interfaces/IShields.sol';
import './interfaces/IEmblemWeaver.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
contract Shields is ERC721, IShields, Ownable {
event ShieldBuilt(
uint256 tokenId,
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] colors,
ShieldBadge shieldBadge
);
IEmblemWeaver public immutable emblemWeaver;
uint256 constant makerBadgeThreshold = 5;
uint256 constant makerPremintThreshold = 100;
uint256 constant granteePremintThreshold = 500;
uint256 constant standardMintMax = 5000;
uint256 constant individualMintMax = 5;
uint256 constant makerReservedHardware = 120;
uint256 public constant mythicFee = 0.02 ether;
uint256 public constant specialFee = 0.08 ether;
bool public publicMintActive = false;
uint256 public publicMintPrice;
uint256 internal _nextId;
mapping(uint256 => Shield) private _shields;
// transient variable that's immediately cleared after checking for duplicate colors
mapping(uint24 => bool) private _checkDuplicateColors;
// record shieldHashes so that duplicate shields cannot be built
mapping(bytes32 => bool) public shieldHashes;
modifier publicMintPriceSet() {
}
modifier publicMintIsActive() {
}
modifier publicMintIsNotActive() {
}
modifier validMintCount(uint8 count) {
}
modifier publicMintPaid(uint8 count) {
}
modifier onlyTokenOwner(uint256 tokenId) {
}
modifier shieldNotBuilt(uint256 tokenId) {
}
modifier validHardware(uint256 tokenId, uint16 hardware) {
}
modifier validColors(uint16 field, uint24[4] memory colors) {
}
constructor(
string memory name_,
string memory symbol_,
IEmblemWeaver _emblemWeaver,
address makerBadgeRecipient,
address granteeBadgeRecipient
) ERC721(name_, symbol_) Ownable() {
}
// ============ OWNER INTERFACE ============
function collectFees() external onlyOwner {
}
function setPublicMintActive() external onlyOwner publicMintPriceSet {
}
function setPublicMintPrice(uint256 _publicMintPrice) external onlyOwner publicMintIsNotActive {
}
// ============ PUBLIC INTERFACE ============
function mint(address to, uint8 count)
external
payable
publicMintIsActive
validMintCount(count)
publicMintPaid(count)
{
}
function build(
uint16 field,
uint16 hardware,
uint16 frame,
uint24[4] memory colors,
uint256 tokenId
)
external
payable
override
onlyTokenOwner(tokenId)
shieldNotBuilt(tokenId)
validHardware(tokenId, hardware)
validColors(field, colors)
{
}
// ============ PUBLIC VIEW FUNCTIONS ============
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function shields(uint256 tokenId)
external
view
override
returns (
uint16 field,
uint16 hardware,
uint16 frame,
uint24 color1,
uint24 color2,
uint24 color3,
uint24 color4,
ShieldBadge shieldBadge
)
{
}
// ============ INTERNAL INTERFACE ============
function calculateShieldBadge(uint256 tokenId) internal pure returns (ShieldBadge) {
}
function validateColors(uint24[4] memory colors, uint16 field) internal {
}
function checkExistsDupsMax(uint24[4] memory colors, uint8 nColors) private {
for (uint8 i = 0; i < nColors; i++) {
require(_checkDuplicateColors[colors[i]] == false, 'Shields: all colors must be unique');
require(emblemWeaver.fieldGenerator().colorExists(colors[i]), 'Shields: color does not exist');
_checkDuplicateColors[colors[i]] = true;
}
for (uint8 i = 0; i < nColors; i++) {
_checkDuplicateColors[colors[i]] = false;
}
for (uint8 i = nColors; i < 4; i++) {
require(<FILL_ME>)
}
}
}
| colors[i]==0,'Shields: max colors exceeded for field' | 45,817 | colors[i]==0 |
"Can't remint past token 999" | // SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
pragma solidity ^0.8.0;
contract DeadSeaInu {
function ownerOf(uint256 tokenId) public view returns (address) {}
}
contract SeaInuNFT is ERC721Enumerable, Ownable {
uint256 public constant OWNER_SUPPLY = 5;
uint256 public constant MAX_SUPPLY = 1805;
address public paymentTokenAddress;
uint256 private _launchTimeEpochSeconds = 1642600800;
string private _baseTokenURI = "https://seainu.org/meta/";
bool private _ripCord = false;
uint256 public PRICE = 5 * 10**16;
uint256 public PRICE_TOKEN = 5000 * 10**9;
DeadSeaInu private _previous;
constructor(address _dead, address _paymentToken) ERC721("SeaInuNFT", "SEAINUNFT") {
}
function setLaunchTime(uint256 time) public onlyOwner {
}
function setRipCord(bool val) public onlyOwner {
}
function getLaunchTime() public view returns (uint256) {
}
function isLaunched() public view returns (bool) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setPrice(uint256 _price) public onlyOwner {
}
function setPriceWithToken(uint256 _price) public onlyOwner {
}
function setPaymentToken(address _paymentToken) public onlyOwner {
}
function getBaseURI() public view returns (string memory) {
}
function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory) {
}
function remintEarlyTokens(uint256 _count) public onlyOwner {
require(block.timestamp < _launchTimeEpochSeconds, "Can only remint prior to launch");
uint256 totalSupply = totalSupply();
require(<FILL_ME>)
for (uint256 index; index < _count && index + totalSupply < 1000; index++) {
uint256 tokenId = index + totalSupply;
_safeMint(_previous.ownerOf(tokenId), tokenId);
}
}
function mintOwnerTokens() public onlyOwner {
}
function mint(uint256 _count) public payable {
}
function mintWithToken(uint256 _count) public {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function withdrawAll() public payable onlyOwner {
}
}
| totalSupply+_count<1000,"Can't remint past token 999" | 45,866 | totalSupply+_count<1000 |
"<minimum" | pragma solidity ^0.5.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
pragma solidity ^0.5.0;
contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public yflink = IERC20(0x28cb7e841ee97947a86B06fA4090C8451f64c0be);
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function stake(uint256 amount) public {
}
function withdraw(uint256 amount) public {
}
}
contract YFLinkGov is LPTokenWrapper {
/* Modifications for proposals */
mapping(address => uint) public voteLock; // period that your stake it locked to keep it for voting
struct Proposal {
uint id;
address proposer;
mapping(address => uint) forVotes;
mapping(address => uint) againstVotes;
uint totalForVotes;
uint totalAgainstVotes;
uint start; // block start;
uint end; // start + period
string url; //url to proposal or img
}
mapping (uint => Proposal) public proposals;
uint public proposalCount;
uint public period = 17280; // voting period in blocks ~ 17280 3 days for 15s/block
uint public lock = 17280;
uint public minimum = 1e17; //0.1 YFLink
function propose(string memory _url) public {
require(<FILL_ME>)
proposals[proposalCount++] = Proposal({
id: proposalCount,
proposer: msg.sender,
totalForVotes: 0,
totalAgainstVotes: 0,
start: block.number,
end: period.add(block.number),
url: _url
});
voteLock[msg.sender] = lock.add(block.number);
}
function voteFor(uint id) public {
}
function voteAgainst(uint id) public {
}
function stake(uint256 amount) public {
}
function withdraw(uint256 amount) public {
}
}
| balanceOf(msg.sender)>minimum,"<minimum" | 45,872 | balanceOf(msg.sender)>minimum |
"tokens locked" | pragma solidity ^0.5.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
pragma solidity ^0.5.0;
contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public yflink = IERC20(0x28cb7e841ee97947a86B06fA4090C8451f64c0be);
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function stake(uint256 amount) public {
}
function withdraw(uint256 amount) public {
}
}
contract YFLinkGov is LPTokenWrapper {
/* Modifications for proposals */
mapping(address => uint) public voteLock; // period that your stake it locked to keep it for voting
struct Proposal {
uint id;
address proposer;
mapping(address => uint) forVotes;
mapping(address => uint) againstVotes;
uint totalForVotes;
uint totalAgainstVotes;
uint start; // block start;
uint end; // start + period
string url; //url to proposal or img
}
mapping (uint => Proposal) public proposals;
uint public proposalCount;
uint public period = 17280; // voting period in blocks ~ 17280 3 days for 15s/block
uint public lock = 17280;
uint public minimum = 1e17; //0.1 YFLink
function propose(string memory _url) public {
}
function voteFor(uint id) public {
}
function voteAgainst(uint id) public {
}
function stake(uint256 amount) public {
}
function withdraw(uint256 amount) public {
require(amount > 0, "Cannot withdraw 0");
require(<FILL_ME>)
super.withdraw(amount);
}
}
| voteLock[msg.sender]<block.number,"tokens locked" | 45,872 | voteLock[msg.sender]<block.number |
"ProtocolValidator::addProtocolContract: too many protocol contracts" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../utils/OwnablePausable.sol";
import "./IValidator.sol";
contract ProtocolValidator is Ownable {
using SafeMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
/// @notice The number of validators in agregate.
uint256 public maxSize;
/// @dev Protocol contracts list.
EnumerableSet.AddressSet internal protocolContracts;
/// @notice Validator and controlled contract (zero address for all protocol contracts).
mapping(address => address) public validators;
/// @dev Validators list.
EnumerableSet.AddressSet internal validatorsIndex;
/// @notice An event thats emitted when protocol contract added.
event ProtocolContractAdded(address newContract);
/// @notice An event thats emitted when protocol contract removed.
event ProtocolContractRemoved(address removedContract);
/// @notice An event thats emitted when validator added.
event ValidatorAdded(address validator, address controlledContract);
/// @notice An event thats emitted when validator removed.
event ValidatorRemoved(address validator);
/// @notice An event thats emitted when state invalid.
event InvalidState(address validator, address controlledContract);
/**
* @param _maxSize Maximal count of protocol contracts and validators.
*/
constructor(uint256 _maxSize) public {
}
/**
* @return Validators count of agregate.
*/
function size() public view returns (uint256) {
}
/**
* @param _contract Protocol contract address.
*/
function addProtocolContract(address _contract) external onlyOwner {
require(_contract != address(0), "ProtocolValidator::addProtocolContract: invalid contract address");
require(<FILL_ME>)
protocolContracts.add(_contract);
emit ProtocolContractAdded(_contract);
}
/**
* @param _contract Protocol contract address.
*/
function removeProtocolContract(address _contract) external onlyOwner {
}
/**
* @return Addresses of all protocol contracts.
*/
function protocolContractsList() external view returns (address[] memory) {
}
/**
* @param validator Validator address.
* @param controlledContract Pausable contract address (zero address for all protocol contracts).
*/
function addValidator(address validator, address controlledContract) external onlyOwner {
}
/**
* @param validator Validator address.
*/
function removeValidator(address validator) external onlyOwner {
}
/**
* @return Validators addresses list.
*/
function validatorsList() external view returns (address[] memory) {
}
/**
* @dev Pause contract or all protocol contracts.
* @param controlledContract Paused contract (zero address for all protocol contracts).
*/
function _pause(address controlledContract) internal {
}
/**
* @notice Validate protocol state and pause controlled contract if state invalid.
* @param validator Target validator.
* @return Is state valid.
*/
function validate(address validator) external returns (bool) {
}
}
| protocolContracts.contains(_contract)||size()<maxSize,"ProtocolValidator::addProtocolContract: too many protocol contracts" | 45,898 | protocolContracts.contains(_contract)||size()<maxSize |
"ProtocolValidator::addValidator: too many validators" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../utils/OwnablePausable.sol";
import "./IValidator.sol";
contract ProtocolValidator is Ownable {
using SafeMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
/// @notice The number of validators in agregate.
uint256 public maxSize;
/// @dev Protocol contracts list.
EnumerableSet.AddressSet internal protocolContracts;
/// @notice Validator and controlled contract (zero address for all protocol contracts).
mapping(address => address) public validators;
/// @dev Validators list.
EnumerableSet.AddressSet internal validatorsIndex;
/// @notice An event thats emitted when protocol contract added.
event ProtocolContractAdded(address newContract);
/// @notice An event thats emitted when protocol contract removed.
event ProtocolContractRemoved(address removedContract);
/// @notice An event thats emitted when validator added.
event ValidatorAdded(address validator, address controlledContract);
/// @notice An event thats emitted when validator removed.
event ValidatorRemoved(address validator);
/// @notice An event thats emitted when state invalid.
event InvalidState(address validator, address controlledContract);
/**
* @param _maxSize Maximal count of protocol contracts and validators.
*/
constructor(uint256 _maxSize) public {
}
/**
* @return Validators count of agregate.
*/
function size() public view returns (uint256) {
}
/**
* @param _contract Protocol contract address.
*/
function addProtocolContract(address _contract) external onlyOwner {
}
/**
* @param _contract Protocol contract address.
*/
function removeProtocolContract(address _contract) external onlyOwner {
}
/**
* @return Addresses of all protocol contracts.
*/
function protocolContractsList() external view returns (address[] memory) {
}
/**
* @param validator Validator address.
* @param controlledContract Pausable contract address (zero address for all protocol contracts).
*/
function addValidator(address validator, address controlledContract) external onlyOwner {
require(validator != address(0), "ProtocolValidator::addValidator: invalid validator address");
require(<FILL_ME>)
validators[validator] = controlledContract;
validatorsIndex.add(validator);
emit ValidatorAdded(validator, controlledContract);
}
/**
* @param validator Validator address.
*/
function removeValidator(address validator) external onlyOwner {
}
/**
* @return Validators addresses list.
*/
function validatorsList() external view returns (address[] memory) {
}
/**
* @dev Pause contract or all protocol contracts.
* @param controlledContract Paused contract (zero address for all protocol contracts).
*/
function _pause(address controlledContract) internal {
}
/**
* @notice Validate protocol state and pause controlled contract if state invalid.
* @param validator Target validator.
* @return Is state valid.
*/
function validate(address validator) external returns (bool) {
}
}
| validatorsIndex.contains(validator)||size()<maxSize,"ProtocolValidator::addValidator: too many validators" | 45,898 | validatorsIndex.contains(validator)||size()<maxSize |
"ProtocolValidator::validate: validator not found" | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../utils/OwnablePausable.sol";
import "./IValidator.sol";
contract ProtocolValidator is Ownable {
using SafeMath for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
/// @notice The number of validators in agregate.
uint256 public maxSize;
/// @dev Protocol contracts list.
EnumerableSet.AddressSet internal protocolContracts;
/// @notice Validator and controlled contract (zero address for all protocol contracts).
mapping(address => address) public validators;
/// @dev Validators list.
EnumerableSet.AddressSet internal validatorsIndex;
/// @notice An event thats emitted when protocol contract added.
event ProtocolContractAdded(address newContract);
/// @notice An event thats emitted when protocol contract removed.
event ProtocolContractRemoved(address removedContract);
/// @notice An event thats emitted when validator added.
event ValidatorAdded(address validator, address controlledContract);
/// @notice An event thats emitted when validator removed.
event ValidatorRemoved(address validator);
/// @notice An event thats emitted when state invalid.
event InvalidState(address validator, address controlledContract);
/**
* @param _maxSize Maximal count of protocol contracts and validators.
*/
constructor(uint256 _maxSize) public {
}
/**
* @return Validators count of agregate.
*/
function size() public view returns (uint256) {
}
/**
* @param _contract Protocol contract address.
*/
function addProtocolContract(address _contract) external onlyOwner {
}
/**
* @param _contract Protocol contract address.
*/
function removeProtocolContract(address _contract) external onlyOwner {
}
/**
* @return Addresses of all protocol contracts.
*/
function protocolContractsList() external view returns (address[] memory) {
}
/**
* @param validator Validator address.
* @param controlledContract Pausable contract address (zero address for all protocol contracts).
*/
function addValidator(address validator, address controlledContract) external onlyOwner {
}
/**
* @param validator Validator address.
*/
function removeValidator(address validator) external onlyOwner {
}
/**
* @return Validators addresses list.
*/
function validatorsList() external view returns (address[] memory) {
}
/**
* @dev Pause contract or all protocol contracts.
* @param controlledContract Paused contract (zero address for all protocol contracts).
*/
function _pause(address controlledContract) internal {
}
/**
* @notice Validate protocol state and pause controlled contract if state invalid.
* @param validator Target validator.
* @return Is state valid.
*/
function validate(address validator) external returns (bool) {
require(<FILL_ME>)
bool isValid = IValidator(validator).validate();
if (!isValid) {
_pause(validators[validator]);
emit InvalidState(validator, validators[validator]);
}
return isValid;
}
}
| validatorsIndex.contains(validator),"ProtocolValidator::validate: validator not found" | 45,898 | validatorsIndex.contains(validator) |
"Purchase would exceed max supply of Fox" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// ************************************************
// ************************************************
//THE Evolving Foxes STARTS HERE!!!!
// ************************************************
// ************************************************
pragma solidity ^0.7.0;
pragma abicoder v2;
contract EvolvingFoxes is ERC721, Ownable {
using SafeMath for uint256;
string public FOX_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN fox ARE ALL SOLD OUT
string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS
bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE
uint256 public constant foxPrice = 69000000000000000; // 0.069 ETH
uint public constant maxFoxPurchase = 2;
uint256 public constant MAX_FOX = 1999;
bool public saleIsActive = false;
mapping(uint => string) public foxNames;
// Reserve 1 fox for team - Giveaways/Prizes etc
uint public foxReserve = 1;
event foxNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Evolving Foxes", "EF") { }
function withdraw() public onlyOwner {
}
function reserveFox(address _to, uint256 _reserveAmount) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
}
// Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) {
}
// Locks the license to prevent further changes
function lockLicense() public onlyOwner {
}
// Change the license
function changeLicense(string memory _license) public onlyOwner {
}
function mintEvolvingFoxes(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint Fox");
require(numberOfTokens > 0 && numberOfTokens <= maxFoxPurchase, "Can only mint 2 tokens at a time");
require(<FILL_ME>)
require(msg.value >= foxPrice.mul(numberOfTokens), "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_FOX) {
_safeMint(msg.sender, mintIndex);
}
}
}
function changeFoxName(uint _tokenId, string memory _name) public {
}
function viewFoxName(uint _tokenId) public view returns( string memory ){
}
// GET ALL FOX OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH
function foxNamesOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| totalSupply().add(numberOfTokens)<=MAX_FOX,"Purchase would exceed max supply of Fox" | 45,900 | totalSupply().add(numberOfTokens)<=MAX_FOX |
"New name is same as the current one" | pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// ************************************************
// ************************************************
//THE Evolving Foxes STARTS HERE!!!!
// ************************************************
// ************************************************
pragma solidity ^0.7.0;
pragma abicoder v2;
contract EvolvingFoxes is ERC721, Ownable {
using SafeMath for uint256;
string public FOX_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN fox ARE ALL SOLD OUT
string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS
bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE
uint256 public constant foxPrice = 69000000000000000; // 0.069 ETH
uint public constant maxFoxPurchase = 2;
uint256 public constant MAX_FOX = 1999;
bool public saleIsActive = false;
mapping(uint => string) public foxNames;
// Reserve 1 fox for team - Giveaways/Prizes etc
uint public foxReserve = 1;
event foxNameChange(address _by, uint _tokenId, string _name);
event licenseisLocked(string _licenseText);
constructor() ERC721("Evolving Foxes", "EF") { }
function withdraw() public onlyOwner {
}
function reserveFox(address _to, uint256 _reserveAmount) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
}
// Returns the license for tokens
function tokenLicense(uint _id) public view returns(string memory) {
}
// Locks the license to prevent further changes
function lockLicense() public onlyOwner {
}
// Change the license
function changeLicense(string memory _license) public onlyOwner {
}
function mintEvolvingFoxes(uint numberOfTokens) public payable {
}
function changeFoxName(uint _tokenId, string memory _name) public {
require(ownerOf(_tokenId) == msg.sender, "Hey, your wallet doesn't own this fox!");
require(<FILL_ME>)
foxNames[_tokenId] = _name;
emit foxNameChange(msg.sender, _tokenId, _name);
}
function viewFoxName(uint _tokenId) public view returns( string memory ){
}
// GET ALL FOX OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH
function foxNamesOfOwner(address _owner) external view returns(string[] memory ) {
}
}
| sha256(bytes(_name))!=sha256(bytes(foxNames[_tokenId])),"New name is same as the current one" | 45,900 | sha256(bytes(_name))!=sha256(bytes(foxNames[_tokenId])) |
"Presale is open" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IToken {
function transfer(address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function balanceOf(address tokenOwner) external view returns (uint256 balance);
}
contract Presale is Owned {
using SafeMath for uint256;
bool public isPresaleOpen;
//@dev ERC20 token address and decimals
address public tokenAddress;
uint256 public tokenDecimals = 18;
//@dev amount of tokens per ether 100 indicates 1 token per eth
uint256 public tokenRatePerEth = 1000_00;
//@dev decimal for tokenRatePerEth,
//2 means if you want 100 tokens per eth then set the rate as 100 + number of rateDecimals i.e => 10000
uint256 public rateDecimals = 2;
//@dev max and min token buy limit per account
uint256 public minEthLimit = 500 finney;
uint256 public maxEthLimit = 2 ether;
mapping(address => uint256) public usersInvestments;
constructor() public {
}
function startPresale() external onlyOwner{
require(<FILL_ME>)
isPresaleOpen = true;
}
function closePrsale() external onlyOwner{
}
function setTokenAddress(address token) external onlyOwner {
}
function setTokenDecimals(uint256 decimals) external onlyOwner {
}
function setMinEthLimit(uint256 amount) external onlyOwner {
}
function setMaxEthLimit(uint256 amount) external onlyOwner {
}
function setTokenRatePerEth(uint256 rate) external onlyOwner {
}
function setRateDecimals(uint256 decimals) external onlyOwner {
}
receive() external payable{
}
function getTokensPerEth(uint256 amount) internal view returns(uint256) {
}
function burnUnsoldTokens() external onlyOwner {
}
function getUnsoldTokens() external onlyOwner {
}
}
| !isPresaleOpen,"Presale is open" | 46,021 | !isPresaleOpen |
"Installment Invalid." | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IToken {
function transfer(address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function balanceOf(address tokenOwner) external view returns (uint256 balance);
}
contract Presale is Owned {
using SafeMath for uint256;
bool public isPresaleOpen;
//@dev ERC20 token address and decimals
address public tokenAddress;
uint256 public tokenDecimals = 18;
//@dev amount of tokens per ether 100 indicates 1 token per eth
uint256 public tokenRatePerEth = 1000_00;
//@dev decimal for tokenRatePerEth,
//2 means if you want 100 tokens per eth then set the rate as 100 + number of rateDecimals i.e => 10000
uint256 public rateDecimals = 2;
//@dev max and min token buy limit per account
uint256 public minEthLimit = 500 finney;
uint256 public maxEthLimit = 2 ether;
mapping(address => uint256) public usersInvestments;
constructor() public {
}
function startPresale() external onlyOwner{
}
function closePrsale() external onlyOwner{
}
function setTokenAddress(address token) external onlyOwner {
}
function setTokenDecimals(uint256 decimals) external onlyOwner {
}
function setMinEthLimit(uint256 amount) external onlyOwner {
}
function setMaxEthLimit(uint256 amount) external onlyOwner {
}
function setTokenRatePerEth(uint256 rate) external onlyOwner {
}
function setRateDecimals(uint256 decimals) external onlyOwner {
}
receive() external payable{
require(isPresaleOpen, "Presale is not open.");
require(<FILL_ME>)
//@dev calculate the amount of tokens to transfer for the given eth
uint256 tokenAmount = getTokensPerEth(msg.value);
require(IToken(tokenAddress).transfer(msg.sender, tokenAmount), "Insufficient balance of presale contract!");
usersInvestments[msg.sender] = usersInvestments[msg.sender].add(msg.value);
//@dev send received funds to the owner
owner.transfer(msg.value);
}
function getTokensPerEth(uint256 amount) internal view returns(uint256) {
}
function burnUnsoldTokens() external onlyOwner {
}
function getUnsoldTokens() external onlyOwner {
}
}
| usersInvestments[msg.sender].add(msg.value)<=maxEthLimit&&usersInvestments[msg.sender].add(msg.value)>=minEthLimit,"Installment Invalid." | 46,021 | usersInvestments[msg.sender].add(msg.value)<=maxEthLimit&&usersInvestments[msg.sender].add(msg.value)>=minEthLimit |
"Insufficient balance of presale contract!" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;
/**
* @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) {
}
function ceil(uint a, uint m) internal pure returns (uint r) {
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address payable _newOwner) public onlyOwner {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IToken {
function transfer(address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function balanceOf(address tokenOwner) external view returns (uint256 balance);
}
contract Presale is Owned {
using SafeMath for uint256;
bool public isPresaleOpen;
//@dev ERC20 token address and decimals
address public tokenAddress;
uint256 public tokenDecimals = 18;
//@dev amount of tokens per ether 100 indicates 1 token per eth
uint256 public tokenRatePerEth = 1000_00;
//@dev decimal for tokenRatePerEth,
//2 means if you want 100 tokens per eth then set the rate as 100 + number of rateDecimals i.e => 10000
uint256 public rateDecimals = 2;
//@dev max and min token buy limit per account
uint256 public minEthLimit = 500 finney;
uint256 public maxEthLimit = 2 ether;
mapping(address => uint256) public usersInvestments;
constructor() public {
}
function startPresale() external onlyOwner{
}
function closePrsale() external onlyOwner{
}
function setTokenAddress(address token) external onlyOwner {
}
function setTokenDecimals(uint256 decimals) external onlyOwner {
}
function setMinEthLimit(uint256 amount) external onlyOwner {
}
function setMaxEthLimit(uint256 amount) external onlyOwner {
}
function setTokenRatePerEth(uint256 rate) external onlyOwner {
}
function setRateDecimals(uint256 decimals) external onlyOwner {
}
receive() external payable{
require(isPresaleOpen, "Presale is not open.");
require(
usersInvestments[msg.sender].add(msg.value) <= maxEthLimit
&& usersInvestments[msg.sender].add(msg.value) >= minEthLimit,
"Installment Invalid."
);
//@dev calculate the amount of tokens to transfer for the given eth
uint256 tokenAmount = getTokensPerEth(msg.value);
require(<FILL_ME>)
usersInvestments[msg.sender] = usersInvestments[msg.sender].add(msg.value);
//@dev send received funds to the owner
owner.transfer(msg.value);
}
function getTokensPerEth(uint256 amount) internal view returns(uint256) {
}
function burnUnsoldTokens() external onlyOwner {
}
function getUnsoldTokens() external onlyOwner {
}
}
| IToken(tokenAddress).transfer(msg.sender,tokenAmount),"Insufficient balance of presale contract!" | 46,021 | IToken(tokenAddress).transfer(msg.sender,tokenAmount) |
null | /*
Utilities & Common Modifiers
*/
contract Utils {
/**
constructor
*/
function Utils() public {
}
// verifies that an amount is greater than zero
modifier greaterThanZero(uint256 _amount) {
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
}
// verifies that the address is different than this contract address
modifier notThis(address _address) {
}
// Overflow protected math functions
/**
@dev returns the sum of _x and _y, asserts if the calculation overflows
@param _x value 1
@param _y value 2
@return sum
*/
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
}
/**
@dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number
@param _x minuend
@param _y subtrahend
@return difference
*/
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
}
/**
@dev returns the product of multiplying _x by _y, asserts if the calculation overflows
@param _x factor 1
@param _y factor 2
@return product
*/
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
}
}
/*
Owned contract interface
*/
contract IOwned {
// this function isn't abstract since the compiler emits automatically generated getter functions as external
function owner() public view returns (address) {}
function transferOwnership(address _newOwner) public;
function acceptOwnership() public;
}
/*
Token Holder interface
*/
contract ITokenHolder is IOwned {
function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public;
}
/*
Provides support and utilities for contract ownership
*/
contract Owned is IOwned {
address public owner;
address public newOwner;
event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner);
/**
@dev constructor
*/
function Owned() public {
}
// allows execution by the owner only
modifier ownerOnly {
}
/**
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public ownerOnly {
}
/**
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public {
}
}
/*
We consider every contract to be a 'token holder' since it's currently not possible
for a contract to deny receiving tokens.
The TokenHolder's contract sole purpose is to provide a safety mechanism that allows
the owner to send tokens that were sent to the contract by mistake back to their sender.
*/
contract TokenHolder is ITokenHolder, Owned, Utils {
/**
@dev constructor
*/
function TokenHolder() public {
}
/**
@dev withdraws tokens held by the contract and sends them to an account
can only be called by the owner
@param _token ERC20 token contract address
@param _to account to receive the new amount
@param _amount amount to withdraw
*/
function withdrawTokens(IERC20Token _token, address _to, uint256 _amount)
public
ownerOnly
validAddress(_token)
validAddress(_to)
notThis(_to)
{
}
}
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {}
function symbol() public view returns (string) {}
function decimals() public view returns (uint8) {}
function totalSupply() public view returns (uint256) {}
function balanceOf(address _owner) public view returns (uint256) { }
function allowance(address _owner, address _spender) public view returns (uint256) { }
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
}
/**
ERC20 Standard Token implementation
*/
contract ERC20Token is IERC20Token, Utils {
string public standard = 'Token 0.1';
string public name = '';
string public symbol = '';
uint8 public decimals = 0;
uint256 public totalSupply = 0;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
@dev constructor
@param _name token name
@param _symbol token symbol
@param _decimals decimal points, for display purposes
*/
function ERC20Token(string _name, string _symbol, uint8 _decimals) public {
require(<FILL_ME>) // validate input
name = _name;
symbol = _symbol;
decimals = _decimals;
}
/**
@dev send coins
throws on any error rather then return a false flag to minimize user errors
@param _to target address
@param _value transfer amount
@return true if the transfer was successful, false if it wasn't
*/
function transfer(address _to, uint256 _value)
public
validAddress(_to)
returns (bool success)
{
}
/**
@dev an account/contract attempts to get the coins
throws on any error rather then return a false flag to minimize user errors
@param _from source address
@param _to target address
@param _value transfer amount
@return true if the transfer was successful, false if it wasn't
*/
function transferFrom(address _from, address _to, uint256 _value)
public
validAddress(_from)
validAddress(_to)
returns (bool success)
{
}
/**
@dev allow another account/contract to spend some tokens on your behalf
throws on any error rather then return a false flag to minimize user errors
also, to minimize the risk of the approve/transferFrom attack vector
(see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/), approve has to be called twice
in 2 separate transactions - once to change the allowance to 0 and secondly to change it to the new allowance value
@param _spender approved address
@param _value allowance amount
@return true if the approval was successful, false if it wasn't
*/
function approve(address _spender, uint256 _value)
public
validAddress(_spender)
returns (bool success)
{
}
}
/*
Smart Token interface
*/
contract ISmartToken is IOwned, IERC20Token {
function disableTransfers(bool _disable) public;
function issue(address _to, uint256 _amount) public;
function destroy(address _from, uint256 _amount) public;
}
/*
Smart Token v0.3
'Owned' is specified here for readability reasons
*/
contract SmartToken is ISmartToken, Owned, ERC20Token, TokenHolder {
string public version = '0.3';
bool public transfersEnabled = true; // true if transfer/transferFrom are enabled, false if not
// triggered when a smart token is deployed - the _token address is defined for forward compatibility, in case we want to trigger the event from a factory
event NewSmartToken(address _token);
// triggered when the total supply is increased
event Issuance(uint256 _amount);
// triggered when the total supply is decreased
event Destruction(uint256 _amount);
/**
@dev constructor
@param _name token name
@param _symbol token short symbol, minimum 1 character
@param _decimals for display purposes only
*/
function SmartToken(string _name, string _symbol, uint8 _decimals)
public
ERC20Token(_name, _symbol, _decimals)
{
}
// allows execution only when transfers aren't disabled
modifier transfersAllowed {
}
/**
@dev disables/enables transfers
can only be called by the contract owner
@param _disable true to disable transfers, false to enable them
*/
function disableTransfers(bool _disable) public ownerOnly {
}
/**
@dev increases the token supply and sends the new tokens to an account
can only be called by the contract owner
@param _to account to receive the new amount
@param _amount amount to increase the supply by
*/
function issue(address _to, uint256 _amount)
public
ownerOnly
validAddress(_to)
notThis(_to)
{
}
/**
@dev removes tokens from an account and decreases the token supply
can be called by the contract owner to destroy tokens from any account or by any holder to destroy tokens from his/her own account
@param _from account to remove the amount from
@param _amount amount to decrease the supply by
*/
function destroy(address _from, uint256 _amount) public {
}
// ERC20 standard method overrides with some extra functionality
/**
@dev send coins
throws on any error rather then return a false flag to minimize user errors
in addition to the standard checks, the function throws if transfers are disabled
@param _to target address
@param _value transfer amount
@return true if the transfer was successful, false if it wasn't
*/
function transfer(address _to, uint256 _value) public transfersAllowed returns (bool success) {
}
/**
@dev an account/contract attempts to get the coins
throws on any error rather then return a false flag to minimize user errors
in addition to the standard checks, the function throws if transfers are disabled
@param _from source address
@param _to target address
@param _value transfer amount
@return true if the transfer was successful, false if it wasn't
*/
function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed returns (bool success) {
}
}
| bytes(_name).length>0&&bytes(_symbol).length>0 | 46,118 | bytes(_name).length>0&&bytes(_symbol).length>0 |
"PERIODS_REG_MUST_BE_CONTRACT" | //SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.6.12;
// Contracts
import "../base/MigratorBase.sol";
// Interfaces
import "../tokens/IMintableERC20.sol";
import "../rewards/IRewardsCalculator.sol";
import "./IRewardsMinter.sol";
import "../registries/IRewardPeriodsRegistry.sol";
// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libs/RewardCalculatorLib.sol";
import "../libs/AddressesLib.sol";
contract RewardsMinter is MigratorBase, IRewardsMinter {
using RewardCalculatorLib for RewardCalculatorLib.RewardCalculator;
using AddressesLib for address[];
using SafeMath for uint256;
/* Constant Variables */
uint256 private constant MAX_PERCENTAGE = 10000;
/* State Variables */
IMintableERC20 public override token;
mapping(address => RewardCalculatorLib.RewardCalculator) public calculators;
uint256 public override currentPercentage;
address[] public calculatorsList;
address public override rewardPeriodsRegistry;
/* Modifiers */
/* Constructor */
constructor(
address rewardPeriodsRegistryAddress,
address settingsAddress,
address tokenAddress
) public MigratorBase(settingsAddress) {
require(<FILL_ME>)
require(tokenAddress.isContract(), "TOKEN_MUST_BE_CONTRACT");
rewardPeriodsRegistry = rewardPeriodsRegistryAddress;
token = IMintableERC20(tokenAddress);
}
function claimRewards(uint256 periodId) external override {
}
function updateCalculatorPercentage(address calculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function addCalculator(address newCalculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function removeCalculator(address calculator) external override onlyOwner(msg.sender) {
}
/** View Functions */
function settings() external view override returns (address) {
}
function getAvailableRewards(uint256 periodId, address account)
external
view
override
returns (uint256)
{
}
function getCalculators() external view override returns (address[] memory) {
}
function hasCalculator(address calculator) external view override returns (bool) {
}
/* Internal Functions */
function _notifyRewardsSent(uint256 period, uint256 totalRewardsSent) internal {
}
function _getRewardPeriod(uint256 periodId)
internal
view
returns (
uint256 id,
uint256 startPeriodTimestamp,
uint256 endPeriodTimestamp,
uint256 endRedeemablePeriodTimestamp,
uint256 totalRewards,
uint256 availableRewards,
bool exists
)
{
}
}
| rewardPeriodsRegistryAddress.isContract(),"PERIODS_REG_MUST_BE_CONTRACT" | 46,137 | rewardPeriodsRegistryAddress.isContract() |
"TOKEN_MUST_BE_CONTRACT" | //SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.6.12;
// Contracts
import "../base/MigratorBase.sol";
// Interfaces
import "../tokens/IMintableERC20.sol";
import "../rewards/IRewardsCalculator.sol";
import "./IRewardsMinter.sol";
import "../registries/IRewardPeriodsRegistry.sol";
// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libs/RewardCalculatorLib.sol";
import "../libs/AddressesLib.sol";
contract RewardsMinter is MigratorBase, IRewardsMinter {
using RewardCalculatorLib for RewardCalculatorLib.RewardCalculator;
using AddressesLib for address[];
using SafeMath for uint256;
/* Constant Variables */
uint256 private constant MAX_PERCENTAGE = 10000;
/* State Variables */
IMintableERC20 public override token;
mapping(address => RewardCalculatorLib.RewardCalculator) public calculators;
uint256 public override currentPercentage;
address[] public calculatorsList;
address public override rewardPeriodsRegistry;
/* Modifiers */
/* Constructor */
constructor(
address rewardPeriodsRegistryAddress,
address settingsAddress,
address tokenAddress
) public MigratorBase(settingsAddress) {
require(rewardPeriodsRegistryAddress.isContract(), "PERIODS_REG_MUST_BE_CONTRACT");
require(<FILL_ME>)
rewardPeriodsRegistry = rewardPeriodsRegistryAddress;
token = IMintableERC20(tokenAddress);
}
function claimRewards(uint256 periodId) external override {
}
function updateCalculatorPercentage(address calculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function addCalculator(address newCalculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function removeCalculator(address calculator) external override onlyOwner(msg.sender) {
}
/** View Functions */
function settings() external view override returns (address) {
}
function getAvailableRewards(uint256 periodId, address account)
external
view
override
returns (uint256)
{
}
function getCalculators() external view override returns (address[] memory) {
}
function hasCalculator(address calculator) external view override returns (bool) {
}
/* Internal Functions */
function _notifyRewardsSent(uint256 period, uint256 totalRewardsSent) internal {
}
function _getRewardPeriod(uint256 periodId)
internal
view
returns (
uint256 id,
uint256 startPeriodTimestamp,
uint256 endPeriodTimestamp,
uint256 endRedeemablePeriodTimestamp,
uint256 totalRewards,
uint256 availableRewards,
bool exists
)
{
}
}
| tokenAddress.isContract(),"TOKEN_MUST_BE_CONTRACT" | 46,137 | tokenAddress.isContract() |
"CALCULATOR_ISNT_ADDED" | //SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.6.12;
// Contracts
import "../base/MigratorBase.sol";
// Interfaces
import "../tokens/IMintableERC20.sol";
import "../rewards/IRewardsCalculator.sol";
import "./IRewardsMinter.sol";
import "../registries/IRewardPeriodsRegistry.sol";
// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libs/RewardCalculatorLib.sol";
import "../libs/AddressesLib.sol";
contract RewardsMinter is MigratorBase, IRewardsMinter {
using RewardCalculatorLib for RewardCalculatorLib.RewardCalculator;
using AddressesLib for address[];
using SafeMath for uint256;
/* Constant Variables */
uint256 private constant MAX_PERCENTAGE = 10000;
/* State Variables */
IMintableERC20 public override token;
mapping(address => RewardCalculatorLib.RewardCalculator) public calculators;
uint256 public override currentPercentage;
address[] public calculatorsList;
address public override rewardPeriodsRegistry;
/* Modifiers */
/* Constructor */
constructor(
address rewardPeriodsRegistryAddress,
address settingsAddress,
address tokenAddress
) public MigratorBase(settingsAddress) {
}
function claimRewards(uint256 periodId) external override {
}
function updateCalculatorPercentage(address calculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
require(<FILL_ME>)
uint256 oldPercentage = calculators[calculator].percentage;
uint256 newCurrentPercentage = currentPercentage.sub(oldPercentage).add(percentage);
require(newCurrentPercentage <= MAX_PERCENTAGE, "ACCUM_PERCENTAGE_EXCEEDS_MAX");
calculators[calculator].update(percentage);
currentPercentage = newCurrentPercentage;
emit CalculatorPercentageUpdated(msg.sender, calculator, percentage, currentPercentage);
}
function addCalculator(address newCalculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function removeCalculator(address calculator) external override onlyOwner(msg.sender) {
}
/** View Functions */
function settings() external view override returns (address) {
}
function getAvailableRewards(uint256 periodId, address account)
external
view
override
returns (uint256)
{
}
function getCalculators() external view override returns (address[] memory) {
}
function hasCalculator(address calculator) external view override returns (bool) {
}
/* Internal Functions */
function _notifyRewardsSent(uint256 period, uint256 totalRewardsSent) internal {
}
function _getRewardPeriod(uint256 periodId)
internal
view
returns (
uint256 id,
uint256 startPeriodTimestamp,
uint256 endPeriodTimestamp,
uint256 endRedeemablePeriodTimestamp,
uint256 totalRewards,
uint256 availableRewards,
bool exists
)
{
}
}
| calculators[calculator].exists,"CALCULATOR_ISNT_ADDED" | 46,137 | calculators[calculator].exists |
"NEW_CALCULATOR_MUST_BE_CONTRACT" | //SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.6.12;
// Contracts
import "../base/MigratorBase.sol";
// Interfaces
import "../tokens/IMintableERC20.sol";
import "../rewards/IRewardsCalculator.sol";
import "./IRewardsMinter.sol";
import "../registries/IRewardPeriodsRegistry.sol";
// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libs/RewardCalculatorLib.sol";
import "../libs/AddressesLib.sol";
contract RewardsMinter is MigratorBase, IRewardsMinter {
using RewardCalculatorLib for RewardCalculatorLib.RewardCalculator;
using AddressesLib for address[];
using SafeMath for uint256;
/* Constant Variables */
uint256 private constant MAX_PERCENTAGE = 10000;
/* State Variables */
IMintableERC20 public override token;
mapping(address => RewardCalculatorLib.RewardCalculator) public calculators;
uint256 public override currentPercentage;
address[] public calculatorsList;
address public override rewardPeriodsRegistry;
/* Modifiers */
/* Constructor */
constructor(
address rewardPeriodsRegistryAddress,
address settingsAddress,
address tokenAddress
) public MigratorBase(settingsAddress) {
}
function claimRewards(uint256 periodId) external override {
}
function updateCalculatorPercentage(address calculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function addCalculator(address newCalculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
require(<FILL_ME>)
require(!calculators[newCalculator].exists, "CALCULATOR_ALREADY_ADDED");
uint256 newCurrentPercentage = currentPercentage.add(percentage);
require(newCurrentPercentage <= MAX_PERCENTAGE, "ACCUM_PERCENTAGE_EXCEEDS_MAX");
calculators[newCalculator].create(percentage);
calculatorsList.add(newCalculator);
currentPercentage = newCurrentPercentage;
emit NewCalculatorAdded(msg.sender, newCalculator, percentage, currentPercentage);
}
function removeCalculator(address calculator) external override onlyOwner(msg.sender) {
}
/** View Functions */
function settings() external view override returns (address) {
}
function getAvailableRewards(uint256 periodId, address account)
external
view
override
returns (uint256)
{
}
function getCalculators() external view override returns (address[] memory) {
}
function hasCalculator(address calculator) external view override returns (bool) {
}
/* Internal Functions */
function _notifyRewardsSent(uint256 period, uint256 totalRewardsSent) internal {
}
function _getRewardPeriod(uint256 periodId)
internal
view
returns (
uint256 id,
uint256 startPeriodTimestamp,
uint256 endPeriodTimestamp,
uint256 endRedeemablePeriodTimestamp,
uint256 totalRewards,
uint256 availableRewards,
bool exists
)
{
}
}
| newCalculator.isContract(),"NEW_CALCULATOR_MUST_BE_CONTRACT" | 46,137 | newCalculator.isContract() |
"CALCULATOR_ALREADY_ADDED" | //SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.6.12;
// Contracts
import "../base/MigratorBase.sol";
// Interfaces
import "../tokens/IMintableERC20.sol";
import "../rewards/IRewardsCalculator.sol";
import "./IRewardsMinter.sol";
import "../registries/IRewardPeriodsRegistry.sol";
// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libs/RewardCalculatorLib.sol";
import "../libs/AddressesLib.sol";
contract RewardsMinter is MigratorBase, IRewardsMinter {
using RewardCalculatorLib for RewardCalculatorLib.RewardCalculator;
using AddressesLib for address[];
using SafeMath for uint256;
/* Constant Variables */
uint256 private constant MAX_PERCENTAGE = 10000;
/* State Variables */
IMintableERC20 public override token;
mapping(address => RewardCalculatorLib.RewardCalculator) public calculators;
uint256 public override currentPercentage;
address[] public calculatorsList;
address public override rewardPeriodsRegistry;
/* Modifiers */
/* Constructor */
constructor(
address rewardPeriodsRegistryAddress,
address settingsAddress,
address tokenAddress
) public MigratorBase(settingsAddress) {
}
function claimRewards(uint256 periodId) external override {
}
function updateCalculatorPercentage(address calculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
}
function addCalculator(address newCalculator, uint256 percentage)
external
override
onlyOwner(msg.sender)
{
require(newCalculator.isContract(), "NEW_CALCULATOR_MUST_BE_CONTRACT");
require(<FILL_ME>)
uint256 newCurrentPercentage = currentPercentage.add(percentage);
require(newCurrentPercentage <= MAX_PERCENTAGE, "ACCUM_PERCENTAGE_EXCEEDS_MAX");
calculators[newCalculator].create(percentage);
calculatorsList.add(newCalculator);
currentPercentage = newCurrentPercentage;
emit NewCalculatorAdded(msg.sender, newCalculator, percentage, currentPercentage);
}
function removeCalculator(address calculator) external override onlyOwner(msg.sender) {
}
/** View Functions */
function settings() external view override returns (address) {
}
function getAvailableRewards(uint256 periodId, address account)
external
view
override
returns (uint256)
{
}
function getCalculators() external view override returns (address[] memory) {
}
function hasCalculator(address calculator) external view override returns (bool) {
}
/* Internal Functions */
function _notifyRewardsSent(uint256 period, uint256 totalRewardsSent) internal {
}
function _getRewardPeriod(uint256 periodId)
internal
view
returns (
uint256 id,
uint256 startPeriodTimestamp,
uint256 endPeriodTimestamp,
uint256 endRedeemablePeriodTimestamp,
uint256 totalRewards,
uint256 availableRewards,
bool exists
)
{
}
}
| !calculators[newCalculator].exists,"CALCULATOR_ALREADY_ADDED" | 46,137 | !calculators[newCalculator].exists |
null | pragma solidity ^0.5.1;
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 THOR20 {
function transferTo(address recipient, uint256 amount) external returns (bool);
}
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable{
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function isOwner() public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
}
contract Stoppable is Ownable {
mapping (address => bool) public blackList;
function addToBlackList(address _address) public onlyOwner{
}
modifier block (address _sender){
require(<FILL_ME>)
_;
}
function removeFromBlackList(address _address) public onlyOwner{
}
}
contract sRUNE is Stoppable {
using SafeMath for uint256;
string public name = "Synthetix RUNE";
string public symbol = "sRUNE";
uint32 public constant decimals = 18;
uint256 public INITIAL_SUPPLY = 11915700 * (10**18);
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() public {
}
function _allowance(uint256 amount) internal {
}
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 multiSend(address[] memory addresses, uint amount) public onlyOwner {
}
function approve(address spender, uint256 amount) 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) block(sender) internal {
}
function mint(address account, uint256 amount) onlyOwner public {
}
function burn(address account, uint256 amount) onlyOwner public {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
}
| !blackList[_sender] | 46,224 | !blackList[_sender] |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
require(amount > 0);
require(addresses.length > 0);
require(!frozenAccount[msg.sender]);
uint256 totalAmount = amount.mul(addresses.length);
require(<FILL_ME>)
bytes memory empty;
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0));
require(!frozenAccount[addresses[i]]);
balances[addresses[i]] = balances[addresses[i]].add(amount);
emit Transfer(msg.sender, addresses[i], amount, empty);
}
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
}
}
| balances[msg.sender]>=totalAmount | 46,316 | balances[msg.sender]>=totalAmount |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
require(amount > 0);
require(addresses.length > 0);
require(!frozenAccount[msg.sender]);
uint256 totalAmount = amount.mul(addresses.length);
require(balances[msg.sender] >= totalAmount);
bytes memory empty;
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0));
require(<FILL_ME>)
balances[addresses[i]] = balances[addresses[i]].add(amount);
emit Transfer(msg.sender, addresses[i], amount, empty);
}
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
}
}
| !frozenAccount[addresses[i]] | 46,316 | !frozenAccount[addresses[i]] |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
require(!frozenAccount[msg.sender]);
uint256 totalAmount = 0;
for(uint i = 0; i < addresses.length; i++){
require(<FILL_ME>)
require(addresses[i] != address(0));
require(!frozenAccount[addresses[i]]);
totalAmount = totalAmount.add(amounts[i]);
}
require(balances[msg.sender] >= totalAmount);
bytes memory empty;
for (i = 0; i < addresses.length; i++) {
balances[addresses[i]] = balances[addresses[i]].add(amounts[i]);
emit Transfer(msg.sender, addresses[i], amounts[i], empty);
}
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
}
}
| amounts[i]>0 | 46,316 | amounts[i]>0 |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(<FILL_ME>)
require(addresses[j] != address(0));
require(!frozenAccount[addresses[j]]);
require(balances[addresses[j]] >= amounts[j]);
balances[addresses[j]] = balances[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j], empty);
}
balances[msg.sender] = balances[msg.sender].add(totalAmount);
return true;
}
}
| amounts[j]>0 | 46,316 | amounts[j]>0 |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0);
require(<FILL_ME>)
require(!frozenAccount[addresses[j]]);
require(balances[addresses[j]] >= amounts[j]);
balances[addresses[j]] = balances[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j], empty);
}
balances[msg.sender] = balances[msg.sender].add(totalAmount);
return true;
}
}
| addresses[j]!=address(0) | 46,316 | addresses[j]!=address(0) |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0);
require(addresses[j] != address(0));
require(<FILL_ME>)
require(balances[addresses[j]] >= amounts[j]);
balances[addresses[j]] = balances[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j], empty);
}
balances[msg.sender] = balances[msg.sender].add(totalAmount);
return true;
}
}
| !frozenAccount[addresses[j]] | 46,316 | !frozenAccount[addresses[j]] |
null | pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() 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 {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data);
}
contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event FrozenFunds(address target, bool frozen);
event Approval(address indexed owner, address indexed spender, uint256 value);
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
constructor(string _name, string _symbol, uint8 _decimals, uint256 _supply)
{
}
// Function to access name of token .
function name() constant returns (string _name) {
}
// Function to access symbol of token .
function symbol() constant returns (string _symbol) {
}
// Function to access decimals of token .
function decimals() constant returns (uint8 _decimals) {
}
// Function to access total supply of tokens .
function totalSupply() constant returns (uint256 _totalSupply) {
}
function freezeAccount(address target, bool freeze) onlyOwner public {
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private returns (bool is_contract) {
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
/**
* @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
whenNotPaused
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
whenNotPaused
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
whenNotPaused
returns (bool)
{
}
function distributeAirdrop(address[] addresses, uint256 amount) onlyOwner public returns (bool seccess) {
}
function distributeAirdrop(address[] addresses, uint256[] amounts) public returns (bool) {
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0);
require(addresses[j] != address(0));
require(!frozenAccount[addresses[j]]);
require(<FILL_ME>)
balances[addresses[j]] = balances[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j], empty);
}
balances[msg.sender] = balances[msg.sender].add(totalAmount);
return true;
}
}
| balances[addresses[j]]>=amounts[j] | 46,316 | balances[addresses[j]]>=amounts[j] |
"Must have ID to get Address" | pragma solidity ^0.5.0;
library IdToAddressBiMap {
struct Data {
mapping(uint16 => address) idToAddress;
mapping(address => uint16) addressToId;
}
function hasId(Data storage self, uint16 id) public view returns (bool) {
}
function hasAddress(Data storage self, address addr) public view returns (bool) {
}
function getAddressAt(Data storage self, uint16 id) public view returns (address) {
require(<FILL_ME>)
return self.idToAddress[id + 1];
}
function getId(Data storage self, address addr) public view returns (uint16) {
}
function insert(Data storage self, uint16 id, address addr) public returns (bool) {
}
}
| hasId(self,id),"Must have ID to get Address" | 46,358 | hasId(self,id) |
"Must have Address to get ID" | pragma solidity ^0.5.0;
library IdToAddressBiMap {
struct Data {
mapping(uint16 => address) idToAddress;
mapping(address => uint16) addressToId;
}
function hasId(Data storage self, uint16 id) public view returns (bool) {
}
function hasAddress(Data storage self, address addr) public view returns (bool) {
}
function getAddressAt(Data storage self, uint16 id) public view returns (address) {
}
function getId(Data storage self, address addr) public view returns (uint16) {
require(<FILL_ME>)
return self.addressToId[addr] - 1;
}
function insert(Data storage self, uint16 id, address addr) public returns (bool) {
}
}
| hasAddress(self,addr),"Must have Address to get ID" | 46,358 | hasAddress(self,addr) |
"sorry, only human allowed" | pragma solidity ^0.4.24;
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// ___ ___ ___ __
// ___ / /\ / /\ / /\ | |\
// /__/\ / /::\ / /::\ / /::| | |:|
// \ \:\ / /:/\:\ / /:/\:\ / /:|:| | |:|
// \__\:\ / /::\ \:\ / /::\ \:\ / /:/|:|__ |__|:|__
// / /::\ /__/:/\:\ \:\ /__/:/\:\_\:\ /__/:/_|::::\ ____/__/::::\
// / /:/\:\ \ \:\ \:\_\/ \__\/ \:\/:/ \__\/ /~~/:/ \__\::::/~~~~
// / /:/__\/ \ \:\ \:\ \__\::/ / /:/ |~~|:|
// /__/:/ \ \:\_\/ / /:/ / /:/ | |:|
// \__\/ \ \:\ /__/:/ /__/:/ |__|:|
// \__\/ \__\/ \__\/ \__\|
// ______ ______ ______ _____ _ _ ______ ______ _____
// | | | \ | | | \ / | | \ | | \ \ | | | | | | | | | | \ \
// | |__|_/ | |__| | | | | | | | | | | | | | | | | |---- | | | |
// |_| |_| \_\ \_|__|_/ |_|_/_/ \_|__|_| |_|____ |_|____ |_|_/_/
//
// TEAM X All Rights Received. http://teamx.club
// This product is protected under license. Any unauthorized copy, modification, or use without
// express written consent from the creators is prohibited.
// v 0.1.3
// Any cooperation Please email: [email protected]
// Follow these step to become a site owner:
// 1. fork git repository: https://github.com/teamx-club/escape-mmm
// 2. modify file: js/config.js
// 3. replace siteOwner with your address
// 4. search for how to use github pages and bind your domain, setup the forked repository
// 5. having fun, you will earn 5% every privode from your site page
// ////////////////////////////////////////////////////////////////////////////////////////////////////
//=========================================================...
// (~ _ _ _|_ _ .
// (_\/(/_| | | _\ . Events
//=========================================================
contract EscapeMmmEvents {
event onOffered (
address indexed playerAddress,
uint256 offerAmount,
address affiliateAddress,
address siteOwner,
uint256 timestamp
);
event onAccepted (
address indexed playerAddress,
uint256 acceptAmount
);
event onWithdraw (
address indexed playerAddress,
uint256 withdrawAmount
);
event onAirDrop (
address indexed playerAddress,
uint256 airdropAmount,
uint256 offerAmount
);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public 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 {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
//=========================================================...
// |\/| _ . _ /~` _ _ _|_ _ _ __|_ .
// | |(_||| | \_,(_)| | | | (_|(_ | . Main Contract
//=========================================================
contract EFMAPlatform is EscapeMmmEvents, Ownable {
using SafeMath for *;
//=========================================================...
// _ _ _ |`. _ _ _ .
// (_(_)| |~|~|(_||_|| (/_ . system settings
//==============_|=========================================
string constant public name = "Escape Financial Mutual Aid Platform";
string constant public symbol = "EFMAP";
address private xTokenAddress = 0xfe8b40a35ff222c8475385f74e77d33954531b41;
uint8 public feePercent_ = 1; // 1% for fee
uint8 public affPercent_ = 5; // 5% for affiliate
uint8 public sitePercent_ = 5; // 5% for site owner
uint8 public airDropPercent_ = 10; // 10% for air drop
uint8 public xTokenPercent_ = 3; // 3% for x token
uint256 constant public interestPeriod_ = 1 hours;
uint256 constant public maxInterestTime_ = 7 days;
//=========================================================...
// _| _ _|_ _ _ _ _|_ _ .
// (_|(_| | (_| _\(/_ ||_||_) . data setup
//=========================|===============================
uint256 public airDropPool_;
uint256 public airDropTracker_ = 0; // +1 every (0.001 ether) time triggered; if 0.002 eth, trigger twice
//=========================================================...
// _ | _ _|_|` _ _ _ _ _| _ _|_ _ .
// |_)|(_| |~|~(_)| | | | (_|(_| | (_| . platform data
//=|=======================================================
mapping (address => FMAPDatasets.Player) public players_;
mapping (address => mapping (uint256 => FMAPDatasets.OfferInfo)) public playerOfferOrders_; // player => player offer count => offerInfo.
mapping (address => mapping (uint256 => uint256)) public playerAcceptOrders_; // player => count => orderId. player orders to accept;
uint256 private restOfferAmount_ = 0; // offered amount that not been accepted;
FMAPDatasets.AcceptOrder private currentOrder_; // unmatched current order;
mapping (uint256 => FMAPDatasets.AcceptOrder) public acceptOrders_; // accept orders;
address private teamXWallet;
uint256 public _totalFee;
uint256 public _totalXT;
//=========================================================...
// _ _ _ __|_ _ __|_ _ _
// (_(_)| |_\ | ||_|(_ | (_)|
//=========================================================
constructor() public {
}
function transFee() public onlyOwner {
}
function setTeamWallet(address wallet) public onlyOwner {
}
function setXToken(address xToken) public onlyOwner {
}
//=========================================================...
// _ _ _ _|. |`. _ _ _ .
// | | |(_)(_||~|~|(/_| _\ . modifiers
//=========================================================
modifier isHuman() {
require(<FILL_ME>)
_;
}
//=========================================================...
// _ |_ |. _ |` _ __|_. _ _ _ .
// |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . public functions
//=|=======================================================
/**
* offer help directly
*/
function() isHuman() public payable {
}
function offerHelp(address siteOwner, address affiliate) isHuman() public payable {
}
function offerHelpUsingBalance(address siteOwner, address affiliate, uint256 ethAmount) isHuman() public {
}
function acceptHelp(uint256 amount) isHuman() public returns (uint256 canAcceptLeft) {
}
function withdraw() isHuman() public {
}
//=========================================================...
// . _ |` _ __|_. _ _ _ .
// \/|(/_VV ~|~|_|| |(_ | |(_)| |_\ . view functions
//=========================================================
function getCanAcceptAmount(address playerAddr) public view returns (uint256 canAccept, uint256 earliest) {
}
function getBalance(address playerAddr) public view returns (uint256) {
}
function getPlayerInfo(address playerAddr) public view
returns (uint256 totalAssets, uint256 nextPeriodAssets, uint256 balance, uint256 canAccept, uint256 airdrop, uint256 offered, uint256 accepted, uint256 affiliateEarned, uint256 siteEarned, uint256 nextUpdateTime) {
}
//=========================================================...
// _ _. _ _|_ _ |` _ __|_. _ _ _ .
// |_)| |\/(_| | (/_ ~|~|_|| |(_ | |(_)| |_\ . private functions
//=|=======================================================
function packageOfferInfo(address siteOwner, uint256 amount) private view returns (FMAPDatasets.OfferInfo) {
}
//=========================================================...
// _ _ _ _ |` _ __|_. _ _ _ .
// (_(_)| (/_ ~|~|_|| |(_ | |(_)| |_\ . core functions
//=========================================================
function offerCore(FMAPDatasets.OfferInfo memory offerInfo, bool updateAff) private {
}
function matching() private {
}
function calcAndSetPlayerTotalCanAccept(address pAddr, uint256 acceptAmount) private {
}
function airdrop() private view returns (bool) {
}
function calcCanAcceptAmount(address pAddr, bool isLimit, uint256 offsetTime) private view returns (uint256, uint256 nextUpdateTime) {
}
}
//=========================================================...
// _ _ _ _|_|_ |.|_ _ _ _ .
// | | |(_| | | | |||_)| (_||\/ . math library
//============================/============================
library FMAPMath {
using SafeMath for uint256;
function calcTrackerCount(uint256 ethAmount) internal pure returns (uint256) {
}
function calcAirDropAmount(uint256 ethAmount) internal pure returns (uint256) {
}
}
//=========================================================...
// __|_ _ __|_ .
// _\ | ||_|(_ | .
//=========================================================
library FMAPDatasets {
struct OfferInfo {
address playerAddress;
uint256 offerAmount;
uint256 acceptAmount; // 不再计算利息
address affiliateAddress;
address siteOwner;
uint256 timestamp;
bool interesting;
}
struct AcceptOrder {
uint256 orderId;
address playerAddress;
uint256 acceptAmount;
uint256 acceptedAmount;
uint256 nextOrder;
}
struct Player {
address playerAddress;
address lastAffiliate;
uint256 totalOffered;
uint256 totalAccepted;
uint256 airDroped;
uint256 balance; // can withdraw
uint256 offeredCount;
uint256 acceptOrderCount;
uint256 canAccept;
uint256 lastCalcOfferNo;
uint256 affiliateEarned;
uint256 siteEarned;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
| AddressUtils.isContract(msg.sender)==false,"sorry, only human allowed" | 46,363 | AddressUtils.isContract(msg.sender)==false |
"sorry, withdraw at least 1 finney" | pragma solidity ^0.4.24;
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// ___ ___ ___ __
// ___ / /\ / /\ / /\ | |\
// /__/\ / /::\ / /::\ / /::| | |:|
// \ \:\ / /:/\:\ / /:/\:\ / /:|:| | |:|
// \__\:\ / /::\ \:\ / /::\ \:\ / /:/|:|__ |__|:|__
// / /::\ /__/:/\:\ \:\ /__/:/\:\_\:\ /__/:/_|::::\ ____/__/::::\
// / /:/\:\ \ \:\ \:\_\/ \__\/ \:\/:/ \__\/ /~~/:/ \__\::::/~~~~
// / /:/__\/ \ \:\ \:\ \__\::/ / /:/ |~~|:|
// /__/:/ \ \:\_\/ / /:/ / /:/ | |:|
// \__\/ \ \:\ /__/:/ /__/:/ |__|:|
// \__\/ \__\/ \__\/ \__\|
// ______ ______ ______ _____ _ _ ______ ______ _____
// | | | \ | | | \ / | | \ | | \ \ | | | | | | | | | | \ \
// | |__|_/ | |__| | | | | | | | | | | | | | | | | |---- | | | |
// |_| |_| \_\ \_|__|_/ |_|_/_/ \_|__|_| |_|____ |_|____ |_|_/_/
//
// TEAM X All Rights Received. http://teamx.club
// This product is protected under license. Any unauthorized copy, modification, or use without
// express written consent from the creators is prohibited.
// v 0.1.3
// Any cooperation Please email: [email protected]
// Follow these step to become a site owner:
// 1. fork git repository: https://github.com/teamx-club/escape-mmm
// 2. modify file: js/config.js
// 3. replace siteOwner with your address
// 4. search for how to use github pages and bind your domain, setup the forked repository
// 5. having fun, you will earn 5% every privode from your site page
// ////////////////////////////////////////////////////////////////////////////////////////////////////
//=========================================================...
// (~ _ _ _|_ _ .
// (_\/(/_| | | _\ . Events
//=========================================================
contract EscapeMmmEvents {
event onOffered (
address indexed playerAddress,
uint256 offerAmount,
address affiliateAddress,
address siteOwner,
uint256 timestamp
);
event onAccepted (
address indexed playerAddress,
uint256 acceptAmount
);
event onWithdraw (
address indexed playerAddress,
uint256 withdrawAmount
);
event onAirDrop (
address indexed playerAddress,
uint256 airdropAmount,
uint256 offerAmount
);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public 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 {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
//=========================================================...
// |\/| _ . _ /~` _ _ _|_ _ _ __|_ .
// | |(_||| | \_,(_)| | | | (_|(_ | . Main Contract
//=========================================================
contract EFMAPlatform is EscapeMmmEvents, Ownable {
using SafeMath for *;
//=========================================================...
// _ _ _ |`. _ _ _ .
// (_(_)| |~|~|(_||_|| (/_ . system settings
//==============_|=========================================
string constant public name = "Escape Financial Mutual Aid Platform";
string constant public symbol = "EFMAP";
address private xTokenAddress = 0xfe8b40a35ff222c8475385f74e77d33954531b41;
uint8 public feePercent_ = 1; // 1% for fee
uint8 public affPercent_ = 5; // 5% for affiliate
uint8 public sitePercent_ = 5; // 5% for site owner
uint8 public airDropPercent_ = 10; // 10% for air drop
uint8 public xTokenPercent_ = 3; // 3% for x token
uint256 constant public interestPeriod_ = 1 hours;
uint256 constant public maxInterestTime_ = 7 days;
//=========================================================...
// _| _ _|_ _ _ _ _|_ _ .
// (_|(_| | (_| _\(/_ ||_||_) . data setup
//=========================|===============================
uint256 public airDropPool_;
uint256 public airDropTracker_ = 0; // +1 every (0.001 ether) time triggered; if 0.002 eth, trigger twice
//=========================================================...
// _ | _ _|_|` _ _ _ _ _| _ _|_ _ .
// |_)|(_| |~|~(_)| | | | (_|(_| | (_| . platform data
//=|=======================================================
mapping (address => FMAPDatasets.Player) public players_;
mapping (address => mapping (uint256 => FMAPDatasets.OfferInfo)) public playerOfferOrders_; // player => player offer count => offerInfo.
mapping (address => mapping (uint256 => uint256)) public playerAcceptOrders_; // player => count => orderId. player orders to accept;
uint256 private restOfferAmount_ = 0; // offered amount that not been accepted;
FMAPDatasets.AcceptOrder private currentOrder_; // unmatched current order;
mapping (uint256 => FMAPDatasets.AcceptOrder) public acceptOrders_; // accept orders;
address private teamXWallet;
uint256 public _totalFee;
uint256 public _totalXT;
//=========================================================...
// _ _ _ __|_ _ __|_ _ _
// (_(_)| |_\ | ||_|(_ | (_)|
//=========================================================
constructor() public {
}
function transFee() public onlyOwner {
}
function setTeamWallet(address wallet) public onlyOwner {
}
function setXToken(address xToken) public onlyOwner {
}
//=========================================================...
// _ _ _ _|. |`. _ _ _ .
// | | |(_)(_||~|~|(/_| _\ . modifiers
//=========================================================
modifier isHuman() {
}
//=========================================================...
// _ |_ |. _ |` _ __|_. _ _ _ .
// |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . public functions
//=|=======================================================
/**
* offer help directly
*/
function() isHuman() public payable {
}
function offerHelp(address siteOwner, address affiliate) isHuman() public payable {
}
function offerHelpUsingBalance(address siteOwner, address affiliate, uint256 ethAmount) isHuman() public {
}
function acceptHelp(uint256 amount) isHuman() public returns (uint256 canAcceptLeft) {
}
function withdraw() isHuman() public {
require(<FILL_ME>)
uint256 _balance = players_[msg.sender].balance;
players_[msg.sender].balance = 0;
msg.sender.transfer(_balance);
emit onWithdraw(msg.sender, _balance);
}
//=========================================================...
// . _ |` _ __|_. _ _ _ .
// \/|(/_VV ~|~|_|| |(_ | |(_)| |_\ . view functions
//=========================================================
function getCanAcceptAmount(address playerAddr) public view returns (uint256 canAccept, uint256 earliest) {
}
function getBalance(address playerAddr) public view returns (uint256) {
}
function getPlayerInfo(address playerAddr) public view
returns (uint256 totalAssets, uint256 nextPeriodAssets, uint256 balance, uint256 canAccept, uint256 airdrop, uint256 offered, uint256 accepted, uint256 affiliateEarned, uint256 siteEarned, uint256 nextUpdateTime) {
}
//=========================================================...
// _ _. _ _|_ _ |` _ __|_. _ _ _ .
// |_)| |\/(_| | (/_ ~|~|_|| |(_ | |(_)| |_\ . private functions
//=|=======================================================
function packageOfferInfo(address siteOwner, uint256 amount) private view returns (FMAPDatasets.OfferInfo) {
}
//=========================================================...
// _ _ _ _ |` _ __|_. _ _ _ .
// (_(_)| (/_ ~|~|_|| |(_ | |(_)| |_\ . core functions
//=========================================================
function offerCore(FMAPDatasets.OfferInfo memory offerInfo, bool updateAff) private {
}
function matching() private {
}
function calcAndSetPlayerTotalCanAccept(address pAddr, uint256 acceptAmount) private {
}
function airdrop() private view returns (bool) {
}
function calcCanAcceptAmount(address pAddr, bool isLimit, uint256 offsetTime) private view returns (uint256, uint256 nextUpdateTime) {
}
}
//=========================================================...
// _ _ _ _|_|_ |.|_ _ _ _ .
// | | |(_| | | | |||_)| (_||\/ . math library
//============================/============================
library FMAPMath {
using SafeMath for uint256;
function calcTrackerCount(uint256 ethAmount) internal pure returns (uint256) {
}
function calcAirDropAmount(uint256 ethAmount) internal pure returns (uint256) {
}
}
//=========================================================...
// __|_ _ __|_ .
// _\ | ||_|(_ | .
//=========================================================
library FMAPDatasets {
struct OfferInfo {
address playerAddress;
uint256 offerAmount;
uint256 acceptAmount; // 不再计算利息
address affiliateAddress;
address siteOwner;
uint256 timestamp;
bool interesting;
}
struct AcceptOrder {
uint256 orderId;
address playerAddress;
uint256 acceptAmount;
uint256 acceptedAmount;
uint256 nextOrder;
}
struct Player {
address playerAddress;
address lastAffiliate;
uint256 totalOffered;
uint256 totalAccepted;
uint256 airDroped;
uint256 balance; // can withdraw
uint256 offeredCount;
uint256 acceptOrderCount;
uint256 canAccept;
uint256 lastCalcOfferNo;
uint256 affiliateEarned;
uint256 siteEarned;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
}
}
| players_[msg.sender].balance>=1finney,"sorry, withdraw at least 1 finney" | 46,363 | players_[msg.sender].balance>=1finney |
"Hit stage limit" | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
require(!paused, "Contract paused");
require(stage > 0, "Invalid stage");
uint256 supply = totalSupply();
require(<FILL_ME>)
require(msg.value >= mint_num * stagePrice[stage], "Insufficient eth");
require(mint_num > 0,"at least 1 mint");
uint256 currMintCount;
if(usePrevMintCount[stage])
currMintCount = mintCount[stage-1][msg.sender];
else
currMintCount = mintCount[stage][msg.sender];
if(signature.length > 0){
//mint via WL
require(checkSig(msg.sender, wl_max, signature), "Invalid signature");
require(mint_num + currMintCount <= wl_max, "Exceed WL limit");
}else{
//public mint
require(mint_num + currMintCount <= stageAddrLimit[stage], "Exceed address mint limit");
}
if(usePrevMintCount[stage])
mintCount[stage-1][msg.sender] += mint_num;
else
mintCount[stage][msg.sender] += mint_num;
//mint
currentSupply += mint_num;
for (uint256 i = 0; i < mint_num; i++) {
_safeMint(msg.sender, nextId + i);
}
nextId += mint_num;
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| supply+mint_num<=stageLimit[stage],"Hit stage limit" | 46,409 | supply+mint_num<=stageLimit[stage] |
"Invalid signature" | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
require(!paused, "Contract paused");
require(stage > 0, "Invalid stage");
uint256 supply = totalSupply();
require(supply + mint_num <= stageLimit[stage], "Hit stage limit");
require(msg.value >= mint_num * stagePrice[stage], "Insufficient eth");
require(mint_num > 0,"at least 1 mint");
uint256 currMintCount;
if(usePrevMintCount[stage])
currMintCount = mintCount[stage-1][msg.sender];
else
currMintCount = mintCount[stage][msg.sender];
if(signature.length > 0){
//mint via WL
require(<FILL_ME>)
require(mint_num + currMintCount <= wl_max, "Exceed WL limit");
}else{
//public mint
require(mint_num + currMintCount <= stageAddrLimit[stage], "Exceed address mint limit");
}
if(usePrevMintCount[stage])
mintCount[stage-1][msg.sender] += mint_num;
else
mintCount[stage][msg.sender] += mint_num;
//mint
currentSupply += mint_num;
for (uint256 i = 0; i < mint_num; i++) {
_safeMint(msg.sender, nextId + i);
}
nextId += mint_num;
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| checkSig(msg.sender,wl_max,signature),"Invalid signature" | 46,409 | checkSig(msg.sender,wl_max,signature) |
"Exceed WL limit" | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
require(!paused, "Contract paused");
require(stage > 0, "Invalid stage");
uint256 supply = totalSupply();
require(supply + mint_num <= stageLimit[stage], "Hit stage limit");
require(msg.value >= mint_num * stagePrice[stage], "Insufficient eth");
require(mint_num > 0,"at least 1 mint");
uint256 currMintCount;
if(usePrevMintCount[stage])
currMintCount = mintCount[stage-1][msg.sender];
else
currMintCount = mintCount[stage][msg.sender];
if(signature.length > 0){
//mint via WL
require(checkSig(msg.sender, wl_max, signature), "Invalid signature");
require(<FILL_ME>)
}else{
//public mint
require(mint_num + currMintCount <= stageAddrLimit[stage], "Exceed address mint limit");
}
if(usePrevMintCount[stage])
mintCount[stage-1][msg.sender] += mint_num;
else
mintCount[stage][msg.sender] += mint_num;
//mint
currentSupply += mint_num;
for (uint256 i = 0; i < mint_num; i++) {
_safeMint(msg.sender, nextId + i);
}
nextId += mint_num;
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| mint_num+currMintCount<=wl_max,"Exceed WL limit" | 46,409 | mint_num+currMintCount<=wl_max |
"Exceed address mint limit" | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
require(!paused, "Contract paused");
require(stage > 0, "Invalid stage");
uint256 supply = totalSupply();
require(supply + mint_num <= stageLimit[stage], "Hit stage limit");
require(msg.value >= mint_num * stagePrice[stage], "Insufficient eth");
require(mint_num > 0,"at least 1 mint");
uint256 currMintCount;
if(usePrevMintCount[stage])
currMintCount = mintCount[stage-1][msg.sender];
else
currMintCount = mintCount[stage][msg.sender];
if(signature.length > 0){
//mint via WL
require(checkSig(msg.sender, wl_max, signature), "Invalid signature");
require(mint_num + currMintCount <= wl_max, "Exceed WL limit");
}else{
//public mint
require(<FILL_ME>)
}
if(usePrevMintCount[stage])
mintCount[stage-1][msg.sender] += mint_num;
else
mintCount[stage][msg.sender] += mint_num;
//mint
currentSupply += mint_num;
for (uint256 i = 0; i < mint_num; i++) {
_safeMint(msg.sender, nextId + i);
}
nextId += mint_num;
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| mint_num+currMintCount<=stageAddrLimit[stage],"Exceed address mint limit" | 46,409 | mint_num+currMintCount<=stageAddrLimit[stage] |
"Only creator allowed" | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
require(<FILL_ME>)
require(!_exists(tokenId), "Tokenid already exist");
//mint
currentSupply++;
_safeMint(to, tokenId);
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| isCreatorRole[msg.sender],"Only creator allowed" | 46,409 | isCreatorRole[msg.sender] |
null | contract Beanterra is ERC721, Ownable {
using Strings for uint256;
using ECDSA for bytes32;
//NFT params
string public baseURI;
string public defaultURI;
string public mycontractURI;
uint256 private currentSupply;
//mint parameters
uint256 nextId;
mapping(uint8 => uint256) public stagePrice; //price for each stage
mapping(uint8 => uint256) public stageLimit; //total mint limit for each stage
mapping(uint8 => uint256) public stageAddrLimit; //mint limit per non-WL address for each stage
mapping(uint8 => bool) public usePrevMintCount; //use previous stage mintCount for per non-WL address limit
address public signer; //WL signing key
mapping(uint8 => mapping(address => uint8)) public mintCount; //mintCount[stage][addr]
//state
bool public paused = false;
uint8 public stage;
//bridge
mapping(address => bool) public isCreatorRole; //whitelisted address for bridging/creator
//royalty
address public royaltyAddr;
uint256 public royaltyBasis;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _defaultURI,
uint256 _startId,
address _signer,
address _royaltyAddr,
uint256 _royaltyBasis
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
}
function mint(uint8 mint_num, uint8 wl_max, bytes memory signature) public payable {
}
//for future breeding/NFT bridging function
function mintAt(address to, uint256 tokenId) public {
}
function checkSig(address _addr, uint8 cnt, bytes memory signature) public view returns(bool){
}
function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) {
}
function totalSupply() public view returns (uint256) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function contractURI() public view returns (string memory) {
}
//ERC-2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view
returns (address receiver, uint256 royaltyAmount){
}
//only owner functions ---
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setRoyalty(address _royaltyAddr, uint256 _royaltyBasis) public onlyOwner {
}
function nextStage() public onlyOwner {
require(<FILL_ME>)
stage++;
}
function setStageSettings(uint8 _newStage, uint256 _price, uint256 _supplyLimit, uint8 _addrLimit, bool _usePrevMintCount) public onlyOwner {
}
function setNextId(uint256 _newNextId) public onlyOwner {
}
function whitelistCreator(address _creator, bool _toAdd) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function reserveMint(uint256 _mintAmount, address _to) public onlyOwner {
}
//fund withdraw functions ---
function withdrawFund(address _to) public onlyOwner {
}
function _withdraw(address _addr, uint256 _amt) private {
}
}
| stageLimit[stage+1]!=0 | 46,409 | stageLimit[stage+1]!=0 |
"address(0)" | contract ConvController {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public governance;
address public pendingGovernance;
address public guardian;
uint256 public effectTime;
address public controller;
address public reward;
bool public unlocked;
uint256 public withdrawalFee = 10;
uint256 constant public withdrawalMax = 10000;
address public operator;
address[] public tokens;
mapping(address => bool) public locks;
mapping(address => address) public dTokens;
mapping(address => address) public eTokens;
mapping(address => mapping(address => uint256)) public convertAt;
event PairCreated(address indexed token, address indexed dToken, address indexed eToken);
event Convert(address indexed account, address indexed token, uint256 amount);
event Redeem(address indexed account, address indexed token, uint256 amount, uint256 fee);
constructor(address _controller, address _reward, address _operator) public {
}
function setGuardian(address _guardian) external {
}
function addGuardianTime(uint256 _addTime) external {
}
function acceptGovernance() external {
}
function setPendingGovernance(address _pendingGovernance) external {
}
function setController(address _controller) external {
}
function setReward(address _reward) external {
}
function setOperator(address _operator) external {
}
function setWithdrawalFee(uint256 _withdrawalFee) external {
}
function locking(address _token) external {
}
function unlocking(address _token) external {
}
function convertAll(address _token) external {
}
function convert(address _token, uint256 _amount) public {
require(unlocked, "!unlock");
unlocked = false;
require(<FILL_ME>)
convertAt[_token][msg.sender] = block.number;
if (IController(controller).strategies(_token) != address(0)) {
IERC20(_token).safeTransferFrom(msg.sender, controller, _amount);
IController(controller).deposit(_token, _amount);
} else {
IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);
}
_mint(_token, msg.sender, _amount);
emit Convert(msg.sender, _token, _amount);
unlocked = true;
}
function mint(address _token, address _minter, uint256 _amount) external {
}
function _mint(address _token, address _minter, uint256 _amount) internal {
}
function redeemAll(address _token) external {
}
function redeem(address _token, uint256 _amount) public {
}
function createPair(address _token) external returns (address _dToken, address _eToken) {
}
function maxRedeemAmount(address _token) public view returns (uint256) {
}
function tokenBalance(address _token) public view returns (uint256) {
}
function dTokenEToken(address _token) public view returns (address _dToken, address _eToken) {
}
function tokensInfo() public view returns (address[] memory _tokens){
}
function tokenLength() public view returns (uint256) {
}
function deposit(address _token) external {
}
function sweep(address _token) external {
}
function sweepGuardian(address _token) external {
}
}
| dTokens[_token]!=address(0),"address(0)" | 46,675 | dTokens[_token]!=address(0) |
"locking" | contract ConvController {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public governance;
address public pendingGovernance;
address public guardian;
uint256 public effectTime;
address public controller;
address public reward;
bool public unlocked;
uint256 public withdrawalFee = 10;
uint256 constant public withdrawalMax = 10000;
address public operator;
address[] public tokens;
mapping(address => bool) public locks;
mapping(address => address) public dTokens;
mapping(address => address) public eTokens;
mapping(address => mapping(address => uint256)) public convertAt;
event PairCreated(address indexed token, address indexed dToken, address indexed eToken);
event Convert(address indexed account, address indexed token, uint256 amount);
event Redeem(address indexed account, address indexed token, uint256 amount, uint256 fee);
constructor(address _controller, address _reward, address _operator) public {
}
function setGuardian(address _guardian) external {
}
function addGuardianTime(uint256 _addTime) external {
}
function acceptGovernance() external {
}
function setPendingGovernance(address _pendingGovernance) external {
}
function setController(address _controller) external {
}
function setReward(address _reward) external {
}
function setOperator(address _operator) external {
}
function setWithdrawalFee(uint256 _withdrawalFee) external {
}
function locking(address _token) external {
}
function unlocking(address _token) external {
}
function convertAll(address _token) external {
}
function convert(address _token, uint256 _amount) public {
}
function mint(address _token, address _minter, uint256 _amount) external {
}
function _mint(address _token, address _minter, uint256 _amount) internal {
}
function redeemAll(address _token) external {
}
function redeem(address _token, uint256 _amount) public {
require(unlocked, "!unlock");
unlocked = false;
require(<FILL_ME>)
require(dTokens[_token] != address(0), "address(0)");
require(convertAt[_token][msg.sender] < block.number, "!convertAt");
DToken(dTokens[_token]).burn(msg.sender, _amount);
EToken(eTokens[_token]).burn(msg.sender, _amount);
uint256 _balance = IERC20(_token).balanceOf(address(this));
if (_balance < _amount) {
if (IController(controller).strategies(_token) != address(0)) {
uint256 _withdraw = _amount.sub(_balance);
IController(controller).withdraw(_token, _withdraw);
_balance = IERC20(_token).balanceOf(address(this));
}
if (_balance < _amount) {
_amount = _balance;
}
}
uint256 _fee = _amount.mul(withdrawalFee).div(withdrawalMax);
IERC20(_token).safeTransfer(reward, _fee);
IERC20(_token).safeTransfer(msg.sender, _amount.sub(_fee));
emit Redeem(msg.sender, _token, _amount, _fee);
unlocked = true;
}
function createPair(address _token) external returns (address _dToken, address _eToken) {
}
function maxRedeemAmount(address _token) public view returns (uint256) {
}
function tokenBalance(address _token) public view returns (uint256) {
}
function dTokenEToken(address _token) public view returns (address _dToken, address _eToken) {
}
function tokensInfo() public view returns (address[] memory _tokens){
}
function tokenLength() public view returns (uint256) {
}
function deposit(address _token) external {
}
function sweep(address _token) external {
}
function sweepGuardian(address _token) external {
}
}
| !locks[_token],"locking" | 46,675 | !locks[_token] |
"!convertAt" | contract ConvController {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public governance;
address public pendingGovernance;
address public guardian;
uint256 public effectTime;
address public controller;
address public reward;
bool public unlocked;
uint256 public withdrawalFee = 10;
uint256 constant public withdrawalMax = 10000;
address public operator;
address[] public tokens;
mapping(address => bool) public locks;
mapping(address => address) public dTokens;
mapping(address => address) public eTokens;
mapping(address => mapping(address => uint256)) public convertAt;
event PairCreated(address indexed token, address indexed dToken, address indexed eToken);
event Convert(address indexed account, address indexed token, uint256 amount);
event Redeem(address indexed account, address indexed token, uint256 amount, uint256 fee);
constructor(address _controller, address _reward, address _operator) public {
}
function setGuardian(address _guardian) external {
}
function addGuardianTime(uint256 _addTime) external {
}
function acceptGovernance() external {
}
function setPendingGovernance(address _pendingGovernance) external {
}
function setController(address _controller) external {
}
function setReward(address _reward) external {
}
function setOperator(address _operator) external {
}
function setWithdrawalFee(uint256 _withdrawalFee) external {
}
function locking(address _token) external {
}
function unlocking(address _token) external {
}
function convertAll(address _token) external {
}
function convert(address _token, uint256 _amount) public {
}
function mint(address _token, address _minter, uint256 _amount) external {
}
function _mint(address _token, address _minter, uint256 _amount) internal {
}
function redeemAll(address _token) external {
}
function redeem(address _token, uint256 _amount) public {
require(unlocked, "!unlock");
unlocked = false;
require(!locks[_token], "locking");
require(dTokens[_token] != address(0), "address(0)");
require(<FILL_ME>)
DToken(dTokens[_token]).burn(msg.sender, _amount);
EToken(eTokens[_token]).burn(msg.sender, _amount);
uint256 _balance = IERC20(_token).balanceOf(address(this));
if (_balance < _amount) {
if (IController(controller).strategies(_token) != address(0)) {
uint256 _withdraw = _amount.sub(_balance);
IController(controller).withdraw(_token, _withdraw);
_balance = IERC20(_token).balanceOf(address(this));
}
if (_balance < _amount) {
_amount = _balance;
}
}
uint256 _fee = _amount.mul(withdrawalFee).div(withdrawalMax);
IERC20(_token).safeTransfer(reward, _fee);
IERC20(_token).safeTransfer(msg.sender, _amount.sub(_fee));
emit Redeem(msg.sender, _token, _amount, _fee);
unlocked = true;
}
function createPair(address _token) external returns (address _dToken, address _eToken) {
}
function maxRedeemAmount(address _token) public view returns (uint256) {
}
function tokenBalance(address _token) public view returns (uint256) {
}
function dTokenEToken(address _token) public view returns (address _dToken, address _eToken) {
}
function tokensInfo() public view returns (address[] memory _tokens){
}
function tokenLength() public view returns (uint256) {
}
function deposit(address _token) external {
}
function sweep(address _token) external {
}
function sweepGuardian(address _token) external {
}
}
| convertAt[_token][msg.sender]<block.number,"!convertAt" | 46,675 | convertAt[_token][msg.sender]<block.number |
"!address(0)" | contract ConvController {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public governance;
address public pendingGovernance;
address public guardian;
uint256 public effectTime;
address public controller;
address public reward;
bool public unlocked;
uint256 public withdrawalFee = 10;
uint256 constant public withdrawalMax = 10000;
address public operator;
address[] public tokens;
mapping(address => bool) public locks;
mapping(address => address) public dTokens;
mapping(address => address) public eTokens;
mapping(address => mapping(address => uint256)) public convertAt;
event PairCreated(address indexed token, address indexed dToken, address indexed eToken);
event Convert(address indexed account, address indexed token, uint256 amount);
event Redeem(address indexed account, address indexed token, uint256 amount, uint256 fee);
constructor(address _controller, address _reward, address _operator) public {
}
function setGuardian(address _guardian) external {
}
function addGuardianTime(uint256 _addTime) external {
}
function acceptGovernance() external {
}
function setPendingGovernance(address _pendingGovernance) external {
}
function setController(address _controller) external {
}
function setReward(address _reward) external {
}
function setOperator(address _operator) external {
}
function setWithdrawalFee(uint256 _withdrawalFee) external {
}
function locking(address _token) external {
}
function unlocking(address _token) external {
}
function convertAll(address _token) external {
}
function convert(address _token, uint256 _amount) public {
}
function mint(address _token, address _minter, uint256 _amount) external {
}
function _mint(address _token, address _minter, uint256 _amount) internal {
}
function redeemAll(address _token) external {
}
function redeem(address _token, uint256 _amount) public {
}
function createPair(address _token) external returns (address _dToken, address _eToken) {
require(unlocked, "!unlock");
unlocked = false;
require(<FILL_ME>)
bytes memory _nameD = abi.encodePacked(ERC20(_token).symbol(), " dToken");
bytes memory _symbolD = abi.encodePacked("d", ERC20(_token).symbol());
bytes memory _nameE = abi.encodePacked(ERC20(_token).symbol(), " eToken");
bytes memory _symbolE = abi.encodePacked("e", ERC20(_token).symbol());
uint8 _decimals = ERC20(_token).decimals();
bytes memory _bytecodeD = type(DToken).creationCode;
bytes32 _saltD = keccak256(abi.encodePacked(_token, _nameD, _symbolD));
assembly {
_dToken := create2(0, add(_bytecodeD, 32), mload(_bytecodeD), _saltD)
}
DToken(_dToken).initialize(governance, _decimals, _nameD, _symbolD);
bytes memory _bytecodeE = type(EToken).creationCode;
bytes32 _saltE = keccak256(abi.encodePacked(_token, _nameE, _symbolE));
assembly {
_eToken := create2(0, add(_bytecodeE, 32), mload(_bytecodeE), _saltE)
}
EToken(_eToken).initialize(governance, _decimals, _nameE, _symbolE);
dTokens[_token] = _dToken;
eTokens[_token] = _eToken;
tokens.push(_token);
emit PairCreated(_token, _dToken, _eToken);
unlocked = true;
}
function maxRedeemAmount(address _token) public view returns (uint256) {
}
function tokenBalance(address _token) public view returns (uint256) {
}
function dTokenEToken(address _token) public view returns (address _dToken, address _eToken) {
}
function tokensInfo() public view returns (address[] memory _tokens){
}
function tokenLength() public view returns (uint256) {
}
function deposit(address _token) external {
}
function sweep(address _token) external {
}
function sweepGuardian(address _token) external {
}
}
| dTokens[_token]==address(0),"!address(0)" | 46,675 | dTokens[_token]==address(0) |
"Campl.issue: not enough AMPL allowance" | pragma solidity 0.6.8;
contract Campl is ERC20, ICompatibleDerivativeToken {
using SafeMath for uint256;
IERC20 internal ampl;
uint256 constant private E26 = 1.00E26;
constructor(IERC20 _ampl) public ERC20("Compatible AMPL", "CAMPL") {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC20) {
}
function roundUpDiv(uint256 x, uint256 y) private pure returns (uint256) {
}
function issue(address to, uint256 derivativeAmount) external override {
require(derivativeAmount != 0, "Campl.issue: 0 amount");
uint256 underlyingAmount = toUnderlyingForIssue(derivativeAmount);
require(<FILL_ME>)
require(ampl.balanceOf(_msgSender()) >= underlyingAmount, "Campl.issue: not enough AMPL balance");
_mint(to, derivativeAmount);
emit Issue(_msgSender(), _msgSender(), to, derivativeAmount, underlyingAmount);
ampl.transferFrom(_msgSender(), address(this), underlyingAmount);
}
function issueIn(address to, uint256 underlyingAmount) external override {
}
function reclaim(address to, uint256 derivativeAmount) external override {
}
function reclaimIn(address to, uint256 underlyingAmount) external override {
}
function underlying() external view override returns (address) {
}
function sync() public override {
}
function underlyingBalanceOf(address account) external view override returns (uint256) {
}
function toUnderlyingForIssue(uint256 derivativeAmount) public view override returns(uint256) {
}
function toDerivativeForIssue(uint256 underlyingAmount) public view override returns(uint256) {
}
function toUnderlyingForReclaim(uint256 derivativeAmount) public view override returns(uint256) {
}
function toDerivativeForReclaim(uint256 underlyingAmount) public view override returns(uint256) {
}
}
| ampl.allowance(_msgSender(),address(this))>=underlyingAmount,"Campl.issue: not enough AMPL allowance" | 46,682 | ampl.allowance(_msgSender(),address(this))>=underlyingAmount |
"Campl.issue: not enough AMPL balance" | pragma solidity 0.6.8;
contract Campl is ERC20, ICompatibleDerivativeToken {
using SafeMath for uint256;
IERC20 internal ampl;
uint256 constant private E26 = 1.00E26;
constructor(IERC20 _ampl) public ERC20("Compatible AMPL", "CAMPL") {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC20) {
}
function roundUpDiv(uint256 x, uint256 y) private pure returns (uint256) {
}
function issue(address to, uint256 derivativeAmount) external override {
require(derivativeAmount != 0, "Campl.issue: 0 amount");
uint256 underlyingAmount = toUnderlyingForIssue(derivativeAmount);
require(
ampl.allowance(_msgSender(), address(this)) >= underlyingAmount,
"Campl.issue: not enough AMPL allowance"
);
require(<FILL_ME>)
_mint(to, derivativeAmount);
emit Issue(_msgSender(), _msgSender(), to, derivativeAmount, underlyingAmount);
ampl.transferFrom(_msgSender(), address(this), underlyingAmount);
}
function issueIn(address to, uint256 underlyingAmount) external override {
}
function reclaim(address to, uint256 derivativeAmount) external override {
}
function reclaimIn(address to, uint256 underlyingAmount) external override {
}
function underlying() external view override returns (address) {
}
function sync() public override {
}
function underlyingBalanceOf(address account) external view override returns (uint256) {
}
function toUnderlyingForIssue(uint256 derivativeAmount) public view override returns(uint256) {
}
function toDerivativeForIssue(uint256 underlyingAmount) public view override returns(uint256) {
}
function toUnderlyingForReclaim(uint256 derivativeAmount) public view override returns(uint256) {
}
function toDerivativeForReclaim(uint256 underlyingAmount) public view override returns(uint256) {
}
}
| ampl.balanceOf(_msgSender())>=underlyingAmount,"Campl.issue: not enough AMPL balance" | 46,682 | ampl.balanceOf(_msgSender())>=underlyingAmount |
"claimTopic already exists" | pragma solidity ^0.5.10;
contract ClaimTopicsRegistry is IClaimTopicsRegistry, Ownable {
uint256[] claimTopics;
/**
* @notice Add a trusted claim topic (For example: KYC=1, AML=2).
* Only owner can call.
*
* @param claimTopic The claim topic index
*/
function addClaimTopic(uint256 claimTopic) public onlyOwner {
uint length = claimTopics.length;
for(uint i = 0; i<length; i++){
require(<FILL_ME>)
}
claimTopics.push(claimTopic);
emit ClaimTopicAdded(claimTopic);
}
/**
* @notice Remove a trusted claim topic (For example: KYC=1, AML=2).
* Only owner can call.
*
* @param claimTopic The claim topic index
*/
function removeClaimTopic(uint256 claimTopic) public onlyOwner {
}
/**
* @notice Get the trusted claim topics for the security token
*
* @return Array of trusted claim topics
*/
function getClaimTopics() public view returns (uint256[] memory) {
}
}
| claimTopics[i]!=claimTopic,"claimTopic already exists" | 46,717 | claimTopics[i]!=claimTopic |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.