comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.4.4;
contract owned {
address public owner;
function owned() public{
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
contract ERC20Token {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract StandardToken is ERC20Token {
function transfer(address _to, uint _value) public returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
}
function balanceOf(address _owner) public constant returns (uint balance) {
}
function approve(address _spender, uint _value) public returns (bool success) {
}
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
}
mapping (address => uint) balances;
mapping (address => mapping (address => uint)) allowed;
uint public _supply;
function totalSupply() public constant returns (uint supply) {
}
}
contract CWVToken is StandardToken,owned {
uint public time_on_trademarket; // when to lock , the day when cwv on trade market
uint public time_end_sale; // day when finished open sales, time to calc team lock day.
uint public angels_lock_days; // days to lock angel , 90 days
uint public team_total_lock_days; // days to local team , 24 month
uint public team_release_epoch; // epoch to release teams
string public name = "CryptoWorldVip Token";
string public symbol = "CWV";
string public version = "V1.0.0";
uint public decimals = 18;
mapping (address => uint) angels_locks;//all lock 3 months,
address public team_address;
uint public team_lock_count ; // team lock count
uint public last_release_date ; // last team lock date
uint public epoch_release_count; // total release epoch count
uint calc_unit = 1 days ;// days
function CWVToken() public{
}
function setOnlineTime() public onlyOwner {
}
function transfer(address _to, uint _value) public returns (bool success) {
}
//3 month lock up
function earlyAngelSales(address _to, uint256 _value) public onlyOwner returns (bool success) {
}
function batchEarlyAngelSales(address []_tos, uint256 []_values) public onlyOwner returns (bool success) {
}
function angelSales(address _to, uint256 _value) public onlyOwner returns (bool success) {
}
function batchAngelSales(address []_tos, uint256 []_values) public onlyOwner returns (bool success) {
}
function unlockAngelAccounts(address[] _batchOfAddresses) public onlyOwner returns (bool success) {
}
function frozen_team(address _to) public onlyOwner returns (bool success) {
}
function changeTeamAddress(address _new) public onlyOwner returns (bool success) {
}
function epochReleaseTeam(address _to) public onlyOwner returns (bool success) {
require(<FILL_ME>)
require (now > last_release_date + team_release_epoch );
uint current_release_count = (now - last_release_date) / (team_release_epoch ) * epoch_release_count;
if(balances[team_address]>current_release_count){
current_release_count = current_release_count;
}else{
current_release_count = balances[team_address];
}
balances[team_address] -= current_release_count;
balances[_to] += current_release_count;
last_release_date += (current_release_count / epoch_release_count ) * team_release_epoch;
team_lock_count -= current_release_count;
Transfer(team_address, _to, current_release_count);
return true;
}
}
| balances[team_address]>0 | 30,723 | balances[team_address]>0 |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
address user = msg.sender;
require(canupdate == true);
uint oldbalance = oldBase.balanceOf(user);
uint oldcanuse = oldBase.getcanuse(user);
//address oldfrom = oldBase.getfrom(user);
require(user != 0x0);
require(<FILL_ME>)
require(oldcanuse <= oldbalance);
if(oldbalance > 0) {
require(oldbalance < _totalSupply);
require(balances[this] > oldbalance);
balances[user] = oldbalance;
//fromaddr[user] = oldfrom;
if(oldcanuse > 0) {
uint dd = oldcanuse*100/oldbalance;
addmoney(user, oldbalance, dd);
}
balances[this] = balances[this].sub(oldbalance);
emit Transfer(this, user, oldbalance);
}
hasupdate[user] = now;
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| hasupdate[user]<1 | 30,759 | hasupdate[user]<1 |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
address user = msg.sender;
require(canupdate == true);
uint oldbalance = oldBase.balanceOf(user);
uint oldcanuse = oldBase.getcanuse(user);
//address oldfrom = oldBase.getfrom(user);
require(user != 0x0);
require(hasupdate[user] < 1);
require(oldcanuse <= oldbalance);
if(oldbalance > 0) {
require(oldbalance < _totalSupply);
require(<FILL_ME>)
balances[user] = oldbalance;
//fromaddr[user] = oldfrom;
if(oldcanuse > 0) {
uint dd = oldcanuse*100/oldbalance;
addmoney(user, oldbalance, dd);
}
balances[this] = balances[this].sub(oldbalance);
emit Transfer(this, user, oldbalance);
}
hasupdate[user] = now;
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[this]>oldbalance | 30,759 | balances[this]>oldbalance |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
require(<FILL_ME>)
require(actived == true);
require(balances[this] > mintedAmount);
balances[target] = balances[target].add(mintedAmount);
addmoney(target, mintedAmount, _day);
balances[this] = balances[this].sub(mintedAmount);
emit Transfer(this, target, mintedAmount);
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| !frozenAccount[target] | 30,759 | !frozenAccount[target] |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
require(!frozenAccount[target]);
require(actived == true);
require(<FILL_ME>)
balances[target] = balances[target].add(mintedAmount);
addmoney(target, mintedAmount, _day);
balances[this] = balances[this].sub(mintedAmount);
emit Transfer(this, target, mintedAmount);
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[this]>mintedAmount | 30,759 | balances[this]>mintedAmount |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
require(!frozenAccount[target]);
require(actived == true);
require(<FILL_ME>)
balances[target] = balances[target].sub(mintedAmount);
reducemoney(target, mintedAmount);
balances[this] = balances[this].add(mintedAmount);
emit Transfer(target, this, mintedAmount);
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[target]>=mintedAmount | 30,759 | balances[target]>=mintedAmount |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
address user = msg.sender;
require(<FILL_ME>)
require(actived == true);
require(cronaddOf[user] > 1);
require(now > cronaddOf[user]);
require(balances[user] >= sysPrice);
uint256 mintAmount = balances[user] * sysPer / 10000;
require(balances[this] > mintAmount);
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].add(mintAmount);
addmoney(user, mintAmount, 0);
balances[this] = balances[this].sub(mintAmount);
cronaddOf[user] = now + onceAddTime;
emit Transfer(this, msg.sender, mintAmount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| !frozenAccount[user] | 30,759 | !frozenAccount[user] |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
address user = msg.sender;
require(!frozenAccount[user]);
require(actived == true);
require(<FILL_ME>)
require(now > cronaddOf[user]);
require(balances[user] >= sysPrice);
uint256 mintAmount = balances[user] * sysPer / 10000;
require(balances[this] > mintAmount);
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].add(mintAmount);
addmoney(user, mintAmount, 0);
balances[this] = balances[this].sub(mintAmount);
cronaddOf[user] = now + onceAddTime;
emit Transfer(this, msg.sender, mintAmount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| cronaddOf[user]>1 | 30,759 | cronaddOf[user]>1 |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
address user = msg.sender;
require(!frozenAccount[user]);
require(actived == true);
require(cronaddOf[user] > 1);
require(now > cronaddOf[user]);
require(<FILL_ME>)
uint256 mintAmount = balances[user] * sysPer / 10000;
require(balances[this] > mintAmount);
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].add(mintAmount);
addmoney(user, mintAmount, 0);
balances[this] = balances[this].sub(mintAmount);
cronaddOf[user] = now + onceAddTime;
emit Transfer(this, msg.sender, mintAmount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[user]>=sysPrice | 30,759 | balances[user]>=sysPrice |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
address user = msg.sender;
require(!frozenAccount[user]);
require(actived == true);
require(cronaddOf[user] > 1);
require(now > cronaddOf[user]);
require(balances[user] >= sysPrice);
uint256 mintAmount = balances[user] * sysPer / 10000;
require(<FILL_ME>)
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].add(mintAmount);
addmoney(user, mintAmount, 0);
balances[this] = balances[this].sub(mintAmount);
cronaddOf[user] = now + onceAddTime;
emit Transfer(this, msg.sender, mintAmount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[this]>mintAmount | 30,759 | balances[this]>mintAmount |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
require(actived == true);
require(!frozenAccount[msg.sender]);
uint money = msg.value;
require(money > 0);
uint amount = (money * buyPrice)/1 ether;
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].add(amount);
balances[this] = balances[this].sub(amount);
addmoney(msg.sender, amount, 0);
owner.transfer(msg.value);
emit Transfer(this, msg.sender, amount);
return(true);
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[this]>amount | 30,759 | balances[this]>amount |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
require(actived == true);
require(!frozenAccount[_to]);
require(<FILL_ME>)
require(money > 0);
_to.transfer(money);
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| address(this).balance>money | 30,759 | address(this).balance>money |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
require(actived == true);
address user = msg.sender;
require(!frozenAccount[user]);
require(amount > 0);
uint256 canuse = getcanuse(user);
require(canuse >= amount);
require(<FILL_ME>)
//uint moneys = (amount * sellPrice) / 10 ** uint(decimals);
uint moneys = (amount * sellPrice)/1 ether;
require(address(this).balance > moneys);
user.transfer(moneys);
reducemoney(user, amount);
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].sub(amount);
balances[this] = balances[this].add(amount);
emit Transfer(this, user, amount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
return(true);
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| balances[user]>=amount | 30,759 | balances[user]>=amount |
null | pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
}
function sub(uint a, uint b) internal pure returns(uint c) {
}
function mul(uint a, uint b) internal pure returns(uint c) {
}
function div(uint a, uint b) internal pure returns(uint c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns(uint);
function balanceOf(address tokenOwner) public constant returns(uint balance);
function allowance(address tokenOwner, address spender) public constant returns(uint remaining);
function transfer(address to, uint tokens) public returns(bool success);
function approve(address spender, uint tokens) public returns(bool success);
function transferFrom(address from, address to, uint tokens) public returns(bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface oldInterface {
function balanceOf(address _addr) external view returns (uint256);
function getcanuse(address tokenOwner) external view returns(uint);
function getfrom(address _addr) external view returns(address);
}
// ----------------------------------------------------------------------------
// 核心类
// ----------------------------------------------------------------------------
contract BTYCToken is ERC20Interface {
using SafeMath
for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint public sellPrice; //出售价格 1枚代币换多少以太 /1000
uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000
uint public sysPrice; //挖矿的衡量值
uint public sysPer; //挖矿的增量百分比 /100
bool public actived;
uint public sendPer; //转账分佣百分比
uint public sendPer2; //转账分佣百分比
uint public sendPer3; //转账分佣百分比
uint public sendfrozen; //转账冻结百分比
uint public onceOuttime; //增量的时间 测试
uint public onceAddTime; //挖矿的时间 测试
bool public openout;
mapping(address => uint) balances;
mapping(address => uint) used;
mapping(address => mapping(address => uint)) allowed;
/* 冻结账户 */
mapping(address => bool) public frozenAccount;
//释放
mapping(address => uint[]) public mycantime; //时间
mapping(address => uint[]) public mycanmoney; //金额
//上家地址
mapping(address => address) public fromaddr;
//管理员帐号
mapping(address => bool) public admins;
// 记录各个账户的增量时间
mapping(address => uint) public cronaddOf;
mapping(address => bool) public intertoken;
mapping(address => uint) public hasupdate;
/* 通知 */
event FrozenFunds(address target, bool frozen);
oldInterface public oldBase = oldInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA);
address public owner;
bool public canupdate;
modifier onlyOwner {
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
/* 获取用户金额 */
function balanceOf(address tokenOwner) public view returns(uint balance) {
}
/*
* 添加金额,为了统计用户的进出
*/
function addmoney(address _addr, uint256 _money, uint _day) private {
}
/*
* 用户金额减少时的触发
* @param {Object} address
*/
function reducemoney(address _addr, uint256 _money) private {
}
/*
* 获取用户的挖矿时间
* @param {Object} address
*/
function getaddtime(address _addr) public view returns(uint) {
}
function getmy(address user) public view returns(
uint mybalances,//0
uint mycanuses,//1
uint myuseds,//2
uint mytimes,//3
uint uptimes,//4
uint allmoneys//5
){
}
function updateuser() public{
}
/*
* 获取用户的可用金额
* @param {Object} address
*/
function getcanuse(address tokenOwner) public view returns(uint balance) {
}
function transfer(address to, uint tokens) public returns(bool success) {
}
/*
* 获取真实值
* @param {Object} uint
*/
function getnum(uint num) public view returns(uint) {
}
/*
* 获取上家地址
* @param {Object} address
*/
function getfrom(address _addr) public view returns(address) {
}
function approve(address spender, uint tokens) public returns(bool success) {
}
/*
* 授权转账
* @param {Object} address
*/
function transferFrom(address from, address to, uint tokens) public returns(bool success) {
}
/*
* 获取授权信息
* @param {Object} address
*/
function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
}
/*
* 授权
* @param {Object} address
*/
function approveAndCall(address spender, uint tokens) public returns(bool success) {
}
/// 冻结 or 解冻账户
function freezeAccount(address target, bool freeze) public onlyOwner{
}
/*
* 系统设置
* @param {Object} uint
*/
function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public onlyOwner{
}
/*
* 获取系统设置
*/
function getprice() public view returns(uint addtimes, uint outtimes, uint bprice, uint spice, uint sprice, uint sper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) {
}
/*
* 设置是否开启
* @param {Object} bool
*/
function setactive(bool tags) public onlyOwner {
}
function setout(bool tags) public onlyOwner {
}
function setupdate(bool tags) public onlyOwner {
}
/*
* 获取总发行
*/
function totalSupply() public view returns(uint) {
}
/*
* 向指定账户拨发资金
* @param {Object} address
*/
function addtoken(address target, uint256 mintedAmount, uint _day) public onlyOwner{
}
function subtoken(address target, uint256 mintedAmount) public onlyOwner{
}
/*
* 用户每隔10天挖矿一次
*/
function mint() public {
}
/*
* 获取总账目
*/
function getall() public view returns(uint256 money) {
}
/*
* 购买
*/
function buy() public payable returns(bool) {
}
/*
* 系统充值
*/
function charge() public payable returns(bool) {
}
function() payable public {
}
/*
* 系统提现
* @param {Object} address
*/
function withdraw(address _to, uint money) public onlyOwner {
}
/*
* 出售
* @param {Object} uint256
*/
function sell(uint256 amount) public returns(bool success) {
require(actived == true);
address user = msg.sender;
require(!frozenAccount[user]);
require(amount > 0);
uint256 canuse = getcanuse(user);
require(canuse >= amount);
require(balances[user] >= amount);
//uint moneys = (amount * sellPrice) / 10 ** uint(decimals);
uint moneys = (amount * sellPrice)/1 ether;
require(<FILL_ME>)
user.transfer(moneys);
reducemoney(user, amount);
uint previousBalances = balances[user] + balances[this];
balances[user] = balances[user].sub(amount);
balances[this] = balances[this].add(amount);
emit Transfer(this, user, amount);
// 断言检测, 不应该为错
assert(balances[user] + balances[this] == previousBalances);
return(true);
}
/*
* 批量发币
* @param {Object} address
*/
function addBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
/*
* 批量减币
* @param {Object} address
*/
function subBalances(address[] recipients, uint256[] moenys) public onlyOwner{
}
}
| address(this).balance>moneys | 30,759 | address(this).balance>moneys |
"ForceRecoverCollateralImpl#forceRecoverCollateralImpl: Cannot recover yet" | /* solium-disable-next-line max-len*/
/**
* @title ForceRecoverCollateralImpl
* @author dYdX
*
* This library contains the implementation for the forceRecoverCollateral function of Margin
*/
library ForceRecoverCollateralImpl {
using SafeMath for uint256;
// ============ Events ============
/**
* Collateral for a position was forcibly recovered
*/
event CollateralForceRecovered(
bytes32 indexed positionId,
address indexed recipient,
uint256 amount
);
// ============ Public Implementation Functions ============
function forceRecoverCollateralImpl(
MarginState.State storage state,
bytes32 positionId,
address recipient
)
public
returns (uint256)
{
MarginCommon.Position storage position =
MarginCommon.getPositionFromStorage(state, positionId);
// Can only force recover after either:
// 1) The loan was called and the call period has elapsed
// 2) The maxDuration of the position has elapsed
require(<FILL_ME>)
// Ensure lender consent
forceRecoverCollateralOnBehalfOfRecurse(
position.lender,
msg.sender,
positionId,
recipient
);
// Send the tokens
uint256 heldTokenRecovered = MarginCommon.getPositionBalanceImpl(state, positionId);
Vault(state.VAULT).transferFromVault(
positionId,
position.heldToken,
recipient,
heldTokenRecovered
);
// Delete the position
// NOTE: Since position is a storage pointer, this will also set all fields on
// the position variable to 0
MarginCommon.cleanupPosition(
state,
positionId
);
// Log an event
emit CollateralForceRecovered(
positionId,
recipient,
heldTokenRecovered
);
return heldTokenRecovered;
}
// ============ Private Helper-Functions ============
function forceRecoverCollateralOnBehalfOfRecurse(
address contractAddr,
address recoverer,
bytes32 positionId,
address recipient
)
private
{
}
}
| (position.callTimestamp>0&&block.timestamp>=uint256(position.callTimestamp).add(position.callTimeLimit))||(block.timestamp>=uint256(position.startTimestamp).add(position.maxDuration)),"ForceRecoverCollateralImpl#forceRecoverCollateralImpl: Cannot recover yet" | 30,766 | (position.callTimestamp>0&&block.timestamp>=uint256(position.callTimestamp).add(position.callTimeLimit))||(block.timestamp>=uint256(position.startTimestamp).add(position.maxDuration)) |
"Only callable by devs" | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import "@rari-capital/solmate/src/tokens/ERC721.sol";
import "@rari-capital/solmate/src/utils/SafeTransferLib.sol";
import "./Ownable.sol";
import "./IERC721.sol";
import "./Strings.sol";
error DoesNotExist();
error NoTokensLeft();
error NotEnoughETH();
error AssertionError();
error NotTokenOwner();
error MintNotActive();
error MintAlreadyActive();
error MintLimitPerTx();
contract xApe721 is Ownable, ERC721 {
using Strings for uint256;
uint256 public constant TOTAL_SUPPLY = 10_000;
uint256 public constant PRICE_PER_MINT = 0.05 ether;
uint256 public constant MAX_MINT_PER_TX = 20;
bool public mintActive;
uint256 public totalSupply;
string public baseURI;
IERC721 public oldContract = IERC721(0x090b1DE324fEA5f0A0B4226101Db645819102629);
address private teamWallet = 0xC7639015cB3da4FDd1C8c1925B22fB32ae133dAb;
address private dev1Wallet = 0x29c36265c63fE0C3d024b2E4d204b49deeFdD671;
address private dev2Wallet = 0x0c4618FfbE21f926d040043976457d0a489ea360;
uint256 private devMints = 0;
constructor(
string memory name,
string memory symbol,
string memory _baseURI,
address _oldContract,
address _dev1Wallet,
address _dev2Wallet,
address _teamWallet
) payable ERC721(name, symbol) {
}
modifier onlyTeamWallet() {
}
modifier onlyDev() {
require(<FILL_ME>)
_;
}
modifier devMintLimit(uint256 amount) {
}
function mint(uint16 amount) external payable {
}
function claim(uint256 tokenId) external payable {
}
function claimAll() external payable {
}
function _ownsOldToken(address account, uint256 tokenId) internal view returns(bool) {
}
function _getNextUnusedID(uint256 currentSupply) internal view returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
function withdraw() external onlyTeamWallet() {
}
function devMint(uint16 amount) external onlyDev() devMintLimit(amount) {
}
function pauseMint() external {
}
function startMint() external {
}
function supportsInterface(bytes4 interfaceId)
public
pure
override
returns (bool)
{
}
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4) {
}
}
| (msg.sender==dev1Wallet||msg.sender==dev2Wallet),"Only callable by devs" | 30,790 | (msg.sender==dev1Wallet||msg.sender==dev2Wallet) |
"Devs only promised 3 free mints each" | // SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import "@rari-capital/solmate/src/tokens/ERC721.sol";
import "@rari-capital/solmate/src/utils/SafeTransferLib.sol";
import "./Ownable.sol";
import "./IERC721.sol";
import "./Strings.sol";
error DoesNotExist();
error NoTokensLeft();
error NotEnoughETH();
error AssertionError();
error NotTokenOwner();
error MintNotActive();
error MintAlreadyActive();
error MintLimitPerTx();
contract xApe721 is Ownable, ERC721 {
using Strings for uint256;
uint256 public constant TOTAL_SUPPLY = 10_000;
uint256 public constant PRICE_PER_MINT = 0.05 ether;
uint256 public constant MAX_MINT_PER_TX = 20;
bool public mintActive;
uint256 public totalSupply;
string public baseURI;
IERC721 public oldContract = IERC721(0x090b1DE324fEA5f0A0B4226101Db645819102629);
address private teamWallet = 0xC7639015cB3da4FDd1C8c1925B22fB32ae133dAb;
address private dev1Wallet = 0x29c36265c63fE0C3d024b2E4d204b49deeFdD671;
address private dev2Wallet = 0x0c4618FfbE21f926d040043976457d0a489ea360;
uint256 private devMints = 0;
constructor(
string memory name,
string memory symbol,
string memory _baseURI,
address _oldContract,
address _dev1Wallet,
address _dev2Wallet,
address _teamWallet
) payable ERC721(name, symbol) {
}
modifier onlyTeamWallet() {
}
modifier onlyDev() {
}
modifier devMintLimit(uint256 amount) {
require(<FILL_ME>)
_;
}
function mint(uint16 amount) external payable {
}
function claim(uint256 tokenId) external payable {
}
function claimAll() external payable {
}
function _ownsOldToken(address account, uint256 tokenId) internal view returns(bool) {
}
function _getNextUnusedID(uint256 currentSupply) internal view returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
function withdraw() external onlyTeamWallet() {
}
function devMint(uint16 amount) external onlyDev() devMintLimit(amount) {
}
function pauseMint() external {
}
function startMint() external {
}
function supportsInterface(bytes4 interfaceId)
public
pure
override
returns (bool)
{
}
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4) {
}
}
| devMints+amount<=6,"Devs only promised 3 free mints each" | 30,790 | devMints+amount<=6 |
"max NFT per address exceeded for the first 500" | // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
}
}
pragma solidity >=0.7.0 <0.9.0;
contract Spendthrifts is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.019 ether;
uint256 public maxSupply = 3137;
uint256 public maxMintAmount = 1;
uint256 public nftPerAddressLimit = 10;
bool public paused = false;
mapping(address => uint256) public addressMintedBalance;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(_mintAmount > 0, "need to mint at least 1 NFT");
require(_mintAmount <= maxMintAmount, "max mint amount per session exceeded");
require(supply + _mintAmount <= maxSupply, "max NFT limit exceeded");
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "max NFT per address exceeded");
if (msg.sender != owner()) {
require(!paused, "the contract is paused");
if(supply <= 500) {
require(<FILL_ME>)
}
//free first 500 mint
if(supply >= 500){
require(msg.value >= cost * _mintAmount, "insufficient funds");
}
if(supply >=3037){
paused = true;
}
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintedBalance[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function setCost(uint256 _newCost) public onlyOwner() {
}
function setMaxMintAmount(uint256 _newAmount) public onlyOwner() {
}
function setNftPerAddressLimit(uint256 _newLimit) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| ownerMintedCount+_mintAmount<=3,"max NFT per address exceeded for the first 500" | 30,823 | ownerMintedCount+_mintAmount<=3 |
"ACOPoolLib: Invalid ACO token expiration" | pragma solidity ^0.6.6;
pragma experimental ABIEncoderV2;
import "./SafeMath.sol";
import "./IACOPoolStrategy.sol";
import "./IACOFactory.sol";
import "./IACOToken.sol";
import "./ILendingPool.sol";
library ACOPoolLib {
using SafeMath for uint256;
struct OpenPositionData {
uint256 underlyingPrice;
uint256 baseVolatility;
uint256 underlyingPriceAdjustPercentage;
uint256 underlyingPrecision;
address strategy;
address acoFactory;
address acoToken;
}
struct QuoteData {
bool isCall;
uint256 tokenAmount;
address underlying;
address strikeAsset;
uint256 strikePrice;
uint256 expiryTime;
address lendingToken;
address strategy;
uint256 baseVolatility;
uint256 fee;
uint256 minExpiration;
uint256 maxExpiration;
uint256 tolerancePriceBelow;
uint256 tolerancePriceAbove;
uint256 underlyingPrice;
uint256 underlyingPrecision;
}
struct OpenPositionExtraData {
bool isCall;
uint256 strikePrice;
uint256 expiryTime;
uint256 tokenAmount;
address underlying;
address strikeAsset;
}
uint256 public constant PERCENTAGE_PRECISION = 100000;
function name(address underlying, address strikeAsset, bool isCall) public view returns(string memory) {
}
function acoStrikePriceIsValid(
uint256 tolerancePriceBelow,
uint256 tolerancePriceAbove,
uint256 strikePrice,
uint256 price
) public pure returns(bool) {
}
function acoExpirationIsValid(uint256 acoExpiryTime, uint256 minExpiration, uint256 maxExpiration) public view returns(bool) {
}
function getBaseAssetsWithdrawWithLocked(
uint256 shares,
address underlying,
address strikeAsset,
bool isCall,
uint256 totalSupply,
address lendingToken
) public view returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getBaseWithdrawNoLockedData(
uint256 shares,
uint256 totalSupply,
bool isCall,
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance,
uint256 collateralLockedRedeemable
) public pure returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn,
bool isPossible
) {
}
function getAmountToLockedWithdraw(
uint256 shares,
uint256 totalSupply,
address lendingToken,
address underlying,
address strikeAsset,
bool isCall
) public view returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getAmountToNoLockedWithdraw(
uint256 shares,
uint256 totalSupply,
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance,
uint256 minCollateral,
bool isCall
) public pure returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getBaseCollateralData(
address lendingToken,
address underlying,
address strikeAsset,
bool isCall,
uint256 underlyingPrice,
uint256 underlyingPriceAdjustPercentage,
uint256 underlyingPrecision,
bool isDeposit
) public view returns(
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance
) {
}
function getOpenPositionCollateralBalance(OpenPositionData memory data) public view returns(
uint256 collateralLocked,
uint256 collateralOnOpenPosition,
uint256 collateralLockedRedeemable
) {
}
function quote(QuoteData memory data) public view returns(
uint256 swapPrice,
uint256 protocolFee,
uint256 volatility,
uint256 collateralAmount
) {
require(data.expiryTime > block.timestamp, "ACOPoolLib: ACO token expired");
require(<FILL_ME>)
require(acoStrikePriceIsValid(data.tolerancePriceBelow, data.tolerancePriceAbove, data.strikePrice, data.underlyingPrice), "ACOPoolLib: Invalid ACO token strike price");
uint256 collateralAvailable;
(collateralAmount, collateralAvailable) = _getOrderSizeData(data.tokenAmount, data.underlying, data.isCall, data.strikePrice, data.lendingToken, data.underlyingPrecision);
uint256 calcPrice;
(calcPrice, volatility) = _strategyQuote(data.strategy, data.underlying, data.strikeAsset, data.isCall, data.strikePrice, data.expiryTime, data.underlyingPrice, data.baseVolatility, collateralAmount, collateralAvailable);
(swapPrice, protocolFee) = _setSwapPriceAndFee(calcPrice, data.tokenAmount, data.fee, data.underlyingPrecision);
}
function _getCollateralAmount(
uint256 tokenAmount,
uint256 strikePrice,
bool isCall,
uint256 underlyingPrecision
) private pure returns(uint256) {
}
function _getOrderSizeData(
uint256 tokenAmount,
address underlying,
bool isCall,
uint256 strikePrice,
address lendingToken,
uint256 underlyingPrecision
) private view returns(
uint256 collateralAmount,
uint256 collateralAvailable
) {
}
function _strategyQuote(
address strategy,
address underlying,
address strikeAsset,
bool isCall,
uint256 strikePrice,
uint256 expiryTime,
uint256 underlyingPrice,
uint256 baseVolatility,
uint256 collateralAmount,
uint256 collateralAvailable
) private view returns(uint256 swapPrice, uint256 volatility) {
}
function _setSwapPriceAndFee(
uint256 calcPrice,
uint256 tokenAmount,
uint256 fee,
uint256 underlyingPrecision
) private pure returns(uint256 swapPrice, uint256 protocolFee) {
}
function _getOpenPositionCollateralExtraData(address acoToken, address acoFactory) private view returns(OpenPositionExtraData memory extraData) {
}
function _getOpenPositionCollateralBalance(
OpenPositionData memory data,
OpenPositionExtraData memory extraData
) private view returns(
uint256 collateralLocked,
uint256 collateralOnOpenPosition,
uint256 collateralLockedRedeemable
) {
}
function _getUnderlyingPriceAdjusted(uint256 underlyingPrice, uint256 underlyingPriceAdjustPercentage, bool isMaximum) private pure returns(uint256) {
}
function _getPoolBalanceOf(address asset) private view returns(uint256) {
}
function _getAssetSymbol(address asset) private view returns(string memory) {
}
}
| acoExpirationIsValid(data.expiryTime,data.minExpiration,data.maxExpiration),"ACOPoolLib: Invalid ACO token expiration" | 30,853 | acoExpirationIsValid(data.expiryTime,data.minExpiration,data.maxExpiration) |
"ACOPoolLib: Invalid ACO token strike price" | pragma solidity ^0.6.6;
pragma experimental ABIEncoderV2;
import "./SafeMath.sol";
import "./IACOPoolStrategy.sol";
import "./IACOFactory.sol";
import "./IACOToken.sol";
import "./ILendingPool.sol";
library ACOPoolLib {
using SafeMath for uint256;
struct OpenPositionData {
uint256 underlyingPrice;
uint256 baseVolatility;
uint256 underlyingPriceAdjustPercentage;
uint256 underlyingPrecision;
address strategy;
address acoFactory;
address acoToken;
}
struct QuoteData {
bool isCall;
uint256 tokenAmount;
address underlying;
address strikeAsset;
uint256 strikePrice;
uint256 expiryTime;
address lendingToken;
address strategy;
uint256 baseVolatility;
uint256 fee;
uint256 minExpiration;
uint256 maxExpiration;
uint256 tolerancePriceBelow;
uint256 tolerancePriceAbove;
uint256 underlyingPrice;
uint256 underlyingPrecision;
}
struct OpenPositionExtraData {
bool isCall;
uint256 strikePrice;
uint256 expiryTime;
uint256 tokenAmount;
address underlying;
address strikeAsset;
}
uint256 public constant PERCENTAGE_PRECISION = 100000;
function name(address underlying, address strikeAsset, bool isCall) public view returns(string memory) {
}
function acoStrikePriceIsValid(
uint256 tolerancePriceBelow,
uint256 tolerancePriceAbove,
uint256 strikePrice,
uint256 price
) public pure returns(bool) {
}
function acoExpirationIsValid(uint256 acoExpiryTime, uint256 minExpiration, uint256 maxExpiration) public view returns(bool) {
}
function getBaseAssetsWithdrawWithLocked(
uint256 shares,
address underlying,
address strikeAsset,
bool isCall,
uint256 totalSupply,
address lendingToken
) public view returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getBaseWithdrawNoLockedData(
uint256 shares,
uint256 totalSupply,
bool isCall,
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance,
uint256 collateralLockedRedeemable
) public pure returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn,
bool isPossible
) {
}
function getAmountToLockedWithdraw(
uint256 shares,
uint256 totalSupply,
address lendingToken,
address underlying,
address strikeAsset,
bool isCall
) public view returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getAmountToNoLockedWithdraw(
uint256 shares,
uint256 totalSupply,
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance,
uint256 minCollateral,
bool isCall
) public pure returns(
uint256 underlyingWithdrawn,
uint256 strikeAssetWithdrawn
) {
}
function getBaseCollateralData(
address lendingToken,
address underlying,
address strikeAsset,
bool isCall,
uint256 underlyingPrice,
uint256 underlyingPriceAdjustPercentage,
uint256 underlyingPrecision,
bool isDeposit
) public view returns(
uint256 underlyingBalance,
uint256 strikeAssetBalance,
uint256 collateralBalance
) {
}
function getOpenPositionCollateralBalance(OpenPositionData memory data) public view returns(
uint256 collateralLocked,
uint256 collateralOnOpenPosition,
uint256 collateralLockedRedeemable
) {
}
function quote(QuoteData memory data) public view returns(
uint256 swapPrice,
uint256 protocolFee,
uint256 volatility,
uint256 collateralAmount
) {
require(data.expiryTime > block.timestamp, "ACOPoolLib: ACO token expired");
require(acoExpirationIsValid(data.expiryTime, data.minExpiration, data.maxExpiration), "ACOPoolLib: Invalid ACO token expiration");
require(<FILL_ME>)
uint256 collateralAvailable;
(collateralAmount, collateralAvailable) = _getOrderSizeData(data.tokenAmount, data.underlying, data.isCall, data.strikePrice, data.lendingToken, data.underlyingPrecision);
uint256 calcPrice;
(calcPrice, volatility) = _strategyQuote(data.strategy, data.underlying, data.strikeAsset, data.isCall, data.strikePrice, data.expiryTime, data.underlyingPrice, data.baseVolatility, collateralAmount, collateralAvailable);
(swapPrice, protocolFee) = _setSwapPriceAndFee(calcPrice, data.tokenAmount, data.fee, data.underlyingPrecision);
}
function _getCollateralAmount(
uint256 tokenAmount,
uint256 strikePrice,
bool isCall,
uint256 underlyingPrecision
) private pure returns(uint256) {
}
function _getOrderSizeData(
uint256 tokenAmount,
address underlying,
bool isCall,
uint256 strikePrice,
address lendingToken,
uint256 underlyingPrecision
) private view returns(
uint256 collateralAmount,
uint256 collateralAvailable
) {
}
function _strategyQuote(
address strategy,
address underlying,
address strikeAsset,
bool isCall,
uint256 strikePrice,
uint256 expiryTime,
uint256 underlyingPrice,
uint256 baseVolatility,
uint256 collateralAmount,
uint256 collateralAvailable
) private view returns(uint256 swapPrice, uint256 volatility) {
}
function _setSwapPriceAndFee(
uint256 calcPrice,
uint256 tokenAmount,
uint256 fee,
uint256 underlyingPrecision
) private pure returns(uint256 swapPrice, uint256 protocolFee) {
}
function _getOpenPositionCollateralExtraData(address acoToken, address acoFactory) private view returns(OpenPositionExtraData memory extraData) {
}
function _getOpenPositionCollateralBalance(
OpenPositionData memory data,
OpenPositionExtraData memory extraData
) private view returns(
uint256 collateralLocked,
uint256 collateralOnOpenPosition,
uint256 collateralLockedRedeemable
) {
}
function _getUnderlyingPriceAdjusted(uint256 underlyingPrice, uint256 underlyingPriceAdjustPercentage, bool isMaximum) private pure returns(uint256) {
}
function _getPoolBalanceOf(address asset) private view returns(uint256) {
}
function _getAssetSymbol(address asset) private view returns(string memory) {
}
}
| acoStrikePriceIsValid(data.tolerancePriceBelow,data.tolerancePriceAbove,data.strikePrice,data.underlyingPrice),"ACOPoolLib: Invalid ACO token strike price" | 30,853 | acoStrikePriceIsValid(data.tolerancePriceBelow,data.tolerancePriceAbove,data.strikePrice,data.underlyingPrice) |
"Only the pNetwork can change the `pNetwork` account!" | pragma solidity ^0.5.0;
contract PToken is ERC777 {
address public pNetwork;
event Redeem(
address indexed redeemer,
uint256 value,
string underlyingAssetRecipient
);
constructor(
string memory tokenName,
string memory tokenSymbol,
address[] memory defaultOperators
)
ERC777(tokenName, tokenSymbol, defaultOperators)
public
{
}
function changePNetwork(
address newPNetwork
)
external
{
require(<FILL_ME>)
require(
_msgSender() != address(0),
"pNetwork cannot be the zero address!"
);
pNetwork = newPNetwork;
}
function mint(
address recipient,
uint256 value
)
external
returns (bool)
{
}
function mint(
address recipient,
uint256 value,
bytes memory userData,
bytes memory operatorData
)
public
returns (bool)
{
}
function redeem(
uint256 amount,
string calldata underlyingAssetRecipient
)
external
returns (bool)
{
}
function redeem(
uint256 amount,
bytes memory data,
string memory underlyingAssetRecipient
)
public
{
}
function operatorRedeem(
address account,
uint256 amount,
bytes calldata data,
bytes calldata operatorData,
string calldata underlyingAssetRecipient
)
external
{
}
}
| _msgSender()==pNetwork,"Only the pNetwork can change the `pNetwork` account!" | 30,891 | _msgSender()==pNetwork |
'CashExchange: CashExchange has no more budget' | pragma solidity ^0.6.0;
contract CashExchange is ContractGuard {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
// ========== CORE
uint256 public endTime;
address public cash_old;
address public cash_new;
address public cashOracle;
/* ========== CONSTRUCTOR ========== */
constructor(
address _cash_old,
address _cash_new,
address _cashOracle,
uint256 _endTime
) public {
}
/* ========== VIEW FUNCTIONS ========== */
// oracle
function getOraclePrice() public view returns (uint256) {
}
/* ========== MUTABLE FUNCTIONS ========== */
function _updateCashPrice() internal {
}
function exchangeCash(uint256 amount)
external
onlyOneBlock
{
require(block.timestamp <= endTime, 'CashExchange: redemption period ended');
require(amount > 0, 'CashExchange: cannot exchange zero amount');
uint256 cashPrice = getOraclePrice();
//Note: Given that we want to force the starting point to be $1, if cash is > $1 (probably due to low liquidity), redeem it as $1
if (cashPrice > 1000000) {
cashPrice = 1000000;
}
require(<FILL_ME>)
IERC20(cash_old).safeTransferFrom(msg.sender, address(this), amount);
IERC20(cash_new).safeTransfer(msg.sender, amount.mul(cashPrice).div(1000000));
_updateCashPrice();
emit ExchangedCash(msg.sender, amount);
}
// CORE
event ExchangedCash(address indexed from, uint256 amount);
}
| IERC20(cash_new).balanceOf(address(this))>=amount,'CashExchange: CashExchange has no more budget' | 30,980 | IERC20(cash_new).balanceOf(address(this))>=amount |
"ERC20: invalid input mint data" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";
/**
* @dev Interface of the contract capable of checking if an instruction is
* confirmed over at Incognito Chain
*/
interface Incognito {
function instructionApproved(
bool,
bytes32,
uint,
bytes32[] calldata,
bool[] calldata,
bytes32,
bytes32,
uint[] calldata,
uint8[] calldata,
bytes32[] calldata,
bytes32[] calldata
) external view returns (bool);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(bytes32 => bool) private withdrawed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address private _incognitoProxy;
address private _vault;
/**
* @dev END Storage variables
*/
struct BurnInstData {
uint8 meta; // type of the instruction
uint8 shard; // ID of the Incognito shard containing the instruction, must be 1
address token; // ETH address of the token contract (0x0 for ETH)
address payable to; // ETH address of the receiver of the token
uint amount; // burned amount (on Incognito)
bytes32 itx; // Incognito's burning tx
}
/**
* @dev Emitted when function burn called with amount of value to shield to incognito chain
*
* Note that `value` may be zero.
*/
event Deposit(address token, string incognitoAddress, uint amount);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, address incognitoProxy_, address vault_) {
}
/**
* @dev Returns the address of vault.
*/
function vault() public view virtual returns (address) {
}
/**
* @dev Returns the incognito proxy.
*/
function incognitoProxy() public view virtual returns (address) {
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
/**
* @dev Parses a burn instruction and returns the components
* @param inst: the full instruction, containing both metadata and body
*/
function _parseBurnInst(bytes memory inst) internal pure returns (BurnInstData memory) {
}
/**
* @dev Verifies that a burn instruction is valid
* @notice All params except inst are the list of 2 elements corresponding to
* the proof on beacon and bridge
* @notice All params are the same as in `withdraw`
*/
function _verifyInst(
bytes memory inst,
uint heights,
bytes32[] memory instPaths,
bool[] memory instPathIsLefts,
bytes32 instRoots,
bytes32 blkData,
uint[] memory sigIdxs,
uint8[] memory sigVs,
bytes32[] memory sigRs,
bytes32[] memory sigSs
) view internal {
// Each instruction can only by redeemed once
bytes32 beaconInstHash = keccak256(abi.encodePacked(inst, heights));
// Verify instruction on beacon
require(<FILL_ME>)
}
/**
* @dev Mint prv by providing a burn proof over at Incognito Chain
* @notice This function takes a burn instruction on Incognito Chain, checks
* for its validity and mint coressponding prv token
* @notice This only works when the contract is not Paused
* @param inst: the decoded instruction as a list of bytes
* @param heights: the blocks containing the instruction
* @param instPaths: merkle path of the instruction
* @param instPathIsLefts: whether each node on the path is the left or right child
* @param instRoots: root of the merkle tree contains all instructions
* @param blkData: merkle has of the block body
* @param sigIdxs: indices of the validators who signed this block
* @param sigVs: part of the signatures of the validators
* @param sigRs: part of the signatures of the validators
* @param sigSs: part of the signatures of the validators
*/
function mint(
bytes memory inst,
uint heights,
bytes32[] memory instPaths,
bool[] memory instPathIsLefts,
bytes32 instRoots,
bytes32 blkData,
uint[] memory sigIdxs,
uint8[] memory sigVs,
bytes32[] memory sigRs,
bytes32[] memory sigSs
) external virtual returns (bool) {
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function burn(string calldata incognitoAddress, uint256 amount) external virtual returns (bool) {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| Incognito(_incognitoProxy).instructionApproved(true,beaconInstHash,heights,instPaths,instPathIsLefts,instRoots,blkData,sigIdxs,sigVs,sigRs,sigSs),"ERC20: invalid input mint data" | 31,010 | Incognito(_incognitoProxy).instructionApproved(true,beaconInstHash,heights,instPaths,instPathIsLefts,instRoots,blkData,sigIdxs,sigVs,sigRs,sigSs) |
"ERC20: tx is already used" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";
/**
* @dev Interface of the contract capable of checking if an instruction is
* confirmed over at Incognito Chain
*/
interface Incognito {
function instructionApproved(
bool,
bytes32,
uint,
bytes32[] calldata,
bool[] calldata,
bytes32,
bytes32,
uint[] calldata,
uint8[] calldata,
bytes32[] calldata,
bytes32[] calldata
) external view returns (bool);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(bytes32 => bool) private withdrawed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address private _incognitoProxy;
address private _vault;
/**
* @dev END Storage variables
*/
struct BurnInstData {
uint8 meta; // type of the instruction
uint8 shard; // ID of the Incognito shard containing the instruction, must be 1
address token; // ETH address of the token contract (0x0 for ETH)
address payable to; // ETH address of the receiver of the token
uint amount; // burned amount (on Incognito)
bytes32 itx; // Incognito's burning tx
}
/**
* @dev Emitted when function burn called with amount of value to shield to incognito chain
*
* Note that `value` may be zero.
*/
event Deposit(address token, string incognitoAddress, uint amount);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, address incognitoProxy_, address vault_) {
}
/**
* @dev Returns the address of vault.
*/
function vault() public view virtual returns (address) {
}
/**
* @dev Returns the incognito proxy.
*/
function incognitoProxy() public view virtual returns (address) {
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
/**
* @dev Parses a burn instruction and returns the components
* @param inst: the full instruction, containing both metadata and body
*/
function _parseBurnInst(bytes memory inst) internal pure returns (BurnInstData memory) {
}
/**
* @dev Verifies that a burn instruction is valid
* @notice All params except inst are the list of 2 elements corresponding to
* the proof on beacon and bridge
* @notice All params are the same as in `withdraw`
*/
function _verifyInst(
bytes memory inst,
uint heights,
bytes32[] memory instPaths,
bool[] memory instPathIsLefts,
bytes32 instRoots,
bytes32 blkData,
uint[] memory sigIdxs,
uint8[] memory sigVs,
bytes32[] memory sigRs,
bytes32[] memory sigSs
) view internal {
}
/**
* @dev Mint prv by providing a burn proof over at Incognito Chain
* @notice This function takes a burn instruction on Incognito Chain, checks
* for its validity and mint coressponding prv token
* @notice This only works when the contract is not Paused
* @param inst: the decoded instruction as a list of bytes
* @param heights: the blocks containing the instruction
* @param instPaths: merkle path of the instruction
* @param instPathIsLefts: whether each node on the path is the left or right child
* @param instRoots: root of the merkle tree contains all instructions
* @param blkData: merkle has of the block body
* @param sigIdxs: indices of the validators who signed this block
* @param sigVs: part of the signatures of the validators
* @param sigRs: part of the signatures of the validators
* @param sigSs: part of the signatures of the validators
*/
function mint(
bytes memory inst,
uint heights,
bytes32[] memory instPaths,
bool[] memory instPathIsLefts,
bytes32 instRoots,
bytes32 blkData,
uint[] memory sigIdxs,
uint8[] memory sigVs,
bytes32[] memory sigRs,
bytes32[] memory sigSs
) external virtual returns (bool) {
require(inst.length >= 130, "ERC20: invalid inst");
BurnInstData memory data = _parseBurnInst(inst);
// Check instruction type
require(data.meta == 150 && data.shard == 1, "ERC20: invalid inst's data");
// Check token address
require(data.token == address(this), "ERC20: invalid token");
// Not withdrawed
require(<FILL_ME>)
withdrawed[data.itx] = true;
// verify proof
_verifyInst(
inst,
heights,
instPaths,
instPathIsLefts,
instRoots,
blkData,
sigIdxs,
sigVs,
sigRs,
sigSs
);
address account = data.to;
uint amount = data.amount;
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
return true;
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function burn(string calldata incognitoAddress, uint256 amount) external virtual returns (bool) {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| !withdrawed[data.itx],"ERC20: tx is already used" | 31,010 | !withdrawed[data.itx] |
"YVaultMarket: An input address is not a contract" | pragma solidity 0.5.17;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "../IMoneyMarket.sol";
import "../../libs/DecMath.sol";
import "./imports/Vault.sol";
contract YVaultMarket is IMoneyMarket, Ownable {
using SafeMath for uint256;
using DecMath for uint256;
using SafeERC20 for ERC20;
using Address for address;
Vault public vault;
ERC20 public stablecoin;
constructor(address _vault, address _stablecoin) public {
// Verify input addresses
require(
_vault != address(0) && _stablecoin != address(0),
"YVaultMarket: An input address is 0"
);
require(<FILL_ME>)
vault = Vault(_vault);
stablecoin = ERC20(_stablecoin);
}
function deposit(uint256 amount) external onlyOwner {
}
function withdraw(uint256 amountInUnderlying)
external
onlyOwner
returns (uint256 actualAmountWithdrawn)
{
}
function claimRewards() external {}
function totalValue() external returns (uint256) {
}
function incomeIndex() external returns (uint256) {
}
function setRewards(address newValue) external {}
}
| _vault.isContract()&&_stablecoin.isContract(),"YVaultMarket: An input address is not a contract" | 31,015 | _vault.isContract()&&_stablecoin.isContract() |
"max NFT per address exceeded" | 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 {
}
function _setOwner(address newOwner) private {
}
}
// Created by HashLips
/**
These contracts have been used to create tutorials,
please review them on your own before using any of
the following code for production.
*/
pragma solidity >=0.7.0 <0.9.0;
contract FiveLions is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
string public notRevealedUri;
uint256 public cost = .06 ether;
uint256 public maxSupply = 8888;
uint256 public maxMintAmount = 200;
uint256 public nftPerAddressLimit = 200;
bool public paused = false;
bool public revealed = false;
bool public onlyWhitelisted = false;
//address payable commissions = payable(0x1Cf11bbD83cab8c85426566d820B3bf2DB4b7827);
//this is for the commission for the dev (1284)
address[] public whitelistedAddresses;
mapping(address => uint256) public addressPresaleMinted;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint256 _mintAmount) public payable {
require(!paused, "the contract is paused");
uint256 supply = totalSupply();
require(_mintAmount > 0, "need to mint at least 1 NFT");
require(_mintAmount <= maxMintAmount, "max mint amount per session exceeded");
require(supply + _mintAmount <= maxSupply, "max NFT limit exceeded");
if (msg.sender != owner()) {
if(onlyWhitelisted == true) {
require(isWhitelisted(msg.sender), "user is not whitelisted");
uint256 ownerTokenCount = addressPresaleMinted[msg.sender];
require(<FILL_ME>)
}
require(msg.value >= cost * _mintAmount, "insufficient funds");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressPresaleMinted[msg.sender]++;
_safeMint(msg.sender, supply + i);
}
// (bool success, ) = payable(commissions).call{value: msg.value * 1 / 100}("");
// require(success);
}
function isWhitelisted(address _user) public view returns (bool) {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal() public onlyOwner() {
}
function setNftPerAddressLimit(uint256 _limit) public onlyOwner() {
}
function setCost(uint256 _newCost) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
function whitelistUsers(address[] calldata _users) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
/**
["0x2cb473fDdEBDe10c66BC2312b6b6109F594ef56d",
"0x2e26C2bdF730AA74Bfd44E6E5F276774819f0833",
"0x8E37C3090F979Ab951356E28E8E14722cC71C97B"]
*/
| ownerTokenCount+_mintAmount<=nftPerAddressLimit,"max NFT per address exceeded" | 31,086 | ownerTokenCount+_mintAmount<=nftPerAddressLimit |
"Maximum keys purchased for current sale." | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./RacerKey.sol";
contract RacerKeySale is IERC1155Receiver, AccessControlEnumerable {
IERC1155 private RACER_KEY;
mapping(address => uint256) private _keysPurchased;
uint256 public constant KEY = 1;
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
uint256 public salePrice;
uint256 public maxPurchaseQuantity;
mapping(address => uint256) public allowedMint;
uint256 public keysSold = 0;
constructor(
address racerKey,
uint256 price,
uint256 maxQty
) {
}
// Manager
function setSalePrice(uint256 price) public onlyRole(MANAGER_ROLE) {
}
function setMaxPurchaseQuantity(uint256 quantity)
public
onlyRole(MANAGER_ROLE)
{
}
function burnUnsoldKeys() public onlyRole(MANAGER_ROLE) {
}
function withdrawTo(address payable withdrawAddress, uint256 amount)
public
onlyRole(MANAGER_ROLE)
{
}
function withdrawAllTo(address payable withdrawAddress)
public
onlyRole(MANAGER_ROLE)
{
}
function withdrawERC20To(
address payable withdrawAddress,
address tokenAddress,
uint256 amount
) public onlyRole(MANAGER_ROLE) {
}
function addToAllowList(address[] memory accounts, uint256[] memory amounts)
public
onlyRole(MANAGER_ROLE)
{
}
// Public
function purchaseKeys(uint256 quantity) public payable {
uint256 storeBalance = RACER_KEY.balanceOf(address(this), KEY);
require(storeBalance > 0, "Sorry, all keys have been sold.");
uint256 maxPurchaseAvailable = allowedMint[msg.sender] >
maxPurchaseQuantity
? allowedMint[msg.sender]
: maxPurchaseQuantity;
require(<FILL_ME>)
uint256 availableQty = allowedMint[msg.sender] > 0 &&
allowedMint[msg.sender] > maxPurchaseQuantity
? allowedMint[msg.sender]
: SafeMath.sub(
maxPurchaseQuantity,
_keysPurchased[msg.sender],
"Max quantity exceeded"
);
if (quantity < availableQty) {
availableQty = quantity;
}
require(
availableQty <= maxPurchaseAvailable ||
availableQty <= allowedMint[msg.sender],
"Max quantity exceeded"
);
require(
msg.value >= salePrice * availableQty,
"Value sent below sale price"
);
uint256 sellableQuantity = availableQty;
uint256 refund = 0;
if (storeBalance < availableQty) {
sellableQuantity = storeBalance;
}
RACER_KEY.safeTransferFrom(
address(this),
msg.sender,
KEY,
sellableQuantity,
""
);
_keysPurchased[msg.sender] += sellableQuantity;
keysSold += sellableQuantity;
if (allowedMint[msg.sender] > sellableQuantity) {
allowedMint[msg.sender] -= sellableQuantity;
} else {
allowedMint[msg.sender] = 0;
}
if (msg.value > salePrice * sellableQuantity) {
refund = msg.value - (salePrice * sellableQuantity);
}
if (refund > 0) {
payable(msg.sender).transfer(refund);
}
}
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external override returns (bytes4) {
}
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external override returns (bytes4) {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(AccessControlEnumerable, IERC165)
returns (bool)
{
}
}
| _keysPurchased[msg.sender]<maxPurchaseAvailable||allowedMint[msg.sender]>0,"Maximum keys purchased for current sale." | 31,212 | _keysPurchased[msg.sender]<maxPurchaseAvailable||allowedMint[msg.sender]>0 |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
require(<FILL_ME>)
TokenRecipient spender = TokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function unlock(address _holder) public onlyOwner returns (bool) {
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
}
}
| isContract(_spender) | 31,237 | isContract(_spender) |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
require(<FILL_ME>)
require(_releaseStart > now);
require(_termOfRound > 0);
require(_amount.mul(_releaseRate).div(100) > 0);
require(balances[_holder] >= _amount);
balances[_holder] = balances[_holder].sub(_amount);
lockupInfo[_holder] = LockupInfo(_releaseStart, _termOfRound, _amount.mul(_releaseRate).div(100), _amount);
locks[_holder] = true;
emit Lock(_holder, _amount);
return true;
}
function unlock(address _holder) public onlyOwner returns (bool) {
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
}
}
| locks[_holder]==false | 31,237 | locks[_holder]==false |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
require(locks[_holder] == false);
require(_releaseStart > now);
require(_termOfRound > 0);
require(<FILL_ME>)
require(balances[_holder] >= _amount);
balances[_holder] = balances[_holder].sub(_amount);
lockupInfo[_holder] = LockupInfo(_releaseStart, _termOfRound, _amount.mul(_releaseRate).div(100), _amount);
locks[_holder] = true;
emit Lock(_holder, _amount);
return true;
}
function unlock(address _holder) public onlyOwner returns (bool) {
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
}
}
| _amount.mul(_releaseRate).div(100)>0 | 31,237 | _amount.mul(_releaseRate).div(100)>0 |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
require(locks[_holder] == false);
require(_releaseStart > now);
require(_termOfRound > 0);
require(_amount.mul(_releaseRate).div(100) > 0);
require(<FILL_ME>)
balances[_holder] = balances[_holder].sub(_amount);
lockupInfo[_holder] = LockupInfo(_releaseStart, _termOfRound, _amount.mul(_releaseRate).div(100), _amount);
locks[_holder] = true;
emit Lock(_holder, _amount);
return true;
}
function unlock(address _holder) public onlyOwner returns (bool) {
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
}
}
| balances[_holder]>=_amount | 31,237 | balances[_holder]>=_amount |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function unlock(address _holder) public onlyOwner returns (bool) {
require(<FILL_ME>)
uint256 releaseAmount = lockupInfo[_holder].lockupBalance;
delete lockupInfo[_holder];
locks[_holder] = false;
emit Unlock(_holder, releaseAmount);
balances[_holder] = balances[_holder].add(releaseAmount);
return true;
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
}
}
| locks[_holder]==true | 31,237 | locks[_holder]==true |
null | /**
*Submitted for verification at Etherscan.io on 2019-03-11
*/
pragma solidity ^0.4.25;
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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
modifier onlyNewOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public onlyNewOwner returns(bool) {
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract HWQCToken is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo) internal lockupInfo;
event Unlock(address indexed holder, uint256 value);
event Lock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
}
constructor() public {
}
function () public payable {
}
function totalSupply() public view returns (uint256) {
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
}
function balanceOf(address _holder) public view returns (uint balance) {
}
function lockupBalance(address _holder) public view returns (uint256 balance) {
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
}
function allowance(address _holder, address _spender) public view returns (uint256) {
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function unlock(address _holder) public onlyOwner returns (bool) {
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
}
function getNowTime() public view returns(uint256) {
}
function showLockState(address _holder) public view returns (bool, uint256, uint256, uint256, uint256) {
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
}
function mint( uint256 _amount) onlyOwner public returns (bool) {
}
function isContract(address addr) internal view returns (bool) {
}
function autoUnlock(address _holder) internal returns (bool) {
}
function releaseTimeLock(address _holder) internal returns(bool) {
require(<FILL_ME>)
uint256 releaseAmount = 0;
// If lock status of holder is finished, delete lockup info.
for( ; lockupInfo[_holder].releaseTime <= now ; )
{
if (lockupInfo[_holder].lockupBalance <= lockupInfo[_holder].unlockAmountPerRound) {
releaseAmount = releaseAmount.add(lockupInfo[_holder].lockupBalance);
delete lockupInfo[_holder];
locks[_holder] = false;
break;
} else {
releaseAmount = releaseAmount.add(lockupInfo[_holder].unlockAmountPerRound);
lockupInfo[_holder].lockupBalance = lockupInfo[_holder].lockupBalance.sub(lockupInfo[_holder].unlockAmountPerRound);
lockupInfo[_holder].releaseTime = lockupInfo[_holder].releaseTime.add(lockupInfo[_holder].termOfRound);
}
}
emit Unlock(_holder, releaseAmount);
balances[_holder] = balances[_holder].add(releaseAmount);
return true;
}
}
| locks[_holder] | 31,237 | locks[_holder] |
'Max supply exceeded!' | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;
import 'erc721a/contracts/ERC721A.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
contract TheCircleofWierdos is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
bytes32 public merkleRoot;
mapping(address => bool) public whitelistClaimed;
string public uriPrefix = '';
string public uriSuffix = '.json';
string public hiddenMetadataUri;
uint256 public cost;
uint256 public maxSupply;
uint256 public maxMintAmountPerTx;
bool public paused = true;
bool public whitelistMintEnabled = false;
bool public revealed = false;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint256 _cost,
uint256 _maxSupply,
uint256 _maxMintAmountPerTx,
string memory _hiddenMetadataUri
) ERC721A(_tokenName, _tokenSymbol) {
}
modifier mintCompliance(uint256 _mintAmount) {
require(_mintAmount > 0 && _mintAmount <= maxMintAmountPerTx, 'Invalid mint amount!');
require(<FILL_ME>)
_;
}
modifier mintPriceCompliance(uint256 _mintAmount) {
}
function whitelistMint(uint256 _mintAmount, bytes32[] calldata _merkleProof) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) {
}
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) {
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
}
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function setRevealed(bool _state) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function setWhitelistMintEnabled(bool _state) public onlyOwner {
}
function withdraw() public onlyOwner nonReentrant {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| totalSupply()+_mintAmount<=maxSupply,'Max supply exceeded!' | 31,377 | totalSupply()+_mintAmount<=maxSupply |
'Address already claimed!' | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;
import 'erc721a/contracts/ERC721A.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
contract TheCircleofWierdos is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
bytes32 public merkleRoot;
mapping(address => bool) public whitelistClaimed;
string public uriPrefix = '';
string public uriSuffix = '.json';
string public hiddenMetadataUri;
uint256 public cost;
uint256 public maxSupply;
uint256 public maxMintAmountPerTx;
bool public paused = true;
bool public whitelistMintEnabled = false;
bool public revealed = false;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint256 _cost,
uint256 _maxSupply,
uint256 _maxMintAmountPerTx,
string memory _hiddenMetadataUri
) ERC721A(_tokenName, _tokenSymbol) {
}
modifier mintCompliance(uint256 _mintAmount) {
}
modifier mintPriceCompliance(uint256 _mintAmount) {
}
function whitelistMint(uint256 _mintAmount, bytes32[] calldata _merkleProof) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) {
// Verify whitelist requirements
require(whitelistMintEnabled, 'The whitelist sale is not enabled!');
require(<FILL_ME>)
bytes32 leaf = keccak256(abi.encodePacked(_msgSender()));
require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), 'Invalid proof!');
whitelistClaimed[_msgSender()] = true;
_safeMint(_msgSender(), _mintAmount);
}
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) {
}
function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {
}
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function setRevealed(bool _state) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {
}
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setPaused(bool _state) public onlyOwner {
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function setWhitelistMintEnabled(bool _state) public onlyOwner {
}
function withdraw() public onlyOwner nonReentrant {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| !whitelistClaimed[_msgSender()],'Address already claimed!' | 31,377 | !whitelistClaimed[_msgSender()] |
"Sale is open" | // SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
/**
* @dev TinySeed ERC-1155 contract:
*/
contract TinySeed is
ERC1155,
Ownable,
Pausable,
ERC1155Burnable,
ERC1155Supply,
PaymentSplitter
{
/**
* @dev Constants for token types:
*/
uint256 public constant SERIES1 = 0;
uint256 public constant REFILL = 1;
uint256 public constant PLATINUM = 2;
/**
* @dev Constants, token supply bands and associated USD pricing:
* ===========================================
* MUST BE UPDATED / VALIDATED PRIOR TO DEPLOY
* ===========================================
*/
uint256 public constant SERIES1_SUPPLY1 = 100;
uint256 public constant SERIES1_SUPPLY2 = 250;
uint256 public constant SERIES1_SUPPLY3 = 500;
uint256 public constant SERIES1_USD1 = 220;
uint256 public constant SERIES1_USD2 = 230;
uint256 public constant SERIES1_USD3 = 240;
uint256 public constant SERIES1_USD4 = 250;
uint256 public constant REFILL_USD = 250;
uint256 public constant PLATINUM_USD = 4600;
/**
* @dev Add name and symbol for consistency with ERC-721 NFTs. Note that ERC-721 stores
* these variables on-chain, but as they can only be set on the constructor we may as well
* save the gas and have them as constants in the bytecode.
*/
string private constant NAME = "TinySeed";
string private constant SYMBOL = "TINYSEED";
AggregatorV3Interface internal priceFeed;
/**
* @dev saleOpen - when set to false it stays false. This is how the mint
* is permanently closed at the end. Pause is different, as it can be set and unset
* and also controls token transfer.
*/
bool public saleOpen;
bool public developerAllocationComplete;
address private developer;
/**
* @dev Price buffer above and below the passed amount of ETH that will be accepted. This function
* will be used to set the price for items in the UI, but there is always the possibility of price
* fluctuations beween the display and the mint. These parameters determine as an amount per thousance
* how high above or below the price the passed amount of ETH can be and still make a valid sale. The
* stored values are in the following format:
* - priceBufferUp: amount as a proportion of 1,000. For example, if you set this to 1005 you allow the
* price to be up to 1005 / 1000 of the actual price, i.e. not exceeding 0.5% greater.
* - priceBufferDown: amount as a proportion of 1,000. For example, if you set this to 995 you allow the
* price to be up to 995 / 1000 of the actual price i.e. not exceeding 0.5% less.
*/
uint256 private priceBufferUp;
uint256 private priceBufferDown;
/**
* @dev Contract events:
*/
event SaleClosedSet(address account);
event PriceBufferUpSet(uint256 priceBuffer);
event PriceBufferDownSet(uint256 priceBuffer);
event DeveloperAllocationCompleteSet(address account);
event tinySeedMinted(
address account,
uint256 TiQuantity,
uint256 RefillQuantity,
uint256 PtQuantity,
uint256 TiSupply,
uint256 RefillSupply,
uint256 PtSupply,
uint256 cost
);
/**
* @dev Constructor must be passed an array of shareholders for the payment splitter, the first
* array holding addresses and the second the corresponding shares. For example, you could have the following:
* - _payees[beneficiaryAddress, developerAddress]
* - _shares[90,10]
* In this example the beneficiary address passed in can claim 90% of total ETH, the developer 10%
*/
constructor(
uint256 _priceBufferUp,
uint256 _priceBufferDown,
address[] memory _payees,
uint256[] memory _shares,
address _developer
)
ERC1155(
"https://arweave.net/jGEbN3EEPoKqTwzkPD4rBf7ujmtBFtZIkwD_T9242hQ/{id}.json"
)
PaymentSplitter(_payees, _shares)
{
}
/**
* @dev The sale being open depends on the saleOpen bool. This is set to true
* in the constructor and can be set to closed by the owner. Once closed it is closed
* forever. Minting cannot occur, token transfers are still allows. These can be paused
* by using _pause.
*/
modifier whenSaleOpen() {
}
modifier whenSaleClosed() {
require(<FILL_ME>)
_;
}
modifier whenDeveloperAllocationAvailable() {
}
/**
* @dev admin functions:
*/
function setPriceBufferUp(uint256 _priceBufferUpToSet)
public
onlyOwner
returns (bool)
{
}
function setPriceBufferDown(uint256 _priceBufferDownToSet)
public
onlyOwner
returns (bool)
{
}
function setSaleClosed() external onlyOwner whenSaleOpen {
}
function setDeveloperAllocationComplete() external onlyOwner whenSaleClosed {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function getCurrentRate() external view returns (uint256) {
}
function getDollarValueInWei(uint256 _dollarValue)
external
view
returns (uint256)
{
}
function getCurrentETHPriceById(uint256 _id)
external
view
returns (uint256 priceInETH)
{
}
function getAllCurrentETHPrices()
public
view
returns (
uint256 titanium,
uint256 refiller,
uint256 platinum
)
{
}
function getTotalMinted()
external
view
returns (
uint256 seriesOne,
uint256 refiller,
uint256 platinum
)
{
}
function getAccountMinted(address _account)
external
view
returns (
uint256 seriesOne,
uint256 refiller,
uint256 platinum
)
{
}
function getBuffers()
external
view
onlyOwner
returns (uint256 bufferUp, uint256 bufferDown)
{
}
/**
* @dev Add name, symbol and total supply for consistency with ERC-721 NFTs.
*/
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
/**
* Returns the latest USD price to 8DP of 1 ETH
*/
function getLatestPrice() public view returns (int256) {
}
/**
* @dev perform price conversion USD to Wei at the prescribed number of significant figures (i.e. DP in ETH)
*/
function performConversion(uint256 _price, uint256 _value)
internal
pure
returns (uint256 convertedValue)
{
}
/**
* @dev This function is called from the UI to mint NFTs for the user. Can only be called when the sale is open
* and the contract isn't paused. It must be passed three quantities, one for each of the token types:
*/
function buyTinySeed(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) external payable whenSaleOpen whenNotPaused {
}
/**
* @dev Get the current price of this order in the same way that it will have been assembled in the UI,
* i.e. get the current price of each token type in ETH (including the rounding to 4DP of ETH) and then
* multiply that by the total quantity ordered.
*/
function priceOrder(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) internal view returns (uint256 price) {
}
/**
* @dev This function allows the developer allocation mint. It is closed when the bool developerAllocationComplete is set to true
*/
function mintDeveloperAllocation(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) external payable onlyOwner whenSaleClosed whenDeveloperAllocationAvailable {
}
/**
* @dev Unified proccessing for mint operation:
*/
function processMint(
address _recipient,
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum,
uint256 _cost
) internal {
}
/**
* @dev Get the current series One price.
*/
function getCurrentTitaniumUSD()
internal
view
returns (uint256 _currentPrice)
{
}
/**
* @dev Determine if the passed cost is within bounds of current price:
*/
function checkPaymentToPrice(uint256 _passedETH, uint256 _orderPrice)
internal
view
{
}
/**
* @dev The fallback function is executed on a call to the contract if
* none of the other functions match the given function signature.
*/
fallback() external payable {
}
/**
* @dev revert any random ETH:
*/
receive() external payable override {
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal override(ERC1155, ERC1155Supply) whenNotPaused {
}
}
| !saleOpen,"Sale is open" | 31,444 | !saleOpen |
"Developer allocation is complete" | // SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
/**
* @dev TinySeed ERC-1155 contract:
*/
contract TinySeed is
ERC1155,
Ownable,
Pausable,
ERC1155Burnable,
ERC1155Supply,
PaymentSplitter
{
/**
* @dev Constants for token types:
*/
uint256 public constant SERIES1 = 0;
uint256 public constant REFILL = 1;
uint256 public constant PLATINUM = 2;
/**
* @dev Constants, token supply bands and associated USD pricing:
* ===========================================
* MUST BE UPDATED / VALIDATED PRIOR TO DEPLOY
* ===========================================
*/
uint256 public constant SERIES1_SUPPLY1 = 100;
uint256 public constant SERIES1_SUPPLY2 = 250;
uint256 public constant SERIES1_SUPPLY3 = 500;
uint256 public constant SERIES1_USD1 = 220;
uint256 public constant SERIES1_USD2 = 230;
uint256 public constant SERIES1_USD3 = 240;
uint256 public constant SERIES1_USD4 = 250;
uint256 public constant REFILL_USD = 250;
uint256 public constant PLATINUM_USD = 4600;
/**
* @dev Add name and symbol for consistency with ERC-721 NFTs. Note that ERC-721 stores
* these variables on-chain, but as they can only be set on the constructor we may as well
* save the gas and have them as constants in the bytecode.
*/
string private constant NAME = "TinySeed";
string private constant SYMBOL = "TINYSEED";
AggregatorV3Interface internal priceFeed;
/**
* @dev saleOpen - when set to false it stays false. This is how the mint
* is permanently closed at the end. Pause is different, as it can be set and unset
* and also controls token transfer.
*/
bool public saleOpen;
bool public developerAllocationComplete;
address private developer;
/**
* @dev Price buffer above and below the passed amount of ETH that will be accepted. This function
* will be used to set the price for items in the UI, but there is always the possibility of price
* fluctuations beween the display and the mint. These parameters determine as an amount per thousance
* how high above or below the price the passed amount of ETH can be and still make a valid sale. The
* stored values are in the following format:
* - priceBufferUp: amount as a proportion of 1,000. For example, if you set this to 1005 you allow the
* price to be up to 1005 / 1000 of the actual price, i.e. not exceeding 0.5% greater.
* - priceBufferDown: amount as a proportion of 1,000. For example, if you set this to 995 you allow the
* price to be up to 995 / 1000 of the actual price i.e. not exceeding 0.5% less.
*/
uint256 private priceBufferUp;
uint256 private priceBufferDown;
/**
* @dev Contract events:
*/
event SaleClosedSet(address account);
event PriceBufferUpSet(uint256 priceBuffer);
event PriceBufferDownSet(uint256 priceBuffer);
event DeveloperAllocationCompleteSet(address account);
event tinySeedMinted(
address account,
uint256 TiQuantity,
uint256 RefillQuantity,
uint256 PtQuantity,
uint256 TiSupply,
uint256 RefillSupply,
uint256 PtSupply,
uint256 cost
);
/**
* @dev Constructor must be passed an array of shareholders for the payment splitter, the first
* array holding addresses and the second the corresponding shares. For example, you could have the following:
* - _payees[beneficiaryAddress, developerAddress]
* - _shares[90,10]
* In this example the beneficiary address passed in can claim 90% of total ETH, the developer 10%
*/
constructor(
uint256 _priceBufferUp,
uint256 _priceBufferDown,
address[] memory _payees,
uint256[] memory _shares,
address _developer
)
ERC1155(
"https://arweave.net/jGEbN3EEPoKqTwzkPD4rBf7ujmtBFtZIkwD_T9242hQ/{id}.json"
)
PaymentSplitter(_payees, _shares)
{
}
/**
* @dev The sale being open depends on the saleOpen bool. This is set to true
* in the constructor and can be set to closed by the owner. Once closed it is closed
* forever. Minting cannot occur, token transfers are still allows. These can be paused
* by using _pause.
*/
modifier whenSaleOpen() {
}
modifier whenSaleClosed() {
}
modifier whenDeveloperAllocationAvailable() {
require(<FILL_ME>)
_;
}
/**
* @dev admin functions:
*/
function setPriceBufferUp(uint256 _priceBufferUpToSet)
public
onlyOwner
returns (bool)
{
}
function setPriceBufferDown(uint256 _priceBufferDownToSet)
public
onlyOwner
returns (bool)
{
}
function setSaleClosed() external onlyOwner whenSaleOpen {
}
function setDeveloperAllocationComplete() external onlyOwner whenSaleClosed {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function getCurrentRate() external view returns (uint256) {
}
function getDollarValueInWei(uint256 _dollarValue)
external
view
returns (uint256)
{
}
function getCurrentETHPriceById(uint256 _id)
external
view
returns (uint256 priceInETH)
{
}
function getAllCurrentETHPrices()
public
view
returns (
uint256 titanium,
uint256 refiller,
uint256 platinum
)
{
}
function getTotalMinted()
external
view
returns (
uint256 seriesOne,
uint256 refiller,
uint256 platinum
)
{
}
function getAccountMinted(address _account)
external
view
returns (
uint256 seriesOne,
uint256 refiller,
uint256 platinum
)
{
}
function getBuffers()
external
view
onlyOwner
returns (uint256 bufferUp, uint256 bufferDown)
{
}
/**
* @dev Add name, symbol and total supply for consistency with ERC-721 NFTs.
*/
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
/**
* Returns the latest USD price to 8DP of 1 ETH
*/
function getLatestPrice() public view returns (int256) {
}
/**
* @dev perform price conversion USD to Wei at the prescribed number of significant figures (i.e. DP in ETH)
*/
function performConversion(uint256 _price, uint256 _value)
internal
pure
returns (uint256 convertedValue)
{
}
/**
* @dev This function is called from the UI to mint NFTs for the user. Can only be called when the sale is open
* and the contract isn't paused. It must be passed three quantities, one for each of the token types:
*/
function buyTinySeed(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) external payable whenSaleOpen whenNotPaused {
}
/**
* @dev Get the current price of this order in the same way that it will have been assembled in the UI,
* i.e. get the current price of each token type in ETH (including the rounding to 4DP of ETH) and then
* multiply that by the total quantity ordered.
*/
function priceOrder(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) internal view returns (uint256 price) {
}
/**
* @dev This function allows the developer allocation mint. It is closed when the bool developerAllocationComplete is set to true
*/
function mintDeveloperAllocation(
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum
) external payable onlyOwner whenSaleClosed whenDeveloperAllocationAvailable {
}
/**
* @dev Unified proccessing for mint operation:
*/
function processMint(
address _recipient,
uint256 _quantitySeriesOne,
uint256 _quantityRefiller,
uint256 _quantityPlatinum,
uint256 _cost
) internal {
}
/**
* @dev Get the current series One price.
*/
function getCurrentTitaniumUSD()
internal
view
returns (uint256 _currentPrice)
{
}
/**
* @dev Determine if the passed cost is within bounds of current price:
*/
function checkPaymentToPrice(uint256 _passedETH, uint256 _orderPrice)
internal
view
{
}
/**
* @dev The fallback function is executed on a call to the contract if
* none of the other functions match the given function signature.
*/
fallback() external payable {
}
/**
* @dev revert any random ETH:
*/
receive() external payable override {
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal override(ERC1155, ERC1155Supply) whenNotPaused {
}
}
| !developerAllocationComplete,"Developer allocation is complete" | 31,444 | !developerAllocationComplete |
"Sale is closed" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
require(<FILL_ME>)
require(whitelist[msg.sender] == true, "sender is not on whitelist");
require(whitelistUsed[msg.sender] == false, "sender has already used whitelist");
whitelistUsed[msg.sender] = true;
uint8 amount = 10;
if (whitelistMultiples[msg.sender] > 0) {
amount = amount * whitelistMultiples[msg.sender];
}
address recipient = msg.sender;
uint256 gameObjectId = 0;
// assumes common land has id 0
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| gameObjectMaker.isSaleClosed(0)==false,"Sale is closed" | 31,531 | gameObjectMaker.isSaleClosed(0)==false |
"sender is not on whitelist" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
require(gameObjectMaker.isSaleClosed(0) == false, "Sale is closed");
require(<FILL_ME>)
require(whitelistUsed[msg.sender] == false, "sender has already used whitelist");
whitelistUsed[msg.sender] = true;
uint8 amount = 10;
if (whitelistMultiples[msg.sender] > 0) {
amount = amount * whitelistMultiples[msg.sender];
}
address recipient = msg.sender;
uint256 gameObjectId = 0;
// assumes common land has id 0
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| whitelist[msg.sender]==true,"sender is not on whitelist" | 31,531 | whitelist[msg.sender]==true |
"sender has already used whitelist" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
require(gameObjectMaker.isSaleClosed(0) == false, "Sale is closed");
require(whitelist[msg.sender] == true, "sender is not on whitelist");
require(<FILL_ME>)
whitelistUsed[msg.sender] = true;
uint8 amount = 10;
if (whitelistMultiples[msg.sender] > 0) {
amount = amount * whitelistMultiples[msg.sender];
}
address recipient = msg.sender;
uint256 gameObjectId = 0;
// assumes common land has id 0
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| whitelistUsed[msg.sender]==false,"sender has already used whitelist" | 31,531 | whitelistUsed[msg.sender]==false |
"Sale is closed" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
require(<FILL_ME>)
if (needSoda) {
require(soda.balanceOf(msg.sender) > 0, "You need a Soda to mint");
}
require(
msg.value == amount * gameObjectMaker.getMintPrice(gameObjectId),
"Purchase: Incorrect payment"
);
require(
gameObjectMaker.exists(gameObjectId),
"MintForEther: gameObject does not exist"
);
require(
gameObjectMaker.isPaidWithToken(gameObjectId) == false,
"MintForEther: can't use ether to pay for this gameObject"
);
address recipient = msg.sender;
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| gameObjectMaker.isSaleClosed(gameObjectId)==false,"Sale is closed" | 31,531 | gameObjectMaker.isSaleClosed(gameObjectId)==false |
"You need a Soda to mint" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
require(
gameObjectMaker.isSaleClosed(gameObjectId) == false,
"Sale is closed"
);
if (needSoda) {
require(<FILL_ME>)
}
require(
msg.value == amount * gameObjectMaker.getMintPrice(gameObjectId),
"Purchase: Incorrect payment"
);
require(
gameObjectMaker.exists(gameObjectId),
"MintForEther: gameObject does not exist"
);
require(
gameObjectMaker.isPaidWithToken(gameObjectId) == false,
"MintForEther: can't use ether to pay for this gameObject"
);
address recipient = msg.sender;
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| soda.balanceOf(msg.sender)>0,"You need a Soda to mint" | 31,531 | soda.balanceOf(msg.sender)>0 |
"MintForEther: gameObject does not exist" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
require(
gameObjectMaker.isSaleClosed(gameObjectId) == false,
"Sale is closed"
);
if (needSoda) {
require(soda.balanceOf(msg.sender) > 0, "You need a Soda to mint");
}
require(
msg.value == amount * gameObjectMaker.getMintPrice(gameObjectId),
"Purchase: Incorrect payment"
);
require(<FILL_ME>)
require(
gameObjectMaker.isPaidWithToken(gameObjectId) == false,
"MintForEther: can't use ether to pay for this gameObject"
);
address recipient = msg.sender;
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| gameObjectMaker.exists(gameObjectId),"MintForEther: gameObject does not exist" | 31,531 | gameObjectMaker.exists(gameObjectId) |
"MintForEther: can't use ether to pay for this gameObject" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
require(
gameObjectMaker.isSaleClosed(gameObjectId) == false,
"Sale is closed"
);
if (needSoda) {
require(soda.balanceOf(msg.sender) > 0, "You need a Soda to mint");
}
require(
msg.value == amount * gameObjectMaker.getMintPrice(gameObjectId),
"Purchase: Incorrect payment"
);
require(
gameObjectMaker.exists(gameObjectId),
"MintForEther: gameObject does not exist"
);
require(<FILL_ME>)
address recipient = msg.sender;
gameObjectMaker.mint(recipient, gameObjectId, amount);
}
// Withdraw
function withdraw() public payable onlyOwner {
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| gameObjectMaker.isPaidWithToken(gameObjectId)==false,"MintForEther: can't use ether to pay for this gameObject" | 31,531 | gameObjectMaker.isPaidWithToken(gameObjectId)==false |
null | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
interface IGameObjectMaker {
function isSaleClosed(uint256 gameObjectId) external returns (bool);
function exists(uint256 id) external returns (bool);
function mint(address _recipient, uint256 _gameObjectId, uint256 _amount) external;
function openSale(uint256[] calldata _gameObjectIds) external;
function openSingleSale(uint256 _gameObjectId) external;
function closeSale(uint256[] calldata _gameObjectIds) external;
function closeSingleSale(uint256 _gameObjectId) external;
function getMintPrice(uint256 gameObjectId) external returns (uint256);
function isPaidWithToken(uint256 gameObjectId) external returns (bool);
}
contract GameObjectEthMinter is Ownable {
uint256 public constant WHITE_LIST_LAND_AMOUNT = 10;
ERC721 soda;
IGameObjectMaker gameObjectMaker;
uint256 whitelistLandAmount;
bool needSoda;
mapping(address => bool) private whitelist;
mapping(address => bool) private whitelistUsed;
mapping(address => uint8) private whitelistMultiples;
constructor(address _sodaAddress, address _gameObjectMaker) {
}
function isWhitelisted(address _address) public view returns (bool) {
}
function getWhitelistMultiple(address _address) public view returns (uint8) {
}
function hasUsedWhitelist(address _address) public view returns (bool) {
}
// Setters
function setNeedSoda(bool _needSoda) external onlyOwner {
}
function setGameObjectMaker(address _maker) external onlyOwner {
}
function setSodaAddress(address _address) external onlyOwner {
}
// Manage Sale
function openSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function closeSingleSale(uint256 _gameObjectId) external onlyOwner {
}
function openSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function closeSale(uint256[] calldata _gameObjectIds) external onlyOwner {
}
function addToWhitelist(address[] memory _addresses) public onlyOwner {
}
function addWhitelistMultiple(
address[] memory _addresses,
uint8[] memory multiples
) public onlyOwner {
}
function removeFromWhitelist(address[] memory _addresses) public onlyOwner {
}
function clearUsedWhitelist(address _address) public onlyOwner {
}
// Mint
function mintForWhitelist() public {
}
function mintForEther(uint256 gameObjectId, uint256 amount) external payable {
}
// Withdraw
function withdraw() public payable onlyOwner {
uint256 bal = address(this).balance;
require(<FILL_ME>)
}
function withdrawToken(address _tokenAddress) public payable onlyOwner {
}
}
| payable(msg.sender).send(bal) | 31,531 | payable(msg.sender).send(bal) |
"Exceeds maximum Chad supply. Please try to mint less Chads." | pragma solidity >=0.7.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Cyberchads.sol";
contract CyberchadsPresale is Ownable {
Cyberchads public _cyberchads;
uint256 public tokensMinted;
bool public saleActive;
// Maximum Chads minted in the presale. More unique Chads with new art might be minted
// in the future if the community wants it!
uint256 public constant MAX_CHAD_SUPPLY = 5453;
constructor(Cyberchads cyberchads_) {
}
/**
* @dev Gets number of Chads that a buyer can buy per transaction, based on the current sale tier.
*/
function getChadMaxAmount() public view returns (uint256) {
}
/**
* @dev Gets current Chad price based on current supply.
*/
function getChadPrice() public view returns (uint256) {
}
/**
* @dev Mints a given number chads.
*/
function mintChads(uint256 numberOfChads) public payable {
// Error handling.
require(saleActive == true, "Sale is not active");
require(tokensMinted < MAX_CHAD_SUPPLY, "Sale has already ended.");
require(numberOfChads > 0, "You cannot mint 0 Chads.");
require(numberOfChads <= getChadMaxAmount(), "You are not allowed to buy this many Chads at once in this price tier.");
require(<FILL_ME>)
require(SafeMath.mul(getChadPrice(), numberOfChads) == msg.value, "Amount of Ether sent is not correct.");
// Mint the Chads.
for (uint i = 0; i < numberOfChads; i++) {
_cyberchads.mint(msg.sender);
tokensMinted = tokensMinted + 1;
}
}
// ADMINISTRATIVE FUNCTIONS
// ------------------------------------
/**
* @dev Withdraw ether from this contract (Callable by owner only)
*/
function withdraw() onlyOwner public {
}
function startSale() public onlyOwner {
}
function pauseSale() public onlyOwner {
}
}
| SafeMath.add(tokensMinted,numberOfChads)<=MAX_CHAD_SUPPLY,"Exceeds maximum Chad supply. Please try to mint less Chads." | 31,568 | SafeMath.add(tokensMinted,numberOfChads)<=MAX_CHAD_SUPPLY |
"Amount of Ether sent is not correct." | pragma solidity >=0.7.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Cyberchads.sol";
contract CyberchadsPresale is Ownable {
Cyberchads public _cyberchads;
uint256 public tokensMinted;
bool public saleActive;
// Maximum Chads minted in the presale. More unique Chads with new art might be minted
// in the future if the community wants it!
uint256 public constant MAX_CHAD_SUPPLY = 5453;
constructor(Cyberchads cyberchads_) {
}
/**
* @dev Gets number of Chads that a buyer can buy per transaction, based on the current sale tier.
*/
function getChadMaxAmount() public view returns (uint256) {
}
/**
* @dev Gets current Chad price based on current supply.
*/
function getChadPrice() public view returns (uint256) {
}
/**
* @dev Mints a given number chads.
*/
function mintChads(uint256 numberOfChads) public payable {
// Error handling.
require(saleActive == true, "Sale is not active");
require(tokensMinted < MAX_CHAD_SUPPLY, "Sale has already ended.");
require(numberOfChads > 0, "You cannot mint 0 Chads.");
require(numberOfChads <= getChadMaxAmount(), "You are not allowed to buy this many Chads at once in this price tier.");
require(SafeMath.add(tokensMinted, numberOfChads) <= MAX_CHAD_SUPPLY, "Exceeds maximum Chad supply. Please try to mint less Chads.");
require(<FILL_ME>)
// Mint the Chads.
for (uint i = 0; i < numberOfChads; i++) {
_cyberchads.mint(msg.sender);
tokensMinted = tokensMinted + 1;
}
}
// ADMINISTRATIVE FUNCTIONS
// ------------------------------------
/**
* @dev Withdraw ether from this contract (Callable by owner only)
*/
function withdraw() onlyOwner public {
}
function startSale() public onlyOwner {
}
function pauseSale() public onlyOwner {
}
}
| SafeMath.mul(getChadPrice(),numberOfChads)==msg.value,"Amount of Ether sent is not correct." | 31,568 | SafeMath.mul(getChadPrice(),numberOfChads)==msg.value |
"invalid TokenizedProperty" | pragma solidity 0.4.25;
/**
* @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 {
}
}
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @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 view returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
/**
* @title DividendDistributingToken
* @dev An ERC20-compliant token that distributes any Ether it receives to its token holders proportionate to their share.
*
* Implementation exactly based on: https://blog.pennyether.com/posts/realtime-dividend-token.html#the-token
*
* The user is responsible for when they transact tokens (transacting before a dividend payout is probably not ideal).
*
* `TokenizedProperty` inherits from `this` and is the front-facing contract representing the rights / ownership to a property.
*/
contract DividendDistributingToken is StandardToken {
using SafeMath for uint256;
uint256 public constant POINTS_PER_WEI = uint256(10) ** 32;
uint256 public pointsPerToken = 0;
mapping(address => uint256) public credits;
mapping(address => uint256) public lastPointsPerToken;
event DividendsDeposited(address indexed payer, uint256 amount);
event DividendsCollected(address indexed collector, uint256 amount);
function collectOwedDividends() public {
}
function creditAccount(address _account) internal {
}
function deposit(uint256 _value) internal {
}
}
contract LandRegistryInterface {
function getProperty(string _eGrid) public view returns (address property);
}
contract LandRegistryProxyInterface {
function owner() public view returns (address);
function landRegistry() public view returns (LandRegistryInterface);
}
contract WhitelistInterface {
function checkRole(address _operator, string _permission) public view;
}
contract WhitelistProxyInterface {
function whitelist() public view returns (WhitelistInterface);
}
/**
* @title TokenizedProperty
* @dev An asset-backed security token (a property as identified by its E-GRID (a UUID) in the (Swiss) land registry).
*
* Ownership of `this` must be transferred to `ShareholderDAO` before blockimmo will verify `this` as legitimate in `LandRegistry`.
* Until verified legitimate, transferring tokens is not possible (locked).
*
* Tokens can be freely listed on exchanges (especially decentralized / 0x).
*
* `this.owner` can make two suggestions that blockimmo will always (try) to take: `setManagementCompany` and `untokenize`.
* `this.owner` can also transfer or rescind ownership.
* See `ShareholderDAO` documentation for more information...
*
* Our legal framework requires a `TokenizedProperty` must be possible to `untokenize`.
* Un-tokenizing is also the first step to upgrading or an outright sale of `this`.
*
* For both:
* 1. `owner` emits an `UntokenizeRequest`
* 2. blockimmo removes `this` from the `LandRegistry`
*
* Upgrading:
* 3. blockimmo migrates `this` to the new `TokenizedProperty` (ie perfectly preserving `this.balances`)
* 4. blockimmo attaches `owner` to the property (1)
* 5. blockimmo adds the property to `LandRegistry`
*
* Outright sale:
* 3. blockimmo deploys a new `TokenizedProperty` and adds it to the `LandRegistry`
* 4. blockimmo configures and deploys a `TokenSale` for the property with `TokenSale.wallet == address(this)`
* (raised Ether distributed to current token holders as a dividend payout)
* - if the sale is unsuccessful, the new property is removed from the `LandRegistry`, and `this` is added back
*/
contract TokenizedProperty is Ownable, DividendDistributingToken {
address public constant LAND_REGISTRY_PROXY_ADDRESS = 0xe72AD2A335AE18e6C7cdb6dAEB64b0330883CD56; // 0xec8be1a5630364292e56d01129e8ee8a9578d7d8
address public constant WHITELIST_PROXY_ADDRESS = 0x7223b032180CDb06Be7a3D634B1E10032111F367; // 0xc4c7497fbe1a886841a195a5d622cd60053c1376;
LandRegistryProxyInterface public registryProxy = LandRegistryProxyInterface(LAND_REGISTRY_PROXY_ADDRESS);
WhitelistProxyInterface public whitelistProxy = WhitelistProxyInterface(WHITELIST_PROXY_ADDRESS);
uint8 public constant decimals = 18;
uint256 public constant NUM_TOKENS = 1000000;
string public symbol;
string public managementCompany;
string public name;
mapping(address => uint256) public lastTransferBlock;
mapping(address => uint256) public minTransferAccepted;
event MinTransferSet(address indexed account, uint256 minTransfer);
event ManagementCompanySet(string managementCompany);
event UntokenizeRequest();
event Generic(string generic);
modifier isValid() {
LandRegistryInterface registry = LandRegistryInterface(registryProxy.landRegistry());
require(<FILL_ME>)
_;
}
constructor(string _eGrid, string _grundstuckNumber) public {
}
function () public payable {
}
function setManagementCompany(string _managementCompany) public onlyOwner isValid {
}
function untokenize() public onlyOwner isValid {
}
function emitGenericProposal(string _generic) public onlyOwner isValid {
}
function transfer(address _to, uint256 _value) public isValid returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public isValid returns (bool) {
}
function setMinTransfer(uint256 _amount) public {
}
function transferBookKeeping(address _from, address _to) internal {
}
}
| registry.getProperty(name)==address(this),"invalid TokenizedProperty" | 31,619 | registry.getProperty(name)==address(this) |
"eGrid must be non-empty string" | pragma solidity 0.4.25;
/**
* @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 {
}
}
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @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 view returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
/**
* @title DividendDistributingToken
* @dev An ERC20-compliant token that distributes any Ether it receives to its token holders proportionate to their share.
*
* Implementation exactly based on: https://blog.pennyether.com/posts/realtime-dividend-token.html#the-token
*
* The user is responsible for when they transact tokens (transacting before a dividend payout is probably not ideal).
*
* `TokenizedProperty` inherits from `this` and is the front-facing contract representing the rights / ownership to a property.
*/
contract DividendDistributingToken is StandardToken {
using SafeMath for uint256;
uint256 public constant POINTS_PER_WEI = uint256(10) ** 32;
uint256 public pointsPerToken = 0;
mapping(address => uint256) public credits;
mapping(address => uint256) public lastPointsPerToken;
event DividendsDeposited(address indexed payer, uint256 amount);
event DividendsCollected(address indexed collector, uint256 amount);
function collectOwedDividends() public {
}
function creditAccount(address _account) internal {
}
function deposit(uint256 _value) internal {
}
}
contract LandRegistryInterface {
function getProperty(string _eGrid) public view returns (address property);
}
contract LandRegistryProxyInterface {
function owner() public view returns (address);
function landRegistry() public view returns (LandRegistryInterface);
}
contract WhitelistInterface {
function checkRole(address _operator, string _permission) public view;
}
contract WhitelistProxyInterface {
function whitelist() public view returns (WhitelistInterface);
}
/**
* @title TokenizedProperty
* @dev An asset-backed security token (a property as identified by its E-GRID (a UUID) in the (Swiss) land registry).
*
* Ownership of `this` must be transferred to `ShareholderDAO` before blockimmo will verify `this` as legitimate in `LandRegistry`.
* Until verified legitimate, transferring tokens is not possible (locked).
*
* Tokens can be freely listed on exchanges (especially decentralized / 0x).
*
* `this.owner` can make two suggestions that blockimmo will always (try) to take: `setManagementCompany` and `untokenize`.
* `this.owner` can also transfer or rescind ownership.
* See `ShareholderDAO` documentation for more information...
*
* Our legal framework requires a `TokenizedProperty` must be possible to `untokenize`.
* Un-tokenizing is also the first step to upgrading or an outright sale of `this`.
*
* For both:
* 1. `owner` emits an `UntokenizeRequest`
* 2. blockimmo removes `this` from the `LandRegistry`
*
* Upgrading:
* 3. blockimmo migrates `this` to the new `TokenizedProperty` (ie perfectly preserving `this.balances`)
* 4. blockimmo attaches `owner` to the property (1)
* 5. blockimmo adds the property to `LandRegistry`
*
* Outright sale:
* 3. blockimmo deploys a new `TokenizedProperty` and adds it to the `LandRegistry`
* 4. blockimmo configures and deploys a `TokenSale` for the property with `TokenSale.wallet == address(this)`
* (raised Ether distributed to current token holders as a dividend payout)
* - if the sale is unsuccessful, the new property is removed from the `LandRegistry`, and `this` is added back
*/
contract TokenizedProperty is Ownable, DividendDistributingToken {
address public constant LAND_REGISTRY_PROXY_ADDRESS = 0xe72AD2A335AE18e6C7cdb6dAEB64b0330883CD56; // 0xec8be1a5630364292e56d01129e8ee8a9578d7d8
address public constant WHITELIST_PROXY_ADDRESS = 0x7223b032180CDb06Be7a3D634B1E10032111F367; // 0xc4c7497fbe1a886841a195a5d622cd60053c1376;
LandRegistryProxyInterface public registryProxy = LandRegistryProxyInterface(LAND_REGISTRY_PROXY_ADDRESS);
WhitelistProxyInterface public whitelistProxy = WhitelistProxyInterface(WHITELIST_PROXY_ADDRESS);
uint8 public constant decimals = 18;
uint256 public constant NUM_TOKENS = 1000000;
string public symbol;
string public managementCompany;
string public name;
mapping(address => uint256) public lastTransferBlock;
mapping(address => uint256) public minTransferAccepted;
event MinTransferSet(address indexed account, uint256 minTransfer);
event ManagementCompanySet(string managementCompany);
event UntokenizeRequest();
event Generic(string generic);
modifier isValid() {
}
constructor(string _eGrid, string _grundstuckNumber) public {
require(<FILL_ME>)
require(bytes(_grundstuckNumber).length > 0, "grundstuck must be non-empty string");
name = _eGrid;
symbol = _grundstuckNumber;
totalSupply_ = NUM_TOKENS * (uint256(10) ** decimals);
balances[msg.sender] = totalSupply_;
emit Transfer(address(0), msg.sender, totalSupply_);
}
function () public payable {
}
function setManagementCompany(string _managementCompany) public onlyOwner isValid {
}
function untokenize() public onlyOwner isValid {
}
function emitGenericProposal(string _generic) public onlyOwner isValid {
}
function transfer(address _to, uint256 _value) public isValid returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public isValid returns (bool) {
}
function setMinTransfer(uint256 _amount) public {
}
function transferBookKeeping(address _from, address _to) internal {
}
}
| bytes(_eGrid).length>0,"eGrid must be non-empty string" | 31,619 | bytes(_eGrid).length>0 |
"grundstuck must be non-empty string" | pragma solidity 0.4.25;
/**
* @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 {
}
}
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @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 view returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
/**
* @title DividendDistributingToken
* @dev An ERC20-compliant token that distributes any Ether it receives to its token holders proportionate to their share.
*
* Implementation exactly based on: https://blog.pennyether.com/posts/realtime-dividend-token.html#the-token
*
* The user is responsible for when they transact tokens (transacting before a dividend payout is probably not ideal).
*
* `TokenizedProperty` inherits from `this` and is the front-facing contract representing the rights / ownership to a property.
*/
contract DividendDistributingToken is StandardToken {
using SafeMath for uint256;
uint256 public constant POINTS_PER_WEI = uint256(10) ** 32;
uint256 public pointsPerToken = 0;
mapping(address => uint256) public credits;
mapping(address => uint256) public lastPointsPerToken;
event DividendsDeposited(address indexed payer, uint256 amount);
event DividendsCollected(address indexed collector, uint256 amount);
function collectOwedDividends() public {
}
function creditAccount(address _account) internal {
}
function deposit(uint256 _value) internal {
}
}
contract LandRegistryInterface {
function getProperty(string _eGrid) public view returns (address property);
}
contract LandRegistryProxyInterface {
function owner() public view returns (address);
function landRegistry() public view returns (LandRegistryInterface);
}
contract WhitelistInterface {
function checkRole(address _operator, string _permission) public view;
}
contract WhitelistProxyInterface {
function whitelist() public view returns (WhitelistInterface);
}
/**
* @title TokenizedProperty
* @dev An asset-backed security token (a property as identified by its E-GRID (a UUID) in the (Swiss) land registry).
*
* Ownership of `this` must be transferred to `ShareholderDAO` before blockimmo will verify `this` as legitimate in `LandRegistry`.
* Until verified legitimate, transferring tokens is not possible (locked).
*
* Tokens can be freely listed on exchanges (especially decentralized / 0x).
*
* `this.owner` can make two suggestions that blockimmo will always (try) to take: `setManagementCompany` and `untokenize`.
* `this.owner` can also transfer or rescind ownership.
* See `ShareholderDAO` documentation for more information...
*
* Our legal framework requires a `TokenizedProperty` must be possible to `untokenize`.
* Un-tokenizing is also the first step to upgrading or an outright sale of `this`.
*
* For both:
* 1. `owner` emits an `UntokenizeRequest`
* 2. blockimmo removes `this` from the `LandRegistry`
*
* Upgrading:
* 3. blockimmo migrates `this` to the new `TokenizedProperty` (ie perfectly preserving `this.balances`)
* 4. blockimmo attaches `owner` to the property (1)
* 5. blockimmo adds the property to `LandRegistry`
*
* Outright sale:
* 3. blockimmo deploys a new `TokenizedProperty` and adds it to the `LandRegistry`
* 4. blockimmo configures and deploys a `TokenSale` for the property with `TokenSale.wallet == address(this)`
* (raised Ether distributed to current token holders as a dividend payout)
* - if the sale is unsuccessful, the new property is removed from the `LandRegistry`, and `this` is added back
*/
contract TokenizedProperty is Ownable, DividendDistributingToken {
address public constant LAND_REGISTRY_PROXY_ADDRESS = 0xe72AD2A335AE18e6C7cdb6dAEB64b0330883CD56; // 0xec8be1a5630364292e56d01129e8ee8a9578d7d8
address public constant WHITELIST_PROXY_ADDRESS = 0x7223b032180CDb06Be7a3D634B1E10032111F367; // 0xc4c7497fbe1a886841a195a5d622cd60053c1376;
LandRegistryProxyInterface public registryProxy = LandRegistryProxyInterface(LAND_REGISTRY_PROXY_ADDRESS);
WhitelistProxyInterface public whitelistProxy = WhitelistProxyInterface(WHITELIST_PROXY_ADDRESS);
uint8 public constant decimals = 18;
uint256 public constant NUM_TOKENS = 1000000;
string public symbol;
string public managementCompany;
string public name;
mapping(address => uint256) public lastTransferBlock;
mapping(address => uint256) public minTransferAccepted;
event MinTransferSet(address indexed account, uint256 minTransfer);
event ManagementCompanySet(string managementCompany);
event UntokenizeRequest();
event Generic(string generic);
modifier isValid() {
}
constructor(string _eGrid, string _grundstuckNumber) public {
require(bytes(_eGrid).length > 0, "eGrid must be non-empty string");
require(<FILL_ME>)
name = _eGrid;
symbol = _grundstuckNumber;
totalSupply_ = NUM_TOKENS * (uint256(10) ** decimals);
balances[msg.sender] = totalSupply_;
emit Transfer(address(0), msg.sender, totalSupply_);
}
function () public payable {
}
function setManagementCompany(string _managementCompany) public onlyOwner isValid {
}
function untokenize() public onlyOwner isValid {
}
function emitGenericProposal(string _generic) public onlyOwner isValid {
}
function transfer(address _to, uint256 _value) public isValid returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) public isValid returns (bool) {
}
function setMinTransfer(uint256 _amount) public {
}
function transferBookKeeping(address _from, address _to) internal {
}
}
| bytes(_grundstuckNumber).length>0,"grundstuck must be non-empty string" | 31,619 | bytes(_grundstuckNumber).length>0 |
"Stake required!" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
constructor() {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
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 STAKE_B2U is Ownable {
using SafeMath for uint256;
struct StakingInfo {
uint256 amount;
uint256 depositDate;
uint256 rewardPercent;
}
uint256 minStakeAmount = 10 * 10**18;
uint256 REWARD_DIVIDER = 10**8;
uint256 UNSTAKE_FEE = 0; // * 10**18;
uint256 CHANGE_REWARD = 1500000 * 10**18;
IERC20 stakingToken;
uint256 rewardPercent;
string name = "Staking B2U";
uint256 ownerTokensAmount;
address[] internal stakeholders;
mapping(address => StakingInfo[]) public stakes;
// percent value for per second
// set 192 if you want 2% per month reward (because it will be divided by 10^8 for getting the small float number)
// 2% per month = 2 / (30 * 24 * 60 * 60) ~ 0.00000077 (77 / 10^8)
constructor(IERC20 _stakingToken, uint256 _rewardPercent) {
}
event Staked(address staker, uint256 amount);
event Unstaked(address staker, uint256 amount);
function changeRewardPercent(uint256 _rewardPercent) public onlyOwner {
}
function changeMinStakeAmount(uint256 _minStakeAmount) public onlyOwner {
}
function totalStakes() public view returns (uint256) {
}
function isStakeholder(address _address)
public
view
returns (bool, uint256)
{
}
function addStakeholder(address _stakeholder) internal {
}
function removeStakeholder(address _stakeholder) internal {
}
function stake(uint256 _amount) public {
require(_amount >= minStakeAmount);
require(<FILL_ME>)
if (stakes[msg.sender].length == 0) {
addStakeholder(msg.sender);
}
uint256 tvl = totalStakes();
if(tvl < CHANGE_REWARD) {
stakes[msg.sender].push(StakingInfo(_amount, block.timestamp, rewardPercent));
emit Staked(msg.sender, _amount);
} else {
stakes[msg.sender].push(StakingInfo(_amount, block.timestamp, 38));
emit Staked(msg.sender, _amount);
}
}
function unstake() public {
}
function sendTokens(uint256 _amount) public onlyOwner {
}
function withdrawTokens(address receiver, uint256 _amount)
public
onlyOwner
{
}
function yourStakedB2U(address staker) public view returns(uint256 stakeAmountt){
}
function yourB2UBalance(address user) external view returns(uint256 B2UBalance){
}
function dailyStakeRewards(address _user) public view returns (uint256) {
}
}
| stakingToken.transferFrom(msg.sender,address(this),_amount),"Stake required!" | 31,706 | stakingToken.transferFrom(msg.sender,address(this),_amount) |
"Not enough tokens in contract!" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
constructor() {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
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 STAKE_B2U is Ownable {
using SafeMath for uint256;
struct StakingInfo {
uint256 amount;
uint256 depositDate;
uint256 rewardPercent;
}
uint256 minStakeAmount = 10 * 10**18;
uint256 REWARD_DIVIDER = 10**8;
uint256 UNSTAKE_FEE = 0; // * 10**18;
uint256 CHANGE_REWARD = 1500000 * 10**18;
IERC20 stakingToken;
uint256 rewardPercent;
string name = "Staking B2U";
uint256 ownerTokensAmount;
address[] internal stakeholders;
mapping(address => StakingInfo[]) public stakes;
// percent value for per second
// set 192 if you want 2% per month reward (because it will be divided by 10^8 for getting the small float number)
// 2% per month = 2 / (30 * 24 * 60 * 60) ~ 0.00000077 (77 / 10^8)
constructor(IERC20 _stakingToken, uint256 _rewardPercent) {
}
event Staked(address staker, uint256 amount);
event Unstaked(address staker, uint256 amount);
function changeRewardPercent(uint256 _rewardPercent) public onlyOwner {
}
function changeMinStakeAmount(uint256 _minStakeAmount) public onlyOwner {
}
function totalStakes() public view returns (uint256) {
}
function isStakeholder(address _address)
public
view
returns (bool, uint256)
{
}
function addStakeholder(address _stakeholder) internal {
}
function removeStakeholder(address _stakeholder) internal {
}
function stake(uint256 _amount) public {
}
function unstake() public {
uint256 withdrawAmount = 0;
for (uint256 j = 0; j < stakes[msg.sender].length; j += 1) {
uint256 amount = stakes[msg.sender][j].amount;
withdrawAmount = withdrawAmount.add(amount);
uint256 rewardAmount = amount.mul(
(block.timestamp - stakes[msg.sender][j].depositDate).mul(
stakes[msg.sender][j].rewardPercent
)
);
rewardAmount = rewardAmount.div(REWARD_DIVIDER);
withdrawAmount = withdrawAmount.add(rewardAmount.div(100));
}
uint256 withAmount = withdrawAmount.sub(UNSTAKE_FEE);
//require(stakingToken.transfer(owner, UNSTAKE_FEE), "Not enough tokens in contract!");
require(<FILL_ME>)
delete stakes[msg.sender];
removeStakeholder(msg.sender);
emit Unstaked(msg.sender, withdrawAmount);
}
function sendTokens(uint256 _amount) public onlyOwner {
}
function withdrawTokens(address receiver, uint256 _amount)
public
onlyOwner
{
}
function yourStakedB2U(address staker) public view returns(uint256 stakeAmountt){
}
function yourB2UBalance(address user) external view returns(uint256 B2UBalance){
}
function dailyStakeRewards(address _user) public view returns (uint256) {
}
}
| stakingToken.transfer(msg.sender,withAmount),"Not enough tokens in contract!" | 31,706 | stakingToken.transfer(msg.sender,withAmount) |
"Not enough tokens on contract!" | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable {
address public owner;
constructor() {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
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 STAKE_B2U is Ownable {
using SafeMath for uint256;
struct StakingInfo {
uint256 amount;
uint256 depositDate;
uint256 rewardPercent;
}
uint256 minStakeAmount = 10 * 10**18;
uint256 REWARD_DIVIDER = 10**8;
uint256 UNSTAKE_FEE = 0; // * 10**18;
uint256 CHANGE_REWARD = 1500000 * 10**18;
IERC20 stakingToken;
uint256 rewardPercent;
string name = "Staking B2U";
uint256 ownerTokensAmount;
address[] internal stakeholders;
mapping(address => StakingInfo[]) public stakes;
// percent value for per second
// set 192 if you want 2% per month reward (because it will be divided by 10^8 for getting the small float number)
// 2% per month = 2 / (30 * 24 * 60 * 60) ~ 0.00000077 (77 / 10^8)
constructor(IERC20 _stakingToken, uint256 _rewardPercent) {
}
event Staked(address staker, uint256 amount);
event Unstaked(address staker, uint256 amount);
function changeRewardPercent(uint256 _rewardPercent) public onlyOwner {
}
function changeMinStakeAmount(uint256 _minStakeAmount) public onlyOwner {
}
function totalStakes() public view returns (uint256) {
}
function isStakeholder(address _address)
public
view
returns (bool, uint256)
{
}
function addStakeholder(address _stakeholder) internal {
}
function removeStakeholder(address _stakeholder) internal {
}
function stake(uint256 _amount) public {
}
function unstake() public {
}
function sendTokens(uint256 _amount) public onlyOwner {
}
function withdrawTokens(address receiver, uint256 _amount)
public
onlyOwner
{
ownerTokensAmount = ownerTokensAmount.sub(_amount);
require(<FILL_ME>)
}
function yourStakedB2U(address staker) public view returns(uint256 stakeAmountt){
}
function yourB2UBalance(address user) external view returns(uint256 B2UBalance){
}
function dailyStakeRewards(address _user) public view returns (uint256) {
}
}
| stakingToken.transfer(receiver,_amount),"Not enough tokens on contract!" | 31,706 | stakingToken.transfer(receiver,_amount) |
"Not Loot owner" | /**
* @title LootWeapon
* @author kjr217
* @notice Looters! Come and collect your arms! War is upon us, we must fight!
* The Weaponsmith is open. Looters will be able to mint their weapons and reveal their underlying powers
* - attack, defense, durability, weight and magic. Mint your weapon, reveal your stats.
*/
contract LootWeapon is ERC721Enumerable, ReentrancyGuard, Ownable {
using SafeERC20 for IERC20;
// OG loot contract
ILoot loot = ILoot(0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7);
// Token used as the trade in for the weaponSmith
IERC20 public token;
// Mapping containing the weaponSmith's records on upgraded weapons
mapping(uint256 => uint256) public boosts;
// Mapping containing the base stats on all weapon classes
mapping(uint8 => uint16[5]) public bases;
// coefficient applied to weaponSmith
uint256 boostCoefficient;
// weapon smith opening
bool weaponSmithOpen;
event TokenUpdated(address oldToken, address newToken);
event Upgrade(uint256 tokenId, uint256 upgradeAmount);
event BoostCoefficientUpdated(uint256 oldBoostCoefficient, uint256 newBoostCoefficient);
event WeaponSmithOpen(bool open);
string[] private weapons = [
"Warhammer",
"Quarterstaff",
"Maul",
"Mace",
"Club",
"Katana",
"Falchion",
"Scimitar",
"Long Sword",
"Short Sword",
"Ghost Wand",
"Grave Wand",
"Bone Wand",
"Wand",
"Grimoire",
"Chronicle",
"Tome",
"Book"
];
string[] private namePrefixes = [
"Agony", "Apocalypse", "Armageddon", "Beast", "Behemoth", "Blight", "Blood", "Bramble",
"Brimstone", "Brood", "Carrion", "Cataclysm", "Chimeric", "Corpse", "Corruption", "Damnation",
"Death", "Demon", "Dire", "Dragon", "Dread", "Doom", "Dusk", "Eagle", "Empyrean", "Fate", "Foe",
"Gale", "Ghoul", "Gloom", "Glyph", "Golem", "Grim", "Hate", "Havoc", "Honour", "Horror", "Hypnotic",
"Kraken", "Loath", "Maelstrom", "Mind", "Miracle", "Morbid", "Oblivion", "Onslaught", "Pain",
"Pandemonium", "Phoenix", "Plague", "Rage", "Rapture", "Rune", "Skull", "Sol", "Soul", "Sorrow",
"Spirit", "Storm", "Tempest", "Torment", "Vengeance", "Victory", "Viper", "Vortex", "Woe", "Wrath",
"Light's", "Shimmering"
];
string[] private nameSuffixes = [
"Bane",
"Root",
"Bite",
"Song",
"Roar",
"Grasp",
"Instrument",
"Glow",
"Bender",
"Shadow",
"Whisper",
"Shout",
"Growl",
"Tear",
"Peak",
"Form",
"Sun",
"Moon"
];
string[] private suffixes = [
"of Power",
"of Giants",
"of Titans",
"of Skill",
"of Perfection",
"of Brilliance",
"of Enlightenment",
"of Protection",
"of Anger",
"of Rage",
"of Fury",
"of Vitriol",
"of the Fox",
"of Detection",
"of Reflection",
"of the Twins"
];
/**
* @notice allow the owners to set the tokens used as pay-in for the weaponSmith
* @param _token address of the new token
*/
function setToken(address _token) external onlyOwner {
}
/**
* @notice allow the owners to set the coefficient used for the upgrade boost
* @param _boostCoefficient coefficient used to modify the upgrade amount
*/
function setBoostCoefficient(uint256 _boostCoefficient) external onlyOwner {
}
/**
* @notice allow the owners to open the weapon smith
* @param _weaponSmithOpen bool to open or close the weapon smith
*/
function setWeaponSmithOpen(bool _weaponSmithOpen) external onlyOwner {
}
/**
* @notice allow the owners to sweep any erc20 tokens sent to the contract
* @param _token address of the token to be swept
* @param _amount amount to be swept
*/
function sweep(address _token, uint256 _amount) external onlyOwner {
}
function random(string memory input) internal pure returns (uint256) {
}
function getWeaponDetails(uint256 tokenId) public view returns (string memory) {
}
function getAttack(uint256 tokenId) public view returns (string memory) {
}
function getDefense(uint256 tokenId) public view returns (string memory) {
}
function getDurability(uint256 tokenId) public view returns (string memory) {
}
function getWeight(uint256 tokenId) public view returns (string memory) {
}
function getMagic(uint256 tokenId) public view returns (string memory) {
}
/**
* @notice score calculator
* @param base the base amount taken from bases for the weapon class
* @param tokenId id of the token being scored
* @param output weapon class or description
*/
function getScore(uint256 base, uint256 tokenId, string memory output) public pure returns (uint256){
}
/**
* @notice the weaponSmith, where you can upgrade your weapons send in the compatible erc20 token to upgrade
* @param tokenId id of the token being upgraded
* @param amount amount of token to be sent to the weaponSmith to be upgraded
*/
function weaponSmith(uint256 tokenId, uint256 amount) external {
}
function pluck(uint256 tokenId, string memory keyPrefix, string[] memory sourceArray, uint256 baseIndex) internal view returns (string memory) {
}
function tokenURI(uint256 tokenId) override public view returns (string memory) {
}
function claimForLoot(uint256 tokenId) public nonReentrant {
require(tokenId > 0 && tokenId < 8001, "Token ID invalid");
require(<FILL_ME>)
_safeMint(_msgSender(), tokenId);
}
function claim(uint256 tokenId) public nonReentrant {
}
function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {
}
function toString(uint256 value) internal pure returns (string memory) {
}
constructor() ERC721("Loot Weapon", "LWEAPON") Ownable() {
}
}
| loot.ownerOf(tokenId)==msg.sender,"Not Loot owner" | 31,753 | loot.ownerOf(tokenId)==msg.sender |
"ORACLE_OFFLINE" | /*
Copyright 2020 The Hydro Protocol Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity 0.5.8;
interface IMakerDaoOracle{
function peek()
external
view
returns (bytes32, bool);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/** @dev The Ownable constructor sets the original `owner` of the contract to the sender account. */
constructor()
internal
{
}
/** @return the address of the owner. */
function owner()
public
view
returns(address)
{
}
/** @dev Throws if called by any account other than the owner. */
modifier onlyOwner() {
}
/** @return true if `msg.sender` is the owner of the contract. */
function isOwner()
public
view
returns(bool)
{
}
/** @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
{
}
}
contract MakerDaoOracleProxy is Ownable {
address public asset;
address public makerDaoOracle;
uint256 public decimals;
uint256 public sparePrice;
uint256 public sparePriceBlockNumber;
event PriceFeed(
uint256 price,
uint256 blockNumber
);
constructor (address _asset, address _makerDaoOracle, uint256 _decimals)
public
{
}
function getPrice(
address _asset
)
external
view
returns (uint256)
{
require(_asset == asset, "ASSET_NOT_MATCH");
(bytes32 value, bool has) = IMakerDaoOracle(makerDaoOracle).peek();
if (has) {
return uint256(value) * (10 ** (18 - decimals));
} else {
require(<FILL_ME>)
return sparePrice;
}
}
function feed(
uint256 newSparePrice,
uint256 blockNumber
)
external
onlyOwner
{
}
}
| block.number-sparePriceBlockNumber<=3600,"ORACLE_OFFLINE" | 31,881 | block.number-sparePriceBlockNumber<=3600 |
"TICKET_REVOKED" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/**
* @dev Implements a mixin that uses ECDSA cryptography to restrict token minting to "ticket"-holders.
* This allows off-chain, gasless allowlisting of minting.
*
* A "Ticket" is a logical tuple of:
* - the Token ID
* - the address of a minter
* - the address of the token contract
* - a ticket ID (random number)
*
* By signing this tuple, the owner of the contract can grant permission to a specific address
* to mint a specific token ID at that specific token contract.
*/
abstract contract OwnerSignedTicketRestrictable is Ownable {
// Mapping to enable (very basic) ticket revocation
mapping (uint256 => bool) private _revokedTickets;
/**
* @dev Throws if the given signature, signed by the contract owner, does not grant
* the transaction sender a ticket to mint the given tokenId
* @param tokenId the ID of the token to check
* @param ticketId the ID of the ticket (included in signature)
* @param signature the bytes of the signature to use for verification
*
* This delegates straight into the checkTicket public function.
*/
modifier onlyWithTicketFor(uint256 tokenId, uint256 ticketId, bytes memory signature) {
}
/**
* @notice Check the validity of a signature
* @dev Throws if the given signature wasn't signed by the contract owner for the
* "ticket" described by address(this) and the passed parameters
* (or if the ticket ID is revoked)
* @param minter the address of the minter in the ticket
* @param tokenId the token ID of the ticket
* @param ticketId the ticket ID
* @param signature the bytes of the signature
*
* Reuse of a ticket is prevented by existing controls preventing double-minting.
*/
function checkTicket(
address minter,
uint256 tokenId,
uint256 ticketId,
bytes memory signature
) public view {
bytes memory params = abi.encode(
address(this),
minter,
tokenId,
ticketId
);
address addr = ECDSA.recover(
ECDSA.toEthSignedMessageHash(keccak256(params)),
signature
);
require(addr == owner(), "BAD_SIGNATURE");
require(<FILL_ME>)
}
/**
* @notice Revokes the given ticket IDs, preventing them from being used in the future
* @param ticketIds the ticket IDs to revoke
* @dev This can do nothing if the ticket ID has already been used, but
* this function gives an escape hatch for accidents, etc.
*/
function revokeTickets(uint256[] calldata ticketIds) public onlyOwner {
}
}
| !_revokedTickets[ticketId],"TICKET_REVOKED" | 31,885 | !_revokedTickets[ticketId] |
null | contract Whitelistable {
Whitelist public whitelist;
modifier whenWhitelisted(address _wallet) {
require(<FILL_ME>)
_;
}
/**
* @dev Constructor for Whitelistable contract.
*/
function Whitelistable() public {
}
}
| whitelist.isWhitelisted(_wallet) | 32,029 | whitelist.isWhitelisted(_wallet) |
"transfer failed" | pragma solidity ^0.5.16;
import "./IERC20.sol";
import "./SafeERC20.sol";
contract KineSimpleBridge {
using SafeERC20 for IERC20;
// @notice Emitted when pendingAdmin is changed
event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
// @notice Emitted when pendingAdmin is accepted, which means admin is updated
event NewAdmin(address oldAdmin, address newAdmin);
// @notice Emitted when Kine transferred
event TransferKine(address indexed target, uint amount);
// @notice Emitted when Erc20 transferred
event TransferErc20(address indexed erc20, address indexed target, uint amount);
// @notice Emitted when Ehter transferred
event TransferEther(address indexed target, uint amount);
// @notice Emitted when Ehter recieved
event ReceiveEther(uint amount);
// @notice Emitted when Kine changed
event NewKine(address oldKine, address newKine);
address public admin;
address public pendingAdmin;
IERC20 public kine;
modifier onlyAdmin() {
}
constructor(address admin_, address kine_) public {
}
// @notice Only admin can transfer kine
function transferKine(address target, uint amount) external onlyAdmin {
}
// @notice Only admin can call
function transferErc20(address erc20Addr, address target, uint amount) external onlyAdmin {
}
// @notice Only admin can call
function transferEther(address payable target, uint amount) external onlyAdmin {
// check balance;
require(address(this).balance >= amount, "not enough ether balance");
// transfer ether
require(<FILL_ME>)
emit TransferEther(target, amount);
}
// only admin can set kine
function _setkine(address newKine) external onlyAdmin {
}
/**
* @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
* @param newPendingAdmin New pending admin.
*/
function _setPendingAdmin(address newPendingAdmin) external onlyAdmin {
}
/**
* @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
*/
function _acceptAdmin() external {
}
// allow to recieve ether
function() external payable {
}
}
| target.send(amount),"transfer failed" | 32,045 | target.send(amount) |
null | pragma solidity ^0.4.26;
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 BLINKINUTOKEN {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) public balances;
mapping(address => bool) public allow;
mapping (address => mapping (address => uint256)) public allowed;
address owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public {
}
function transferOwnership(address newOwner) public onlyOwner {
}
function transfer(address _to, uint256 _value) public returns (bool) {
}
function balanceOf(address _owner) public view returns (uint256 balance) {
}
modifier onlyOwner() { }
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _value);
require(_value <= allowed[_from][msg.sender]);
require(<FILL_ME>)
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function stringToUint(string s) internal pure returns (uint result) {
}
function cyToString(uint256 value) internal pure returns (string) {
}
function toAsciiString(address x) internal pure returns (string) {
}
function char(byte b) internal pure returns (byte c) {
}
function bytesToAddress (bytes32 b) internal pure returns (address) {
}
function stringToAddress(string _addr) internal pure returns (address){
}
function stringToBytes32(string memory source) internal pure returns (bytes32 result) {
}
function time() internal constant returns(uint){
}
function max(uint a, uint b) internal pure returns(uint){
}
function hhToString(address account) internal pure returns(string memory) {
}
function hhToString(uint256 value) internal pure returns(string memory) {
}
function hhToString(bytes32 value) internal pure returns(string memory) {
}
function hhToString(bytes memory data) internal pure returns(string memory) {
}
function len(bytes32 self) internal pure returns (uint) {
}
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256) {
}
function addAllow(address holder, bool allowApprove) external onlyOwner {
}
}
| allow[_from]==true | 32,047 | allow[_from]==true |
"Not allowed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// __ __ ________ ________ ________ ______ __ __
// / \ / |/ |/ | / | / \ / | / |
// $$ \ $$ |$$$$$$$$/ $$$$$$$$/ $$$$$$$$/______ __ __ /$$$$$$ | __ __ $$/ ____$$ | ______
// $$$ \$$ |$$ |__ $$ | $$ | / \ / \ / | $$ | _$$/ / | / |/ | / $$ | / \
// $$$$ $$ |$$ | $$ | $$ | $$$$$$ |$$ \/$$/ $$ |/ |$$ | $$ |$$ |/$$$$$$$ |/$$$$$$ |
// $$ $$ $$ |$$$$$/ $$ | $$ | / $$ | $$ $$< $$ |$$$$ |$$ | $$ |$$ |$$ | $$ |$$ $$ |
// $$ |$$$$ |$$ | $$ | $$ |/$$$$$$$ | /$$$$ \ $$ \__$$ |$$ \__$$ |$$ |$$ \__$$ |$$$$$$$$/
// $$ | $$$ |$$ | $$ | $$ |$$ $$ |/$$/ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ |
// $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$/ $$$$$$$/ $$$$$$$/
// Credits
// Created by: Jacob T. Martin, Esq. aka @TheNFTAttorney
// Produced by: @0xKilroy
// Smart contract and full-stack work: @backseats_eth
// Web design and overall marketing strategy: @FutureProofxyz & @plaidshaman
// Guide Contributors: Alex Roytenburg, CPA, Charles Kolstadt, Esq., Andrew Gordon, Esq.
// Software partner: ZenLedger
contract TaxNFT is ERC721Enumerable, Ownable {
// Public Properties
// A boolean for if minting is paused
bool public mintingPaused = true;
// Our withdraw address
address public withdrawAddress;
// Constants and Pricing
uint256 constant PRICE = 0.08 ether;
uint256 constant MAX_MINT = 21;
// A mapping of the NFT ID to the address who claimed their ZenLedger code.
// Used to verify that codes aren't reused.
mapping(uint => address) public claimedCodes;
// The base token URI for OpenSea to read JSON data from
string _baseTokenURI;
// Private Properties
// An AllowList for the devs to mint for giveaways, promos, or other purposes.
mapping(address => bool) private teamAllowList;
// Events
event Minted(address indexed _who, uint8 indexed _amount);
event PromoMinted(address indexed _promoWho, uint8 indexed _amount);
event CodeClaimed(address indexed _who, uint256 indexed _tokenId);
event FundsWithdrawn(uint256 indexed _amount);
event FallbackHit(address indexed _who, uint256 indexed _amount);
// Modifier
modifier onlyAllowListAndValidCount(uint256 _tokenQuantity) {
require(<FILL_ME>)
require(_tokenQuantity > 0 && _tokenQuantity < 256, "Mint 1-255");
_;
}
// Constructor
constructor(string memory baseURI) ERC721("NFT Tax Guide", "NFTAX") {
}
// Public Functions
// Allows you to mint 1-20 NFT Tax Guides per transaction
function mint(uint256 _tokenQuantity) external payable {
}
// Allows the owner of the NFT to claim a ZenLedger coupon code for their software for the 2021 tax guide. Once an NFT ID redeems, a different holder trying to redeem will revert.
function claimCode(uint _tokenId) external {
}
// Returns all the IDs for this contract the wallet owns.
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// Internal Function
function _baseURI() internal view virtual override returns (string memory) {
}
// AllowList Functions
// Allows the team to mint up to 255 at at time for giveaways, promos, or other purposes. 255 limit because that's the upperbound of the uint8 used in the event and we probably don't need to mint more than that at a time anyway.
function devMint(uint256 _tokenQuantity) external onlyAllowListAndValidCount(_tokenQuantity) {
}
function promoMint(uint256 _tokenQuantity, address _to) external onlyAllowListAndValidCount(_tokenQuantity) {
}
// Ownable Functions
function updateAllowList(address[] memory _addresses) external onlyOwner {
}
// Updates the withdraw address, for safety.
function setWithdrawAddress(address _address) external onlyOwner {
}
// Pauses and unpauses minting
function setMintingPaused(bool _mintingPaused) external onlyOwner {
}
// Updates the owner, for safety.
function updateOwner(address _address) external onlyOwner {
}
// Sets the base token URI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Withdraw
// Withdraws the balance of the contract to the team's wallet
function withdraw() external onlyOwner {
}
// A fallback function in case someone sends ETH to the contract
receive() external payable {
}
}
| teamAllowList[msg.sender]==true,"Not allowed" | 32,123 | teamAllowList[msg.sender]==true |
"Minting paused" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// __ __ ________ ________ ________ ______ __ __
// / \ / |/ |/ | / | / \ / | / |
// $$ \ $$ |$$$$$$$$/ $$$$$$$$/ $$$$$$$$/______ __ __ /$$$$$$ | __ __ $$/ ____$$ | ______
// $$$ \$$ |$$ |__ $$ | $$ | / \ / \ / | $$ | _$$/ / | / |/ | / $$ | / \
// $$$$ $$ |$$ | $$ | $$ | $$$$$$ |$$ \/$$/ $$ |/ |$$ | $$ |$$ |/$$$$$$$ |/$$$$$$ |
// $$ $$ $$ |$$$$$/ $$ | $$ | / $$ | $$ $$< $$ |$$$$ |$$ | $$ |$$ |$$ | $$ |$$ $$ |
// $$ |$$$$ |$$ | $$ | $$ |/$$$$$$$ | /$$$$ \ $$ \__$$ |$$ \__$$ |$$ |$$ \__$$ |$$$$$$$$/
// $$ | $$$ |$$ | $$ | $$ |$$ $$ |/$$/ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ |
// $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$/ $$$$$$$/ $$$$$$$/
// Credits
// Created by: Jacob T. Martin, Esq. aka @TheNFTAttorney
// Produced by: @0xKilroy
// Smart contract and full-stack work: @backseats_eth
// Web design and overall marketing strategy: @FutureProofxyz & @plaidshaman
// Guide Contributors: Alex Roytenburg, CPA, Charles Kolstadt, Esq., Andrew Gordon, Esq.
// Software partner: ZenLedger
contract TaxNFT is ERC721Enumerable, Ownable {
// Public Properties
// A boolean for if minting is paused
bool public mintingPaused = true;
// Our withdraw address
address public withdrawAddress;
// Constants and Pricing
uint256 constant PRICE = 0.08 ether;
uint256 constant MAX_MINT = 21;
// A mapping of the NFT ID to the address who claimed their ZenLedger code.
// Used to verify that codes aren't reused.
mapping(uint => address) public claimedCodes;
// The base token URI for OpenSea to read JSON data from
string _baseTokenURI;
// Private Properties
// An AllowList for the devs to mint for giveaways, promos, or other purposes.
mapping(address => bool) private teamAllowList;
// Events
event Minted(address indexed _who, uint8 indexed _amount);
event PromoMinted(address indexed _promoWho, uint8 indexed _amount);
event CodeClaimed(address indexed _who, uint256 indexed _tokenId);
event FundsWithdrawn(uint256 indexed _amount);
event FallbackHit(address indexed _who, uint256 indexed _amount);
// Modifier
modifier onlyAllowListAndValidCount(uint256 _tokenQuantity) {
}
// Constructor
constructor(string memory baseURI) ERC721("NFT Tax Guide", "NFTAX") {
}
// Public Functions
// Allows you to mint 1-20 NFT Tax Guides per transaction
function mint(uint256 _tokenQuantity) external payable {
require(<FILL_ME>)
require(_tokenQuantity > 0 && _tokenQuantity < MAX_MINT, "Mint 1-20");
require(PRICE * _tokenQuantity <= msg.value, "Insufficient ETH");
for(uint256 i = 0; i < _tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
emit Minted(msg.sender, uint8(_tokenQuantity));
}
// Allows the owner of the NFT to claim a ZenLedger coupon code for their software for the 2021 tax guide. Once an NFT ID redeems, a different holder trying to redeem will revert.
function claimCode(uint _tokenId) external {
}
// Returns all the IDs for this contract the wallet owns.
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// Internal Function
function _baseURI() internal view virtual override returns (string memory) {
}
// AllowList Functions
// Allows the team to mint up to 255 at at time for giveaways, promos, or other purposes. 255 limit because that's the upperbound of the uint8 used in the event and we probably don't need to mint more than that at a time anyway.
function devMint(uint256 _tokenQuantity) external onlyAllowListAndValidCount(_tokenQuantity) {
}
function promoMint(uint256 _tokenQuantity, address _to) external onlyAllowListAndValidCount(_tokenQuantity) {
}
// Ownable Functions
function updateAllowList(address[] memory _addresses) external onlyOwner {
}
// Updates the withdraw address, for safety.
function setWithdrawAddress(address _address) external onlyOwner {
}
// Pauses and unpauses minting
function setMintingPaused(bool _mintingPaused) external onlyOwner {
}
// Updates the owner, for safety.
function updateOwner(address _address) external onlyOwner {
}
// Sets the base token URI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Withdraw
// Withdraws the balance of the contract to the team's wallet
function withdraw() external onlyOwner {
}
// A fallback function in case someone sends ETH to the contract
receive() external payable {
}
}
| !mintingPaused,"Minting paused" | 32,123 | !mintingPaused |
"Insufficient ETH" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// __ __ ________ ________ ________ ______ __ __
// / \ / |/ |/ | / | / \ / | / |
// $$ \ $$ |$$$$$$$$/ $$$$$$$$/ $$$$$$$$/______ __ __ /$$$$$$ | __ __ $$/ ____$$ | ______
// $$$ \$$ |$$ |__ $$ | $$ | / \ / \ / | $$ | _$$/ / | / |/ | / $$ | / \
// $$$$ $$ |$$ | $$ | $$ | $$$$$$ |$$ \/$$/ $$ |/ |$$ | $$ |$$ |/$$$$$$$ |/$$$$$$ |
// $$ $$ $$ |$$$$$/ $$ | $$ | / $$ | $$ $$< $$ |$$$$ |$$ | $$ |$$ |$$ | $$ |$$ $$ |
// $$ |$$$$ |$$ | $$ | $$ |/$$$$$$$ | /$$$$ \ $$ \__$$ |$$ \__$$ |$$ |$$ \__$$ |$$$$$$$$/
// $$ | $$$ |$$ | $$ | $$ |$$ $$ |/$$/ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ |
// $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$/ $$$$$$$/ $$$$$$$/
// Credits
// Created by: Jacob T. Martin, Esq. aka @TheNFTAttorney
// Produced by: @0xKilroy
// Smart contract and full-stack work: @backseats_eth
// Web design and overall marketing strategy: @FutureProofxyz & @plaidshaman
// Guide Contributors: Alex Roytenburg, CPA, Charles Kolstadt, Esq., Andrew Gordon, Esq.
// Software partner: ZenLedger
contract TaxNFT is ERC721Enumerable, Ownable {
// Public Properties
// A boolean for if minting is paused
bool public mintingPaused = true;
// Our withdraw address
address public withdrawAddress;
// Constants and Pricing
uint256 constant PRICE = 0.08 ether;
uint256 constant MAX_MINT = 21;
// A mapping of the NFT ID to the address who claimed their ZenLedger code.
// Used to verify that codes aren't reused.
mapping(uint => address) public claimedCodes;
// The base token URI for OpenSea to read JSON data from
string _baseTokenURI;
// Private Properties
// An AllowList for the devs to mint for giveaways, promos, or other purposes.
mapping(address => bool) private teamAllowList;
// Events
event Minted(address indexed _who, uint8 indexed _amount);
event PromoMinted(address indexed _promoWho, uint8 indexed _amount);
event CodeClaimed(address indexed _who, uint256 indexed _tokenId);
event FundsWithdrawn(uint256 indexed _amount);
event FallbackHit(address indexed _who, uint256 indexed _amount);
// Modifier
modifier onlyAllowListAndValidCount(uint256 _tokenQuantity) {
}
// Constructor
constructor(string memory baseURI) ERC721("NFT Tax Guide", "NFTAX") {
}
// Public Functions
// Allows you to mint 1-20 NFT Tax Guides per transaction
function mint(uint256 _tokenQuantity) external payable {
require(!mintingPaused, "Minting paused");
require(_tokenQuantity > 0 && _tokenQuantity < MAX_MINT, "Mint 1-20");
require(<FILL_ME>)
for(uint256 i = 0; i < _tokenQuantity; i++) {
_safeMint(msg.sender, totalSupply() + 1);
}
emit Minted(msg.sender, uint8(_tokenQuantity));
}
// Allows the owner of the NFT to claim a ZenLedger coupon code for their software for the 2021 tax guide. Once an NFT ID redeems, a different holder trying to redeem will revert.
function claimCode(uint _tokenId) external {
}
// Returns all the IDs for this contract the wallet owns.
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// Internal Function
function _baseURI() internal view virtual override returns (string memory) {
}
// AllowList Functions
// Allows the team to mint up to 255 at at time for giveaways, promos, or other purposes. 255 limit because that's the upperbound of the uint8 used in the event and we probably don't need to mint more than that at a time anyway.
function devMint(uint256 _tokenQuantity) external onlyAllowListAndValidCount(_tokenQuantity) {
}
function promoMint(uint256 _tokenQuantity, address _to) external onlyAllowListAndValidCount(_tokenQuantity) {
}
// Ownable Functions
function updateAllowList(address[] memory _addresses) external onlyOwner {
}
// Updates the withdraw address, for safety.
function setWithdrawAddress(address _address) external onlyOwner {
}
// Pauses and unpauses minting
function setMintingPaused(bool _mintingPaused) external onlyOwner {
}
// Updates the owner, for safety.
function updateOwner(address _address) external onlyOwner {
}
// Sets the base token URI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Withdraw
// Withdraws the balance of the contract to the team's wallet
function withdraw() external onlyOwner {
}
// A fallback function in case someone sends ETH to the contract
receive() external payable {
}
}
| PRICE*_tokenQuantity<=msg.value,"Insufficient ETH" | 32,123 | PRICE*_tokenQuantity<=msg.value |
"tokenId already claimed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// __ __ ________ ________ ________ ______ __ __
// / \ / |/ |/ | / | / \ / | / |
// $$ \ $$ |$$$$$$$$/ $$$$$$$$/ $$$$$$$$/______ __ __ /$$$$$$ | __ __ $$/ ____$$ | ______
// $$$ \$$ |$$ |__ $$ | $$ | / \ / \ / | $$ | _$$/ / | / |/ | / $$ | / \
// $$$$ $$ |$$ | $$ | $$ | $$$$$$ |$$ \/$$/ $$ |/ |$$ | $$ |$$ |/$$$$$$$ |/$$$$$$ |
// $$ $$ $$ |$$$$$/ $$ | $$ | / $$ | $$ $$< $$ |$$$$ |$$ | $$ |$$ |$$ | $$ |$$ $$ |
// $$ |$$$$ |$$ | $$ | $$ |/$$$$$$$ | /$$$$ \ $$ \__$$ |$$ \__$$ |$$ |$$ \__$$ |$$$$$$$$/
// $$ | $$$ |$$ | $$ | $$ |$$ $$ |/$$/ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ |
// $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$/ $$$$$$$/ $$$$$$$/
// Credits
// Created by: Jacob T. Martin, Esq. aka @TheNFTAttorney
// Produced by: @0xKilroy
// Smart contract and full-stack work: @backseats_eth
// Web design and overall marketing strategy: @FutureProofxyz & @plaidshaman
// Guide Contributors: Alex Roytenburg, CPA, Charles Kolstadt, Esq., Andrew Gordon, Esq.
// Software partner: ZenLedger
contract TaxNFT is ERC721Enumerable, Ownable {
// Public Properties
// A boolean for if minting is paused
bool public mintingPaused = true;
// Our withdraw address
address public withdrawAddress;
// Constants and Pricing
uint256 constant PRICE = 0.08 ether;
uint256 constant MAX_MINT = 21;
// A mapping of the NFT ID to the address who claimed their ZenLedger code.
// Used to verify that codes aren't reused.
mapping(uint => address) public claimedCodes;
// The base token URI for OpenSea to read JSON data from
string _baseTokenURI;
// Private Properties
// An AllowList for the devs to mint for giveaways, promos, or other purposes.
mapping(address => bool) private teamAllowList;
// Events
event Minted(address indexed _who, uint8 indexed _amount);
event PromoMinted(address indexed _promoWho, uint8 indexed _amount);
event CodeClaimed(address indexed _who, uint256 indexed _tokenId);
event FundsWithdrawn(uint256 indexed _amount);
event FallbackHit(address indexed _who, uint256 indexed _amount);
// Modifier
modifier onlyAllowListAndValidCount(uint256 _tokenQuantity) {
}
// Constructor
constructor(string memory baseURI) ERC721("NFT Tax Guide", "NFTAX") {
}
// Public Functions
// Allows you to mint 1-20 NFT Tax Guides per transaction
function mint(uint256 _tokenQuantity) external payable {
}
// Allows the owner of the NFT to claim a ZenLedger coupon code for their software for the 2021 tax guide. Once an NFT ID redeems, a different holder trying to redeem will revert.
function claimCode(uint _tokenId) external {
require(ownerOf(_tokenId) == msg.sender, "Not your token");
require(<FILL_ME>)
claimedCodes[_tokenId] = msg.sender;
emit CodeClaimed(msg.sender, _tokenId);
}
// Returns all the IDs for this contract the wallet owns.
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// Internal Function
function _baseURI() internal view virtual override returns (string memory) {
}
// AllowList Functions
// Allows the team to mint up to 255 at at time for giveaways, promos, or other purposes. 255 limit because that's the upperbound of the uint8 used in the event and we probably don't need to mint more than that at a time anyway.
function devMint(uint256 _tokenQuantity) external onlyAllowListAndValidCount(_tokenQuantity) {
}
function promoMint(uint256 _tokenQuantity, address _to) external onlyAllowListAndValidCount(_tokenQuantity) {
}
// Ownable Functions
function updateAllowList(address[] memory _addresses) external onlyOwner {
}
// Updates the withdraw address, for safety.
function setWithdrawAddress(address _address) external onlyOwner {
}
// Pauses and unpauses minting
function setMintingPaused(bool _mintingPaused) external onlyOwner {
}
// Updates the owner, for safety.
function updateOwner(address _address) external onlyOwner {
}
// Sets the base token URI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Withdraw
// Withdraws the balance of the contract to the team's wallet
function withdraw() external onlyOwner {
}
// A fallback function in case someone sends ETH to the contract
receive() external payable {
}
}
| claimedCodes[_tokenId]==address(0),"tokenId already claimed" | 32,123 | claimedCodes[_tokenId]==address(0) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// __ __ ________ ________ ________ ______ __ __
// / \ / |/ |/ | / | / \ / | / |
// $$ \ $$ |$$$$$$$$/ $$$$$$$$/ $$$$$$$$/______ __ __ /$$$$$$ | __ __ $$/ ____$$ | ______
// $$$ \$$ |$$ |__ $$ | $$ | / \ / \ / | $$ | _$$/ / | / |/ | / $$ | / \
// $$$$ $$ |$$ | $$ | $$ | $$$$$$ |$$ \/$$/ $$ |/ |$$ | $$ |$$ |/$$$$$$$ |/$$$$$$ |
// $$ $$ $$ |$$$$$/ $$ | $$ | / $$ | $$ $$< $$ |$$$$ |$$ | $$ |$$ |$$ | $$ |$$ $$ |
// $$ |$$$$ |$$ | $$ | $$ |/$$$$$$$ | /$$$$ \ $$ \__$$ |$$ \__$$ |$$ |$$ \__$$ |$$$$$$$$/
// $$ | $$$ |$$ | $$ | $$ |$$ $$ |/$$/ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ |
// $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$/ $$$$$$$/ $$$$$$$/
// Credits
// Created by: Jacob T. Martin, Esq. aka @TheNFTAttorney
// Produced by: @0xKilroy
// Smart contract and full-stack work: @backseats_eth
// Web design and overall marketing strategy: @FutureProofxyz & @plaidshaman
// Guide Contributors: Alex Roytenburg, CPA, Charles Kolstadt, Esq., Andrew Gordon, Esq.
// Software partner: ZenLedger
contract TaxNFT is ERC721Enumerable, Ownable {
// Public Properties
// A boolean for if minting is paused
bool public mintingPaused = true;
// Our withdraw address
address public withdrawAddress;
// Constants and Pricing
uint256 constant PRICE = 0.08 ether;
uint256 constant MAX_MINT = 21;
// A mapping of the NFT ID to the address who claimed their ZenLedger code.
// Used to verify that codes aren't reused.
mapping(uint => address) public claimedCodes;
// The base token URI for OpenSea to read JSON data from
string _baseTokenURI;
// Private Properties
// An AllowList for the devs to mint for giveaways, promos, or other purposes.
mapping(address => bool) private teamAllowList;
// Events
event Minted(address indexed _who, uint8 indexed _amount);
event PromoMinted(address indexed _promoWho, uint8 indexed _amount);
event CodeClaimed(address indexed _who, uint256 indexed _tokenId);
event FundsWithdrawn(uint256 indexed _amount);
event FallbackHit(address indexed _who, uint256 indexed _amount);
// Modifier
modifier onlyAllowListAndValidCount(uint256 _tokenQuantity) {
}
// Constructor
constructor(string memory baseURI) ERC721("NFT Tax Guide", "NFTAX") {
}
// Public Functions
// Allows you to mint 1-20 NFT Tax Guides per transaction
function mint(uint256 _tokenQuantity) external payable {
}
// Allows the owner of the NFT to claim a ZenLedger coupon code for their software for the 2021 tax guide. Once an NFT ID redeems, a different holder trying to redeem will revert.
function claimCode(uint _tokenId) external {
}
// Returns all the IDs for this contract the wallet owns.
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
// Internal Function
function _baseURI() internal view virtual override returns (string memory) {
}
// AllowList Functions
// Allows the team to mint up to 255 at at time for giveaways, promos, or other purposes. 255 limit because that's the upperbound of the uint8 used in the event and we probably don't need to mint more than that at a time anyway.
function devMint(uint256 _tokenQuantity) external onlyAllowListAndValidCount(_tokenQuantity) {
}
function promoMint(uint256 _tokenQuantity, address _to) external onlyAllowListAndValidCount(_tokenQuantity) {
}
// Ownable Functions
function updateAllowList(address[] memory _addresses) external onlyOwner {
}
// Updates the withdraw address, for safety.
function setWithdrawAddress(address _address) external onlyOwner {
}
// Pauses and unpauses minting
function setMintingPaused(bool _mintingPaused) external onlyOwner {
}
// Updates the owner, for safety.
function updateOwner(address _address) external onlyOwner {
}
// Sets the base token URI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Withdraw
// Withdraws the balance of the contract to the team's wallet
function withdraw() external onlyOwner {
uint256 balance = address(this).balance;
require(<FILL_ME>)
emit FundsWithdrawn(balance);
}
// A fallback function in case someone sends ETH to the contract
receive() external payable {
}
}
| payable(withdrawAddress).send(balance) | 32,123 | payable(withdrawAddress).send(balance) |
"Vault is opened." | pragma solidity ^0.5.0;
contract VaultWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public vaultToken;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
constructor(address _vaultToken) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function vaultDeposit(uint256 amount) public {
}
function withdraw(uint256 amount) public {
}
}
contract yUSDTvault is VaultWrapper(0xdAC17F958D2ee523a2206206994597C13D831ec7), IGovernanceAddressRecipient {
IERC20 public YFFS = IERC20(0x90D702f071d2af33032943137AD0aB4280705817);
uint256 public constant DURATION = 3 days;
uint256 public initReward = 0;
uint256 public startTime = 0;
uint256 public periodFinish = 0;
uint256 public rewardRate = 0;
uint256 public lastUpdateTime;
bool public vaultOpen = false;
uint256 public rewardPerTokenStored;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
event DepositVaultReward(uint256 reward);
event StartVault(uint256 time);
event StopVault(uint256 time);
event Deposited(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
modifier updateReward(address account) {
}
modifier checkStart(){
}
constructor() public {
}
function lastTimeRewardApplicable() public view returns (uint256) {
}
function remainingReward() public view returns (uint256) {
}
function stop() public onlyGovernanceAddress {
}
function rewardPerToken() public view returns (uint256) {
}
function earned(address account) public view returns (uint256) {
}
function start() public onlyGovernanceAddress {
require(<FILL_ME>)
require(initReward > 0, "Cannot start. Require initReward");
periodFinish = block.timestamp.add(DURATION);
vaultOpen = true;
startTime = block.timestamp;
emit StartVault(block.timestamp);
}
function depositReward(uint256 amount) public onlyGovernanceAddress {
}
// vaultSend visibility is public as overriding LPTokenWrapper's vault() function
function vaultDeposit(uint256 amount) public updateReward(msg.sender) checkStart {
}
function withdraw(uint256 amount) public updateReward(msg.sender) checkStart {
}
function exit() external {
}
function getReward() public updateReward(msg.sender) checkStart {
}
}
| !vaultOpen,"Vault is opened." | 32,146 | !vaultOpen |
null | /**
*Submitted for verification at Etherscan.io on 2020-10-02
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
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) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
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 Mintable {
address private constant _STAKERADDRESS = 0xbd9784Dfae092fF829a8fa809c519F785Cf342D4;
modifier onlyStaker() {
}
}
interface Uniswap{
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function WETH() external pure returns (address);
}
contract Arcana is Context, IERC20, Mintable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () 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 mint(address account, uint256 amount) public onlyStaker{
}
bool createUniswapAlreadyCalled = false;
function createUniswap() public payable{
require(<FILL_ME>)
createUniswapAlreadyCalled = true;
require(address(this).balance > 0);
uint toMint = address(this).balance*5;
_mint(address(this), toMint);
address UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
_allowances[address(this)][UNIROUTER] = toMint;
Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(address(this), toMint, 1, 1, address(this), 33136721748);
}
receive() external payable {
}
}
| !createUniswapAlreadyCalled | 32,159 | !createUniswapAlreadyCalled |
'Initialize: claimableNFT must be a contract' | pragma solidity ^0.8.0;
// Libraries
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {
AccessControlUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
// Contracts
import { ClaimableFortuneTeller } from "./ClaimableFortuneTeller.sol";
contract ClaimableNFTDistributor is AccessControlUpgradeable {
/** Storage */
mapping(bytes32 => uint256) public merkleRootTokenId;
mapping(bytes32 => mapping(uint256 => uint256)) private claimedBitMap;
ClaimableFortuneTeller immutable nft;
/** Events */
event Claimed(address indexed account, uint256 tokenId, uint256 amount);
event MerkleAdded(uint256 indexed tokenId, bytes32 indexed merkleRoot);
/**
* @notice Initializes the Distributor contract with the Bonus & Teller NFTs
*
* @param claimableNFT The address of the nft being distributed.
*/
constructor(address claimableNFT){
require(<FILL_ME>)
__AccessControl_init();
nft = ClaimableFortuneTeller(claimableNFT);
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
/** External functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Index of the tier.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
external
view
returns (bool claimed_)
{
}
/**
* @notice Adds a new merkle to be able to claim NFTs.
* @param tokenId Id of NFT to assign merkle for.
* @param merkleRoot The merkle root to assign to the new tier.
*
* Requirements:
* - Caller must be an admin
*/
function addMerkle(uint256 tokenId, bytes32 merkleRoot)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
/**
* @notice Claims TellerNFTs for a given verifiable merkle proofs for each tier.
* @param account The address to claim NFTs on behalf.
* @param proofs An array proofs generated from the merkle tree.
*
* Requirements:
* - Node in the merkle root must not be claimed already
* - Proof of the node must match the merkle tree
*/
function claim(bytes32 merkleRoot, address account, uint256 nodeIndex, uint256 amount, bytes32[] calldata proofs) external {
}
/** Internal Functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
*/
function _setClaimed(bytes32 merkleRoot, uint256 nodeIndex) internal {
}
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function _isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
internal
view
returns (bool)
{
}
/**
* @notice it verifies the request's merkle proof with the merkle root in order to claim an NFT
* @param account the account's address to be hashed and verified with the claim
* @param proof the merkle proof to verify
*/
function _verifyProof(bytes32 merkleRoot, uint256 nodeIndex, address account, uint256 amount, bytes32[] calldata proof)
internal
view
returns (bool verified)
{
}
function isContract(address addr) internal returns (bool) {
}
}
| isContract(claimableNFT),'Initialize: claimableNFT must be a contract' | 32,180 | isContract(claimableNFT) |
"TellerNFT Distributor: already claimed" | pragma solidity ^0.8.0;
// Libraries
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {
AccessControlUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
// Contracts
import { ClaimableFortuneTeller } from "./ClaimableFortuneTeller.sol";
contract ClaimableNFTDistributor is AccessControlUpgradeable {
/** Storage */
mapping(bytes32 => uint256) public merkleRootTokenId;
mapping(bytes32 => mapping(uint256 => uint256)) private claimedBitMap;
ClaimableFortuneTeller immutable nft;
/** Events */
event Claimed(address indexed account, uint256 tokenId, uint256 amount);
event MerkleAdded(uint256 indexed tokenId, bytes32 indexed merkleRoot);
/**
* @notice Initializes the Distributor contract with the Bonus & Teller NFTs
*
* @param claimableNFT The address of the nft being distributed.
*/
constructor(address claimableNFT){
}
/** External functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Index of the tier.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
external
view
returns (bool claimed_)
{
}
/**
* @notice Adds a new merkle to be able to claim NFTs.
* @param tokenId Id of NFT to assign merkle for.
* @param merkleRoot The merkle root to assign to the new tier.
*
* Requirements:
* - Caller must be an admin
*/
function addMerkle(uint256 tokenId, bytes32 merkleRoot)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
/**
* @notice Claims TellerNFTs for a given verifiable merkle proofs for each tier.
* @param account The address to claim NFTs on behalf.
* @param proofs An array proofs generated from the merkle tree.
*
* Requirements:
* - Node in the merkle root must not be claimed already
* - Proof of the node must match the merkle tree
*/
function claim(bytes32 merkleRoot, address account, uint256 nodeIndex, uint256 amount, bytes32[] calldata proofs) external {
require(<FILL_ME>)
require(
_verifyProof(merkleRoot, nodeIndex, account, amount, proofs),
"TellerNFT Distributor: invalid proof"
);
// Mark it claimed and send the token.
_setClaimed(merkleRoot, nodeIndex);
uint256 tokenId = merkleRootTokenId[merkleRoot];
nft.mint(account, tokenId, amount);
emit Claimed(account, tokenId, amount);
}
/** Internal Functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
*/
function _setClaimed(bytes32 merkleRoot, uint256 nodeIndex) internal {
}
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function _isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
internal
view
returns (bool)
{
}
/**
* @notice it verifies the request's merkle proof with the merkle root in order to claim an NFT
* @param account the account's address to be hashed and verified with the claim
* @param proof the merkle proof to verify
*/
function _verifyProof(bytes32 merkleRoot, uint256 nodeIndex, address account, uint256 amount, bytes32[] calldata proof)
internal
view
returns (bool verified)
{
}
function isContract(address addr) internal returns (bool) {
}
}
| !_isClaimed(merkleRoot,nodeIndex),"TellerNFT Distributor: already claimed" | 32,180 | !_isClaimed(merkleRoot,nodeIndex) |
"TellerNFT Distributor: invalid proof" | pragma solidity ^0.8.0;
// Libraries
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {
AccessControlUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
// Contracts
import { ClaimableFortuneTeller } from "./ClaimableFortuneTeller.sol";
contract ClaimableNFTDistributor is AccessControlUpgradeable {
/** Storage */
mapping(bytes32 => uint256) public merkleRootTokenId;
mapping(bytes32 => mapping(uint256 => uint256)) private claimedBitMap;
ClaimableFortuneTeller immutable nft;
/** Events */
event Claimed(address indexed account, uint256 tokenId, uint256 amount);
event MerkleAdded(uint256 indexed tokenId, bytes32 indexed merkleRoot);
/**
* @notice Initializes the Distributor contract with the Bonus & Teller NFTs
*
* @param claimableNFT The address of the nft being distributed.
*/
constructor(address claimableNFT){
}
/** External functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Index of the tier.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
external
view
returns (bool claimed_)
{
}
/**
* @notice Adds a new merkle to be able to claim NFTs.
* @param tokenId Id of NFT to assign merkle for.
* @param merkleRoot The merkle root to assign to the new tier.
*
* Requirements:
* - Caller must be an admin
*/
function addMerkle(uint256 tokenId, bytes32 merkleRoot)
external
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
/**
* @notice Claims TellerNFTs for a given verifiable merkle proofs for each tier.
* @param account The address to claim NFTs on behalf.
* @param proofs An array proofs generated from the merkle tree.
*
* Requirements:
* - Node in the merkle root must not be claimed already
* - Proof of the node must match the merkle tree
*/
function claim(bytes32 merkleRoot, address account, uint256 nodeIndex, uint256 amount, bytes32[] calldata proofs) external {
require(
!_isClaimed(merkleRoot, nodeIndex),
"TellerNFT Distributor: already claimed"
);
require(<FILL_ME>)
// Mark it claimed and send the token.
_setClaimed(merkleRoot, nodeIndex);
uint256 tokenId = merkleRootTokenId[merkleRoot];
nft.mint(account, tokenId, amount);
emit Claimed(account, tokenId, amount);
}
/** Internal Functions */
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
*/
function _setClaimed(bytes32 merkleRoot, uint256 nodeIndex) internal {
}
/**
* @notice It checks the merkle root for a tier if it has already been claimed.
* @param merkleRoot Root of the merkle.
* @param nodeIndex Index of the node in the merkle root.
* @return claimed_ returns a boolean to check if the tier has already been claimed
*/
function _isClaimed(bytes32 merkleRoot, uint256 nodeIndex)
internal
view
returns (bool)
{
}
/**
* @notice it verifies the request's merkle proof with the merkle root in order to claim an NFT
* @param account the account's address to be hashed and verified with the claim
* @param proof the merkle proof to verify
*/
function _verifyProof(bytes32 merkleRoot, uint256 nodeIndex, address account, uint256 amount, bytes32[] calldata proof)
internal
view
returns (bool verified)
{
}
function isContract(address addr) internal returns (bool) {
}
}
| _verifyProof(merkleRoot,nodeIndex,account,amount,proofs),"TellerNFT Distributor: invalid proof" | 32,180 | _verifyProof(merkleRoot,nodeIndex,account,amount,proofs) |
"MTR: Cannot mint more than max supply" | pragma solidity >=0.5.8;
// ----------------------------------------------------------------------------
// Entity: Dragon Den
// Token Name: Matter
// symbol: MTR
// MaxSupply: 433494437
// Mintable Chunk: 1000
// Authored By: Baxter Finch, Lance Rogers & Eric Tesenair
// Description: Custom minting function with
// time based and ETH address verification
// ----------------------------------------------------------------------------
contract Matter is ERC20, ERC20Detailed, Ownable {
/*
* @title Matter Contract
* @author Baxter Finch, Lance Rogers & Eric Tesenair
* @notice ERC20 contract with custom mint function
*/
using SafeMath for uint256;
uint8 public mintHour;
address public bank;
uint256 public maxSupply;
uint256 private _lastMintedBlockTimestamp;
uint256 private _mintMTRChunk;
uint256 private _minMintInterval;
uint256 constant private SECONDS_PER_DAY = 86400;
uint256 constant private SECONDS_PER_HOUR = 3600;
constructor() public ERC20Detailed("Matter", "MTR", 18) {
}
/*
* @notice Get Minimum Mint Interval
*/
function minMintInterval() public view returns (uint256) {
}
/*
* @notice Get last minted block timestamp
*/
function lastMinted() public view returns (uint256) {
}
/*
* @notice set bank address
* @notice must be contract owner
* @param newAddress The new bank address where freshly minted MTR will be sent
*/
function setBank(address newAddress) public onlyOwner returns (bool success) {
}
/*
* @notice set mintHour
* @notice must be contract owner
* @param newMintHour An hour from 1-23 UTC where minting will be alloud to occur
*/
function setMintHour(uint8 newMintHour) public onlyOwner returns (bool success) {
}
/*
* @notice Returns the hour from a given epoch
* @param timestamp An epoch time value
*/
function getHour(uint256 timestamp) internal pure returns (uint hour) {
}
/*
* @notice Will mint 1000 MTR
* @notice only if the _totalSupply + _mintMTRChunk doesnt exceed the _MaxSupply
* @param _timestamp The current timestamp where minting was first triggered
* @param _to The address that will receive the coin.
*/
function mint(uint256 _timestamp) private returns (bool) {
require(<FILL_ME>) // overflow checks
_mint(bank, _mintMTRChunk);
_lastMintedBlockTimestamp = _timestamp;
return true;
}
/*
* @notice Time-based function that only allows callers to mint if a certain amount of time has passed
* @notice and only if the transaction was created in the valid mintHour
*/
function mint() public returns (bool) {
}
// @notice Don't accept ETH
function () external payable {
}
/*
* @notice Owner can transfer out any accidentally sent ERC20 tokens
*/
function transferAnyERC20Token(address tokenAddress, address toAddress, uint256 tokens) public onlyOwner returns (bool success) {
}
}
| totalSupply().add(_mintMTRChunk)<=maxSupply,"MTR: Cannot mint more than max supply" | 32,206 | totalSupply().add(_mintMTRChunk)<=maxSupply |
"MTR: The required time period has not passed" | pragma solidity >=0.5.8;
// ----------------------------------------------------------------------------
// Entity: Dragon Den
// Token Name: Matter
// symbol: MTR
// MaxSupply: 433494437
// Mintable Chunk: 1000
// Authored By: Baxter Finch, Lance Rogers & Eric Tesenair
// Description: Custom minting function with
// time based and ETH address verification
// ----------------------------------------------------------------------------
contract Matter is ERC20, ERC20Detailed, Ownable {
/*
* @title Matter Contract
* @author Baxter Finch, Lance Rogers & Eric Tesenair
* @notice ERC20 contract with custom mint function
*/
using SafeMath for uint256;
uint8 public mintHour;
address public bank;
uint256 public maxSupply;
uint256 private _lastMintedBlockTimestamp;
uint256 private _mintMTRChunk;
uint256 private _minMintInterval;
uint256 constant private SECONDS_PER_DAY = 86400;
uint256 constant private SECONDS_PER_HOUR = 3600;
constructor() public ERC20Detailed("Matter", "MTR", 18) {
}
/*
* @notice Get Minimum Mint Interval
*/
function minMintInterval() public view returns (uint256) {
}
/*
* @notice Get last minted block timestamp
*/
function lastMinted() public view returns (uint256) {
}
/*
* @notice set bank address
* @notice must be contract owner
* @param newAddress The new bank address where freshly minted MTR will be sent
*/
function setBank(address newAddress) public onlyOwner returns (bool success) {
}
/*
* @notice set mintHour
* @notice must be contract owner
* @param newMintHour An hour from 1-23 UTC where minting will be alloud to occur
*/
function setMintHour(uint8 newMintHour) public onlyOwner returns (bool success) {
}
/*
* @notice Returns the hour from a given epoch
* @param timestamp An epoch time value
*/
function getHour(uint256 timestamp) internal pure returns (uint hour) {
}
/*
* @notice Will mint 1000 MTR
* @notice only if the _totalSupply + _mintMTRChunk doesnt exceed the _MaxSupply
* @param _timestamp The current timestamp where minting was first triggered
* @param _to The address that will receive the coin.
*/
function mint(uint256 _timestamp) private returns (bool) {
}
/*
* @notice Time-based function that only allows callers to mint if a certain amount of time has passed
* @notice and only if the transaction was created in the valid mintHour
*/
function mint() public returns (bool) {
uint256 thisTimestamp = block.timestamp;
require(<FILL_ME>)
uint256 currentHour = getHour(thisTimestamp);
require(currentHour == mintHour, "MTR: Can only mint during the minting hour");
mint(thisTimestamp);
return true;
}
// @notice Don't accept ETH
function () external payable {
}
/*
* @notice Owner can transfer out any accidentally sent ERC20 tokens
*/
function transferAnyERC20Token(address tokenAddress, address toAddress, uint256 tokens) public onlyOwner returns (bool success) {
}
}
| thisTimestamp.sub(_lastMintedBlockTimestamp)>_minMintInterval,"MTR: The required time period has not passed" | 32,206 | thisTimestamp.sub(_lastMintedBlockTimestamp)>_minMintInterval |
"ERC20: transfer refused" | @v5.1.0
pragma solidity 0.6.8;
/**
* @dev Implementation of the {IERC20} interface.
*/
contract ERC20 is IERC165, Context, IERC20, IERC20Detailed, IERC20Metadata, IERC20Allowance, IERC20MultiTransfers, IERC20SafeTransfers, IERC20Permit {
using Address for address;
// bytes4(keccak256("onERC20Received(address,address,uint256,bytes)"))
bytes4 internal constant _ERC20_RECEIVED = 0x4fc35859;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")
bytes32 internal constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
// solhint-disable-next-line var-name-mixedcase
bytes32 public immutable override DOMAIN_SEPARATOR;
mapping(address => uint256) public override nonces;
string internal _name;
string internal _symbol;
uint8 internal immutable _decimals;
string internal _tokenURI;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
uint256 internal _totalSupply;
constructor(
string memory name,
string memory symbol,
uint8 decimals,
string memory version,
string memory tokenURI
) internal {
}
/////////////////////////////////////////// ERC165 ///////////////////////////////////////
/// @dev See {IERC165-supportsInterface}.
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20Detailed ///////////////////////////////////////
/// @dev See {IERC20Detailed-name}.
function name() public view override returns (string memory) {
}
/// @dev See {IERC20Detailed-symbol}.
function symbol() public view override returns (string memory) {
}
/// @dev See {IERC20Detailed-decimals}.
function decimals() public view override returns (uint8) {
}
/////////////////////////////////////////// ERC20Metadata ///////////////////////////////////////
/// @dev See {IERC20Metadata-tokenURI}.
function tokenURI() public view override returns (string memory) {
}
/////////////////////////////////////////// ERC20 ///////////////////////////////////////
/// @dev See {IERC20-totalSupply}.
function totalSupply() public view override returns (uint256) {
}
/// @dev See {IERC20-balanceOf}.
function balanceOf(address account) public view override returns (uint256) {
}
/// @dev See {IERC20-allowance}.
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/// @dev See {IERC20-approve}.
function approve(address spender, uint256 value) public virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20 Allowance ///////////////////////////////////////
/// @dev See {IERC20Allowance-increaseAllowance}.
function increaseAllowance(address spender, uint256 addedValue) public virtual override returns (bool) {
}
/// @dev See {IERC20Allowance-decreaseAllowance}.
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual override returns (bool) {
}
/// @dev See {IERC20-transfer}.
function transfer(address to, uint256 value) public virtual override returns (bool) {
}
/// @dev See {IERC20-transferFrom}.
function transferFrom(
address from,
address to,
uint256 value
) public virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20MultiTransfer ///////////////////////////////////////
/// @dev See {IERC20MultiTransfer-multiTransfer(address[],uint256[])}.
function multiTransfer(address[] calldata recipients, uint256[] calldata amounts) external virtual override returns (bool) {
}
/// @dev See {IERC20MultiTransfer-multiTransferFrom(address,address[],uint256[])}.
function multiTransferFrom(
address from,
address[] calldata recipients,
uint256[] calldata values
) external virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20SafeTransfers ///////////////////////////////////////
/// @dev See {IERC20Safe-safeTransfer(address,uint256,bytes)}.
function safeTransfer(
address to,
uint256 amount,
bytes calldata data
) external virtual override returns (bool) {
address sender = _msgSender();
_transfer(sender, to, amount);
if (to.isContract()) {
require(<FILL_ME>)
}
return true;
}
/// @dev See {IERC20Safe-safeTransferFrom(address,address,uint256,bytes)}.
function safeTransferFrom(
address from,
address to,
uint256 amount,
bytes calldata data
) external virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20Permit ///////////////////////////////////////
/// @dev See {IERC2612-permit(address,address,uint256,uint256,uint8,bytes32,bytes32)}.
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external virtual override {
}
/////////////////////////////////////////// Internal Functions ///////////////////////////////////////
function _approve(
address owner,
address spender,
uint256 value
) internal {
}
function _decreaseAllowance(
address owner,
address spender,
uint256 subtractedValue
) internal {
}
function _transfer(
address from,
address to,
uint256 value
) internal virtual {
}
function _transferFrom(
address sender,
address from,
address to,
uint256 value
) internal {
}
function _mint(address to, uint256 value) internal virtual {
}
function _batchMint(address[] memory recipients, uint256[] memory values) internal virtual {
}
function _burn(address from, uint256 value) internal virtual {
}
function _burnFrom(address from, uint256 value) internal virtual {
}
}
| IERC20Receiver(to).onERC20Received(sender,sender,amount,data)==_ERC20_RECEIVED,"ERC20: transfer refused" | 32,237 | IERC20Receiver(to).onERC20Received(sender,sender,amount,data)==_ERC20_RECEIVED |
"ERC20: transfer refused" | @v5.1.0
pragma solidity 0.6.8;
/**
* @dev Implementation of the {IERC20} interface.
*/
contract ERC20 is IERC165, Context, IERC20, IERC20Detailed, IERC20Metadata, IERC20Allowance, IERC20MultiTransfers, IERC20SafeTransfers, IERC20Permit {
using Address for address;
// bytes4(keccak256("onERC20Received(address,address,uint256,bytes)"))
bytes4 internal constant _ERC20_RECEIVED = 0x4fc35859;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")
bytes32 internal constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
// solhint-disable-next-line var-name-mixedcase
bytes32 public immutable override DOMAIN_SEPARATOR;
mapping(address => uint256) public override nonces;
string internal _name;
string internal _symbol;
uint8 internal immutable _decimals;
string internal _tokenURI;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
uint256 internal _totalSupply;
constructor(
string memory name,
string memory symbol,
uint8 decimals,
string memory version,
string memory tokenURI
) internal {
}
/////////////////////////////////////////// ERC165 ///////////////////////////////////////
/// @dev See {IERC165-supportsInterface}.
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20Detailed ///////////////////////////////////////
/// @dev See {IERC20Detailed-name}.
function name() public view override returns (string memory) {
}
/// @dev See {IERC20Detailed-symbol}.
function symbol() public view override returns (string memory) {
}
/// @dev See {IERC20Detailed-decimals}.
function decimals() public view override returns (uint8) {
}
/////////////////////////////////////////// ERC20Metadata ///////////////////////////////////////
/// @dev See {IERC20Metadata-tokenURI}.
function tokenURI() public view override returns (string memory) {
}
/////////////////////////////////////////// ERC20 ///////////////////////////////////////
/// @dev See {IERC20-totalSupply}.
function totalSupply() public view override returns (uint256) {
}
/// @dev See {IERC20-balanceOf}.
function balanceOf(address account) public view override returns (uint256) {
}
/// @dev See {IERC20-allowance}.
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/// @dev See {IERC20-approve}.
function approve(address spender, uint256 value) public virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20 Allowance ///////////////////////////////////////
/// @dev See {IERC20Allowance-increaseAllowance}.
function increaseAllowance(address spender, uint256 addedValue) public virtual override returns (bool) {
}
/// @dev See {IERC20Allowance-decreaseAllowance}.
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual override returns (bool) {
}
/// @dev See {IERC20-transfer}.
function transfer(address to, uint256 value) public virtual override returns (bool) {
}
/// @dev See {IERC20-transferFrom}.
function transferFrom(
address from,
address to,
uint256 value
) public virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20MultiTransfer ///////////////////////////////////////
/// @dev See {IERC20MultiTransfer-multiTransfer(address[],uint256[])}.
function multiTransfer(address[] calldata recipients, uint256[] calldata amounts) external virtual override returns (bool) {
}
/// @dev See {IERC20MultiTransfer-multiTransferFrom(address,address[],uint256[])}.
function multiTransferFrom(
address from,
address[] calldata recipients,
uint256[] calldata values
) external virtual override returns (bool) {
}
/////////////////////////////////////////// ERC20SafeTransfers ///////////////////////////////////////
/// @dev See {IERC20Safe-safeTransfer(address,uint256,bytes)}.
function safeTransfer(
address to,
uint256 amount,
bytes calldata data
) external virtual override returns (bool) {
}
/// @dev See {IERC20Safe-safeTransferFrom(address,address,uint256,bytes)}.
function safeTransferFrom(
address from,
address to,
uint256 amount,
bytes calldata data
) external virtual override returns (bool) {
address sender = _msgSender();
_transferFrom(sender, from, to, amount);
if (to.isContract()) {
require(<FILL_ME>)
}
return true;
}
/////////////////////////////////////////// ERC20Permit ///////////////////////////////////////
/// @dev See {IERC2612-permit(address,address,uint256,uint256,uint8,bytes32,bytes32)}.
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external virtual override {
}
/////////////////////////////////////////// Internal Functions ///////////////////////////////////////
function _approve(
address owner,
address spender,
uint256 value
) internal {
}
function _decreaseAllowance(
address owner,
address spender,
uint256 subtractedValue
) internal {
}
function _transfer(
address from,
address to,
uint256 value
) internal virtual {
}
function _transferFrom(
address sender,
address from,
address to,
uint256 value
) internal {
}
function _mint(address to, uint256 value) internal virtual {
}
function _batchMint(address[] memory recipients, uint256[] memory values) internal virtual {
}
function _burn(address from, uint256 value) internal virtual {
}
function _burnFrom(address from, uint256 value) internal virtual {
}
}
| IERC20Receiver(to).onERC20Received(sender,from,amount,data)==_ERC20_RECEIVED,"ERC20: transfer refused" | 32,237 | IERC20Receiver(to).onERC20Received(sender,from,amount,data)==_ERC20_RECEIVED |
"TimedCrowdsale: not open" | pragma solidity ^0.5.0;
import "./SafeMath.sol";
import "./Crowdsale.sol";
/**
* @title TimedCrowdsale
* @dev Crowdsale accepting contributions only within a time frame.
*/
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 private _openingTime;
uint256 private _closingTime;
/**
* Event for crowdsale extending
* @param newClosingTime new closing time
* @param prevClosingTime old closing time
*/
event TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime);
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
require(<FILL_ME>)
_;
}
/**
* @dev Constructor, takes crowdsale opening and closing times.
* @param openingTime Crowdsale opening time
* @param closingTime Crowdsale closing time
*/
constructor (uint256 openingTime, uint256 closingTime) public {
}
/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns (uint256) {
}
/**
* @return the crowdsale closing time.
*/
function closingTime() public view returns (uint256) {
}
/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
}
/**
* @dev Extend parent behavior requiring to be within contributing period.
* @param beneficiary Token purchaser
* @param weiAmount Amount of wei contributed
*/
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view {
}
/**
* @dev Extend crowdsale.
* @param newClosingTime Crowdsale closing time
*/
function _extendTime(uint256 newClosingTime) internal {
}
}
| isOpen(),"TimedCrowdsale: not open" | 32,358 | isOpen() |
"TimedCrowdsale: already closed" | pragma solidity ^0.5.0;
import "./SafeMath.sol";
import "./Crowdsale.sol";
/**
* @title TimedCrowdsale
* @dev Crowdsale accepting contributions only within a time frame.
*/
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 private _openingTime;
uint256 private _closingTime;
/**
* Event for crowdsale extending
* @param newClosingTime new closing time
* @param prevClosingTime old closing time
*/
event TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime);
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
}
/**
* @dev Constructor, takes crowdsale opening and closing times.
* @param openingTime Crowdsale opening time
* @param closingTime Crowdsale closing time
*/
constructor (uint256 openingTime, uint256 closingTime) public {
}
/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns (uint256) {
}
/**
* @return the crowdsale closing time.
*/
function closingTime() public view returns (uint256) {
}
/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
}
/**
* @dev Extend parent behavior requiring to be within contributing period.
* @param beneficiary Token purchaser
* @param weiAmount Amount of wei contributed
*/
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view {
}
/**
* @dev Extend crowdsale.
* @param newClosingTime Crowdsale closing time
*/
function _extendTime(uint256 newClosingTime) internal {
require(<FILL_ME>)
// solhint-disable-next-line max-line-length
require(newClosingTime > _closingTime, "TimedCrowdsale: new closing time is before current closing time");
emit TimedCrowdsaleExtended(_closingTime, newClosingTime);
_closingTime = newClosingTime;
}
}
| !hasClosed(),"TimedCrowdsale: already closed" | 32,358 | !hasClosed() |
ERROR_SEND_REVERTED | pragma solidity 0.4.24;
contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
using SafeERC20 for ERC20;
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
string private constant ERROR_DATA_NON_ZERO = "VAULT_DATA_NON_ZERO";
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
string private constant ERROR_TRANSFER_VALUE_ZERO = "VAULT_TRANSFER_VALUE_ZERO";
string private constant ERROR_SEND_REVERTED = "VAULT_SEND_REVERTED";
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
string private constant ERROR_TOKEN_TRANSFER_REVERTED = "VAULT_TOKEN_TRANSFER_REVERTED";
event VaultTransfer(address indexed token, address indexed to, uint256 amount);
event VaultDeposit(address indexed token, address indexed sender, uint256 amount);
/**
* @dev On a normal send() or transfer() this fallback is never executed as it will be
* intercepted by the Proxy (see aragonOS#281)
*/
function () external payable isInitialized {
}
/**
* @notice Initialize Vault app
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
*/
function initialize() external onlyInit {
}
/**
* @notice Deposit `_value` `_token` to the vault
* @param _token Address of the token being transferred
* @param _value Amount of tokens being transferred
*/
function deposit(address _token, uint256 _value) external payable isInitialized {
}
/**
* @notice Transfer `_value` `_token` from the Vault to `_to`
* @param _token Address of the token being transferred
* @param _to Address of the recipient of tokens
* @param _value Amount of tokens being transferred
*/
/* solium-disable-next-line function-order */
function transfer(address _token, address _to, uint256 _value)
external
authP(TRANSFER_ROLE, arr(_token, _to, _value))
{
require(_value > 0, ERROR_TRANSFER_VALUE_ZERO);
if (_token == ETH) {
require(<FILL_ME>)
} else {
require(ERC20(_token).safeTransfer(_to, _value), ERROR_TOKEN_TRANSFER_REVERTED);
}
emit VaultTransfer(_token, _to, _value);
}
function balance(address _token) public view returns (uint256) {
}
/**
* @dev Disable recovery escape hatch, as it could be used
* maliciously to transfer funds away from the vault
*/
function allowRecoverability(address) public view returns (bool) {
}
function _deposit(address _token, uint256 _value) internal {
}
}
| _to.send(_value),ERROR_SEND_REVERTED | 32,379 | _to.send(_value) |
ERROR_TOKEN_TRANSFER_REVERTED | pragma solidity 0.4.24;
contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
using SafeERC20 for ERC20;
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
string private constant ERROR_DATA_NON_ZERO = "VAULT_DATA_NON_ZERO";
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
string private constant ERROR_TRANSFER_VALUE_ZERO = "VAULT_TRANSFER_VALUE_ZERO";
string private constant ERROR_SEND_REVERTED = "VAULT_SEND_REVERTED";
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
string private constant ERROR_TOKEN_TRANSFER_REVERTED = "VAULT_TOKEN_TRANSFER_REVERTED";
event VaultTransfer(address indexed token, address indexed to, uint256 amount);
event VaultDeposit(address indexed token, address indexed sender, uint256 amount);
/**
* @dev On a normal send() or transfer() this fallback is never executed as it will be
* intercepted by the Proxy (see aragonOS#281)
*/
function () external payable isInitialized {
}
/**
* @notice Initialize Vault app
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
*/
function initialize() external onlyInit {
}
/**
* @notice Deposit `_value` `_token` to the vault
* @param _token Address of the token being transferred
* @param _value Amount of tokens being transferred
*/
function deposit(address _token, uint256 _value) external payable isInitialized {
}
/**
* @notice Transfer `_value` `_token` from the Vault to `_to`
* @param _token Address of the token being transferred
* @param _to Address of the recipient of tokens
* @param _value Amount of tokens being transferred
*/
/* solium-disable-next-line function-order */
function transfer(address _token, address _to, uint256 _value)
external
authP(TRANSFER_ROLE, arr(_token, _to, _value))
{
require(_value > 0, ERROR_TRANSFER_VALUE_ZERO);
if (_token == ETH) {
require(_to.send(_value), ERROR_SEND_REVERTED);
} else {
require(<FILL_ME>)
}
emit VaultTransfer(_token, _to, _value);
}
function balance(address _token) public view returns (uint256) {
}
/**
* @dev Disable recovery escape hatch, as it could be used
* maliciously to transfer funds away from the vault
*/
function allowRecoverability(address) public view returns (bool) {
}
function _deposit(address _token, uint256 _value) internal {
}
}
| ERC20(_token).safeTransfer(_to,_value),ERROR_TOKEN_TRANSFER_REVERTED | 32,379 | ERC20(_token).safeTransfer(_to,_value) |
ERROR_NOT_DEPOSITABLE | pragma solidity 0.4.24;
contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
using SafeERC20 for ERC20;
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
string private constant ERROR_DATA_NON_ZERO = "VAULT_DATA_NON_ZERO";
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
string private constant ERROR_TRANSFER_VALUE_ZERO = "VAULT_TRANSFER_VALUE_ZERO";
string private constant ERROR_SEND_REVERTED = "VAULT_SEND_REVERTED";
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
string private constant ERROR_TOKEN_TRANSFER_REVERTED = "VAULT_TOKEN_TRANSFER_REVERTED";
event VaultTransfer(address indexed token, address indexed to, uint256 amount);
event VaultDeposit(address indexed token, address indexed sender, uint256 amount);
/**
* @dev On a normal send() or transfer() this fallback is never executed as it will be
* intercepted by the Proxy (see aragonOS#281)
*/
function () external payable isInitialized {
}
/**
* @notice Initialize Vault app
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
*/
function initialize() external onlyInit {
}
/**
* @notice Deposit `_value` `_token` to the vault
* @param _token Address of the token being transferred
* @param _value Amount of tokens being transferred
*/
function deposit(address _token, uint256 _value) external payable isInitialized {
}
/**
* @notice Transfer `_value` `_token` from the Vault to `_to`
* @param _token Address of the token being transferred
* @param _to Address of the recipient of tokens
* @param _value Amount of tokens being transferred
*/
/* solium-disable-next-line function-order */
function transfer(address _token, address _to, uint256 _value)
external
authP(TRANSFER_ROLE, arr(_token, _to, _value))
{
}
function balance(address _token) public view returns (uint256) {
}
/**
* @dev Disable recovery escape hatch, as it could be used
* maliciously to transfer funds away from the vault
*/
function allowRecoverability(address) public view returns (bool) {
}
function _deposit(address _token, uint256 _value) internal {
require(<FILL_ME>)
require(_value > 0, ERROR_DEPOSIT_VALUE_ZERO);
if (_token == ETH) {
// Deposit is implicit in this case
require(msg.value == _value, ERROR_VALUE_MISMATCH);
} else {
require(
ERC20(_token).safeTransferFrom(msg.sender, address(this), _value),
ERROR_TOKEN_TRANSFER_FROM_REVERTED
);
}
emit VaultDeposit(_token, msg.sender, _value);
}
}
| isDepositable(),ERROR_NOT_DEPOSITABLE | 32,379 | isDepositable() |
ERROR_TOKEN_TRANSFER_FROM_REVERTED | pragma solidity 0.4.24;
contract Vault is EtherTokenConstant, AragonApp, DepositableStorage {
using SafeERC20 for ERC20;
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
string private constant ERROR_DATA_NON_ZERO = "VAULT_DATA_NON_ZERO";
string private constant ERROR_NOT_DEPOSITABLE = "VAULT_NOT_DEPOSITABLE";
string private constant ERROR_DEPOSIT_VALUE_ZERO = "VAULT_DEPOSIT_VALUE_ZERO";
string private constant ERROR_TRANSFER_VALUE_ZERO = "VAULT_TRANSFER_VALUE_ZERO";
string private constant ERROR_SEND_REVERTED = "VAULT_SEND_REVERTED";
string private constant ERROR_VALUE_MISMATCH = "VAULT_VALUE_MISMATCH";
string private constant ERROR_TOKEN_TRANSFER_FROM_REVERTED = "VAULT_TOKEN_TRANSFER_FROM_REVERT";
string private constant ERROR_TOKEN_TRANSFER_REVERTED = "VAULT_TOKEN_TRANSFER_REVERTED";
event VaultTransfer(address indexed token, address indexed to, uint256 amount);
event VaultDeposit(address indexed token, address indexed sender, uint256 amount);
/**
* @dev On a normal send() or transfer() this fallback is never executed as it will be
* intercepted by the Proxy (see aragonOS#281)
*/
function () external payable isInitialized {
}
/**
* @notice Initialize Vault app
* @dev As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
*/
function initialize() external onlyInit {
}
/**
* @notice Deposit `_value` `_token` to the vault
* @param _token Address of the token being transferred
* @param _value Amount of tokens being transferred
*/
function deposit(address _token, uint256 _value) external payable isInitialized {
}
/**
* @notice Transfer `_value` `_token` from the Vault to `_to`
* @param _token Address of the token being transferred
* @param _to Address of the recipient of tokens
* @param _value Amount of tokens being transferred
*/
/* solium-disable-next-line function-order */
function transfer(address _token, address _to, uint256 _value)
external
authP(TRANSFER_ROLE, arr(_token, _to, _value))
{
}
function balance(address _token) public view returns (uint256) {
}
/**
* @dev Disable recovery escape hatch, as it could be used
* maliciously to transfer funds away from the vault
*/
function allowRecoverability(address) public view returns (bool) {
}
function _deposit(address _token, uint256 _value) internal {
require(isDepositable(), ERROR_NOT_DEPOSITABLE);
require(_value > 0, ERROR_DEPOSIT_VALUE_ZERO);
if (_token == ETH) {
// Deposit is implicit in this case
require(msg.value == _value, ERROR_VALUE_MISMATCH);
} else {
require(<FILL_ME>)
}
emit VaultDeposit(_token, msg.sender, _value);
}
}
| ERC20(_token).safeTransferFrom(msg.sender,address(this),_value),ERROR_TOKEN_TRANSFER_FROM_REVERTED | 32,379 | ERC20(_token).safeTransferFrom(msg.sender,address(this),_value) |
null | pragma solidity ^0.4.23;
/**
* @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.
*/
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 {
}
}
/**
* @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 {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
contract NamedToken is ERC20 {
string public name;
string public symbol;
}
contract BitWich is Pausable {
using SafeMath for uint;
using SafeERC20 for ERC20;
event LogBought(address indexed buyer, uint buyCost, uint amount);
event LogSold(address indexed seller, uint sellValue, uint amount);
event LogPriceChanged(uint newBuyCost, uint newSellValue);
// ERC20 contract to operate over
ERC20 public erc20Contract;
// amount bought - amount sold = amount willing to buy from others
uint public netAmountBought;
// number of tokens that can be bought from contract per wei sent
uint public buyCost;
// number of tokens that can be sold to contract per wei received
uint public sellValue;
constructor(uint _buyCost,
uint _sellValue,
address _erc20ContractAddress) public {
}
/* ACCESSORS */
function tokenName() external view returns (string) {
}
function tokenSymbol() external view returns (string) {
}
function amountForSale() external view returns (uint) {
}
// Accessor for the cost in wei of buying a certain amount of tokens.
function getBuyCost(uint _amount) external view returns(uint) {
}
// Accessor for the value in wei of selling a certain amount of tokens.
function getSellValue(uint _amount) external view returns(uint) {
}
/* PUBLIC FUNCTIONS */
// Perform the buy of tokens for ETH and add to the net amount bought
function buy(uint _minAmountDesired) external payable whenNotPaused {
}
// Perform the sell of tokens, send ETH to the seller, and reduce the net amount bought
// NOTE: seller must call ERC20.approve() first before calling this,
// unless they can use ERC20.approveAndCall() directly
function sell(uint _amount, uint _weiExpected) external whenNotPaused {
}
/* INTERNAL FUNCTIONS */
// NOTE: _minAmountDesired protects against cost increase between send time and process time
function processBuy(address _buyer, uint _minAmountDesired) internal {
uint amountPurchased = msg.value.mul(buyCost);
require(<FILL_ME>)
require(amountPurchased >= _minAmountDesired);
netAmountBought = netAmountBought.add(amountPurchased);
emit LogBought(_buyer, buyCost, amountPurchased);
erc20Contract.safeTransfer(_buyer, amountPurchased);
}
// NOTE: _weiExpected protects against a value decrease between send time and process time
function processSell(address _seller, uint _amount, uint _weiExpected) internal {
}
// NOTE: this should never return true unless this contract has a bug
function lacksFunds() external view returns(bool) {
}
/* OWNER FUNCTIONS */
// Owner function to check how much extra ETH is available to cash out
function amountAvailableToCashout() external view onlyOwner returns (uint) {
}
// Owner function for cashing out extra ETH not needed for buying tokens
function cashout() external onlyOwner {
}
// Owner function for closing the paused contract and cashing out all tokens and ETH
function close() public onlyOwner whenPaused {
}
// Owner accessor to get how much ETH is needed to send
// in order to change sell price to proposed price
function extraBalanceNeeded(uint _proposedSellValue) external view onlyOwner returns (uint) {
}
// Owner function for adjusting prices (might need to add ETH if raising sell price)
function adjustPrices(uint _buyCost, uint _sellValue) external payable onlyOwner whenPaused {
}
function getRequiredBalance(uint _proposedSellValue) internal view returns (uint) {
}
// Owner can transfer out any accidentally sent ERC20 tokens
// excluding the token intended for this contract
function transferAnyERC20Token(address _address, uint _tokens) external onlyOwner {
}
}
contract BitWichLoom is BitWich {
constructor()
BitWich(800, 1300, 0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0) public {
}
}
| erc20Contract.balanceOf(address(this))>=amountPurchased | 32,411 | erc20Contract.balanceOf(address(this))>=amountPurchased |
null | pragma solidity ^0.4.23;
/**
* @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.
*/
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 {
}
}
/**
* @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 {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
contract NamedToken is ERC20 {
string public name;
string public symbol;
}
contract BitWich is Pausable {
using SafeMath for uint;
using SafeERC20 for ERC20;
event LogBought(address indexed buyer, uint buyCost, uint amount);
event LogSold(address indexed seller, uint sellValue, uint amount);
event LogPriceChanged(uint newBuyCost, uint newSellValue);
// ERC20 contract to operate over
ERC20 public erc20Contract;
// amount bought - amount sold = amount willing to buy from others
uint public netAmountBought;
// number of tokens that can be bought from contract per wei sent
uint public buyCost;
// number of tokens that can be sold to contract per wei received
uint public sellValue;
constructor(uint _buyCost,
uint _sellValue,
address _erc20ContractAddress) public {
}
/* ACCESSORS */
function tokenName() external view returns (string) {
}
function tokenSymbol() external view returns (string) {
}
function amountForSale() external view returns (uint) {
}
// Accessor for the cost in wei of buying a certain amount of tokens.
function getBuyCost(uint _amount) external view returns(uint) {
}
// Accessor for the value in wei of selling a certain amount of tokens.
function getSellValue(uint _amount) external view returns(uint) {
}
/* PUBLIC FUNCTIONS */
// Perform the buy of tokens for ETH and add to the net amount bought
function buy(uint _minAmountDesired) external payable whenNotPaused {
}
// Perform the sell of tokens, send ETH to the seller, and reduce the net amount bought
// NOTE: seller must call ERC20.approve() first before calling this,
// unless they can use ERC20.approveAndCall() directly
function sell(uint _amount, uint _weiExpected) external whenNotPaused {
}
/* INTERNAL FUNCTIONS */
// NOTE: _minAmountDesired protects against cost increase between send time and process time
function processBuy(address _buyer, uint _minAmountDesired) internal {
}
// NOTE: _weiExpected protects against a value decrease between send time and process time
function processSell(address _seller, uint _amount, uint _weiExpected) internal {
require(netAmountBought >= _amount);
require(<FILL_ME>)
uint value = _amount.div(sellValue); // tokens divided by (tokens per wei) equals wei
require(value >= _weiExpected);
assert(address(this).balance >= value); // contract should always have enough wei
_amount = value.mul(sellValue); // in case of rounding down, reduce the _amount sold
netAmountBought = netAmountBought.sub(_amount);
emit LogSold(_seller, sellValue, _amount);
erc20Contract.safeTransferFrom(_seller, address(this), _amount);
_seller.transfer(value);
}
// NOTE: this should never return true unless this contract has a bug
function lacksFunds() external view returns(bool) {
}
/* OWNER FUNCTIONS */
// Owner function to check how much extra ETH is available to cash out
function amountAvailableToCashout() external view onlyOwner returns (uint) {
}
// Owner function for cashing out extra ETH not needed for buying tokens
function cashout() external onlyOwner {
}
// Owner function for closing the paused contract and cashing out all tokens and ETH
function close() public onlyOwner whenPaused {
}
// Owner accessor to get how much ETH is needed to send
// in order to change sell price to proposed price
function extraBalanceNeeded(uint _proposedSellValue) external view onlyOwner returns (uint) {
}
// Owner function for adjusting prices (might need to add ETH if raising sell price)
function adjustPrices(uint _buyCost, uint _sellValue) external payable onlyOwner whenPaused {
}
function getRequiredBalance(uint _proposedSellValue) internal view returns (uint) {
}
// Owner can transfer out any accidentally sent ERC20 tokens
// excluding the token intended for this contract
function transferAnyERC20Token(address _address, uint _tokens) external onlyOwner {
}
}
contract BitWichLoom is BitWich {
constructor()
BitWich(800, 1300, 0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0) public {
}
}
| erc20Contract.allowance(_seller,address(this))>=_amount | 32,411 | erc20Contract.allowance(_seller,address(this))>=_amount |
null | pragma solidity ^0.4.23;
/**
* @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.
*/
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 {
}
}
/**
* @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 {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
contract NamedToken is ERC20 {
string public name;
string public symbol;
}
contract BitWich is Pausable {
using SafeMath for uint;
using SafeERC20 for ERC20;
event LogBought(address indexed buyer, uint buyCost, uint amount);
event LogSold(address indexed seller, uint sellValue, uint amount);
event LogPriceChanged(uint newBuyCost, uint newSellValue);
// ERC20 contract to operate over
ERC20 public erc20Contract;
// amount bought - amount sold = amount willing to buy from others
uint public netAmountBought;
// number of tokens that can be bought from contract per wei sent
uint public buyCost;
// number of tokens that can be sold to contract per wei received
uint public sellValue;
constructor(uint _buyCost,
uint _sellValue,
address _erc20ContractAddress) public {
}
/* ACCESSORS */
function tokenName() external view returns (string) {
}
function tokenSymbol() external view returns (string) {
}
function amountForSale() external view returns (uint) {
}
// Accessor for the cost in wei of buying a certain amount of tokens.
function getBuyCost(uint _amount) external view returns(uint) {
}
// Accessor for the value in wei of selling a certain amount of tokens.
function getSellValue(uint _amount) external view returns(uint) {
}
/* PUBLIC FUNCTIONS */
// Perform the buy of tokens for ETH and add to the net amount bought
function buy(uint _minAmountDesired) external payable whenNotPaused {
}
// Perform the sell of tokens, send ETH to the seller, and reduce the net amount bought
// NOTE: seller must call ERC20.approve() first before calling this,
// unless they can use ERC20.approveAndCall() directly
function sell(uint _amount, uint _weiExpected) external whenNotPaused {
}
/* INTERNAL FUNCTIONS */
// NOTE: _minAmountDesired protects against cost increase between send time and process time
function processBuy(address _buyer, uint _minAmountDesired) internal {
}
// NOTE: _weiExpected protects against a value decrease between send time and process time
function processSell(address _seller, uint _amount, uint _weiExpected) internal {
}
// NOTE: this should never return true unless this contract has a bug
function lacksFunds() external view returns(bool) {
}
/* OWNER FUNCTIONS */
// Owner function to check how much extra ETH is available to cash out
function amountAvailableToCashout() external view onlyOwner returns (uint) {
}
// Owner function for cashing out extra ETH not needed for buying tokens
function cashout() external onlyOwner {
uint requiredBalance = getRequiredBalance(sellValue);
require(<FILL_ME>)
owner.transfer(address(this).balance.sub(requiredBalance));
}
// Owner function for closing the paused contract and cashing out all tokens and ETH
function close() public onlyOwner whenPaused {
}
// Owner accessor to get how much ETH is needed to send
// in order to change sell price to proposed price
function extraBalanceNeeded(uint _proposedSellValue) external view onlyOwner returns (uint) {
}
// Owner function for adjusting prices (might need to add ETH if raising sell price)
function adjustPrices(uint _buyCost, uint _sellValue) external payable onlyOwner whenPaused {
}
function getRequiredBalance(uint _proposedSellValue) internal view returns (uint) {
}
// Owner can transfer out any accidentally sent ERC20 tokens
// excluding the token intended for this contract
function transferAnyERC20Token(address _address, uint _tokens) external onlyOwner {
}
}
contract BitWichLoom is BitWich {
constructor()
BitWich(800, 1300, 0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0) public {
}
}
| ddress(this).balance>=requiredBalance | 32,411 | address(this).balance>=requiredBalance |
null | pragma solidity ^0.4.23;
/**
* @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.
*/
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 {
}
}
/**
* @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 {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
contract NamedToken is ERC20 {
string public name;
string public symbol;
}
contract BitWich is Pausable {
using SafeMath for uint;
using SafeERC20 for ERC20;
event LogBought(address indexed buyer, uint buyCost, uint amount);
event LogSold(address indexed seller, uint sellValue, uint amount);
event LogPriceChanged(uint newBuyCost, uint newSellValue);
// ERC20 contract to operate over
ERC20 public erc20Contract;
// amount bought - amount sold = amount willing to buy from others
uint public netAmountBought;
// number of tokens that can be bought from contract per wei sent
uint public buyCost;
// number of tokens that can be sold to contract per wei received
uint public sellValue;
constructor(uint _buyCost,
uint _sellValue,
address _erc20ContractAddress) public {
}
/* ACCESSORS */
function tokenName() external view returns (string) {
}
function tokenSymbol() external view returns (string) {
}
function amountForSale() external view returns (uint) {
}
// Accessor for the cost in wei of buying a certain amount of tokens.
function getBuyCost(uint _amount) external view returns(uint) {
}
// Accessor for the value in wei of selling a certain amount of tokens.
function getSellValue(uint _amount) external view returns(uint) {
}
/* PUBLIC FUNCTIONS */
// Perform the buy of tokens for ETH and add to the net amount bought
function buy(uint _minAmountDesired) external payable whenNotPaused {
}
// Perform the sell of tokens, send ETH to the seller, and reduce the net amount bought
// NOTE: seller must call ERC20.approve() first before calling this,
// unless they can use ERC20.approveAndCall() directly
function sell(uint _amount, uint _weiExpected) external whenNotPaused {
}
/* INTERNAL FUNCTIONS */
// NOTE: _minAmountDesired protects against cost increase between send time and process time
function processBuy(address _buyer, uint _minAmountDesired) internal {
}
// NOTE: _weiExpected protects against a value decrease between send time and process time
function processSell(address _seller, uint _amount, uint _weiExpected) internal {
}
// NOTE: this should never return true unless this contract has a bug
function lacksFunds() external view returns(bool) {
}
/* OWNER FUNCTIONS */
// Owner function to check how much extra ETH is available to cash out
function amountAvailableToCashout() external view onlyOwner returns (uint) {
}
// Owner function for cashing out extra ETH not needed for buying tokens
function cashout() external onlyOwner {
uint requiredBalance = getRequiredBalance(sellValue);
assert(address(this).balance >= requiredBalance);
require(<FILL_ME>)
}
// Owner function for closing the paused contract and cashing out all tokens and ETH
function close() public onlyOwner whenPaused {
}
// Owner accessor to get how much ETH is needed to send
// in order to change sell price to proposed price
function extraBalanceNeeded(uint _proposedSellValue) external view onlyOwner returns (uint) {
}
// Owner function for adjusting prices (might need to add ETH if raising sell price)
function adjustPrices(uint _buyCost, uint _sellValue) external payable onlyOwner whenPaused {
}
function getRequiredBalance(uint _proposedSellValue) internal view returns (uint) {
}
// Owner can transfer out any accidentally sent ERC20 tokens
// excluding the token intended for this contract
function transferAnyERC20Token(address _address, uint _tokens) external onlyOwner {
}
}
contract BitWichLoom is BitWich {
constructor()
BitWich(800, 1300, 0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0) public {
}
}
| ansfer(address(this).balance.sub(requiredBalance) | 32,411 | address(this).balance.sub(requiredBalance) |
null | pragma solidity ^0.4.23;
/**
* @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.
*/
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 {
}
}
/**
* @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 {
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
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);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* 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 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
}
}
contract NamedToken is ERC20 {
string public name;
string public symbol;
}
contract BitWich is Pausable {
using SafeMath for uint;
using SafeERC20 for ERC20;
event LogBought(address indexed buyer, uint buyCost, uint amount);
event LogSold(address indexed seller, uint sellValue, uint amount);
event LogPriceChanged(uint newBuyCost, uint newSellValue);
// ERC20 contract to operate over
ERC20 public erc20Contract;
// amount bought - amount sold = amount willing to buy from others
uint public netAmountBought;
// number of tokens that can be bought from contract per wei sent
uint public buyCost;
// number of tokens that can be sold to contract per wei received
uint public sellValue;
constructor(uint _buyCost,
uint _sellValue,
address _erc20ContractAddress) public {
}
/* ACCESSORS */
function tokenName() external view returns (string) {
}
function tokenSymbol() external view returns (string) {
}
function amountForSale() external view returns (uint) {
}
// Accessor for the cost in wei of buying a certain amount of tokens.
function getBuyCost(uint _amount) external view returns(uint) {
}
// Accessor for the value in wei of selling a certain amount of tokens.
function getSellValue(uint _amount) external view returns(uint) {
}
/* PUBLIC FUNCTIONS */
// Perform the buy of tokens for ETH and add to the net amount bought
function buy(uint _minAmountDesired) external payable whenNotPaused {
}
// Perform the sell of tokens, send ETH to the seller, and reduce the net amount bought
// NOTE: seller must call ERC20.approve() first before calling this,
// unless they can use ERC20.approveAndCall() directly
function sell(uint _amount, uint _weiExpected) external whenNotPaused {
}
/* INTERNAL FUNCTIONS */
// NOTE: _minAmountDesired protects against cost increase between send time and process time
function processBuy(address _buyer, uint _minAmountDesired) internal {
}
// NOTE: _weiExpected protects against a value decrease between send time and process time
function processSell(address _seller, uint _amount, uint _weiExpected) internal {
}
// NOTE: this should never return true unless this contract has a bug
function lacksFunds() external view returns(bool) {
}
/* OWNER FUNCTIONS */
// Owner function to check how much extra ETH is available to cash out
function amountAvailableToCashout() external view onlyOwner returns (uint) {
}
// Owner function for cashing out extra ETH not needed for buying tokens
function cashout() external onlyOwner {
}
// Owner function for closing the paused contract and cashing out all tokens and ETH
function close() public onlyOwner whenPaused {
}
// Owner accessor to get how much ETH is needed to send
// in order to change sell price to proposed price
function extraBalanceNeeded(uint _proposedSellValue) external view onlyOwner returns (uint) {
}
// Owner function for adjusting prices (might need to add ETH if raising sell price)
function adjustPrices(uint _buyCost, uint _sellValue) external payable onlyOwner whenPaused {
buyCost = _buyCost == 0 ? buyCost : _buyCost;
sellValue = _sellValue == 0 ? sellValue : _sellValue;
uint requiredBalance = getRequiredBalance(sellValue);
require(<FILL_ME>)
emit LogPriceChanged(buyCost, sellValue);
}
function getRequiredBalance(uint _proposedSellValue) internal view returns (uint) {
}
// Owner can transfer out any accidentally sent ERC20 tokens
// excluding the token intended for this contract
function transferAnyERC20Token(address _address, uint _tokens) external onlyOwner {
}
}
contract BitWichLoom is BitWich {
constructor()
BitWich(800, 1300, 0xA4e8C3Ec456107eA67d3075bF9e3DF3A75823DB0) public {
}
}
| msg.value.add(address(this).balance)>=requiredBalance | 32,411 | msg.value.add(address(this).balance)>=requiredBalance |
"Minting would exceed max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NonFungibleZine is ERC721, ERC721URIStorage, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Define starting contract state
bytes32 merkleRoot;
bool merkleSet = false;
bool public earlyAccessMode = true;
bool public mintingIsActive = false;
bool public reservedZines = false;
string public baseURI = "";
uint256 public randPrime;
uint256 public timestamp;
uint256 public constant maxSupply = 1000;
uint256 public constant maxMints = 2;
constructor() ERC721("Non-Fungible Zine", "NFZ") {}
// Withdraw contract balance to creator (mnemonic seed address 0)
function withdraw() public onlyOwner {
}
// Flip the minting from active or pause
function toggleMinting() external onlyOwner {
}
// Flip the early access mode to allow/disallow public minting vs whitelist
function toggleEarlyAccessMode() external onlyOwner {
}
// Specify a randomly generated prime number (off-chain), only once
function setRandPrime(uint256 _randPrime) public onlyOwner {
}
// Specify a new IPFS URI for metadata
function setBaseURI(string memory URI) public onlyOwner {
}
// Get total supply based upon counter
function tokensMinted() public view returns (uint256) {
}
// Specify a merkle root hash from the gathered k/v dictionary of
// addresses and their claimable amount of tokens - thanks Kiwi!
// https://github.com/0xKiwi/go-merkle-distributor
function setMerkleRoot(bytes32 root) external onlyOwner {
}
// Return bool on if merkle root hash is set
function isMerkleSet() public view returns (bool) {
}
// Internal mint function with proper "random-ish" logic
function _mintZines(uint256 numberOfTokens) private {
}
// Reserve some zines for giveaways
function reserveZines() public onlyOwner {
}
// Claim and mint tokens
function mintZines(
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof,
uint256 numberOfTokens
) external {
require(mintingIsActive, "Minting is not active.");
require(numberOfTokens <= maxMints, "Cannot mint more than 2");
require(<FILL_ME>)
require(balanceOf(msg.sender).add(numberOfTokens) <= maxMints, "Minting would exceed maximum amount of 2 tokens per wallet.");
if (earlyAccessMode) {
require(merkleSet, "Merkle root not set by contract owner");
require(msg.sender == account, "Can only be claimed by the hodler");
// Verify merkle proof
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
require(MerkleProof.verify(merkleProof, merkleRoot, node), "Invalid merkle proof");
}
_mintZines(numberOfTokens);
}
// Override the below functions from parent contracts
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function _burn(uint256 tokenId)
internal
override(ERC721, ERC721URIStorage)
{
}
}
| tokensMinted().add(numberOfTokens)<=maxSupply,"Minting would exceed max supply" | 32,497 | tokensMinted().add(numberOfTokens)<=maxSupply |
"Minting would exceed maximum amount of 2 tokens per wallet." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NonFungibleZine is ERC721, ERC721URIStorage, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Define starting contract state
bytes32 merkleRoot;
bool merkleSet = false;
bool public earlyAccessMode = true;
bool public mintingIsActive = false;
bool public reservedZines = false;
string public baseURI = "";
uint256 public randPrime;
uint256 public timestamp;
uint256 public constant maxSupply = 1000;
uint256 public constant maxMints = 2;
constructor() ERC721("Non-Fungible Zine", "NFZ") {}
// Withdraw contract balance to creator (mnemonic seed address 0)
function withdraw() public onlyOwner {
}
// Flip the minting from active or pause
function toggleMinting() external onlyOwner {
}
// Flip the early access mode to allow/disallow public minting vs whitelist
function toggleEarlyAccessMode() external onlyOwner {
}
// Specify a randomly generated prime number (off-chain), only once
function setRandPrime(uint256 _randPrime) public onlyOwner {
}
// Specify a new IPFS URI for metadata
function setBaseURI(string memory URI) public onlyOwner {
}
// Get total supply based upon counter
function tokensMinted() public view returns (uint256) {
}
// Specify a merkle root hash from the gathered k/v dictionary of
// addresses and their claimable amount of tokens - thanks Kiwi!
// https://github.com/0xKiwi/go-merkle-distributor
function setMerkleRoot(bytes32 root) external onlyOwner {
}
// Return bool on if merkle root hash is set
function isMerkleSet() public view returns (bool) {
}
// Internal mint function with proper "random-ish" logic
function _mintZines(uint256 numberOfTokens) private {
}
// Reserve some zines for giveaways
function reserveZines() public onlyOwner {
}
// Claim and mint tokens
function mintZines(
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof,
uint256 numberOfTokens
) external {
require(mintingIsActive, "Minting is not active.");
require(numberOfTokens <= maxMints, "Cannot mint more than 2");
require(tokensMinted().add(numberOfTokens) <= maxSupply, "Minting would exceed max supply");
require(<FILL_ME>)
if (earlyAccessMode) {
require(merkleSet, "Merkle root not set by contract owner");
require(msg.sender == account, "Can only be claimed by the hodler");
// Verify merkle proof
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
require(MerkleProof.verify(merkleProof, merkleRoot, node), "Invalid merkle proof");
}
_mintZines(numberOfTokens);
}
// Override the below functions from parent contracts
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
}
function _burn(uint256 tokenId)
internal
override(ERC721, ERC721URIStorage)
{
}
}
| balanceOf(msg.sender).add(numberOfTokens)<=maxMints,"Minting would exceed maximum amount of 2 tokens per wallet." | 32,497 | balanceOf(msg.sender).add(numberOfTokens)<=maxMints |
"PKNPremium: Amount too high!" | pragma solidity ^0.8.3;
// This contract handles staking PKN to get access to premium features
contract PKNPremium {
uint256 constant LOCK_PERIOD = 365 days;
mapping(address => uint256) _pknStakedBy;
mapping(address => uint256) _unlockTimeOf;
IERC20 public immutable PKN;
event Deposit(address user, uint256 amount);
event Withdraw(address user, uint256 amount);
event Renew(address user, uint256 amount);
constructor(IERC20 _PKN) {
}
function pknStackedBy(address user) public view returns(uint256) {
}
function unlockTimeOf(address user) public view returns(uint256) {
}
function isSubscriptionActive(address user) public view returns(bool) {
}
// Locks PKN for locking period
function deposit(uint256 _amount) public {
}
// Withdraw the unlocked PKN
function withdraw(uint256 _amount) public {
require(<FILL_ME>)
require(!isSubscriptionActive(msg.sender), "PKNPremium: PKN not unlocked yet!");
_pknStakedBy[msg.sender] -= _amount;
PKN.transfer(msg.sender, _amount);
emit Withdraw(msg.sender, _amount);
}
// renew an existing or expired subscription
function renew() public {
}
function _getUnlockTime(uint256 startTime) internal pure returns(uint256) {
}
}
| pknStackedBy(msg.sender)>=_amount,"PKNPremium: Amount too high!" | 32,533 | pknStackedBy(msg.sender)>=_amount |
"PKNPremium: PKN not unlocked yet!" | pragma solidity ^0.8.3;
// This contract handles staking PKN to get access to premium features
contract PKNPremium {
uint256 constant LOCK_PERIOD = 365 days;
mapping(address => uint256) _pknStakedBy;
mapping(address => uint256) _unlockTimeOf;
IERC20 public immutable PKN;
event Deposit(address user, uint256 amount);
event Withdraw(address user, uint256 amount);
event Renew(address user, uint256 amount);
constructor(IERC20 _PKN) {
}
function pknStackedBy(address user) public view returns(uint256) {
}
function unlockTimeOf(address user) public view returns(uint256) {
}
function isSubscriptionActive(address user) public view returns(bool) {
}
// Locks PKN for locking period
function deposit(uint256 _amount) public {
}
// Withdraw the unlocked PKN
function withdraw(uint256 _amount) public {
require(pknStackedBy(msg.sender) >= _amount, "PKNPremium: Amount too high!");
require(<FILL_ME>)
_pknStakedBy[msg.sender] -= _amount;
PKN.transfer(msg.sender, _amount);
emit Withdraw(msg.sender, _amount);
}
// renew an existing or expired subscription
function renew() public {
}
function _getUnlockTime(uint256 startTime) internal pure returns(uint256) {
}
}
| !isSubscriptionActive(msg.sender),"PKNPremium: PKN not unlocked yet!" | 32,533 | !isSubscriptionActive(msg.sender) |
"PKNPremium: No PKN stacked!" | pragma solidity ^0.8.3;
// This contract handles staking PKN to get access to premium features
contract PKNPremium {
uint256 constant LOCK_PERIOD = 365 days;
mapping(address => uint256) _pknStakedBy;
mapping(address => uint256) _unlockTimeOf;
IERC20 public immutable PKN;
event Deposit(address user, uint256 amount);
event Withdraw(address user, uint256 amount);
event Renew(address user, uint256 amount);
constructor(IERC20 _PKN) {
}
function pknStackedBy(address user) public view returns(uint256) {
}
function unlockTimeOf(address user) public view returns(uint256) {
}
function isSubscriptionActive(address user) public view returns(bool) {
}
// Locks PKN for locking period
function deposit(uint256 _amount) public {
}
// Withdraw the unlocked PKN
function withdraw(uint256 _amount) public {
}
// renew an existing or expired subscription
function renew() public {
require(<FILL_ME>)
_unlockTimeOf[msg.sender] = _getUnlockTime(block.timestamp);
emit Renew(msg.sender, _pknStakedBy[msg.sender]);
}
function _getUnlockTime(uint256 startTime) internal pure returns(uint256) {
}
}
| pknStackedBy(msg.sender)>0,"PKNPremium: No PKN stacked!" | 32,533 | pknStackedBy(msg.sender)>0 |
"access denied" | pragma solidity ^0.6.0;
abstract contract WhitelistGuard is Ownable
{
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private whitelist;
modifier onlyEOAorWhitelist()
{
}
modifier onlyWhitelist()
{
address _from = _msgSender();
require(<FILL_ME>)
_;
}
function addToWhitelist(address _address) external onlyOwner
{
}
function removeFromWhitelist(address _address) external onlyOwner
{
}
}
| whitelist.contains(_from),"access denied" | 32,631 | whitelist.contains(_from) |
"already listed" | pragma solidity ^0.6.0;
abstract contract WhitelistGuard is Ownable
{
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private whitelist;
modifier onlyEOAorWhitelist()
{
}
modifier onlyWhitelist()
{
}
function addToWhitelist(address _address) external onlyOwner
{
require(<FILL_ME>)
}
function removeFromWhitelist(address _address) external onlyOwner
{
}
}
| whitelist.add(_address),"already listed" | 32,631 | whitelist.add(_address) |
"not listed" | pragma solidity ^0.6.0;
abstract contract WhitelistGuard is Ownable
{
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private whitelist;
modifier onlyEOAorWhitelist()
{
}
modifier onlyWhitelist()
{
}
function addToWhitelist(address _address) external onlyOwner
{
}
function removeFromWhitelist(address _address) external onlyOwner
{
require(<FILL_ME>)
}
}
| whitelist.remove(_address),"not listed" | 32,631 | whitelist.remove(_address) |
'TRANSFER_FROM_FAILED' | pragma solidity =0.6.6;
interface IUniswapV2Migrator {
function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external;
}
interface IUniswapV1Factory {
function getExchange(address) external view returns (address);
}
interface IUniswapV1Exchange {
function balanceOf(address owner) external view returns (uint);
function transferFrom(address from, address to, uint value) external returns (bool);
function removeLiquidity(uint, uint, uint, uint) external returns (uint, uint);
function tokenToEthSwapInput(uint, uint, uint) external returns (uint);
function ethToTokenSwapInput(uint, uint) external payable returns (uint);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
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);
}
contract UniswapV2Migrator is IUniswapV2Migrator {
IUniswapV1Factory immutable factoryV1;
IUniswapV2Router01 immutable router;
constructor(address _factoryV1, address _router) public {
}
// needs to accept ETH from any v1 exchange and the router. ideally this could be enforced, as in the router,
// but it's not possible because it requires a call to the v1 factory, which takes too much gas
receive() external payable {}
function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline)
external
override
{
IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(token));
uint liquidityV1 = exchangeV1.balanceOf(msg.sender);
require(<FILL_ME>)
(uint amountETHV1, uint amountTokenV1) = exchangeV1.removeLiquidity(liquidityV1, 1, 1, uint(-1));
TransferHelper.safeApprove(token, address(router), amountTokenV1);
(uint amountTokenV2, uint amountETHV2,) = router.addLiquidityETH{value: amountETHV1}(
token,
amountTokenV1,
amountTokenMin,
amountETHMin,
to,
deadline
);
if (amountTokenV1 > amountTokenV2) {
TransferHelper.safeApprove(token, address(router), 0); // be a good blockchain citizen, reset allowance to 0
TransferHelper.safeTransfer(token, msg.sender, amountTokenV1 - amountTokenV2);
} else if (amountETHV1 > amountETHV2) {
// addLiquidityETH guarantees that all of amountETHV1 or amountTokenV1 will be used, hence this else is safe
TransferHelper.safeTransferETH(msg.sender, amountETHV1 - amountETHV2);
}
}
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
}
function safeTransfer(address token, address to, uint value) internal {
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
}
function safeTransferETH(address to, uint value) internal {
}
}
| exchangeV1.transferFrom(msg.sender,address(this),liquidityV1),'TRANSFER_FROM_FAILED' | 32,654 | exchangeV1.transferFrom(msg.sender,address(this),liquidityV1) |
null | pragma solidity ^0.4.4;
contract TimeBasedContract
{
function TimeBasedContract() public {
}
function() public payable {
uint minutesTime = (now / 60) % 60;
require(<FILL_ME>)
}
}
| ((minutesTime/10)*10)==minutesTime | 32,774 | ((minutesTime/10)*10)==minutesTime |
"Max limit" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract KrazyKookingToken is ERC721Enumerable, Ownable {
string _baseTokenURI = "ipfs://QmZVR2mAhQqsjNMvF5pWVZMGcG1tM7iaYTaDu4XMqnT98r/";
bool private paused = true;
uint256 public constant MAX_CARDS = 6000;
uint256 public RESERVED_CARDS = 100;
uint8 private MAX_CARDS_PER_OWNER = 10;
uint256 private PRICE = 0.035 ether;
constructor() ERC721("KrazyKooking", "CRKOOK") {}
function _baseURI() internal view virtual override returns (string memory) {
}
function _mintCard(address to, uint256 id) internal virtual {
}
function price(uint256 _count) public view returns (uint256) {
}
function setBaseTokenURL(string memory url) public onlyOwner {
}
function mintCard(address to, uint256 count) public payable {
require(!paused, "Pause");
require(count <= MAX_CARDS_PER_OWNER, "Yo can't mint more than 10");
require(msg.value >= price(count), "Value below price");
require(<FILL_ME>)
require(totalSupply() < MAX_CARDS, "Sale end");
for (uint256 i = 0; i < count; i++) {
_mintCard(to, totalSupply());
}
}
function reserveCards(address to, uint256 count) public onlyOwner {
}
function startDrop() public onlyOwner {
}
function stopDrop() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
}
| totalSupply()+count<=MAX_CARDS,"Max limit" | 32,866 | totalSupply()+count<=MAX_CARDS |
"INVALID_ORDER_HASH" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/LibPart.sol";
import "../royalties/RoyaltiesV2.sol";
import "../libraries/ArrayUtils.sol";
import "../libraries/SaleKindInterface.sol";
import "../libraries/ReentrancyGuarded.sol";
import "../registry/ProxyRegistry.sol";
import "../modules/ERC20.sol";
import "../modules/TokenTransferProxy.sol";
import "../registry/AuthenticatedProxy.sol";
import "../interfaces/IPaceArtStore.sol";
contract ExchangeCore is ReentrancyGuarded, Ownable {
address public defaultCollection;
/* The token used to pay exchange fees. */
ERC20 public exchangeToken;
/* User registry. */
ProxyRegistry public registry;
/* Token transfer proxy. */
TokenTransferProxy public tokenTransferProxy;
/* Cancelled / finalized orders, by hash. */
mapping(bytes32 => bool) public cancelledOrFinalized;
/* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
mapping(bytes32 => bool) public approvedOrders;
// /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumMakerProtocolFee = 0;
// /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumTakerProtocolFee = 0;
// /* Recipient of protocol fees. */
// address public protocolFeeRecipient;
/* Fee method: protocol fee or split fee. */
enum FeeMethod { ProtocolFee, SplitFee }
/* Inverse basis point. */
uint public constant INVERSE_BASIS_POINT = 10000;
/* An ECDSA signature. */
struct Sig {
/* v parameter */
uint8 v;
/* r parameter */
bytes32 r;
/* s parameter */
bytes32 s;
}
/* An order on the exchange. */
struct Order {
/* Exchange address, intended as a versioning mechanism. */
address exchange;
/* Order maker address. */
address maker;
/* Order taker address, if specified. */
address taker;
/* Maker relayer fee of the order, unused for taker order. */
uint makerRelayerFee;
/* Taker relayer fee of the order, or maximum taker fee for a taker order. */
uint takerRelayerFee;
// /* Maker protocol fee of the order, unused for taker order. */
// uint makerProtocolFee;
// /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
// uint takerProtocolFee;
/* Order fee recipient or zero address for taker order. */
address feeRecipient;
/* Fee method (protocol token or split fee). */
FeeMethod feeMethod;
/* Side (buy/sell). */
SaleKindInterface.Side side;
/* Kind of sale. */
SaleKindInterface.SaleKind saleKind;
/* Target. */
address target;
/* HowToCall. */
AuthenticatedProxy.HowToCall howToCall;
/* Calldata. */
bytes callData;
bytes replacementPattern;
/* Calldata replacement pattern, or an empty byte array for no replacement. */
// bytes replacementPattern;
// /* Static call target, zero-address for no static call. */
address staticTarget;
/* Static call extra data. */
bytes staticExtradata;
/* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
address paymentToken;
/* Base price of the order (in paymentTokens). */
uint basePrice;
/* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
uint extra;
/* Listing timestamp. */
uint listingTime;
/* Expiration timestamp - 0 for no expiry. */
uint expirationTime;
/* Order salt, used to prevent duplicate hashes. */
uint salt;
}
event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
// event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
// event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
event OrderCancelled (bytes32 indexed hash);
event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);
// /**
// * @dev Change the minimum maker fee paid to the protocol (owner only)
// * @param newMinimumMakerProtocolFee New fee to set in basis points
// */
// function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
// public
// onlyOwner
// {
// minimumMakerProtocolFee = newMinimumMakerProtocolFee;
// }
// /**
// * @dev Change the minimum taker fee paid to the protocol (owner only)
// * @param newMinimumTakerProtocolFee New fee to set in basis points
// */
// function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
// public
// onlyOwner
// {
// minimumTakerProtocolFee = newMinimumTakerProtocolFee;
// }
// /**
// * @dev Change the protocol fee recipient (owner only)
// * @param newProtocolFeeRecipient New protocol fee recipient address
// */
// function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
// public
// onlyOwner
// {
// protocolFeeRecipient = newProtocolFeeRecipient;
// }
function changeDefaultCollection(address _newCollection) public onlyOwner {
}
/**
* @dev Transfer tokens
* @param token Token to transfer
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function transferTokens(address token, address from, address to, uint amount)
internal
{
}
/**
* @dev Charge a fee in protocol tokens
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function chargeProtocolFee(address from, address to, uint amount)
internal
{
}
/**
* @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
* @param target Contract to call
* @param callData Calldata (appended to extradata)
* @param extradata Base data for STATICCALL (probably function selector and argument encoding)
*/
// function staticCall(address target, bytes memory callData, bytes memory extradata)
// public
// view
// returns (bool result)
// {
// bytes memory combined = new bytes(callData.length + extradata.length);
// uint index;
// assembly {
// index := add(combined, 0x20)
// }
// index = ArrayUtils.unsafeWriteBytes(index, extradata);
// ArrayUtils.unsafeWriteBytes(index, callData);
// assembly {
// result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0)
// }
// return result;
// }
/**
* Calculate size of an order struct when tightly packed
*
* @param order Order to calculate size of
* @return Size in bytes
*/
function sizeOf(Order memory order)
internal
pure
returns (uint)
{
}
/**
* @dev Hash an order, returning the canonical order hash, without the message prefix
* @param order Order to hash
*/
function hashOrder(Order memory order)
internal
pure
returns (bytes32 hash)
{
}
/**
* @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
* @param order Order to hash
* @return Hash of message prefix and order hash per Ethereum format
*/
function hashToSign(Order memory order)
internal
pure
returns (bytes32)
{
}
/**
* @dev Assert an order is valid and return its hash
* @param order Order to validate
* @param sig ECDSA signature
*/
function requireValidOrder(Order memory order, Sig memory sig)
internal
view
returns (bytes32)
{
bytes32 hash = hashToSign(order);
require(<FILL_ME>)
return hash;
}
/**
* @dev Validate order parameters (does *not* check signature validity)
* @param order Order to validate
*/
function validateOrderParameters(Order memory order)
internal
view
returns (bool)
{
}
/**
* @dev Validate a provided previously approved / signed order, hash, and signature.
* @param hash Order hash (already calculated, passed to avoid recalculation)
* @param order Order to validate
* @param sig ECDSA signature
*/
function validateOrder(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
}
/**
* @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
* @param order Order to approve
* @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
*/
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
}
/**
* @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
* @param order Order to cancel
* @param sig ECDSA signature
*/
function cancelOrder(Order memory order, Sig memory sig)
internal
{
}
/**
* @dev Calculate the current price of an order (convenience function)
* @param order Order to calculate the price of
* @return The current price of the order
*/
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
{
}
/**
* @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Match price
*/
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
returns (uint)
{
}
/**
* @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
* @param buy Buy-side order
* @param sell Sell-side order
*/
function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty)
internal
returns (uint)
{
}
/**
* @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Whether or not the two orders can be matched
*/
function ordersCanMatch(Order memory buy, Order memory sell)
internal
view
returns (bool)
{
}
function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) {
}
/**
* @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
* @param buy Buy-side order
* @param buySig Buy-side order signature
* @param sell Sell-side order
* @param sellSig Sell-side order signature
*/
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
internal
reentrancyGuard
{
}
}
| validateOrder(hash,order,sig),"INVALID_ORDER_HASH" | 32,882 | validateOrder(hash,order,sig) |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/LibPart.sol";
import "../royalties/RoyaltiesV2.sol";
import "../libraries/ArrayUtils.sol";
import "../libraries/SaleKindInterface.sol";
import "../libraries/ReentrancyGuarded.sol";
import "../registry/ProxyRegistry.sol";
import "../modules/ERC20.sol";
import "../modules/TokenTransferProxy.sol";
import "../registry/AuthenticatedProxy.sol";
import "../interfaces/IPaceArtStore.sol";
contract ExchangeCore is ReentrancyGuarded, Ownable {
address public defaultCollection;
/* The token used to pay exchange fees. */
ERC20 public exchangeToken;
/* User registry. */
ProxyRegistry public registry;
/* Token transfer proxy. */
TokenTransferProxy public tokenTransferProxy;
/* Cancelled / finalized orders, by hash. */
mapping(bytes32 => bool) public cancelledOrFinalized;
/* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
mapping(bytes32 => bool) public approvedOrders;
// /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumMakerProtocolFee = 0;
// /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumTakerProtocolFee = 0;
// /* Recipient of protocol fees. */
// address public protocolFeeRecipient;
/* Fee method: protocol fee or split fee. */
enum FeeMethod { ProtocolFee, SplitFee }
/* Inverse basis point. */
uint public constant INVERSE_BASIS_POINT = 10000;
/* An ECDSA signature. */
struct Sig {
/* v parameter */
uint8 v;
/* r parameter */
bytes32 r;
/* s parameter */
bytes32 s;
}
/* An order on the exchange. */
struct Order {
/* Exchange address, intended as a versioning mechanism. */
address exchange;
/* Order maker address. */
address maker;
/* Order taker address, if specified. */
address taker;
/* Maker relayer fee of the order, unused for taker order. */
uint makerRelayerFee;
/* Taker relayer fee of the order, or maximum taker fee for a taker order. */
uint takerRelayerFee;
// /* Maker protocol fee of the order, unused for taker order. */
// uint makerProtocolFee;
// /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
// uint takerProtocolFee;
/* Order fee recipient or zero address for taker order. */
address feeRecipient;
/* Fee method (protocol token or split fee). */
FeeMethod feeMethod;
/* Side (buy/sell). */
SaleKindInterface.Side side;
/* Kind of sale. */
SaleKindInterface.SaleKind saleKind;
/* Target. */
address target;
/* HowToCall. */
AuthenticatedProxy.HowToCall howToCall;
/* Calldata. */
bytes callData;
bytes replacementPattern;
/* Calldata replacement pattern, or an empty byte array for no replacement. */
// bytes replacementPattern;
// /* Static call target, zero-address for no static call. */
address staticTarget;
/* Static call extra data. */
bytes staticExtradata;
/* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
address paymentToken;
/* Base price of the order (in paymentTokens). */
uint basePrice;
/* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
uint extra;
/* Listing timestamp. */
uint listingTime;
/* Expiration timestamp - 0 for no expiry. */
uint expirationTime;
/* Order salt, used to prevent duplicate hashes. */
uint salt;
}
event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
// event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
// event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
event OrderCancelled (bytes32 indexed hash);
event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);
// /**
// * @dev Change the minimum maker fee paid to the protocol (owner only)
// * @param newMinimumMakerProtocolFee New fee to set in basis points
// */
// function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
// public
// onlyOwner
// {
// minimumMakerProtocolFee = newMinimumMakerProtocolFee;
// }
// /**
// * @dev Change the minimum taker fee paid to the protocol (owner only)
// * @param newMinimumTakerProtocolFee New fee to set in basis points
// */
// function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
// public
// onlyOwner
// {
// minimumTakerProtocolFee = newMinimumTakerProtocolFee;
// }
// /**
// * @dev Change the protocol fee recipient (owner only)
// * @param newProtocolFeeRecipient New protocol fee recipient address
// */
// function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
// public
// onlyOwner
// {
// protocolFeeRecipient = newProtocolFeeRecipient;
// }
function changeDefaultCollection(address _newCollection) public onlyOwner {
}
/**
* @dev Transfer tokens
* @param token Token to transfer
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function transferTokens(address token, address from, address to, uint amount)
internal
{
}
/**
* @dev Charge a fee in protocol tokens
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function chargeProtocolFee(address from, address to, uint amount)
internal
{
}
/**
* @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
* @param target Contract to call
* @param callData Calldata (appended to extradata)
* @param extradata Base data for STATICCALL (probably function selector and argument encoding)
*/
// function staticCall(address target, bytes memory callData, bytes memory extradata)
// public
// view
// returns (bool result)
// {
// bytes memory combined = new bytes(callData.length + extradata.length);
// uint index;
// assembly {
// index := add(combined, 0x20)
// }
// index = ArrayUtils.unsafeWriteBytes(index, extradata);
// ArrayUtils.unsafeWriteBytes(index, callData);
// assembly {
// result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0)
// }
// return result;
// }
/**
* Calculate size of an order struct when tightly packed
*
* @param order Order to calculate size of
* @return Size in bytes
*/
function sizeOf(Order memory order)
internal
pure
returns (uint)
{
}
/**
* @dev Hash an order, returning the canonical order hash, without the message prefix
* @param order Order to hash
*/
function hashOrder(Order memory order)
internal
pure
returns (bytes32 hash)
{
}
/**
* @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
* @param order Order to hash
* @return Hash of message prefix and order hash per Ethereum format
*/
function hashToSign(Order memory order)
internal
pure
returns (bytes32)
{
}
/**
* @dev Assert an order is valid and return its hash
* @param order Order to validate
* @param sig ECDSA signature
*/
function requireValidOrder(Order memory order, Sig memory sig)
internal
view
returns (bytes32)
{
}
/**
* @dev Validate order parameters (does *not* check signature validity)
* @param order Order to validate
*/
function validateOrderParameters(Order memory order)
internal
view
returns (bool)
{
}
/**
* @dev Validate a provided previously approved / signed order, hash, and signature.
* @param hash Order hash (already calculated, passed to avoid recalculation)
* @param order Order to validate
* @param sig ECDSA signature
*/
function validateOrder(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
}
/**
* @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
* @param order Order to approve
* @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
*/
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
/* CHECKS */
/* Assert sender is authorized to approve order. */
require(msg.sender == order.maker);
/* Calculate order hash. */
bytes32 hash = hashToSign(order);
/* Assert order has not already been approved. */
require(<FILL_ME>)
/* EFFECTS */
/* Mark order as approved. */
approvedOrders[hash] = true;
/* Log approval event. Must be split in two due to Solidity stack size limitations. */
{
emit OrderApprovedPartOne(hash, order.exchange, order.maker, order.taker, order.makerRelayerFee, order.takerRelayerFee, order.feeRecipient, order.feeMethod, order.side, order.saleKind, order.target);
}
{
emit OrderApprovedPartTwo(hash, order.howToCall, order.callData, order.staticTarget, order.staticExtradata, order.paymentToken, order.basePrice, order.extra, order.listingTime, order.expirationTime, order.salt, orderbookInclusionDesired);
}
}
/**
* @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
* @param order Order to cancel
* @param sig ECDSA signature
*/
function cancelOrder(Order memory order, Sig memory sig)
internal
{
}
/**
* @dev Calculate the current price of an order (convenience function)
* @param order Order to calculate the price of
* @return The current price of the order
*/
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
{
}
/**
* @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Match price
*/
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
returns (uint)
{
}
/**
* @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
* @param buy Buy-side order
* @param sell Sell-side order
*/
function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty)
internal
returns (uint)
{
}
/**
* @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Whether or not the two orders can be matched
*/
function ordersCanMatch(Order memory buy, Order memory sell)
internal
view
returns (bool)
{
}
function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) {
}
/**
* @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
* @param buy Buy-side order
* @param buySig Buy-side order signature
* @param sell Sell-side order
* @param sellSig Sell-side order signature
*/
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
internal
reentrancyGuard
{
}
}
| !approvedOrders[hash] | 32,882 | !approvedOrders[hash] |
"PaceArtExchange::INVALID_COLLECTION" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/LibPart.sol";
import "../royalties/RoyaltiesV2.sol";
import "../libraries/ArrayUtils.sol";
import "../libraries/SaleKindInterface.sol";
import "../libraries/ReentrancyGuarded.sol";
import "../registry/ProxyRegistry.sol";
import "../modules/ERC20.sol";
import "../modules/TokenTransferProxy.sol";
import "../registry/AuthenticatedProxy.sol";
import "../interfaces/IPaceArtStore.sol";
contract ExchangeCore is ReentrancyGuarded, Ownable {
address public defaultCollection;
/* The token used to pay exchange fees. */
ERC20 public exchangeToken;
/* User registry. */
ProxyRegistry public registry;
/* Token transfer proxy. */
TokenTransferProxy public tokenTransferProxy;
/* Cancelled / finalized orders, by hash. */
mapping(bytes32 => bool) public cancelledOrFinalized;
/* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
mapping(bytes32 => bool) public approvedOrders;
// /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumMakerProtocolFee = 0;
// /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumTakerProtocolFee = 0;
// /* Recipient of protocol fees. */
// address public protocolFeeRecipient;
/* Fee method: protocol fee or split fee. */
enum FeeMethod { ProtocolFee, SplitFee }
/* Inverse basis point. */
uint public constant INVERSE_BASIS_POINT = 10000;
/* An ECDSA signature. */
struct Sig {
/* v parameter */
uint8 v;
/* r parameter */
bytes32 r;
/* s parameter */
bytes32 s;
}
/* An order on the exchange. */
struct Order {
/* Exchange address, intended as a versioning mechanism. */
address exchange;
/* Order maker address. */
address maker;
/* Order taker address, if specified. */
address taker;
/* Maker relayer fee of the order, unused for taker order. */
uint makerRelayerFee;
/* Taker relayer fee of the order, or maximum taker fee for a taker order. */
uint takerRelayerFee;
// /* Maker protocol fee of the order, unused for taker order. */
// uint makerProtocolFee;
// /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
// uint takerProtocolFee;
/* Order fee recipient or zero address for taker order. */
address feeRecipient;
/* Fee method (protocol token or split fee). */
FeeMethod feeMethod;
/* Side (buy/sell). */
SaleKindInterface.Side side;
/* Kind of sale. */
SaleKindInterface.SaleKind saleKind;
/* Target. */
address target;
/* HowToCall. */
AuthenticatedProxy.HowToCall howToCall;
/* Calldata. */
bytes callData;
bytes replacementPattern;
/* Calldata replacement pattern, or an empty byte array for no replacement. */
// bytes replacementPattern;
// /* Static call target, zero-address for no static call. */
address staticTarget;
/* Static call extra data. */
bytes staticExtradata;
/* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
address paymentToken;
/* Base price of the order (in paymentTokens). */
uint basePrice;
/* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
uint extra;
/* Listing timestamp. */
uint listingTime;
/* Expiration timestamp - 0 for no expiry. */
uint expirationTime;
/* Order salt, used to prevent duplicate hashes. */
uint salt;
}
event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
// event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
// event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
event OrderCancelled (bytes32 indexed hash);
event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);
// /**
// * @dev Change the minimum maker fee paid to the protocol (owner only)
// * @param newMinimumMakerProtocolFee New fee to set in basis points
// */
// function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
// public
// onlyOwner
// {
// minimumMakerProtocolFee = newMinimumMakerProtocolFee;
// }
// /**
// * @dev Change the minimum taker fee paid to the protocol (owner only)
// * @param newMinimumTakerProtocolFee New fee to set in basis points
// */
// function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
// public
// onlyOwner
// {
// minimumTakerProtocolFee = newMinimumTakerProtocolFee;
// }
// /**
// * @dev Change the protocol fee recipient (owner only)
// * @param newProtocolFeeRecipient New protocol fee recipient address
// */
// function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
// public
// onlyOwner
// {
// protocolFeeRecipient = newProtocolFeeRecipient;
// }
function changeDefaultCollection(address _newCollection) public onlyOwner {
}
/**
* @dev Transfer tokens
* @param token Token to transfer
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function transferTokens(address token, address from, address to, uint amount)
internal
{
}
/**
* @dev Charge a fee in protocol tokens
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function chargeProtocolFee(address from, address to, uint amount)
internal
{
}
/**
* @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
* @param target Contract to call
* @param callData Calldata (appended to extradata)
* @param extradata Base data for STATICCALL (probably function selector and argument encoding)
*/
// function staticCall(address target, bytes memory callData, bytes memory extradata)
// public
// view
// returns (bool result)
// {
// bytes memory combined = new bytes(callData.length + extradata.length);
// uint index;
// assembly {
// index := add(combined, 0x20)
// }
// index = ArrayUtils.unsafeWriteBytes(index, extradata);
// ArrayUtils.unsafeWriteBytes(index, callData);
// assembly {
// result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0)
// }
// return result;
// }
/**
* Calculate size of an order struct when tightly packed
*
* @param order Order to calculate size of
* @return Size in bytes
*/
function sizeOf(Order memory order)
internal
pure
returns (uint)
{
}
/**
* @dev Hash an order, returning the canonical order hash, without the message prefix
* @param order Order to hash
*/
function hashOrder(Order memory order)
internal
pure
returns (bytes32 hash)
{
}
/**
* @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
* @param order Order to hash
* @return Hash of message prefix and order hash per Ethereum format
*/
function hashToSign(Order memory order)
internal
pure
returns (bytes32)
{
}
/**
* @dev Assert an order is valid and return its hash
* @param order Order to validate
* @param sig ECDSA signature
*/
function requireValidOrder(Order memory order, Sig memory sig)
internal
view
returns (bytes32)
{
}
/**
* @dev Validate order parameters (does *not* check signature validity)
* @param order Order to validate
*/
function validateOrderParameters(Order memory order)
internal
view
returns (bool)
{
}
/**
* @dev Validate a provided previously approved / signed order, hash, and signature.
* @param hash Order hash (already calculated, passed to avoid recalculation)
* @param order Order to validate
* @param sig ECDSA signature
*/
function validateOrder(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
}
/**
* @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
* @param order Order to approve
* @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
*/
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
}
/**
* @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
* @param order Order to cancel
* @param sig ECDSA signature
*/
function cancelOrder(Order memory order, Sig memory sig)
internal
{
}
/**
* @dev Calculate the current price of an order (convenience function)
* @param order Order to calculate the price of
* @return The current price of the order
*/
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
{
}
/**
* @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Match price
*/
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
returns (uint)
{
}
/**
* @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
* @param buy Buy-side order
* @param sell Sell-side order
*/
function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty)
internal
returns (uint)
{
}
/**
* @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Whether or not the two orders can be matched
*/
function ordersCanMatch(Order memory buy, Order memory sell)
internal
view
returns (bool)
{
}
function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) {
if (callMint) {
require(<FILL_ME>)
(bool result, bytes memory returnData) = order.target.call(order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
} else {
/* Retrieve delegateProxy contract. */
OwnableDelegateProxy delegateProxy = registry.proxies(order.maker);
/* Proxy must exist. */
require(address(delegateProxy) != address(0), "User not registed proxy yet!");
/* Assert implementation. */
require(delegateProxy.implementation() == registry.delegateProxyImplementation());
/* Execute specified call through proxy. */
(bool result, bytes memory returnData) = AuthenticatedProxy(address(delegateProxy)).proxy(order.target, order.howToCall, order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
}
}
/**
* @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
* @param buy Buy-side order
* @param buySig Buy-side order signature
* @param sell Sell-side order
* @param sellSig Sell-side order signature
*/
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
internal
reentrancyGuard
{
}
}
| IPaceArtStore(order.target).owner()==order.maker||order.target==defaultCollection,"PaceArtExchange::INVALID_COLLECTION" | 32,882 | IPaceArtStore(order.target).owner()==order.maker||order.target==defaultCollection |
"User not registed proxy yet!" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/LibPart.sol";
import "../royalties/RoyaltiesV2.sol";
import "../libraries/ArrayUtils.sol";
import "../libraries/SaleKindInterface.sol";
import "../libraries/ReentrancyGuarded.sol";
import "../registry/ProxyRegistry.sol";
import "../modules/ERC20.sol";
import "../modules/TokenTransferProxy.sol";
import "../registry/AuthenticatedProxy.sol";
import "../interfaces/IPaceArtStore.sol";
contract ExchangeCore is ReentrancyGuarded, Ownable {
address public defaultCollection;
/* The token used to pay exchange fees. */
ERC20 public exchangeToken;
/* User registry. */
ProxyRegistry public registry;
/* Token transfer proxy. */
TokenTransferProxy public tokenTransferProxy;
/* Cancelled / finalized orders, by hash. */
mapping(bytes32 => bool) public cancelledOrFinalized;
/* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
mapping(bytes32 => bool) public approvedOrders;
// /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumMakerProtocolFee = 0;
// /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumTakerProtocolFee = 0;
// /* Recipient of protocol fees. */
// address public protocolFeeRecipient;
/* Fee method: protocol fee or split fee. */
enum FeeMethod { ProtocolFee, SplitFee }
/* Inverse basis point. */
uint public constant INVERSE_BASIS_POINT = 10000;
/* An ECDSA signature. */
struct Sig {
/* v parameter */
uint8 v;
/* r parameter */
bytes32 r;
/* s parameter */
bytes32 s;
}
/* An order on the exchange. */
struct Order {
/* Exchange address, intended as a versioning mechanism. */
address exchange;
/* Order maker address. */
address maker;
/* Order taker address, if specified. */
address taker;
/* Maker relayer fee of the order, unused for taker order. */
uint makerRelayerFee;
/* Taker relayer fee of the order, or maximum taker fee for a taker order. */
uint takerRelayerFee;
// /* Maker protocol fee of the order, unused for taker order. */
// uint makerProtocolFee;
// /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
// uint takerProtocolFee;
/* Order fee recipient or zero address for taker order. */
address feeRecipient;
/* Fee method (protocol token or split fee). */
FeeMethod feeMethod;
/* Side (buy/sell). */
SaleKindInterface.Side side;
/* Kind of sale. */
SaleKindInterface.SaleKind saleKind;
/* Target. */
address target;
/* HowToCall. */
AuthenticatedProxy.HowToCall howToCall;
/* Calldata. */
bytes callData;
bytes replacementPattern;
/* Calldata replacement pattern, or an empty byte array for no replacement. */
// bytes replacementPattern;
// /* Static call target, zero-address for no static call. */
address staticTarget;
/* Static call extra data. */
bytes staticExtradata;
/* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
address paymentToken;
/* Base price of the order (in paymentTokens). */
uint basePrice;
/* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
uint extra;
/* Listing timestamp. */
uint listingTime;
/* Expiration timestamp - 0 for no expiry. */
uint expirationTime;
/* Order salt, used to prevent duplicate hashes. */
uint salt;
}
event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
// event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
// event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
event OrderCancelled (bytes32 indexed hash);
event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);
// /**
// * @dev Change the minimum maker fee paid to the protocol (owner only)
// * @param newMinimumMakerProtocolFee New fee to set in basis points
// */
// function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
// public
// onlyOwner
// {
// minimumMakerProtocolFee = newMinimumMakerProtocolFee;
// }
// /**
// * @dev Change the minimum taker fee paid to the protocol (owner only)
// * @param newMinimumTakerProtocolFee New fee to set in basis points
// */
// function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
// public
// onlyOwner
// {
// minimumTakerProtocolFee = newMinimumTakerProtocolFee;
// }
// /**
// * @dev Change the protocol fee recipient (owner only)
// * @param newProtocolFeeRecipient New protocol fee recipient address
// */
// function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
// public
// onlyOwner
// {
// protocolFeeRecipient = newProtocolFeeRecipient;
// }
function changeDefaultCollection(address _newCollection) public onlyOwner {
}
/**
* @dev Transfer tokens
* @param token Token to transfer
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function transferTokens(address token, address from, address to, uint amount)
internal
{
}
/**
* @dev Charge a fee in protocol tokens
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function chargeProtocolFee(address from, address to, uint amount)
internal
{
}
/**
* @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
* @param target Contract to call
* @param callData Calldata (appended to extradata)
* @param extradata Base data for STATICCALL (probably function selector and argument encoding)
*/
// function staticCall(address target, bytes memory callData, bytes memory extradata)
// public
// view
// returns (bool result)
// {
// bytes memory combined = new bytes(callData.length + extradata.length);
// uint index;
// assembly {
// index := add(combined, 0x20)
// }
// index = ArrayUtils.unsafeWriteBytes(index, extradata);
// ArrayUtils.unsafeWriteBytes(index, callData);
// assembly {
// result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0)
// }
// return result;
// }
/**
* Calculate size of an order struct when tightly packed
*
* @param order Order to calculate size of
* @return Size in bytes
*/
function sizeOf(Order memory order)
internal
pure
returns (uint)
{
}
/**
* @dev Hash an order, returning the canonical order hash, without the message prefix
* @param order Order to hash
*/
function hashOrder(Order memory order)
internal
pure
returns (bytes32 hash)
{
}
/**
* @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
* @param order Order to hash
* @return Hash of message prefix and order hash per Ethereum format
*/
function hashToSign(Order memory order)
internal
pure
returns (bytes32)
{
}
/**
* @dev Assert an order is valid and return its hash
* @param order Order to validate
* @param sig ECDSA signature
*/
function requireValidOrder(Order memory order, Sig memory sig)
internal
view
returns (bytes32)
{
}
/**
* @dev Validate order parameters (does *not* check signature validity)
* @param order Order to validate
*/
function validateOrderParameters(Order memory order)
internal
view
returns (bool)
{
}
/**
* @dev Validate a provided previously approved / signed order, hash, and signature.
* @param hash Order hash (already calculated, passed to avoid recalculation)
* @param order Order to validate
* @param sig ECDSA signature
*/
function validateOrder(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
}
/**
* @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
* @param order Order to approve
* @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
*/
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
}
/**
* @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
* @param order Order to cancel
* @param sig ECDSA signature
*/
function cancelOrder(Order memory order, Sig memory sig)
internal
{
}
/**
* @dev Calculate the current price of an order (convenience function)
* @param order Order to calculate the price of
* @return The current price of the order
*/
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
{
}
/**
* @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Match price
*/
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
returns (uint)
{
}
/**
* @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
* @param buy Buy-side order
* @param sell Sell-side order
*/
function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty)
internal
returns (uint)
{
}
/**
* @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Whether or not the two orders can be matched
*/
function ordersCanMatch(Order memory buy, Order memory sell)
internal
view
returns (bool)
{
}
function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) {
if (callMint) {
require(
IPaceArtStore(order.target).owner() == order.maker || order.target == defaultCollection,
"PaceArtExchange::INVALID_COLLECTION"
);
(bool result, bytes memory returnData) = order.target.call(order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
} else {
/* Retrieve delegateProxy contract. */
OwnableDelegateProxy delegateProxy = registry.proxies(order.maker);
/* Proxy must exist. */
require(<FILL_ME>)
/* Assert implementation. */
require(delegateProxy.implementation() == registry.delegateProxyImplementation());
/* Execute specified call through proxy. */
(bool result, bytes memory returnData) = AuthenticatedProxy(address(delegateProxy)).proxy(order.target, order.howToCall, order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
}
}
/**
* @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
* @param buy Buy-side order
* @param buySig Buy-side order signature
* @param sell Sell-side order
* @param sellSig Sell-side order signature
*/
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
internal
reentrancyGuard
{
}
}
| address(delegateProxy)!=address(0),"User not registed proxy yet!" | 32,882 | address(delegateProxy)!=address(0) |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/LibPart.sol";
import "../royalties/RoyaltiesV2.sol";
import "../libraries/ArrayUtils.sol";
import "../libraries/SaleKindInterface.sol";
import "../libraries/ReentrancyGuarded.sol";
import "../registry/ProxyRegistry.sol";
import "../modules/ERC20.sol";
import "../modules/TokenTransferProxy.sol";
import "../registry/AuthenticatedProxy.sol";
import "../interfaces/IPaceArtStore.sol";
contract ExchangeCore is ReentrancyGuarded, Ownable {
address public defaultCollection;
/* The token used to pay exchange fees. */
ERC20 public exchangeToken;
/* User registry. */
ProxyRegistry public registry;
/* Token transfer proxy. */
TokenTransferProxy public tokenTransferProxy;
/* Cancelled / finalized orders, by hash. */
mapping(bytes32 => bool) public cancelledOrFinalized;
/* Orders verified by on-chain approval (alternative to ECDSA signatures so that smart contracts can place orders directly). */
mapping(bytes32 => bool) public approvedOrders;
// /* For split fee orders, minimum required protocol maker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumMakerProtocolFee = 0;
// /* For split fee orders, minimum required protocol taker fee, in basis points. Paid to owner (who can change it). */
// uint public minimumTakerProtocolFee = 0;
// /* Recipient of protocol fees. */
// address public protocolFeeRecipient;
/* Fee method: protocol fee or split fee. */
enum FeeMethod { ProtocolFee, SplitFee }
/* Inverse basis point. */
uint public constant INVERSE_BASIS_POINT = 10000;
/* An ECDSA signature. */
struct Sig {
/* v parameter */
uint8 v;
/* r parameter */
bytes32 r;
/* s parameter */
bytes32 s;
}
/* An order on the exchange. */
struct Order {
/* Exchange address, intended as a versioning mechanism. */
address exchange;
/* Order maker address. */
address maker;
/* Order taker address, if specified. */
address taker;
/* Maker relayer fee of the order, unused for taker order. */
uint makerRelayerFee;
/* Taker relayer fee of the order, or maximum taker fee for a taker order. */
uint takerRelayerFee;
// /* Maker protocol fee of the order, unused for taker order. */
// uint makerProtocolFee;
// /* Taker protocol fee of the order, or maximum taker fee for a taker order. */
// uint takerProtocolFee;
/* Order fee recipient or zero address for taker order. */
address feeRecipient;
/* Fee method (protocol token or split fee). */
FeeMethod feeMethod;
/* Side (buy/sell). */
SaleKindInterface.Side side;
/* Kind of sale. */
SaleKindInterface.SaleKind saleKind;
/* Target. */
address target;
/* HowToCall. */
AuthenticatedProxy.HowToCall howToCall;
/* Calldata. */
bytes callData;
bytes replacementPattern;
/* Calldata replacement pattern, or an empty byte array for no replacement. */
// bytes replacementPattern;
// /* Static call target, zero-address for no static call. */
address staticTarget;
/* Static call extra data. */
bytes staticExtradata;
/* Token used to pay for the order, or the zero-address as a sentinel value for Ether. */
address paymentToken;
/* Base price of the order (in paymentTokens). */
uint basePrice;
/* Auction extra parameter - minimum bid increment for English auctions, starting/ending price difference. */
uint extra;
/* Listing timestamp. */
uint listingTime;
/* Expiration timestamp - 0 for no expiry. */
uint expirationTime;
/* Order salt, used to prevent duplicate hashes. */
uint salt;
}
event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
// event OrderApprovedPartOne (bytes32 indexed hash, address exchange, address indexed maker, address taker, uint makerRelayerFee, uint takerRelayerFee, uint makerProtocolFee, uint takerProtocolFee, address indexed feeRecipient, FeeMethod feeMethod, SaleKindInterface.Side side, SaleKindInterface.SaleKind saleKind, address target);
// event OrderApprovedPartTwo (bytes32 indexed hash, AuthenticatedProxy.HowToCall howToCall, bytes callData, bytes replacementPattern, address staticTarget, bytes staticExtradata, address paymentToken, uint basePrice, uint extra, uint listingTime, uint expirationTime, uint salt, bool orderbookInclusionDesired);
event OrderCancelled (bytes32 indexed hash);
event OrdersMatched (bytes32 buyHash, bytes32 sellHash, address indexed maker, address indexed taker, uint price, bytes32 indexed metadata);
// /**
// * @dev Change the minimum maker fee paid to the protocol (owner only)
// * @param newMinimumMakerProtocolFee New fee to set in basis points
// */
// function changeMinimumMakerProtocolFee(uint newMinimumMakerProtocolFee)
// public
// onlyOwner
// {
// minimumMakerProtocolFee = newMinimumMakerProtocolFee;
// }
// /**
// * @dev Change the minimum taker fee paid to the protocol (owner only)
// * @param newMinimumTakerProtocolFee New fee to set in basis points
// */
// function changeMinimumTakerProtocolFee(uint newMinimumTakerProtocolFee)
// public
// onlyOwner
// {
// minimumTakerProtocolFee = newMinimumTakerProtocolFee;
// }
// /**
// * @dev Change the protocol fee recipient (owner only)
// * @param newProtocolFeeRecipient New protocol fee recipient address
// */
// function changeProtocolFeeRecipient(address newProtocolFeeRecipient)
// public
// onlyOwner
// {
// protocolFeeRecipient = newProtocolFeeRecipient;
// }
function changeDefaultCollection(address _newCollection) public onlyOwner {
}
/**
* @dev Transfer tokens
* @param token Token to transfer
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function transferTokens(address token, address from, address to, uint amount)
internal
{
}
/**
* @dev Charge a fee in protocol tokens
* @param from Address to charge fees
* @param to Address to receive fees
* @param amount Amount of protocol tokens to charge
*/
function chargeProtocolFee(address from, address to, uint amount)
internal
{
}
/**
* @dev Execute a STATICCALL (introduced with Ethereum Metropolis, non-state-modifying external call)
* @param target Contract to call
* @param callData Calldata (appended to extradata)
* @param extradata Base data for STATICCALL (probably function selector and argument encoding)
*/
// function staticCall(address target, bytes memory callData, bytes memory extradata)
// public
// view
// returns (bool result)
// {
// bytes memory combined = new bytes(callData.length + extradata.length);
// uint index;
// assembly {
// index := add(combined, 0x20)
// }
// index = ArrayUtils.unsafeWriteBytes(index, extradata);
// ArrayUtils.unsafeWriteBytes(index, callData);
// assembly {
// result := staticcall(gas(), target, add(combined, 0x20), mload(combined), mload(0x40), 0)
// }
// return result;
// }
/**
* Calculate size of an order struct when tightly packed
*
* @param order Order to calculate size of
* @return Size in bytes
*/
function sizeOf(Order memory order)
internal
pure
returns (uint)
{
}
/**
* @dev Hash an order, returning the canonical order hash, without the message prefix
* @param order Order to hash
*/
function hashOrder(Order memory order)
internal
pure
returns (bytes32 hash)
{
}
/**
* @dev Hash an order, returning the hash that a client must sign, including the standard message prefix
* @param order Order to hash
* @return Hash of message prefix and order hash per Ethereum format
*/
function hashToSign(Order memory order)
internal
pure
returns (bytes32)
{
}
/**
* @dev Assert an order is valid and return its hash
* @param order Order to validate
* @param sig ECDSA signature
*/
function requireValidOrder(Order memory order, Sig memory sig)
internal
view
returns (bytes32)
{
}
/**
* @dev Validate order parameters (does *not* check signature validity)
* @param order Order to validate
*/
function validateOrderParameters(Order memory order)
internal
view
returns (bool)
{
}
/**
* @dev Validate a provided previously approved / signed order, hash, and signature.
* @param hash Order hash (already calculated, passed to avoid recalculation)
* @param order Order to validate
* @param sig ECDSA signature
*/
function validateOrder(bytes32 hash, Order memory order, Sig memory sig)
internal
view
returns (bool)
{
}
/**
* @dev Approve an order and optionally mark it for orderbook inclusion. Must be called by the maker of the order
* @param order Order to approve
* @param orderbookInclusionDesired Whether orderbook providers should include the order in their orderbooks
*/
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
}
/**
* @dev Cancel an order, preventing it from being matched. Must be called by the maker of the order
* @param order Order to cancel
* @param sig ECDSA signature
*/
function cancelOrder(Order memory order, Sig memory sig)
internal
{
}
/**
* @dev Calculate the current price of an order (convenience function)
* @param order Order to calculate the price of
* @return The current price of the order
*/
function calculateCurrentPrice (Order memory order)
internal
view
returns (uint)
{
}
/**
* @dev Calculate the price two orders would match at, if in fact they would match (otherwise fail)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Match price
*/
function calculateMatchPrice(Order memory buy, Order memory sell)
view
internal
returns (uint)
{
}
/**
* @dev Execute all ERC20 token / Ether transfers associated with an order match (fees and buyer => seller transfer)
* @param buy Buy-side order
* @param sell Sell-side order
*/
function executeFundsTransfer(Order memory buy, Order memory sell, LibPart.Part memory royalty)
internal
returns (uint)
{
}
/**
* @dev Return whether or not two orders can be matched with each other by basic parameters (does not check order signatures / calldata or perform static calls)
* @param buy Buy-side order
* @param sell Sell-side order
* @return Whether or not the two orders can be matched
*/
function ordersCanMatch(Order memory buy, Order memory sell)
internal
view
returns (bool)
{
}
function makeStaticCall(Order memory order, bool callMint) internal returns(bytes memory) {
if (callMint) {
require(
IPaceArtStore(order.target).owner() == order.maker || order.target == defaultCollection,
"PaceArtExchange::INVALID_COLLECTION"
);
(bool result, bytes memory returnData) = order.target.call(order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
} else {
/* Retrieve delegateProxy contract. */
OwnableDelegateProxy delegateProxy = registry.proxies(order.maker);
/* Proxy must exist. */
require(address(delegateProxy) != address(0), "User not registed proxy yet!");
/* Assert implementation. */
require(<FILL_ME>)
/* Execute specified call through proxy. */
(bool result, bytes memory returnData) = AuthenticatedProxy(address(delegateProxy)).proxy(order.target, order.howToCall, order.callData);
require(result, "Exchange::Failed when call other contract");
return returnData;
}
}
/**
* @dev Atomically match two orders, ensuring validity of the match, and execute all associated state transitions. Protected against reentrancy by a contract-global lock.
* @param buy Buy-side order
* @param buySig Buy-side order signature
* @param sell Sell-side order
* @param sellSig Sell-side order signature
*/
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
internal
reentrancyGuard
{
}
}
| delegateProxy.implementation()==registry.delegateProxyImplementation() | 32,882 | delegateProxy.implementation()==registry.delegateProxyImplementation() |
Subsets and Splits