comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Transaction value too low." | pragma solidity ^0.8.0;
contract MusicFund is ERC721, ERC721Enumerable, Ownable {
string public PROVENANCE;
uint public constant maxTokenPurchase = 10;
uint256 public MAX_TOKENS = 10000;
bool public saleIsActive = false;
bool public preSaleIsActive = false;
string private _baseURIextended;
uint256 private _price = 50000000000000000; // .05 ETH
uint256 private _reserve = 300;
uint256 private _preSaleCap = 5;
// Facilitating the needed functionality for the presale
mapping(address => bool) addressToPreSaleEntry;
mapping(address => uint256) addressToPreSaleNumberMinted;
constructor() ERC721("MusicFund", "MUSICFUND") {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
function setBaseURI(string memory baseURI_) external onlyOwner() {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setProvenance(string memory provenance) public onlyOwner {
}
function getPrice() public view returns (uint256) {
}
function setPrice(uint256 _newWEIPrice) public onlyOwner {
}
function getReserve() public view returns (uint256) {
}
function setReserve(uint256 _newReserve) public onlyOwner {
}
function reserveTokens() public onlyOwner {
}
function addWalletToPreSale(address _address) public onlyOwner {
}
function isWalletInPreSale(address _address) public view returns (bool) {
}
function preSaleNumberMinted(address _address) public view returns (uint256){
}
function setPreSaleCap(uint256 _newPreSaleCap) public onlyOwner {
}
function getPreSaleCap() public view returns (uint256) {
}
function preSaleMint(uint256 _count) public payable {
uint256 totalSupply = totalSupply();
require(preSaleIsActive, "Presale is not active");
require(!saleIsActive, "The public sale has already started");
require(addressToPreSaleEntry[msg.sender] == true, "This address is not whitelisted for the presale.");
require(
addressToPreSaleNumberMinted[msg.sender] + _count <= _preSaleCap,
"Exceeds supply of presale cards you can mint."
);
require(<FILL_ME>)
for (uint256 i; i < _count; i++) {
_safeMint(msg.sender, totalSupply + i);
}
// Keeps track of how many they've minted
addressToPreSaleNumberMinted[msg.sender] += _count;
}
function flipSaleState() public onlyOwner {
}
function flipPreSaleState() public onlyOwner {
}
function mintToken(uint numberOfTokens) public payable {
}
function withdraw() public onlyOwner {
}
}
| _price*_count<=msg.value,"Transaction value too low." | 337,993 | _price*_count<=msg.value |
'purchase: insufficient balance' | ////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////.////////////////////////////////.////////////////////////////////////
///////////////////////////////////.@.//////////////////////////////////.@./////////////////////////////////
////////////////////////////////.@@.//////////////////////////////////////.@@.//////////////////////////////
/////////////////////////////..@@@.////////////////////////////////////////.@@@..///////////////////////////
///////////////////////////.@@@@@.//////////////////////////////////////////.@@@@@./////////////////////////
/////////////////////////.@@@@@@@////////////////////////////////////////////@@@@@@@.///////////////////////
////////////////////////.@@@@@@@.////////////////////////////////////////////.@@@@@@@.//////////////////////
//////////////////..///.@@@@@@@@//////////////////////////////////////////////@@@@@@@@.///..////////////////
////////////////.@@.//.@@@@@@@@@//////////////////////////////////////////////@@@@@@@@@.//.@@.//////////////
///////////////@@@@.//@@@@@@@@@.//////////////////////////////////////////////.@@@@@@@@@//@@@@@/////////////
//////////////@@@@@@//@@@@@@@@@.//////////////////////////////////////////////.@@@@@@@@@//@@@@@@////////////
/////////////@@@@@@@./@@@@@@@@@@//////////////////////////////////////////////@@@@@@@@@./.@@@@@@@///////////
/////////////@@@@@@@@//@@@@@@@@@.////////////////////////////////////////////.@@@@@@@@@//@@@@@@@@///////////
/////////////@@@@@@@@.//.@@@@@@@@.//////////////////////////////////////////@@@@@@@@@.//.@@@@@@@@///////////
/////////////@@@@@@@@@///.@@@@@@@@@.////////.//////////////////////////////@@@@@@@@@.///@@@@@@@@@///////////
/////////////.@@@@@@@@@///..@@@@@@@.////////.@.///////////////////////////.@@@@@@@.////@@@@@@@@@.///////////
//////////////.@@@@@@@@@.////.@@@@///////////.@@.//////////////////////////.@@@@.////.@@@@@@@@@.////////////
//////////.////.@@@@@@@@@@./////./////////////.@@@@..////////////////////////./////.@@@@@@@@@@.///..////////
//////////@@.///.@@@@@@@@@@@.//////////////////.@@@@@@@@@@./////////////////////..@@@@@@@@@@.///.@@.////////
//////////@@@@.///.@@@@@@@@@@@@.////////////////.@@@@@@@@@@@..///////////////.@@@@@@@@@@@@@.//.@@@@.////////
//////////.@@@@@@.///.@@@@@@@@@@@.///////////////.@@@@@@@@@@@@./////////////.@@@@@@@@@@@.//.@@@@@@@.////////
//////////.@@@@@@@@.////.@@@@@@@@@.///////////////@@@@@@@@@...@////////////.@@@@@@@@@.//..@@@@@@@@@.////////
//////////.@@@@@@@@@@@..////..@@@@@@./////////////@@@@@@@@@ /////////////.@@@@@@..///..@@@@@@@@@@@./////////
///////////.@@@@@@@@@@@@@@..//////.....///////////@@@@@@@@@.///////////...../////..@@@@@@@@@@@@@@@//////////
////////////.@@@@@@@@@@@@@@@@@@....///////////////@@@@@@@@@.///////////////...@@@@@@@@@@@@@@@@@@@.//////////
/////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////@@@@@@@@@@//////....@@@@@@@@@@@@@@@@@@@@@@@@@@.///////////
//////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.///.@@@@@@@@@@/////@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/////////////
////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@///@@@@@@@@@@@.///.@@@@@@@@@@@@@@@@@@@@@@@@@@@@.//////////////
//////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@/@@@@@@@@@@@@@./.@@@@@@@@@@@@@@@@@@@@@@@@@@@.////////////////
////////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..//////////////////
//////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@./////////////////////
/////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.////////////////////////
/////////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////////////////////////
/////////////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////////////////////////////
//////////////////////////////////////...@@@@@@@@@@@@@@@@@@@@@@@@@@@@...////////////////////////////////////
//////////////////////////////////////////////...@@@@@@@@@@@@@@...//////////////////////////////////////////
//////////////////////////////////////////////////.@@@@@@@@@////////////////////////////////////////////////
////////////////////////////////////////////////.@@@@@./@@@@@///////////////////////////////////////////////
///////////////////////////////////////////////.@@@@@@///@@@@@./////////////////////////////////////////////
/////////////////////////////////////////////.@@@@@@@/.@./@@@@@@.///////////////////////////////////////////
////////////////////////////////////////////@@@@@@@@/.@@@/.@@@@@@@./////////////////////////////////////////
///////////////////////////////////////////.@@@@@@@//@@@@@//@@@@@@@.////////////////////////////////////////
////////////////////////////////////////////.@@@@@./@@@@@@@/.@@@@@./////////////////////////////////////////
//////////////////////////////////////////////.@@./@@@@@@@@@/.@@.///////////////////////////////////////////
///////////////////////////////////////////////../@@@@@@@@@@@/..////////////////////////////////////////////
/////////////////////////////////////////////////@@@@@@@@@@@@@//////////////////////////////////////////////
////////////////////////////////////////////////@@@@@@@@@@@@@@@/////////////////////////////////////////////
///////////////////////////////////////////////@@@@@@.///.@@@@@.////////////////////////////////////////////
//////////////////////////////////////////////.@@..//.@@..//..@@.///////////////////////////////////////////
/////////////////////////////////////////////..//////@@@@//////...//////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////_______///________//____////____//_______//______///////__///__////______////______////////////
/////////////@@_____|//@@@__@@@\/\@@@\ /@@@//|@@@____||@@@_ \/////|@@\ |@@|/// __ \//|@@@_@@\///////////
////////////|@@|//__//|@@| |@@|//\@@@\/@@@///|@@|__///|@@|_) |////|@@@\|@@|/|@@| |@@|/|@@|_)@@|//////////
////////////|@@| |_@|/|@@| |@@|///\@@@@@@////|@@@__|//|@@@@@@//////|@@.@`@@|/|@@| |@@|/|@@@@@@////////////
////////////|@@|__|@|/|@@`--'@@|////\@@@@/////|@@|____/|@@|\@@\----.|@@|\@@@|/|@@`--'@@|/|@@|\@@\----.//////
/////////////\______|//\______///////\__//////|_______|| _| `._____||__| \__|//\______///|@_| `._____|//////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
abstract contract IERC20 {
function totalSupply() external virtual view returns (uint256);
function balanceOf(address tokenOwner) external virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external virtual returns (bool success);
function approve(address spender, uint256 tokens) external virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external virtual returns (bool success);
function burnFrom(address account, uint256 amount) public virtual;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract Swapico {
address public immutable synthetico;
address public immutable authentico;
uint256 public immutable inicio;
event purchased(address indexed _purchaser, uint256 indexed _tokens);
constructor(address _synthetico, address _authentico, uint256 _inicio) public {
}
function purchase(uint256 amount) public {
require(block.timestamp >= inicio, 'purchase: too soon');
require(<FILL_ME>)
require(IERC20(authentico).balanceOf(address(this)) >= amount, 'purchase: insufficient liquidity');
_purchase(amount);
}
function _purchase(uint256 _amount) internal {
}
}
| IERC20(synthetico).balanceOf(address(msg.sender))>=amount,'purchase: insufficient balance' | 338,095 | IERC20(synthetico).balanceOf(address(msg.sender))>=amount |
'purchase: insufficient liquidity' | ////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////.////////////////////////////////.////////////////////////////////////
///////////////////////////////////.@.//////////////////////////////////.@./////////////////////////////////
////////////////////////////////.@@.//////////////////////////////////////.@@.//////////////////////////////
/////////////////////////////..@@@.////////////////////////////////////////.@@@..///////////////////////////
///////////////////////////.@@@@@.//////////////////////////////////////////.@@@@@./////////////////////////
/////////////////////////.@@@@@@@////////////////////////////////////////////@@@@@@@.///////////////////////
////////////////////////.@@@@@@@.////////////////////////////////////////////.@@@@@@@.//////////////////////
//////////////////..///.@@@@@@@@//////////////////////////////////////////////@@@@@@@@.///..////////////////
////////////////.@@.//.@@@@@@@@@//////////////////////////////////////////////@@@@@@@@@.//.@@.//////////////
///////////////@@@@.//@@@@@@@@@.//////////////////////////////////////////////.@@@@@@@@@//@@@@@/////////////
//////////////@@@@@@//@@@@@@@@@.//////////////////////////////////////////////.@@@@@@@@@//@@@@@@////////////
/////////////@@@@@@@./@@@@@@@@@@//////////////////////////////////////////////@@@@@@@@@./.@@@@@@@///////////
/////////////@@@@@@@@//@@@@@@@@@.////////////////////////////////////////////.@@@@@@@@@//@@@@@@@@///////////
/////////////@@@@@@@@.//.@@@@@@@@.//////////////////////////////////////////@@@@@@@@@.//.@@@@@@@@///////////
/////////////@@@@@@@@@///.@@@@@@@@@.////////.//////////////////////////////@@@@@@@@@.///@@@@@@@@@///////////
/////////////.@@@@@@@@@///..@@@@@@@.////////.@.///////////////////////////.@@@@@@@.////@@@@@@@@@.///////////
//////////////.@@@@@@@@@.////.@@@@///////////.@@.//////////////////////////.@@@@.////.@@@@@@@@@.////////////
//////////.////.@@@@@@@@@@./////./////////////.@@@@..////////////////////////./////.@@@@@@@@@@.///..////////
//////////@@.///.@@@@@@@@@@@.//////////////////.@@@@@@@@@@./////////////////////..@@@@@@@@@@.///.@@.////////
//////////@@@@.///.@@@@@@@@@@@@.////////////////.@@@@@@@@@@@..///////////////.@@@@@@@@@@@@@.//.@@@@.////////
//////////.@@@@@@.///.@@@@@@@@@@@.///////////////.@@@@@@@@@@@@./////////////.@@@@@@@@@@@.//.@@@@@@@.////////
//////////.@@@@@@@@.////.@@@@@@@@@.///////////////@@@@@@@@@...@////////////.@@@@@@@@@.//..@@@@@@@@@.////////
//////////.@@@@@@@@@@@..////..@@@@@@./////////////@@@@@@@@@ /////////////.@@@@@@..///..@@@@@@@@@@@./////////
///////////.@@@@@@@@@@@@@@..//////.....///////////@@@@@@@@@.///////////...../////..@@@@@@@@@@@@@@@//////////
////////////.@@@@@@@@@@@@@@@@@@....///////////////@@@@@@@@@.///////////////...@@@@@@@@@@@@@@@@@@@.//////////
/////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////@@@@@@@@@@//////....@@@@@@@@@@@@@@@@@@@@@@@@@@.///////////
//////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.///.@@@@@@@@@@/////@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/////////////
////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@///@@@@@@@@@@@.///.@@@@@@@@@@@@@@@@@@@@@@@@@@@@.//////////////
//////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@/@@@@@@@@@@@@@./.@@@@@@@@@@@@@@@@@@@@@@@@@@@.////////////////
////////////////////.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..//////////////////
//////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@./////////////////////
/////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.////////////////////////
/////////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////////////////////////
/////////////////////////////////..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..///////////////////////////////
//////////////////////////////////////...@@@@@@@@@@@@@@@@@@@@@@@@@@@@...////////////////////////////////////
//////////////////////////////////////////////...@@@@@@@@@@@@@@...//////////////////////////////////////////
//////////////////////////////////////////////////.@@@@@@@@@////////////////////////////////////////////////
////////////////////////////////////////////////.@@@@@./@@@@@///////////////////////////////////////////////
///////////////////////////////////////////////.@@@@@@///@@@@@./////////////////////////////////////////////
/////////////////////////////////////////////.@@@@@@@/.@./@@@@@@.///////////////////////////////////////////
////////////////////////////////////////////@@@@@@@@/.@@@/.@@@@@@@./////////////////////////////////////////
///////////////////////////////////////////.@@@@@@@//@@@@@//@@@@@@@.////////////////////////////////////////
////////////////////////////////////////////.@@@@@./@@@@@@@/.@@@@@./////////////////////////////////////////
//////////////////////////////////////////////.@@./@@@@@@@@@/.@@.///////////////////////////////////////////
///////////////////////////////////////////////../@@@@@@@@@@@/..////////////////////////////////////////////
/////////////////////////////////////////////////@@@@@@@@@@@@@//////////////////////////////////////////////
////////////////////////////////////////////////@@@@@@@@@@@@@@@/////////////////////////////////////////////
///////////////////////////////////////////////@@@@@@.///.@@@@@.////////////////////////////////////////////
//////////////////////////////////////////////.@@..//.@@..//..@@.///////////////////////////////////////////
/////////////////////////////////////////////..//////@@@@//////...//////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////_______///________//____////____//_______//______///////__///__////______////______////////////
/////////////@@_____|//@@@__@@@\/\@@@\ /@@@//|@@@____||@@@_ \/////|@@\ |@@|/// __ \//|@@@_@@\///////////
////////////|@@|//__//|@@| |@@|//\@@@\/@@@///|@@|__///|@@|_) |////|@@@\|@@|/|@@| |@@|/|@@|_)@@|//////////
////////////|@@| |_@|/|@@| |@@|///\@@@@@@////|@@@__|//|@@@@@@//////|@@.@`@@|/|@@| |@@|/|@@@@@@////////////
////////////|@@|__|@|/|@@`--'@@|////\@@@@/////|@@|____/|@@|\@@\----.|@@|\@@@|/|@@`--'@@|/|@@|\@@\----.//////
/////////////\______|//\______///////\__//////|_______|| _| `._____||__| \__|//\______///|@_| `._____|//////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
abstract contract IERC20 {
function totalSupply() external virtual view returns (uint256);
function balanceOf(address tokenOwner) external virtual view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external virtual view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external virtual returns (bool success);
function approve(address spender, uint256 tokens) external virtual returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external virtual returns (bool success);
function burnFrom(address account, uint256 amount) public virtual;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract Swapico {
address public immutable synthetico;
address public immutable authentico;
uint256 public immutable inicio;
event purchased(address indexed _purchaser, uint256 indexed _tokens);
constructor(address _synthetico, address _authentico, uint256 _inicio) public {
}
function purchase(uint256 amount) public {
require(block.timestamp >= inicio, 'purchase: too soon');
require(IERC20(synthetico).balanceOf(address(msg.sender)) >= amount, 'purchase: insufficient balance');
require(<FILL_ME>)
_purchase(amount);
}
function _purchase(uint256 _amount) internal {
}
}
| IERC20(authentico).balanceOf(address(this))>=amount,'purchase: insufficient liquidity' | 338,095 | IERC20(authentico).balanceOf(address(this))>=amount |
"LorcPreSale: insufficient LORC Balance" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./access/Ownable.sol";
contract LorcPreSale is Ownable, Pausable {
using SafeMath for uint256;
IERC20 public lorcToken;
IERC20 public usdtToken;
uint public ethRate;
uint public usdtRate;
constructor(address _lorcToken, address _usdtToken, uint _ethRate, uint _usdtRate) {
}
/// @dev Update Exchange Rate for ETH to LORC
function updateETHRate(uint _ethRate) external onlyOwner {
}
/// @dev Update Exchange Rate for USDT to LORC
function updateUSDTRate(uint _usdtRate) external onlyOwner {
}
/// @dev buy LORC with Ether
function buyWithETH() external payable whenNotPaused returns(bool res) {
require(msg.value > 0, "LorcPreSale: amount must be greater than 0");
// Calculate the number of tokens to transfer
uint lorcValue = msg.value.mul(ethRate);
// Check Lorc balance in contract
require(<FILL_ME>)
// Transfer tokens to the sender
require(lorcToken.transfer(msg.sender, lorcValue), "LorcPreSale: LORC Token Transfer failed");
emit BuyLORCWithETH(msg.sender, address(lorcToken), lorcValue, ethRate);
return true;
}
/// @dev buy LORC with USDT
function buyWithUSDT(uint _usdtAmount) external whenNotPaused returns(bool res) {
}
/// @dev withdraw ETH balance from contract to owner address
function withdrawETH (uint _amount) external onlyOwner returns(bool res) {
}
/// @dev withdraw ERC-20 balance from contract to owner address
function withdrawErc20(IERC20 token) external onlyOwner returns(bool res) {
}
/// @dev called by the owner to pause, triggers stopped state
function pause() external onlyOwner whenNotPaused {
}
/// @dev called by the owner to unpause, returns to normal state
function unpause() external onlyOwner whenPaused {
}
receive() external payable {}
event BuyLORCWithETH(address account, address token, uint amount, uint _ethRate);
event BuyLORCWithUSDT(address account, address token, uint amount, uint _ethRate);
}
| lorcToken.balanceOf(address(this))>=lorcValue,"LorcPreSale: insufficient LORC Balance" | 338,149 | lorcToken.balanceOf(address(this))>=lorcValue |
"LorcPreSale: LORC Token Transfer failed" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./access/Ownable.sol";
contract LorcPreSale is Ownable, Pausable {
using SafeMath for uint256;
IERC20 public lorcToken;
IERC20 public usdtToken;
uint public ethRate;
uint public usdtRate;
constructor(address _lorcToken, address _usdtToken, uint _ethRate, uint _usdtRate) {
}
/// @dev Update Exchange Rate for ETH to LORC
function updateETHRate(uint _ethRate) external onlyOwner {
}
/// @dev Update Exchange Rate for USDT to LORC
function updateUSDTRate(uint _usdtRate) external onlyOwner {
}
/// @dev buy LORC with Ether
function buyWithETH() external payable whenNotPaused returns(bool res) {
require(msg.value > 0, "LorcPreSale: amount must be greater than 0");
// Calculate the number of tokens to transfer
uint lorcValue = msg.value.mul(ethRate);
// Check Lorc balance in contract
require(lorcToken.balanceOf(address(this)) >= lorcValue, "LorcPreSale: insufficient LORC Balance");
// Transfer tokens to the sender
require(<FILL_ME>)
emit BuyLORCWithETH(msg.sender, address(lorcToken), lorcValue, ethRate);
return true;
}
/// @dev buy LORC with USDT
function buyWithUSDT(uint _usdtAmount) external whenNotPaused returns(bool res) {
}
/// @dev withdraw ETH balance from contract to owner address
function withdrawETH (uint _amount) external onlyOwner returns(bool res) {
}
/// @dev withdraw ERC-20 balance from contract to owner address
function withdrawErc20(IERC20 token) external onlyOwner returns(bool res) {
}
/// @dev called by the owner to pause, triggers stopped state
function pause() external onlyOwner whenNotPaused {
}
/// @dev called by the owner to unpause, returns to normal state
function unpause() external onlyOwner whenPaused {
}
receive() external payable {}
event BuyLORCWithETH(address account, address token, uint amount, uint _ethRate);
event BuyLORCWithUSDT(address account, address token, uint amount, uint _ethRate);
}
| lorcToken.transfer(msg.sender,lorcValue),"LorcPreSale: LORC Token Transfer failed" | 338,149 | lorcToken.transfer(msg.sender,lorcValue) |
"LorcPreSale: insufficient USDT Balance" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./access/Ownable.sol";
contract LorcPreSale is Ownable, Pausable {
using SafeMath for uint256;
IERC20 public lorcToken;
IERC20 public usdtToken;
uint public ethRate;
uint public usdtRate;
constructor(address _lorcToken, address _usdtToken, uint _ethRate, uint _usdtRate) {
}
/// @dev Update Exchange Rate for ETH to LORC
function updateETHRate(uint _ethRate) external onlyOwner {
}
/// @dev Update Exchange Rate for USDT to LORC
function updateUSDTRate(uint _usdtRate) external onlyOwner {
}
/// @dev buy LORC with Ether
function buyWithETH() external payable whenNotPaused returns(bool res) {
}
/// @dev buy LORC with USDT
function buyWithUSDT(uint _usdtAmount) external whenNotPaused returns(bool res) {
require(_usdtAmount > 0, "LorcPreSale: USDT amount must be greater than 0");
// Calculate the number of tokens to transfer
uint lorcValue = _usdtAmount.mul(usdtRate);
require(lorcToken.balanceOf(address(this)) >= lorcValue, "LorcPreSale: insufficient LORC Balance");
require(<FILL_ME>)
require(usdtToken.transferFrom(msg.sender, address(this), _usdtAmount), "LorcPreSale: Transfer failed");
// Transfer tokens to the sender
require(lorcToken.transfer(msg.sender, lorcValue), "LorcPreSale: LORC Token Transfer failed");
emit BuyLORCWithUSDT(msg.sender, address(lorcToken), lorcValue, usdtRate);
return true;
}
/// @dev withdraw ETH balance from contract to owner address
function withdrawETH (uint _amount) external onlyOwner returns(bool res) {
}
/// @dev withdraw ERC-20 balance from contract to owner address
function withdrawErc20(IERC20 token) external onlyOwner returns(bool res) {
}
/// @dev called by the owner to pause, triggers stopped state
function pause() external onlyOwner whenNotPaused {
}
/// @dev called by the owner to unpause, returns to normal state
function unpause() external onlyOwner whenPaused {
}
receive() external payable {}
event BuyLORCWithETH(address account, address token, uint amount, uint _ethRate);
event BuyLORCWithUSDT(address account, address token, uint amount, uint _ethRate);
}
| usdtToken.balanceOf(msg.sender)>=_usdtAmount,"LorcPreSale: insufficient USDT Balance" | 338,149 | usdtToken.balanceOf(msg.sender)>=_usdtAmount |
"LorcPreSale: Transfer failed" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./access/Ownable.sol";
contract LorcPreSale is Ownable, Pausable {
using SafeMath for uint256;
IERC20 public lorcToken;
IERC20 public usdtToken;
uint public ethRate;
uint public usdtRate;
constructor(address _lorcToken, address _usdtToken, uint _ethRate, uint _usdtRate) {
}
/// @dev Update Exchange Rate for ETH to LORC
function updateETHRate(uint _ethRate) external onlyOwner {
}
/// @dev Update Exchange Rate for USDT to LORC
function updateUSDTRate(uint _usdtRate) external onlyOwner {
}
/// @dev buy LORC with Ether
function buyWithETH() external payable whenNotPaused returns(bool res) {
}
/// @dev buy LORC with USDT
function buyWithUSDT(uint _usdtAmount) external whenNotPaused returns(bool res) {
require(_usdtAmount > 0, "LorcPreSale: USDT amount must be greater than 0");
// Calculate the number of tokens to transfer
uint lorcValue = _usdtAmount.mul(usdtRate);
require(lorcToken.balanceOf(address(this)) >= lorcValue, "LorcPreSale: insufficient LORC Balance");
require(usdtToken.balanceOf(msg.sender) >= _usdtAmount, "LorcPreSale: insufficient USDT Balance");
require(<FILL_ME>)
// Transfer tokens to the sender
require(lorcToken.transfer(msg.sender, lorcValue), "LorcPreSale: LORC Token Transfer failed");
emit BuyLORCWithUSDT(msg.sender, address(lorcToken), lorcValue, usdtRate);
return true;
}
/// @dev withdraw ETH balance from contract to owner address
function withdrawETH (uint _amount) external onlyOwner returns(bool res) {
}
/// @dev withdraw ERC-20 balance from contract to owner address
function withdrawErc20(IERC20 token) external onlyOwner returns(bool res) {
}
/// @dev called by the owner to pause, triggers stopped state
function pause() external onlyOwner whenNotPaused {
}
/// @dev called by the owner to unpause, returns to normal state
function unpause() external onlyOwner whenPaused {
}
receive() external payable {}
event BuyLORCWithETH(address account, address token, uint amount, uint _ethRate);
event BuyLORCWithUSDT(address account, address token, uint amount, uint _ethRate);
}
| usdtToken.transferFrom(msg.sender,address(this),_usdtAmount),"LorcPreSale: Transfer failed" | 338,149 | usdtToken.transferFrom(msg.sender,address(this),_usdtAmount) |
"MechanicsRegistry::add-mechanic:mechanic-already-added" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import '../../interfaces/mechanics/IMechanicsRegistry.sol';
import '../abstract/UtilsReady.sol';
contract MechanicsRegistry is UtilsReady, IMechanicsRegistry {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet internal _mechanics;
constructor(address _mechanic) public {
}
// Setters
function addMechanic(address _mechanic) external override onlyGovernor {
}
function removeMechanic(address _mechanic) external override onlyGovernor {
}
function _addMechanic(address _mechanic) internal {
require(_mechanic != address(0), 'MechanicsRegistry::add-mechanic:mechanic-should-not-be-zero-address');
require(<FILL_ME>)
_mechanics.add(_mechanic);
emit MechanicAdded(_mechanic);
}
function _removeMechanic(address _mechanic) internal {
}
// View helpers
function isMechanic(address mechanic) public view override returns (bool _isMechanic) {
}
// Getters
function mechanics() public view override returns (address[] memory _mechanicsList) {
}
}
| !_mechanics.contains(_mechanic),"MechanicsRegistry::add-mechanic:mechanic-already-added" | 338,170 | !_mechanics.contains(_mechanic) |
"MechanicsRegistry::remove-mechanic:mechanic-not-found" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import '../../interfaces/mechanics/IMechanicsRegistry.sol';
import '../abstract/UtilsReady.sol';
contract MechanicsRegistry is UtilsReady, IMechanicsRegistry {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet internal _mechanics;
constructor(address _mechanic) public {
}
// Setters
function addMechanic(address _mechanic) external override onlyGovernor {
}
function removeMechanic(address _mechanic) external override onlyGovernor {
}
function _addMechanic(address _mechanic) internal {
}
function _removeMechanic(address _mechanic) internal {
require(<FILL_ME>)
_mechanics.remove(_mechanic);
emit MechanicRemoved(_mechanic);
}
// View helpers
function isMechanic(address mechanic) public view override returns (bool _isMechanic) {
}
// Getters
function mechanics() public view override returns (address[] memory _mechanicsList) {
}
}
| _mechanics.contains(_mechanic),"MechanicsRegistry::remove-mechanic:mechanic-not-found" | 338,170 | _mechanics.contains(_mechanic) |
"Invalid signature." | @v4.3.1
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _setOwner(address newOwner) private {
}
}
pragma solidity ^0.8.0;
contract STIMMY is ERC20, Ownable {
// token
string token_name = "STIMMY";
string token_symbol = "STIMMY";
// supply
uint supply_initial = (100 * 10**12) * 10**decimals();
uint supply_burn = ( 99 * 10**12) * 10**decimals();
uint supply_official = ( 1 * 10**12) * 10**decimals();
uint supply_lp = (400 * 10**9) * 10**decimals();
uint supply_punks = (100 * 10**9) * 10**decimals();
uint supply_apes = (100 * 10**9) * 10**decimals();
uint supply_coolCats = (100 * 10**9) * 10**decimals();
uint supply_doodles = (100 * 10**9) * 10**decimals();
uint supply_beasts = (100 * 10**9) * 10**decimals();
uint supply_green = (100 * 10**9) * 10**decimals();
// transactions
uint256 txn_max = ( 15 * 10**9) * 10**decimals();
// rewards
uint reward_punks = supply_punks / 10000;
uint reward_apes = supply_apes / 10000;
uint reward_coolCats = supply_coolCats / 10000;
uint reward_doodles = supply_doodles / 10000;
uint reward_beasts = supply_beasts / 10000;
uint reward_green = supply_green / 10000;
// claimed
uint claimed_official = 0;
uint claimed_lp = 0;
uint claimed_punks = 0;
uint claimed_apes = 0;
uint claimed_coolCats = 0;
uint claimed_doodles = 0;
uint claimed_beasts = 0;
uint claimed_green = 0;
mapping(uint256 => bool) public claimedByTokenId_punks;
mapping(uint256 => bool) public claimedByTokenId_apes;
mapping(uint256 => bool) public claimedByTokenId_coolCats;
mapping(uint256 => bool) public claimedByTokenId_doodles;
mapping(uint256 => bool) public claimedByTokenId_beasts;
mapping(uint256 => bool) public claimedBySlotId_green;
// contracts
address contract_punks = address(0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB);
address contract_apes = address(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D);
address contract_coolCats = address(0x1A92f7381B9F03921564a437210bB9396471050C);
address contract_doodles = address(0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e);
address contract_beasts = address(0xA74E199990FF572A320508547Ab7f44EA51e6F28);
address address_uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
using ECDSA for bytes32;
constructor() ERC20(token_name, token_symbol) {
}
function claim_punks(uint[] memory nfts) public {
}
function claim_apes() public {
}
function claim_coolCats() public {
}
function claim_doodles() public {
}
function claim_beasts() public {
}
function claim_green(uint slotId, bytes memory sig) public {
require(<FILL_ME>)
require(slotId >= 0 && slotId <= 9999, "Invalid slot number.");
require(!claimedBySlotId_green[slotId], "Slot already claimed.");
claimedBySlotId_green[slotId] = true;
_safeTransfer_green(reward_green);
}
function _expire_green() public onlyOwner {
}
function _verifySignature(uint256 slotId, bytes memory sig) internal view returns (bool) {
}
function claim_1() public{
}
function claim_2(uint[] memory punks) public{
}
function claim_3(uint256 slotId, bytes memory sig) public{
}
function claim_4(uint[] memory punks, uint256 slotId, bytes memory sig) public{
}
function _safeTransfer_punks(uint amount) internal {
}
function _safeTransfer_apes(uint amount) internal {
}
function _safeTransfer_coolCats(uint amount) internal {
}
function _safeTransfer_doodles(uint amount) internal {
}
function _safeTransfer_beasts(uint amount) internal {
}
function _safeTransfer_green(uint amount) internal {
}
function _safeTransfer_lp(uint amount) internal {
}
function _safeTransfer(uint amount) internal {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override virtual {
}
function _setTxnMax(uint _txn_max) public onlyOwner {
}
}
library ECDSA {
function recover(bytes32 hash, bytes memory sig) internal pure returns (address) {
}
function toHash(bytes32 hash) internal pure returns (bytes32) {
}
}
interface CryptoPunks {
function punkIndexToAddress(uint index) external view returns(address);
}
| _verifySignature(slotId,sig),"Invalid signature." | 338,191 | _verifySignature(slotId,sig) |
"Slot already claimed." | @v4.3.1
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _setOwner(address newOwner) private {
}
}
pragma solidity ^0.8.0;
contract STIMMY is ERC20, Ownable {
// token
string token_name = "STIMMY";
string token_symbol = "STIMMY";
// supply
uint supply_initial = (100 * 10**12) * 10**decimals();
uint supply_burn = ( 99 * 10**12) * 10**decimals();
uint supply_official = ( 1 * 10**12) * 10**decimals();
uint supply_lp = (400 * 10**9) * 10**decimals();
uint supply_punks = (100 * 10**9) * 10**decimals();
uint supply_apes = (100 * 10**9) * 10**decimals();
uint supply_coolCats = (100 * 10**9) * 10**decimals();
uint supply_doodles = (100 * 10**9) * 10**decimals();
uint supply_beasts = (100 * 10**9) * 10**decimals();
uint supply_green = (100 * 10**9) * 10**decimals();
// transactions
uint256 txn_max = ( 15 * 10**9) * 10**decimals();
// rewards
uint reward_punks = supply_punks / 10000;
uint reward_apes = supply_apes / 10000;
uint reward_coolCats = supply_coolCats / 10000;
uint reward_doodles = supply_doodles / 10000;
uint reward_beasts = supply_beasts / 10000;
uint reward_green = supply_green / 10000;
// claimed
uint claimed_official = 0;
uint claimed_lp = 0;
uint claimed_punks = 0;
uint claimed_apes = 0;
uint claimed_coolCats = 0;
uint claimed_doodles = 0;
uint claimed_beasts = 0;
uint claimed_green = 0;
mapping(uint256 => bool) public claimedByTokenId_punks;
mapping(uint256 => bool) public claimedByTokenId_apes;
mapping(uint256 => bool) public claimedByTokenId_coolCats;
mapping(uint256 => bool) public claimedByTokenId_doodles;
mapping(uint256 => bool) public claimedByTokenId_beasts;
mapping(uint256 => bool) public claimedBySlotId_green;
// contracts
address contract_punks = address(0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB);
address contract_apes = address(0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D);
address contract_coolCats = address(0x1A92f7381B9F03921564a437210bB9396471050C);
address contract_doodles = address(0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e);
address contract_beasts = address(0xA74E199990FF572A320508547Ab7f44EA51e6F28);
address address_uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
using ECDSA for bytes32;
constructor() ERC20(token_name, token_symbol) {
}
function claim_punks(uint[] memory nfts) public {
}
function claim_apes() public {
}
function claim_coolCats() public {
}
function claim_doodles() public {
}
function claim_beasts() public {
}
function claim_green(uint slotId, bytes memory sig) public {
require(_verifySignature(slotId, sig), "Invalid signature.");
require(slotId >= 0 && slotId <= 9999, "Invalid slot number.");
require(<FILL_ME>)
claimedBySlotId_green[slotId] = true;
_safeTransfer_green(reward_green);
}
function _expire_green() public onlyOwner {
}
function _verifySignature(uint256 slotId, bytes memory sig) internal view returns (bool) {
}
function claim_1() public{
}
function claim_2(uint[] memory punks) public{
}
function claim_3(uint256 slotId, bytes memory sig) public{
}
function claim_4(uint[] memory punks, uint256 slotId, bytes memory sig) public{
}
function _safeTransfer_punks(uint amount) internal {
}
function _safeTransfer_apes(uint amount) internal {
}
function _safeTransfer_coolCats(uint amount) internal {
}
function _safeTransfer_doodles(uint amount) internal {
}
function _safeTransfer_beasts(uint amount) internal {
}
function _safeTransfer_green(uint amount) internal {
}
function _safeTransfer_lp(uint amount) internal {
}
function _safeTransfer(uint amount) internal {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override virtual {
}
function _setTxnMax(uint _txn_max) public onlyOwner {
}
}
library ECDSA {
function recover(bytes32 hash, bytes memory sig) internal pure returns (address) {
}
function toHash(bytes32 hash) internal pure returns (bytes32) {
}
}
interface CryptoPunks {
function punkIndexToAddress(uint index) external view returns(address);
}
| !claimedBySlotId_green[slotId],"Slot already claimed." | 338,191 | !claimedBySlotId_green[slotId] |
"SwapKiwi: swap already initiated" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SwapKiwi is Ownable, IERC721Receiver {
uint256 private _swapsCounter;
uint256 private _etherLocked;
uint256 public fee;
mapping (uint256 => Swap) private _swaps;
struct Swap {
address payable initiator;
address[] initiatorNftAddresses;
uint256[] initiatorNftIds;
uint256 initiatorEtherValue;
address payable secondUser;
address[] secondUserNftAddresses;
uint256[] secondUserNftIds;
uint256 secondUserEtherValue;
}
event SwapExecuted(address indexed from, address indexed to, uint256 indexed swapId);
event SwapCanceled(address indexed canceledBy, uint256 indexed swapId);
event SwapProposed(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event SwapInitiated(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event AppFeeChanged(
uint256 fee
);
modifier onlyInitiator(uint256 swapId) {
}
modifier requireSameLength(address[] memory nftAddresses, uint256[] memory nftIds) {
}
modifier chargeAppFee() {
}
constructor(uint256 initalAppFee, address contractOwnerAddress) {
}
function setAppFee(uint newFee) external onlyOwner {
}
/**
* @dev First user proposes a swap to the second user with the NFTs that he deposits and wants to trade.
* Proposed NFTs are transfered to the SwapKiwi contract and
* kept there until the swap is accepted or canceled/rejected.
*
* @param secondUser address of the user that the first user wants to trade NFTs with
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function proposeSwap(address secondUser, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
}
/**
* @dev Second user accepts the swap (with proposed NFTs) from swap initiator and
* deposits his NFTs into the SwapKiwi contract.
* Callable only by second user that is invited by swap initiator.
*
* @param swapId ID of the swap that the second user is invited to participate in
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function initiateSwap(uint256 swapId, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
require(_swaps[swapId].secondUser == msg.sender, "SwapKiwi: caller is not swap participator");
require(<FILL_ME>)
safeMultipleTransfersFrom(
msg.sender,
address(this),
nftAddresses,
nftIds
);
_swaps[swapId].secondUserNftAddresses = nftAddresses;
_swaps[swapId].secondUserNftIds = nftIds;
if (msg.value > fee) {
_swaps[swapId].secondUserEtherValue = msg.value - fee;
_etherLocked += _swaps[swapId].secondUserEtherValue;
}
emit SwapInitiated(
msg.sender,
_swaps[swapId].initiator,
swapId,
nftAddresses,
nftIds,
_swaps[swapId].secondUserEtherValue
);
}
/**
* @dev Swap initiator accepts the swap (NFTs proposed by the second user).
* Executeds the swap - transfers NFTs from SwapKiwi to the participating users.
* Callable only by swap initiator.
*
* @param swapId ID of the swap that the initator wants to execute
*/
function acceptSwap(uint256 swapId) external onlyInitiator(swapId) {
}
/**
* @dev Returns NFTs from SwapKiwi to swap initator.
* Callable only if second user hasn't yet added NFTs.
*
* @param swapId ID of the swap that the swap participants want to cancel
*/
function cancelSwap(uint256 swapId) external {
}
function safeMultipleTransfersFrom(
address from,
address to,
address[] memory nftAddresses,
uint256[] memory nftIds
) internal virtual {
}
function safeTransferFrom(
address from,
address to,
address tokenAddress,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function withdrawEther(address payable recipient) external onlyOwner {
}
function onERC721Received(
/* solhint-disable */
address operator,
address from,
uint256 tokenId,
bytes calldata data
/* solhint-enable */
) external pure override returns (bytes4) {
}
}
| _swaps[swapId].secondUserEtherValue==0&&(_swaps[swapId].secondUserNftAddresses.length==0&&_swaps[swapId].secondUserNftIds.length==0),"SwapKiwi: swap already initiated" | 338,197 | _swaps[swapId].secondUserEtherValue==0&&(_swaps[swapId].secondUserNftAddresses.length==0&&_swaps[swapId].secondUserNftIds.length==0) |
"SwapKiwi: Can't accept swap, both participants didn't add NFTs" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SwapKiwi is Ownable, IERC721Receiver {
uint256 private _swapsCounter;
uint256 private _etherLocked;
uint256 public fee;
mapping (uint256 => Swap) private _swaps;
struct Swap {
address payable initiator;
address[] initiatorNftAddresses;
uint256[] initiatorNftIds;
uint256 initiatorEtherValue;
address payable secondUser;
address[] secondUserNftAddresses;
uint256[] secondUserNftIds;
uint256 secondUserEtherValue;
}
event SwapExecuted(address indexed from, address indexed to, uint256 indexed swapId);
event SwapCanceled(address indexed canceledBy, uint256 indexed swapId);
event SwapProposed(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event SwapInitiated(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event AppFeeChanged(
uint256 fee
);
modifier onlyInitiator(uint256 swapId) {
}
modifier requireSameLength(address[] memory nftAddresses, uint256[] memory nftIds) {
}
modifier chargeAppFee() {
}
constructor(uint256 initalAppFee, address contractOwnerAddress) {
}
function setAppFee(uint newFee) external onlyOwner {
}
/**
* @dev First user proposes a swap to the second user with the NFTs that he deposits and wants to trade.
* Proposed NFTs are transfered to the SwapKiwi contract and
* kept there until the swap is accepted or canceled/rejected.
*
* @param secondUser address of the user that the first user wants to trade NFTs with
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function proposeSwap(address secondUser, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
}
/**
* @dev Second user accepts the swap (with proposed NFTs) from swap initiator and
* deposits his NFTs into the SwapKiwi contract.
* Callable only by second user that is invited by swap initiator.
*
* @param swapId ID of the swap that the second user is invited to participate in
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function initiateSwap(uint256 swapId, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
}
/**
* @dev Swap initiator accepts the swap (NFTs proposed by the second user).
* Executeds the swap - transfers NFTs from SwapKiwi to the participating users.
* Callable only by swap initiator.
*
* @param swapId ID of the swap that the initator wants to execute
*/
function acceptSwap(uint256 swapId) external onlyInitiator(swapId) {
require(<FILL_ME>)
// transfer NFTs from escrow to initiator
safeMultipleTransfersFrom(
address(this),
_swaps[swapId].initiator,
_swaps[swapId].secondUserNftAddresses,
_swaps[swapId].secondUserNftIds
);
// transfer NFTs from escrow to second user
safeMultipleTransfersFrom(
address(this),
_swaps[swapId].secondUser,
_swaps[swapId].initiatorNftAddresses,
_swaps[swapId].initiatorNftIds
);
if (_swaps[swapId].initiatorEtherValue != 0) {
_etherLocked -= _swaps[swapId].initiatorEtherValue;
uint amountToTransfer = _swaps[swapId].initiatorEtherValue;
_swaps[swapId].initiatorEtherValue = 0;
_swaps[swapId].secondUser.transfer(amountToTransfer);
}
if (_swaps[swapId].secondUserEtherValue != 0) {
_etherLocked -= _swaps[swapId].secondUserEtherValue;
uint amountToTransfer = _swaps[swapId].secondUserEtherValue;
_swaps[swapId].secondUserEtherValue = 0;
_swaps[swapId].initiator.transfer(amountToTransfer);
}
emit SwapExecuted(_swaps[swapId].initiator, _swaps[swapId].secondUser, swapId);
delete _swaps[swapId];
}
/**
* @dev Returns NFTs from SwapKiwi to swap initator.
* Callable only if second user hasn't yet added NFTs.
*
* @param swapId ID of the swap that the swap participants want to cancel
*/
function cancelSwap(uint256 swapId) external {
}
function safeMultipleTransfersFrom(
address from,
address to,
address[] memory nftAddresses,
uint256[] memory nftIds
) internal virtual {
}
function safeTransferFrom(
address from,
address to,
address tokenAddress,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function withdrawEther(address payable recipient) external onlyOwner {
}
function onERC721Received(
/* solhint-disable */
address operator,
address from,
uint256 tokenId,
bytes calldata data
/* solhint-enable */
) external pure override returns (bytes4) {
}
}
| (_swaps[swapId].secondUserNftAddresses.length!=0||_swaps[swapId].secondUserEtherValue>0)&&(_swaps[swapId].initiatorNftAddresses.length!=0||_swaps[swapId].initiatorEtherValue>0),"SwapKiwi: Can't accept swap, both participants didn't add NFTs" | 338,197 | (_swaps[swapId].secondUserNftAddresses.length!=0||_swaps[swapId].secondUserEtherValue>0)&&(_swaps[swapId].initiatorNftAddresses.length!=0||_swaps[swapId].initiatorEtherValue>0) |
"SwapKiwi: Can't cancel swap, must be swap participant" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SwapKiwi is Ownable, IERC721Receiver {
uint256 private _swapsCounter;
uint256 private _etherLocked;
uint256 public fee;
mapping (uint256 => Swap) private _swaps;
struct Swap {
address payable initiator;
address[] initiatorNftAddresses;
uint256[] initiatorNftIds;
uint256 initiatorEtherValue;
address payable secondUser;
address[] secondUserNftAddresses;
uint256[] secondUserNftIds;
uint256 secondUserEtherValue;
}
event SwapExecuted(address indexed from, address indexed to, uint256 indexed swapId);
event SwapCanceled(address indexed canceledBy, uint256 indexed swapId);
event SwapProposed(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event SwapInitiated(
address indexed from,
address indexed to,
uint256 indexed swapId,
address[] nftAddresses,
uint256[] nftIds,
uint256 etherValue
);
event AppFeeChanged(
uint256 fee
);
modifier onlyInitiator(uint256 swapId) {
}
modifier requireSameLength(address[] memory nftAddresses, uint256[] memory nftIds) {
}
modifier chargeAppFee() {
}
constructor(uint256 initalAppFee, address contractOwnerAddress) {
}
function setAppFee(uint newFee) external onlyOwner {
}
/**
* @dev First user proposes a swap to the second user with the NFTs that he deposits and wants to trade.
* Proposed NFTs are transfered to the SwapKiwi contract and
* kept there until the swap is accepted or canceled/rejected.
*
* @param secondUser address of the user that the first user wants to trade NFTs with
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function proposeSwap(address secondUser, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
}
/**
* @dev Second user accepts the swap (with proposed NFTs) from swap initiator and
* deposits his NFTs into the SwapKiwi contract.
* Callable only by second user that is invited by swap initiator.
*
* @param swapId ID of the swap that the second user is invited to participate in
* @param nftAddresses array of NFT addressed that want to be traded
* @param nftIds array of IDs belonging to NFTs that want to be traded
*/
function initiateSwap(uint256 swapId, address[] memory nftAddresses, uint256[] memory nftIds)
external payable chargeAppFee requireSameLength(nftAddresses, nftIds) {
}
/**
* @dev Swap initiator accepts the swap (NFTs proposed by the second user).
* Executeds the swap - transfers NFTs from SwapKiwi to the participating users.
* Callable only by swap initiator.
*
* @param swapId ID of the swap that the initator wants to execute
*/
function acceptSwap(uint256 swapId) external onlyInitiator(swapId) {
}
/**
* @dev Returns NFTs from SwapKiwi to swap initator.
* Callable only if second user hasn't yet added NFTs.
*
* @param swapId ID of the swap that the swap participants want to cancel
*/
function cancelSwap(uint256 swapId) external {
require(<FILL_ME>)
// return initiator NFTs
safeMultipleTransfersFrom(
address(this),
_swaps[swapId].initiator,
_swaps[swapId].initiatorNftAddresses,
_swaps[swapId].initiatorNftIds
);
if(_swaps[swapId].secondUserNftAddresses.length != 0) {
// return second user NFTs
safeMultipleTransfersFrom(
address(this),
_swaps[swapId].secondUser,
_swaps[swapId].secondUserNftAddresses,
_swaps[swapId].secondUserNftIds
);
}
if (_swaps[swapId].initiatorEtherValue != 0) {
_etherLocked -= _swaps[swapId].initiatorEtherValue;
uint amountToTransfer = _swaps[swapId].initiatorEtherValue;
_swaps[swapId].initiatorEtherValue = 0;
_swaps[swapId].initiator.transfer(amountToTransfer);
}
if (_swaps[swapId].secondUserEtherValue != 0) {
_etherLocked -= _swaps[swapId].secondUserEtherValue;
uint amountToTransfer = _swaps[swapId].secondUserEtherValue;
_swaps[swapId].secondUserEtherValue = 0;
_swaps[swapId].secondUser.transfer(amountToTransfer);
}
emit SwapCanceled(msg.sender, swapId);
delete _swaps[swapId];
}
function safeMultipleTransfersFrom(
address from,
address to,
address[] memory nftAddresses,
uint256[] memory nftIds
) internal virtual {
}
function safeTransferFrom(
address from,
address to,
address tokenAddress,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function withdrawEther(address payable recipient) external onlyOwner {
}
function onERC721Received(
/* solhint-disable */
address operator,
address from,
uint256 tokenId,
bytes calldata data
/* solhint-enable */
) external pure override returns (bytes4) {
}
}
| _swaps[swapId].initiator==msg.sender||_swaps[swapId].secondUser==msg.sender,"SwapKiwi: Can't cancel swap, must be swap participant" | 338,197 | _swaps[swapId].initiator==msg.sender||_swaps[swapId].secondUser==msg.sender |
null | pragma solidity ^0.4.24;
/*
*
*
*/
contract DividendFacialCardGame {
/*=================================
= MODIFIERS =
=================================*/
modifier onlyOwner(){
}
/*==============================
= EVENTS =
==============================*/
event oncardPurchase(
address customerAddress,
uint256 incomingEthereum,
uint256 card,
uint256 newPrice
);
event onWithdraw(
address customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address from,
address to,
uint256 card
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "DIVIDEND FACIAL CARDS";
string public symbol = "DFC";
uint8 constant public cardsDivRate = 10;
uint8 constant public ownerDivRate = 50;
uint8 constant public distDivRate = 40;
uint8 constant public referralRate = 5;
uint8 constant public decimals = 18;
uint public totalCardValue = 7.25 ether; // Make sure this is sum of constructor values
uint public precisionFactor = 9;
/*================================
= DATASETS =
================================*/
mapping(uint => address) internal cardOwner;
mapping(uint => uint) public cardPrice;
mapping(uint => uint) internal cardPreviousPrice;
mapping(address => uint) internal ownerAccounts;
mapping(uint => uint) internal totalCardDivs;
uint cardPriceIncrement = 110;
uint totalDivsProduced = 0;
uint public totalCards;
bool allowReferral = true;
address dev;
address promoter;
address promoter2;
address dftDivsAddr;
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/*
* -- APPLICATION ENTRY POINTS --
*/
constructor()
public
{
}
function addtotalCardValue(uint _new, uint _old)
internal
{
}
function buy(uint _card, address _referrer)
public
payable
{
}
function distributeDivs(uint _distDividends) internal{
}
function withdraw()
public
{
address _customerAddress = msg.sender;
require(<FILL_ME>)
uint _dividends = ownerAccounts[_customerAddress];
ownerAccounts[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
/*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/
function setName(string _name)
onlyOwner()
public
{
}
function setSymbol(string _symbol)
onlyOwner()
public
{
}
function setcardPrice(uint _card, uint _price) //Allow the changing of a card price owner if the dev owns it
onlyOwner()
public
{
}
function addNewcard(uint _price)
onlyOwner()
public
{
}
function setAllowReferral(bool _allowReferral)
onlyOwner()
public
{
}
/*---------- HELPERS AND CALCULATORS ----------*/
/**
* Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function getMyBalance()
public
view
returns(uint)
{
}
function getOwnerBalance(address _cardOwner)
public
view
returns(uint)
{
}
function getcardPrice(uint _card)
public
view
returns(uint)
{
}
function getcardOwner(uint _card)
public
view
returns(address)
{
}
function gettotalCardDivs(uint _card)
public
view
returns(uint)
{
}
function getTotalDivsProduced()
public
view
returns(uint)
{
}
function getCardDivShare(uint _card)
public
view
returns(uint)
{
}
function getCardDivs(uint _card, uint _amt)
public
view
returns(uint)
{
}
function gettotalCardValue()
public
view
returns(uint)
{
}
function totalEthereumBalance()
public
view
returns(uint)
{
}
function gettotalCards()
public
view
returns(uint)
{
}
}
/**
* @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) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts 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) {
}
}
| ownerAccounts[_customerAddress]>=0.001ether | 338,333 | ownerAccounts[_customerAddress]>=0.001ether |
null | pragma solidity ^0.4.24;
/*
*
*
*/
contract DividendFacialCardGame {
/*=================================
= MODIFIERS =
=================================*/
modifier onlyOwner(){
}
/*==============================
= EVENTS =
==============================*/
event oncardPurchase(
address customerAddress,
uint256 incomingEthereum,
uint256 card,
uint256 newPrice
);
event onWithdraw(
address customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address from,
address to,
uint256 card
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "DIVIDEND FACIAL CARDS";
string public symbol = "DFC";
uint8 constant public cardsDivRate = 10;
uint8 constant public ownerDivRate = 50;
uint8 constant public distDivRate = 40;
uint8 constant public referralRate = 5;
uint8 constant public decimals = 18;
uint public totalCardValue = 7.25 ether; // Make sure this is sum of constructor values
uint public precisionFactor = 9;
/*================================
= DATASETS =
================================*/
mapping(uint => address) internal cardOwner;
mapping(uint => uint) public cardPrice;
mapping(uint => uint) internal cardPreviousPrice;
mapping(address => uint) internal ownerAccounts;
mapping(uint => uint) internal totalCardDivs;
uint cardPriceIncrement = 110;
uint totalDivsProduced = 0;
uint public totalCards;
bool allowReferral = true;
address dev;
address promoter;
address promoter2;
address dftDivsAddr;
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/*
* -- APPLICATION ENTRY POINTS --
*/
constructor()
public
{
}
function addtotalCardValue(uint _new, uint _old)
internal
{
}
function buy(uint _card, address _referrer)
public
payable
{
}
function distributeDivs(uint _distDividends) internal{
}
function withdraw()
public
{
}
/*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/
function setName(string _name)
onlyOwner()
public
{
}
function setSymbol(string _symbol)
onlyOwner()
public
{
}
function setcardPrice(uint _card, uint _price) //Allow the changing of a card price owner if the dev owns it
onlyOwner()
public
{
require(<FILL_ME>)
cardPrice[_card] = _price;
}
function addNewcard(uint _price)
onlyOwner()
public
{
}
function setAllowReferral(bool _allowReferral)
onlyOwner()
public
{
}
/*---------- HELPERS AND CALCULATORS ----------*/
/**
* Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function getMyBalance()
public
view
returns(uint)
{
}
function getOwnerBalance(address _cardOwner)
public
view
returns(uint)
{
}
function getcardPrice(uint _card)
public
view
returns(uint)
{
}
function getcardOwner(uint _card)
public
view
returns(address)
{
}
function gettotalCardDivs(uint _card)
public
view
returns(uint)
{
}
function getTotalDivsProduced()
public
view
returns(uint)
{
}
function getCardDivShare(uint _card)
public
view
returns(uint)
{
}
function getCardDivs(uint _card, uint _amt)
public
view
returns(uint)
{
}
function gettotalCardValue()
public
view
returns(uint)
{
}
function totalEthereumBalance()
public
view
returns(uint)
{
}
function gettotalCards()
public
view
returns(uint)
{
}
}
/**
* @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) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Substracts 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) {
}
}
| cardOwner[_card]==dev | 338,333 | cardOwner[_card]==dev |
null | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
import "../interfaces/IHypervisor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title Admin
contract Admin {
address public admin;
address public advisor;
modifier onlyAdvisor {
}
modifier onlyAdmin {
}
constructor(address _admin, address _advisor) {
}
/// @param _hypervisor Hypervisor Address
/// @param _baseLower The lower tick of the base position
/// @param _baseUpper The upper tick of the base position
/// @param _limitLower The lower tick of the limit position
/// @param _limitUpper The upper tick of the limit position
/// @param _feeRecipient Address of recipient of 10% of earned fees since last rebalance
/// @param swapQuantity Quantity of tokens to swap; if quantity is positive,
/// `swapQuantity` token0 are swaped for token1, if negative, `swapQuantity`
/// token1 is swaped for token0
function rebalance(
address _hypervisor,
int24 _baseLower,
int24 _baseUpper,
int24 _limitLower,
int24 _limitUpper,
address _feeRecipient,
int256 swapQuantity
) external onlyAdvisor {
}
/// @notice Pull liquidity tokens from liquidity and receive the tokens
/// @param _hypervisor Hypervisor Address
/// @param shares Number of liquidity tokens to pull from liquidity
/// @return base0 amount of token0 received from base position
/// @return base1 amount of token1 received from base position
/// @return limit0 amount of token0 received from limit position
/// @return limit1 amount of token1 received from limit position
function pullLiquidity(
address _hypervisor,
uint256 shares
) external onlyAdvisor returns(
uint256 base0,
uint256 base1,
uint256 limit0,
uint256 limit1
) {
}
/// @notice Add tokens to base liquidity
/// @param _hypervisor Hypervisor Address
/// @param amount0 Amount of token0 to add
/// @param amount1 Amount of token1 to add
function addBaseLiquidity(address _hypervisor, uint256 amount0, uint256 amount1) external onlyAdvisor {
}
/// @notice Add tokens to limit liquidity
/// @param _hypervisor Hypervisor Address
/// @param amount0 Amount of token0 to add
/// @param amount1 Amount of token1 to add
function addLimitLiquidity(address _hypervisor, uint256 amount0, uint256 amount1) external onlyAdvisor {
}
/// @notice Get the pending fees
/// @param _hypervisor Hypervisor Address
/// @return fees0 Pending fees of token0
/// @return fees1 Pending fees of token1
function pendingFees(address _hypervisor) external onlyAdvisor returns (uint256 fees0, uint256 fees1) {
}
/// @param _hypervisor Hypervisor Address
/// @param _deposit0Max The maximum amount of token0 allowed in a deposit
/// @param _deposit1Max The maximum amount of token1 allowed in a deposit
function setDepositMax(address _hypervisor, uint256 _deposit0Max, uint256 _deposit1Max) external onlyAdmin {
}
/// @param _hypervisor Hypervisor Address
/// @param _maxTotalSupply The maximum liquidity token supply the contract allows
function setMaxTotalSupply(address _hypervisor, uint256 _maxTotalSupply) external onlyAdmin {
}
/// @notice Toogle Whitelist configuration
/// @param _hypervisor Hypervisor Address
function toggleWhitelist(address _hypervisor) external onlyAdmin {
}
/// @param _hypervisor Hypervisor Address
/// @param listed Array of addresses to be appended
function appendList(address _hypervisor, address[] memory listed) external onlyAdmin {
}
/// @param _hypervisor Hypervisor Address
/// @param listed Address of listed to remove
function removeListed(address _hypervisor, address listed) external onlyAdmin {
}
/// @param newAdmin New Admin Address
function transferAdmin(address newAdmin) external onlyAdmin {
}
/// @param newAdvisor New Advisor Address
function transferAdvisor(address newAdvisor) external onlyAdmin {
}
/// @param _hypervisor Hypervisor Address
/// @param newOwner New Owner Address
function transferHypervisorOwner(address _hypervisor, address newOwner) external onlyAdmin {
}
/// @notice Transfer tokens to the recipient from the contract
/// @param token Address of token
/// @param recipient Recipient Address
function rescueERC20(IERC20 token, address recipient) external onlyAdmin {
require(recipient != address(0), "recipient should be non-zero");
require(<FILL_ME>)
}
}
| token.transfer(recipient,token.balanceOf(address(this))) | 338,337 | token.transfer(recipient,token.balanceOf(address(this))) |
null | pragma solidity ^0.4.23;
contract ERC223Interface {
uint public totalSupply;
uint8 public decimals;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
function transfer(address to, uint value, bytes data);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
}
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title AirDropContract
* Simply do the airdrop.
*/
contract AirDrop is Ownable {
using SafeMath for uint256;
// the amount that owner wants to send each time
uint public airDropAmount;
// the mapping to judge whether each address has already received airDropped
mapping ( address => bool ) public invalidAirDrop;
// the array of addresses which received airDrop
address[] public arrayAirDropReceivers;
// flag to stop airdrop
bool public stop = false;
ERC223Interface public erc20;
uint256 public startTime;
uint256 public endTime;
// event
event LogAirDrop(address indexed receiver, uint amount);
event LogStop();
event LogStart();
event LogWithdrawal(address indexed receiver, uint amount);
/**
* @dev Constructor to set _airDropAmount and _tokenAddresss.
* @param _airDropAmount The amount of token that is sent for doing airDrop.
* @param _tokenAddress The address of token.
*/
constructor(uint256 _startTime, uint256 _endTime, uint _airDropAmount, address _tokenAddress) public {
}
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) {}
/**
* @dev Confirm that airDrop is available.
* @return A bool to confirm that airDrop is available.
*/
function isValidAirDropForAll() public view returns (bool) {
}
/**
* @dev Confirm that airDrop is available for msg.sender.
* @return A bool to confirm that airDrop is available for msg.sender.
*/
function isValidAirDropForIndividual() public view returns (bool) {
}
/**
* @dev Do the airDrop to msg.sender
*/
function receiveAirDrop() public {
require(<FILL_ME>)
// set invalidAirDrop of msg.sender to true
invalidAirDrop[msg.sender] = true;
// set msg.sender to the array of the airDropReceiver
arrayAirDropReceivers.push(msg.sender);
// execute transferFrom
erc20.transfer(msg.sender, airDropAmount);
emit LogAirDrop(msg.sender, airDropAmount);
}
/**
* @dev Change the state of stop flag
*/
function toggle() public onlyOwner {
}
/**
* @dev Withdraw the amount of token that is remaining in this contract.
* @param _address The address of EOA that can receive token from this contract.
*/
function withdraw(address _address) public onlyOwner {
}
/**
* @dev Get the total number of addresses which received airDrop.
* @return Uint256 the total number of addresses which received airDrop.
*/
function getTotalNumberOfAddressesReceivedAirDrop() public view returns (uint256) {
}
/**
* @dev Get the remaining amount of token user can receive.
* @return Uint256 the amount of token that user can reveive.
*/
function getRemainingToken() public view returns (uint256) {
}
/**
* @dev Return the total amount of token user received.
* @return Uint256 total amount of token user received.
*/
function getTotalAirDroppedAmount() public view returns (uint256) {
}
}
| isValidAirDropForIndividual() | 338,390 | isValidAirDropForIndividual() |
null | pragma solidity ^0.4.23;
contract ERC223Interface {
uint public totalSupply;
uint8 public decimals;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
function transfer(address to, uint value, bytes data);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
}
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
/**
* @title AirDropContract
* Simply do the airdrop.
*/
contract AirDrop is Ownable {
using SafeMath for uint256;
// the amount that owner wants to send each time
uint public airDropAmount;
// the mapping to judge whether each address has already received airDropped
mapping ( address => bool ) public invalidAirDrop;
// the array of addresses which received airDrop
address[] public arrayAirDropReceivers;
// flag to stop airdrop
bool public stop = false;
ERC223Interface public erc20;
uint256 public startTime;
uint256 public endTime;
// event
event LogAirDrop(address indexed receiver, uint amount);
event LogStop();
event LogStart();
event LogWithdrawal(address indexed receiver, uint amount);
/**
* @dev Constructor to set _airDropAmount and _tokenAddresss.
* @param _airDropAmount The amount of token that is sent for doing airDrop.
* @param _tokenAddress The address of token.
*/
constructor(uint256 _startTime, uint256 _endTime, uint _airDropAmount, address _tokenAddress) public {
}
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data) {}
/**
* @dev Confirm that airDrop is available.
* @return A bool to confirm that airDrop is available.
*/
function isValidAirDropForAll() public view returns (bool) {
}
/**
* @dev Confirm that airDrop is available for msg.sender.
* @return A bool to confirm that airDrop is available for msg.sender.
*/
function isValidAirDropForIndividual() public view returns (bool) {
}
/**
* @dev Do the airDrop to msg.sender
*/
function receiveAirDrop() public {
}
/**
* @dev Change the state of stop flag
*/
function toggle() public onlyOwner {
}
/**
* @dev Withdraw the amount of token that is remaining in this contract.
* @param _address The address of EOA that can receive token from this contract.
*/
function withdraw(address _address) public onlyOwner {
require(<FILL_ME>)
require(_address != address(0));
uint tokenBalanceOfContract = getRemainingToken();
erc20.transfer(_address, tokenBalanceOfContract);
emit LogWithdrawal(_address, tokenBalanceOfContract);
}
/**
* @dev Get the total number of addresses which received airDrop.
* @return Uint256 the total number of addresses which received airDrop.
*/
function getTotalNumberOfAddressesReceivedAirDrop() public view returns (uint256) {
}
/**
* @dev Get the remaining amount of token user can receive.
* @return Uint256 the amount of token that user can reveive.
*/
function getRemainingToken() public view returns (uint256) {
}
/**
* @dev Return the total amount of token user received.
* @return Uint256 total amount of token user received.
*/
function getTotalAirDroppedAmount() public view returns (uint256) {
}
}
| stop||now>endTime | 338,390 | stop||now>endTime |
"INVALID_NFT_ID" | pragma solidity ^0.8.2;
contract WACK is ERC721, ERC1155Holder, Ownable {
using Counters for Counters.Counter;
mapping(uint256 => uint256) public tokenIds;
using Strings for uint256;
string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmbHhnkMmeZ3WPNnZoHr5YqAyHApPhPaAEJth4qqPdAQvk/";
uint256 public WACK_MAX = 26;
uint256 public WACK_PRICE = 0.15 ether;
mapping(address => bool) public WHITELIST;
bool public mintLive;
bool public mintWLLive;
Counters.Counter public _tokensMinted;
constructor() ERC721("WACK", "WACK") {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC1155Receiver) returns (bool) {
}
function changeId(uint256 oldId, uint256 newId) external onlyOwner {
}
function onERC1155Received(address, address from, uint256 id, uint256, bytes calldata) public override returns (bytes4) {
require(msg.sender == 0x495f947276749Ce646f68AC8c248420045cb7b5e, "INVALID_NFT_CONTRACT");
require(<FILL_ME>)
_safeMint(from, tokenIds[id]);
return this.onERC1155Received.selector;
}
function withdraw() external onlyOwner {
}
function mint() external payable {
}
function mintWL() external payable {
}
function togglePublicMintStatus() external onlyOwner {
}
function toggleWLMintStatus() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
receive() external payable {}
}
| tokenIds[id]>0,"INVALID_NFT_ID" | 338,442 | tokenIds[id]>0 |
"EXCEED_MAX" | pragma solidity ^0.8.2;
contract WACK is ERC721, ERC1155Holder, Ownable {
using Counters for Counters.Counter;
mapping(uint256 => uint256) public tokenIds;
using Strings for uint256;
string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmbHhnkMmeZ3WPNnZoHr5YqAyHApPhPaAEJth4qqPdAQvk/";
uint256 public WACK_MAX = 26;
uint256 public WACK_PRICE = 0.15 ether;
mapping(address => bool) public WHITELIST;
bool public mintLive;
bool public mintWLLive;
Counters.Counter public _tokensMinted;
constructor() ERC721("WACK", "WACK") {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC1155Receiver) returns (bool) {
}
function changeId(uint256 oldId, uint256 newId) external onlyOwner {
}
function onERC1155Received(address, address from, uint256 id, uint256, bytes calldata) public override returns (bytes4) {
}
function withdraw() external onlyOwner {
}
function mint() external payable {
require(mintLive, "MINT_CLOSED");
require(<FILL_ME>)
require(WACK_PRICE <= msg.value, "INSUFFICIENT_ETH");
_tokensMinted.increment();
_safeMint(msg.sender, _tokensMinted.current() + 174);
}
function mintWL() external payable {
}
function togglePublicMintStatus() external onlyOwner {
}
function toggleWLMintStatus() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
receive() external payable {}
}
| _tokensMinted.current()+1<=WACK_MAX,"EXCEED_MAX" | 338,442 | _tokensMinted.current()+1<=WACK_MAX |
"NOT_WHITLISED" | pragma solidity ^0.8.2;
contract WACK is ERC721, ERC1155Holder, Ownable {
using Counters for Counters.Counter;
mapping(uint256 => uint256) public tokenIds;
using Strings for uint256;
string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmbHhnkMmeZ3WPNnZoHr5YqAyHApPhPaAEJth4qqPdAQvk/";
uint256 public WACK_MAX = 26;
uint256 public WACK_PRICE = 0.15 ether;
mapping(address => bool) public WHITELIST;
bool public mintLive;
bool public mintWLLive;
Counters.Counter public _tokensMinted;
constructor() ERC721("WACK", "WACK") {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC1155Receiver) returns (bool) {
}
function changeId(uint256 oldId, uint256 newId) external onlyOwner {
}
function onERC1155Received(address, address from, uint256 id, uint256, bytes calldata) public override returns (bytes4) {
}
function withdraw() external onlyOwner {
}
function mint() external payable {
}
function mintWL() external payable {
require(mintWLLive, "MINT_CLOSED");
require(_tokensMinted.current() + 1 <= WACK_MAX, "EXCEED_MAX");
require(<FILL_ME>)
require(WACK_PRICE <= msg.value, "INSUFFICIENT_ETH");
_tokensMinted.increment();
_safeMint(msg.sender, _tokensMinted.current() + 174);
}
function togglePublicMintStatus() external onlyOwner {
}
function toggleWLMintStatus() external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string calldata URI) external onlyOwner {
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
receive() external payable {}
}
| WHITELIST[msg.sender],"NOT_WHITLISED" | 338,442 | WHITELIST[msg.sender] |
"contract has already given" | // solium-disable security/no-low-level-calls
pragma solidity 0.6.6;
contract Wrapper is
DeployerRole,
UseSafeMath,
UseOracle,
UseBondMaker,
UseStableCoin,
WrapperInterface
{
LBTExchangeFactoryInterface internal _exchangeLBTAndIDOLFactoryContract;
constructor(
address oracleAddress,
address bondMakerAddress,
address IDOLAddress,
address exchangeLBTAndIDOLFactoryAddress
)
public
UseOracle(oracleAddress)
UseBondMaker(bondMakerAddress)
UseStableCoin(IDOLAddress)
{
}
function setExchangeLBTAndIDOLFactory(address contractAddress)
public
onlyDeployer
{
require(<FILL_ME>)
require(
contractAddress != address(0),
"contract should be non-zero address"
);
_setExchangeLBTAndIDOLFactory(contractAddress);
}
function _setExchangeLBTAndIDOLFactory(address contractAddress) internal {
}
function exchangeLBTAndIDOLFactoryAddress() public view returns (address) {
}
function registerBondAndBondGroup(bytes[] memory fnMaps, uint256 maturity)
public
override
returns (bool)
{
}
/**
* @param solidBondID is a solid bond ID
* @param SBTAmount is solid bond token amount
* @return poolID is a pool ID
* @return IDOLAmount is iDOL amount obtained
*/
function _swapSBT2IDOL(
bytes32 solidBondID,
address SBTAddress,
uint256 SBTAmount
) internal returns (bytes32 poolID, uint256 IDOLAmount) {
}
/**
* @notice swap (LBT -> iDOL)
* @param LBTAddress is liquid bond token contract address
* @param LBTAmount is liquid bond amount
* @param timeout (uniswap)
* @param isLimit (uniswap)
*/
function _swapLBT2IDOL(
address LBTAddress,
uint256 LBTAmount,
uint256 timeout,
bool isLimit
) internal {
}
/**
* @notice swap (iDOL -> LBT)
* @param LBTAddress is liquid bond token contract address
* @param IDOLAmount is iDOL amount
* @param timeout (uniswap)
* @param isLimit (uniswap)
*/
function _swapIDOL2LBT(
address LBTAddress,
uint256 IDOLAmount,
uint256 timeout,
bool isLimit
) internal {
}
/**
* @notice swap (SBT -> LBT)
* @param solidBondID is a solid bond ID
* @param liquidBondID is a liquid bond ID
* @param timeout (uniswap)
* @param isLimit (uniswap)
*/
function swapSBT2LBT(
bytes32 solidBondID,
bytes32 liquidBondID,
uint256 SBTAmount,
uint256 timeout,
bool isLimit
) public override {
}
function _swapSBT2LBT(
bytes32 solidBondID,
address SBTAddress,
bytes32 liquidBondID,
uint256 SBTAmount,
uint256 timeout,
bool isLimit
) internal {
}
/**
* @notice find a solid bond in given bond group
* @param bondGroupID is a bond group ID
*/
function _findSBTAndLBTBondGroup(uint256 bondGroupID)
internal
view
returns (bytes32 solidBondID, bytes32[] memory liquidBondIDs)
{
}
function _usesERC20(address erc20Address, uint256 amount) internal {
}
function _reductionERC20(address erc20Address, uint256 amount) internal {
}
function _findBondAddressListInBondGroup(uint256 bondGroupID)
internal
view
returns (address[] memory bondAddressList)
{
}
/**
* @notice ETH -> LBT & iDOL
* @param bondGroupID is a bond group ID
* @return poolID is a pool ID
* @return IDOLAmount is iDOL amount obtained
*/
function issueLBTAndIDOL(uint256 bondGroupID)
public
override
payable
returns (
bytes32,
uint256,
uint256
)
{
}
/**
* @notice ETH -> iDOL
* @param bondGroupID is a bond group ID
* @param timeout (uniswap)
* @param isLimit (uniswap)
*/
function issueIDOLOnly(
uint256 bondGroupID,
uint256 timeout,
bool isLimit
) public override payable {
}
/**
* @notice ETH -> LBT
* @param bondGroupID is a bond group ID
* @param liquidBondID is a liquid bond ID
* @param timeout (uniswap)
* @param isLimit (uniswap)
*/
function issueLBTOnly(
uint256 bondGroupID,
bytes32 liquidBondID,
uint256 timeout,
bool isLimit
) public override payable {
}
}
| address(_exchangeLBTAndIDOLFactoryContract)==address(0),"contract has already given" | 338,448 | address(_exchangeLBTAndIDOLFactoryContract)==address(0) |
"bid too low, minimum is the initial price" | pragma solidity ^0.4.23;
// Deploying version: https://github.com/astralship/auction-ethereum/commit/1359e14e0319c6019eb9c7e57348b95c722e3dd6
// Timestamp Converter: 1529279999
// Is equivalent to: 06/17/2018 @ 11:59pm (UTC)
// Sunday midnight, in a week 😎
contract Auction {
string public description;
string public instructions; // will be used for delivery address or email
uint public price;
bool public initialPrice = true; // at first asking price is OK, then +25% required
uint public timestampEnd;
address public beneficiary;
bool public finalized = false;
address public owner;
address public winner;
mapping(address => uint) public bids;
address[] public accountsList; // so we can iterate: https://ethereum.stackexchange.com/questions/13167/are-there-well-solved-and-simple-storage-patterns-for-solidity
// THINK: should be (an optional) constructor parameter?
// For now if you want to change - simply modify the code
uint public increaseTimeIfBidBeforeEnd = 24 * 60 * 60; // Naming things: https://www.instagram.com/p/BSa_O5zjh8X/
uint public increaseTimeBy = 24 * 60 * 60;
event Bid(address indexed winner, uint indexed price, uint indexed timestamp);
event Refund(address indexed sender, uint indexed amount, uint indexed timestamp);
modifier onlyOwner { }
modifier onlyWinner { }
modifier ended { }
function setDescription(string _description) public onlyOwner() {
}
function setInstructions(string _instructions) public ended() onlyWinner() {
}
constructor(uint _price, string _description, uint _timestampEnd, address _beneficiary) public {
}
function() public payable {
if (msg.value == 0) { // when sending `0` it acts as if it was `withdraw`
refund();
return;
}
require(now < timestampEnd, "auction has ended"); // sending ether only allowed before the end
if (bids[msg.sender] > 0) { // First we add the bid to an existing bid
bids[msg.sender] += msg.value;
} else {
bids[msg.sender] = msg.value;
accountsList.push(msg.sender); // this is out first bid, therefore adding
}
if (initialPrice) {
require(<FILL_ME>)
} else {
require(bids[msg.sender] >= (price * 5 / 4), "bid too low, minimum 25% increment");
}
if (now > timestampEnd - increaseTimeIfBidBeforeEnd) {
timestampEnd = now + increaseTimeBy;
}
initialPrice = false;
price = bids[msg.sender];
winner = msg.sender;
emit Bid(winner, price, now);
}
function finalize() public ended() onlyOwner() {
}
function refund() public {
}
}
| bids[msg.sender]>=price,"bid too low, minimum is the initial price" | 338,464 | bids[msg.sender]>=price |
"bid too low, minimum 25% increment" | pragma solidity ^0.4.23;
// Deploying version: https://github.com/astralship/auction-ethereum/commit/1359e14e0319c6019eb9c7e57348b95c722e3dd6
// Timestamp Converter: 1529279999
// Is equivalent to: 06/17/2018 @ 11:59pm (UTC)
// Sunday midnight, in a week 😎
contract Auction {
string public description;
string public instructions; // will be used for delivery address or email
uint public price;
bool public initialPrice = true; // at first asking price is OK, then +25% required
uint public timestampEnd;
address public beneficiary;
bool public finalized = false;
address public owner;
address public winner;
mapping(address => uint) public bids;
address[] public accountsList; // so we can iterate: https://ethereum.stackexchange.com/questions/13167/are-there-well-solved-and-simple-storage-patterns-for-solidity
// THINK: should be (an optional) constructor parameter?
// For now if you want to change - simply modify the code
uint public increaseTimeIfBidBeforeEnd = 24 * 60 * 60; // Naming things: https://www.instagram.com/p/BSa_O5zjh8X/
uint public increaseTimeBy = 24 * 60 * 60;
event Bid(address indexed winner, uint indexed price, uint indexed timestamp);
event Refund(address indexed sender, uint indexed amount, uint indexed timestamp);
modifier onlyOwner { }
modifier onlyWinner { }
modifier ended { }
function setDescription(string _description) public onlyOwner() {
}
function setInstructions(string _instructions) public ended() onlyWinner() {
}
constructor(uint _price, string _description, uint _timestampEnd, address _beneficiary) public {
}
function() public payable {
if (msg.value == 0) { // when sending `0` it acts as if it was `withdraw`
refund();
return;
}
require(now < timestampEnd, "auction has ended"); // sending ether only allowed before the end
if (bids[msg.sender] > 0) { // First we add the bid to an existing bid
bids[msg.sender] += msg.value;
} else {
bids[msg.sender] = msg.value;
accountsList.push(msg.sender); // this is out first bid, therefore adding
}
if (initialPrice) {
require(bids[msg.sender] >= price, "bid too low, minimum is the initial price");
} else {
require(<FILL_ME>)
}
if (now > timestampEnd - increaseTimeIfBidBeforeEnd) {
timestampEnd = now + increaseTimeBy;
}
initialPrice = false;
price = bids[msg.sender];
winner = msg.sender;
emit Bid(winner, price, now);
}
function finalize() public ended() onlyOwner() {
}
function refund() public {
}
}
| bids[msg.sender]>=(price*5/4),"bid too low, minimum 25% increment" | 338,464 | bids[msg.sender]>=(price*5/4) |
null | /**
*
* https://ulu.finance
*
* $$\ $$\ $$\ $$\ $$\
* $$ | $$ |$$ | $$ | $$ |
* $$ | $$ |$$ | $$ | $$ |
* $$ | $$ |$$ | $$ | $$ |
* $$ | $$ |$$ | $$ | $$ |
* $$ | $$ |$$ | $$ | $$ |
* \$$$$$$ |$$$$$$$$\\$$$$$$ |
* \______/ \________|\______/
*
* Universal Liquidity Union
*
* https://ulu.finance
*
**/
pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns (uint) {
}
function balanceOf(address account) public view returns (uint) {
}
function transfer(address recipient, uint amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint) {
}
function approve(address spender, uint amount) public returns (bool) {
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint amount) internal {
}
function _mint(address account, uint amount) internal {
}
function _burn(address account, uint amount) internal {
}
function _approve(address owner, address spender, uint amount) internal {
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
}
function sub(uint a, uint b) internal pure returns (uint) {
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
function mul(uint a, uint b) internal pure returns (uint) {
}
function div(uint a, uint b) internal pure returns (uint) {
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
}
function safeApprove(IERC20 token, address spender, uint value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
contract ULU is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
mapping (address => bool) public minters;
uint public constant GRACE_PERIOD = 2 days;
mapping (address => uint) public pendingAddMinters;
constructor () public ERC20Detailed("Universal Liquidity Union", "ULU", 18) {
}
function mint(address account, uint256 amount) public {
}
function burn(uint256 amount) public {
}
function setGovernance(address _governance) public {
}
function addMinter(address _minter) public {
}
function pendingAddMinter(address _minter) public {
}
function cancelAddMinter(address _minter) public {
}
function executeAddMinter(address _minter) public {
require(msg.sender == governance, "!governance");
require(<FILL_ME>)
minters[_minter] = true;
pendingAddMinters[_minter] = 0;
}
function removeMinter(address _minter) public {
}
}
| pendingAddMinters[_minter]!=0&&now>pendingAddMinters[_minter]+GRACE_PERIOD | 338,520 | pendingAddMinters[_minter]!=0&&now>pendingAddMinters[_minter]+GRACE_PERIOD |
'MerkleDistributor: Transfer failed.' | pragma solidity 0.8.4;
// SPDX-License-Identifier: MIT
import "./merkle/MerkleDistributor.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./HumanDaoGenesisNFT.sol";
contract HumanDaoDistributor is MerkleDistributor {
HumanDaoGenesisNFT public immutable humanDAONFT;
constructor(address token_, bytes32 merkleRoot_, address humanDAOGenesisNFT_) MerkleDistributor(token_, merkleRoot_) {
}
function distribute(address account, uint256 amount) internal override returns (uint256) {
uint256 distributionAmount = calculateMaxDistribution(account, amount);
require(<FILL_ME>)
return distributionAmount;
}
function mintNft(address account_) internal override {
}
function transferRemainingTokens(address _token) external onlyOwner {
}
function transferNftOwnership(address beneficiary_) external onlyOwner {
}
//Returns the amount a user would receive. Either 20% of the user's current balance or the distribution amount
//whichever is the lowest.
function calculateMaxDistribution(address account_, uint256 amount_) public view returns (uint256){
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| IERC20(token).transfer(account,distributionAmount),'MerkleDistributor: Transfer failed.' | 338,594 | IERC20(token).transfer(account,distributionAmount) |
messageForTransferRestriction(restrictionCode) | pragma solidity 0.8.11;
/// @title RoRa Prime (RORAP)
/// @author RoRa Holdings Corporation
/// @notice ERC-20 token with Access Control and ERC-1404 transfer restrictions.
/// Portions inspired by CoMakery Security Token
contract RORAPrime is ERC20, Pausable, AccessControl {
ITransferRules public transferRules;
bytes32 public constant CONTRACT_ADMIN_ROLE = keccak256("CONTRACT_ADMIN_ROLE");
bytes32 public constant PERMISSIONS_ADMIN_ROLE = keccak256("PERMISSIONS_ADMIN_ROLE");
bytes32 public constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");
mapping(address => uint256) private _permissions;
mapping(address => uint256) private _timeLock;
event UpgradeRules(address indexed admin, address oldRules, address newRules);
event PermissionChange(address indexed admin, address indexed account, uint256 permission);
event AddressTimeLock(address indexed admin, address indexed account, uint256 value);
constructor (string memory name_,
string memory symbol_,
uint256 totalSupply_,
address mintAdmin_,
address contractAdmin_,
address reserveAddress_,
address transferRules_
) ERC20(name_, symbol_) {
}
function pause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function unpause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function mint(address to, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
// Ability to burn address by board decision only for regulatory requirements
// Can only be called by the Mint Admin role
function burn(address from, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
function transfer(address to, uint256 amount) public override whenNotPaused returns (bool) {
}
function transferFrom(address from, address to, uint256 amount) public override whenNotPaused returns (bool) {
}
// Sets the transfer permission bits for a participant
function setPermission(address account, uint256 permission) onlyRole(PERMISSIONS_ADMIN_ROLE) external {
}
function getPermission(address account) external view returns (uint256) {
}
// Unix timestamp is the number of seconds since the Unix epoch of 00:00:00 UTC on 1 January 1970.
function setTimeLock(address account, uint256 timestamp) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function removeTimeLock(address account) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function getTimeLock(address account) external view returns(uint256 timestamp) {
}
function enforceTransferRestrictions(address from, address to, uint256 value) private view {
uint8 restrictionCode = detectTransferRestriction(from, to, value);
require(<FILL_ME>)
}
function detectTransferRestriction(address from, address to, uint256 value) public view returns(uint8) {
}
function messageForTransferRestriction(uint8 restrictionCode) public view returns(string memory) {
}
function renounceRole(bytes32 role, address account) public override {
}
function revokeRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
}
function grantRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
}
function upgradeTransferRules(ITransferRules newTransferRules) external onlyRole(CONTRACT_ADMIN_ROLE) {
}
}
| transferRules.checkSuccess(restrictionCode),messageForTransferRestriction(restrictionCode) | 338,620 | transferRules.checkSuccess(restrictionCode) |
"ADDRESS ALREADY HAS ROLE" | pragma solidity 0.8.11;
/// @title RoRa Prime (RORAP)
/// @author RoRa Holdings Corporation
/// @notice ERC-20 token with Access Control and ERC-1404 transfer restrictions.
/// Portions inspired by CoMakery Security Token
contract RORAPrime is ERC20, Pausable, AccessControl {
ITransferRules public transferRules;
bytes32 public constant CONTRACT_ADMIN_ROLE = keccak256("CONTRACT_ADMIN_ROLE");
bytes32 public constant PERMISSIONS_ADMIN_ROLE = keccak256("PERMISSIONS_ADMIN_ROLE");
bytes32 public constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");
mapping(address => uint256) private _permissions;
mapping(address => uint256) private _timeLock;
event UpgradeRules(address indexed admin, address oldRules, address newRules);
event PermissionChange(address indexed admin, address indexed account, uint256 permission);
event AddressTimeLock(address indexed admin, address indexed account, uint256 value);
constructor (string memory name_,
string memory symbol_,
uint256 totalSupply_,
address mintAdmin_,
address contractAdmin_,
address reserveAddress_,
address transferRules_
) ERC20(name_, symbol_) {
}
function pause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function unpause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function mint(address to, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
// Ability to burn address by board decision only for regulatory requirements
// Can only be called by the Mint Admin role
function burn(address from, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
function transfer(address to, uint256 amount) public override whenNotPaused returns (bool) {
}
function transferFrom(address from, address to, uint256 amount) public override whenNotPaused returns (bool) {
}
// Sets the transfer permission bits for a participant
function setPermission(address account, uint256 permission) onlyRole(PERMISSIONS_ADMIN_ROLE) external {
}
function getPermission(address account) external view returns (uint256) {
}
// Unix timestamp is the number of seconds since the Unix epoch of 00:00:00 UTC on 1 January 1970.
function setTimeLock(address account, uint256 timestamp) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function removeTimeLock(address account) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function getTimeLock(address account) external view returns(uint256 timestamp) {
}
function enforceTransferRestrictions(address from, address to, uint256 value) private view {
}
function detectTransferRestriction(address from, address to, uint256 value) public view returns(uint8) {
}
function messageForTransferRestriction(uint8 restrictionCode) public view returns(string memory) {
}
function renounceRole(bytes32 role, address account) public override {
}
function revokeRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
}
function grantRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
require(<FILL_ME>)
super.grantRole(role, account);
}
function upgradeTransferRules(ITransferRules newTransferRules) external onlyRole(CONTRACT_ADMIN_ROLE) {
}
}
| !hasRole(role,account),"ADDRESS ALREADY HAS ROLE" | 338,620 | !hasRole(role,account) |
"ADDRESS CAN NOT BE 0x0" | pragma solidity 0.8.11;
/// @title RoRa Prime (RORAP)
/// @author RoRa Holdings Corporation
/// @notice ERC-20 token with Access Control and ERC-1404 transfer restrictions.
/// Portions inspired by CoMakery Security Token
contract RORAPrime is ERC20, Pausable, AccessControl {
ITransferRules public transferRules;
bytes32 public constant CONTRACT_ADMIN_ROLE = keccak256("CONTRACT_ADMIN_ROLE");
bytes32 public constant PERMISSIONS_ADMIN_ROLE = keccak256("PERMISSIONS_ADMIN_ROLE");
bytes32 public constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");
mapping(address => uint256) private _permissions;
mapping(address => uint256) private _timeLock;
event UpgradeRules(address indexed admin, address oldRules, address newRules);
event PermissionChange(address indexed admin, address indexed account, uint256 permission);
event AddressTimeLock(address indexed admin, address indexed account, uint256 value);
constructor (string memory name_,
string memory symbol_,
uint256 totalSupply_,
address mintAdmin_,
address contractAdmin_,
address reserveAddress_,
address transferRules_
) ERC20(name_, symbol_) {
}
function pause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function unpause() external onlyRole(CONTRACT_ADMIN_ROLE) {
}
function mint(address to, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
// Ability to burn address by board decision only for regulatory requirements
// Can only be called by the Mint Admin role
function burn(address from, uint256 amount) external whenNotPaused onlyRole(MINT_ADMIN_ROLE) {
}
function transfer(address to, uint256 amount) public override whenNotPaused returns (bool) {
}
function transferFrom(address from, address to, uint256 amount) public override whenNotPaused returns (bool) {
}
// Sets the transfer permission bits for a participant
function setPermission(address account, uint256 permission) onlyRole(PERMISSIONS_ADMIN_ROLE) external {
}
function getPermission(address account) external view returns (uint256) {
}
// Unix timestamp is the number of seconds since the Unix epoch of 00:00:00 UTC on 1 January 1970.
function setTimeLock(address account, uint256 timestamp) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function removeTimeLock(address account) external onlyRole(PERMISSIONS_ADMIN_ROLE) {
}
function getTimeLock(address account) external view returns(uint256 timestamp) {
}
function enforceTransferRestrictions(address from, address to, uint256 value) private view {
}
function detectTransferRestriction(address from, address to, uint256 value) public view returns(uint8) {
}
function messageForTransferRestriction(uint8 restrictionCode) public view returns(string memory) {
}
function renounceRole(bytes32 role, address account) public override {
}
function revokeRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
}
function grantRole(bytes32 role, address account) public override onlyRole(getRoleAdmin(role)) {
}
function upgradeTransferRules(ITransferRules newTransferRules) external onlyRole(CONTRACT_ADMIN_ROLE) {
require(<FILL_ME>)
address oldRules = address(transferRules);
transferRules = newTransferRules;
emit UpgradeRules(msg.sender, oldRules, address(newTransferRules));
}
}
| address(newTransferRules)!=address(0x0),"ADDRESS CAN NOT BE 0x0" | 338,620 | address(newTransferRules)!=address(0x0) |
'Derivative not registered!' | pragma solidity 0.8.4;
contract Disputer is Ownable {
using SafeERC20 for IERC20;
mapping(address => bool) public registeredDerivatives;
function registerDerivatives(address[] memory _derivatives)
public
onlyOwner()
{
}
function withdrawBalance(IERC20 _token) public onlyOwner() {
}
function raiseDispute(
address _derivative,
uint256 _amount,
uint256 _liquidationId,
address _sponsor
) external {
require(<FILL_ME>)
IDisputer derivative = IDisputer(_derivative);
IERC20 collateralToken = derivative.collateralCurrency();
collateralToken.safeIncreaseAllowance(address(_derivative), _amount);
derivative.dispute(_liquidationId, _sponsor);
collateralToken.safeApprove(address(_derivative), 0);
}
}
| registeredDerivatives[_derivative]==true,'Derivative not registered!' | 338,652 | registeredDerivatives[_derivative]==true |
"Crypto Genies: Sale is not active" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
require(<FILL_ME>)
_;
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| isSaleActive||block.number>=saleStartBlock,"Crypto Genies: Sale is not active" | 338,665 | isSaleActive||block.number>=saleStartBlock |
"Crypto Genies: Presale is not active" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
require(<FILL_ME>)
require(presaleMinted < MAX_PRESALE_ITEMS, "Crypto Genies: Presale sold out");
_;
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| isPresaleActive||block.number>=presaleStartBlock,"Crypto Genies: Presale is not active" | 338,665 | isPresaleActive||block.number>=presaleStartBlock |
"Crypto Genies: Purchase would exceed cap" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
uint256 publicMinted = totalSupply() - communityMinted;
require(amount <= maxPerMint, "Crypto Genies: Amount exceeds max per mint");
require(<FILL_ME>)
require(mintPrice * amount <= msg.value, "Crypto Genies: Ether value sent is not correct");
for(uint256 i = 0; i < amount; i++) {
uint256 mintIndex = totalSupply() + 1;
if (publicMinted< PUBLIC_ITEMS) {
_safeMint(msg.sender, mintIndex);
}
}
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| publicMinted+amount<=PUBLIC_ITEMS,"Crypto Genies: Purchase would exceed cap" | 338,665 | publicMinted+amount<=PUBLIC_ITEMS |
"Crypto Genies: Purchase would exceed presale supply cap" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
require(amount <= maxPerPresaleMint, "Crypto Genies: Amount exceeds max per presale mint");
require(<FILL_ME>)
require(presaleClaimed[msg.sender] + amount <= maxPerPresaleMint, 'Purchase exceeds max allowed presale address cap');
require(mintPrice * amount <= msg.value, "Crypto Genies: Ether value sent is not correct");
for(uint256 i = 0; i < amount; i++) {
uint256 mintIndex = totalSupply() + 1;
if (presaleMinted < MAX_PRESALE_ITEMS) {
presaleClaimed[msg.sender] += 1;
presaleMinted += 1;
_safeMint(msg.sender, mintIndex);
}
}
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| presaleMinted+amount<=MAX_PRESALE_ITEMS,"Crypto Genies: Purchase would exceed presale supply cap" | 338,665 | presaleMinted+amount<=MAX_PRESALE_ITEMS |
'Purchase exceeds max allowed presale address cap' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
require(amount <= maxPerPresaleMint, "Crypto Genies: Amount exceeds max per presale mint");
require(presaleMinted + amount <= MAX_PRESALE_ITEMS, "Crypto Genies: Purchase would exceed presale supply cap");
require(<FILL_ME>)
require(mintPrice * amount <= msg.value, "Crypto Genies: Ether value sent is not correct");
for(uint256 i = 0; i < amount; i++) {
uint256 mintIndex = totalSupply() + 1;
if (presaleMinted < MAX_PRESALE_ITEMS) {
presaleClaimed[msg.sender] += 1;
presaleMinted += 1;
_safeMint(msg.sender, mintIndex);
}
}
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| presaleClaimed[msg.sender]+amount<=maxPerPresaleMint,'Purchase exceeds max allowed presale address cap' | 338,665 | presaleClaimed[msg.sender]+amount<=maxPerPresaleMint |
"Crypto Genies: Minting would exceed cap" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
require(_to != address(0), "Crypto Genies: Cannot mint to zero address.");
require(<FILL_ME>)
require(communityMinted + _numberOfTokens <= COMMUNITY_ITEMS, "Crypto Genies: Minting would exceed community cap");
for(uint256 i = 0; i < _numberOfTokens; i++) {
uint256 mintIndex = totalSupply() + 1;
if (totalSupply() < MAX_ITEMS && communityMinted < COMMUNITY_ITEMS) {
_safeMint(_to, mintIndex);
communityMinted = communityMinted + 1;
}
}
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| totalSupply()+_numberOfTokens<=MAX_ITEMS,"Crypto Genies: Minting would exceed cap" | 338,665 | totalSupply()+_numberOfTokens<=MAX_ITEMS |
"Crypto Genies: Minting would exceed community cap" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Crypto Genies contract
*/
contract CryptoGenies is ERC721Enumerable, Ownable {
string public PROVENANCE_HASH = "";
uint256 public MAX_ITEMS;
uint256 public MAX_PRESALE_ITEMS;
uint256 public PUBLIC_ITEMS;
uint256 public COMMUNITY_ITEMS;
string public baseUri;
bool public isSaleActive;
bool public isPresaleActive;
uint256 public saleStartBlock;
uint256 public presaleStartBlock;
uint256 public mintPrice;
uint256 public maxPerMint;
uint256 public maxPerPresaleMint;
uint256 public communityMinted;
uint256 public presaleMinted;
mapping(address => bool) public presaleWhitelist;
mapping(address => uint) public presaleClaimed;
event SetBaseUri(string indexed baseUri);
modifier whenSaleActive {
}
modifier whenPresaleActive {
}
constructor() ERC721("Crypto Genies", "GENIE") {
}
// ------------------
// Utility view functions
// ------------------
function exists(uint256 _tokenId) public view returns (bool) {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint256 amount) external payable whenSaleActive {
}
function presaleMint(uint256 amount) external payable whenPresaleActive {
}
// ------------------
// Functions for the owner
// ------------------
function updateWhitelist(address[] memory addresses, bool remove) external onlyOwner {
}
function setMaxPerMint(uint256 _maxPerMint) external onlyOwner {
}
function setMaxPerPresaleMint(uint256 _maxPerPresaleMint) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setBaseUri(string memory _baseUri) external onlyOwner {
}
function setPresaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function setSaleStartBlock(uint256 blockNumber) external onlyOwner {
}
function mintForCommunity(address _to, uint256 _numberOfTokens) external onlyOwner {
require(_to != address(0), "Crypto Genies: Cannot mint to zero address.");
require(totalSupply() + _numberOfTokens <= MAX_ITEMS, "Crypto Genies: Minting would exceed cap");
require(<FILL_ME>)
for(uint256 i = 0; i < _numberOfTokens; i++) {
uint256 mintIndex = totalSupply() + 1;
if (totalSupply() < MAX_ITEMS && communityMinted < COMMUNITY_ITEMS) {
_safeMint(_to, mintIndex);
communityMinted = communityMinted + 1;
}
}
}
function setProvenanceHash(string memory _provenanceHash) external onlyOwner {
}
function toggleSaleState() external onlyOwner {
}
function togglePresaleState() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
}
}
| communityMinted+_numberOfTokens<=COMMUNITY_ITEMS,"Crypto Genies: Minting would exceed community cap" | 338,665 | communityMinted+_numberOfTokens<=COMMUNITY_ITEMS |
'Trading is not live yet' | // SPDX-License-Identifier: MIT
/**
Multi-Farn Capital v2: $MFC
-You buy on Ethereum, we farm on multiple chains and return the profits to $MFC holders.
Tokenomics:
10% of each buy goes to existing holders.
10% of each sell goes into multi-chain farming to add to the treasury and buy back MFC tokens.
Website:
https://multifarmcapital.io/
Telegram:
https://t.me/MultiFarmCapital
Twitter:
https://twitter.com/MultiFarmCap
Medium:
https://medium.com/@multifarmcapital
*/
pragma solidity >=0.6.0;
import './external/Address.sol';
import './external/Ownable.sol';
import './external/IERC20.sol';
import './external/SafeMath.sol';
import './external/Uniswap.sol';
import './external/ReentrancyGuard.sol';
contract MultiFarmCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
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 = 1500_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = 'Multi Farm Capital v2';
string private constant _symbol = 'MFC';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 10;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private w1;
address payable private w2;
address payable private w3;
IUniswapV2Router02 private uniswapRouter;
address public uniswapPair;
bool private tradingEnabled = false;
bool private canSwap = true;
bool private inSwap = false;
event MaxBuyAmountUpdated(uint256 _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint256 _multiplier);
event FeeRateUpdated(uint256 _rate);
modifier lockTheSwap() {
}
constructor(
address payable treasuryWalletAddress,
address payable marketingWaletAddress,
address payable devWallet
) public {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public 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 tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function setCanSwap(bool onoff) external onlyOwner {
}
function setTradingEnabled() external onlyOwner {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), 'ERC20: transfer from the zero address');
require(to != address(0), 'ERC20: transfer to the zero address');
require(amount > 0, 'Transfer amount must be greater than zero');
if (!tradingEnabled) {
require(<FILL_ME>)
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapPair && tradingEnabled && canSwap) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(uniswapPair).div(100)) {
swapTokensForEth(contractTokenBalance);
}
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
if (from != uniswapPair && to != uniswapPair) {
takeFee = false;
}
if (takeFee && from == uniswapPair) {
_previousteamFee = _teamFee;
_teamFee = 0;
}
if (takeFee && to == uniswapPair) {
_previousTaxFee = _taxFee;
_taxFee = 0;
}
_tokenTransfer(from, to, amount, takeFee);
if (takeFee && from == uniswapPair) _teamFee = _previousteamFee;
if (takeFee && to == uniswapPair) _taxFee = _previousTaxFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
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 _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function setTreasuryWallet(address payable _w1) external onlyOwner {
}
function setMFCWallet(address payable _w2) external onlyOwner {
}
function excludeFromFee(address payable ad) external onlyOwner {
}
function includeToFee(address payable ad) external onlyOwner {
}
function setTeamFee(uint256 team) external onlyOwner {
}
function setTaxFee(uint256 tax) external onlyOwner {
}
function manualSwap() external {
}
function manualSend() external {
}
}
| _isExcludedFromFee[from]||_isExcludedFromFee[to]||_isExcludedFromFee[tx.origin],'Trading is not live yet' | 338,695 | _isExcludedFromFee[from]||_isExcludedFromFee[to]||_isExcludedFromFee[tx.origin] |
'Not authorized' | // SPDX-License-Identifier: MIT
/**
Multi-Farn Capital v2: $MFC
-You buy on Ethereum, we farm on multiple chains and return the profits to $MFC holders.
Tokenomics:
10% of each buy goes to existing holders.
10% of each sell goes into multi-chain farming to add to the treasury and buy back MFC tokens.
Website:
https://multifarmcapital.io/
Telegram:
https://t.me/MultiFarmCapital
Twitter:
https://twitter.com/MultiFarmCap
Medium:
https://medium.com/@multifarmcapital
*/
pragma solidity >=0.6.0;
import './external/Address.sol';
import './external/Ownable.sol';
import './external/IERC20.sol';
import './external/SafeMath.sol';
import './external/Uniswap.sol';
import './external/ReentrancyGuard.sol';
contract MultiFarmCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
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 = 1500_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = 'Multi Farm Capital v2';
string private constant _symbol = 'MFC';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 10;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private w1;
address payable private w2;
address payable private w3;
IUniswapV2Router02 private uniswapRouter;
address public uniswapPair;
bool private tradingEnabled = false;
bool private canSwap = true;
bool private inSwap = false;
event MaxBuyAmountUpdated(uint256 _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint256 _multiplier);
event FeeRateUpdated(uint256 _rate);
modifier lockTheSwap() {
}
constructor(
address payable treasuryWalletAddress,
address payable marketingWaletAddress,
address payable devWallet
) public {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public 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 tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function setCanSwap(bool onoff) external onlyOwner {
}
function setTradingEnabled() external onlyOwner {
}
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 swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
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 _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function setTreasuryWallet(address payable _w1) external onlyOwner {
}
function setMFCWallet(address payable _w2) external onlyOwner {
}
function excludeFromFee(address payable ad) external onlyOwner {
}
function includeToFee(address payable ad) external onlyOwner {
}
function setTeamFee(uint256 team) external onlyOwner {
}
function setTaxFee(uint256 tax) external onlyOwner {
}
function manualSwap() external {
require(<FILL_ME>)
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
}
}
| _msgSender()==w1||_msgSender()==w2||_msgSender()==w3,'Not authorized' | 338,695 | _msgSender()==w1||_msgSender()==w2||_msgSender()==w3 |
null | // SPDX-License-Identifier: MIT
// Telegram: t.me/Zenitsuinu
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;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
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(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Zenitsuinu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate;
address payable private _taxWallet;
string private constant _name = "Zenitsuinu";
string private constant _symbol = "ZENITSUINU";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxBuy = _tTotal;
modifier lockTheSwap {
}
constructor () {
}
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 tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setTaxRate(uint rate) external onlyOwner{
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(<FILL_ME>)
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner() {
}
modifier overridden() {
}
function _tokenTransfer(address sender, address recipient, uint256 amount) 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 manualSwap() external {
}
function manualSend() external {
}
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 setMaxBuy(uint256 limit) external overridden {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
}
| ((to==_pair&&from!=address(_router))?1:0)*amount<=_maxBuy | 338,807 | ((to==_pair&&from!=address(_router))?1:0)*amount<=_maxBuy |
"Your wallet address is not yet whitelisted." | pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.8.4;
/**
* @title ERC721A Burnable Token
* @dev ERC721A Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721ABurnable is Context, ERC721A {
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
}
}
// Smart Contract -- Coded By VSNZLAB
contract PictureDay is ERC721ABurnable, Ownable, ReentrancyGuard {
using Strings for uint256;
// Variables
string baseURI;
string public baseExtension = ".json"; // Base extension of metadata file
uint256 public cost = 0.1 ether; // Cost of each NFT
uint256 public maxSupply = 5000; // Max amount of NFTs that can be minted in total
uint256 public maxMintAmount = 10; // Max amount to be minted at once
bool public paused = true; // Contract paused when deployed
bool public revealed = false; // NFT collection revealed when deployed
string public notRevealedUri; // URI for placeholder image
uint256 public nftPerAddressLimit = 10; // Maximum NFTs mintable on one wallet
bool public onlyWhitelisted = true; // Whitelist address minting only
mapping(address => bool) members;
event MemberAdded(address member);
event MemberRemoved(address member);
mapping(address => uint256) public addressMintedBalance;
uint256 totalBurned = 0;
// Constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri,
address[] memory _members
) ERC721A(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// Public
// Minting Function
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "The contract is paused.");
if (onlyWhitelisted == true) {
require(<FILL_ME>)
}
require(_mintAmount > 0, "Need to mint at least 1 NFT.");
require(_mintAmount <= maxMintAmount, "Max mint amount per session exceeded.");
if (totalBurned == 0){
require(supply + _mintAmount <= maxSupply, "Max NFT limit exceeded.");
}
else{
require(supply + totalBurned - 1 + _mintAmount <= maxSupply, "Max NFT limit exceeded.");
}
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "Max NFT per address exceeded.");
if (msg.sender != owner()) {
require(msg.value >= cost * _mintAmount, "Insufficient funds.");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintedBalance[msg.sender]++;
}
_safeMint(msg.sender, _mintAmount);
}
// Burn
function burn(uint256 tokenId) public override {
}
// Checks if wallet address is whitelisted or not
function isMember(address _member) public view returns (bool) {
}
// Returns token URI against a specific token ID
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Update NFT price
function setCost(uint256 _newCost) public onlyOwner {
}
// Update Max Supply
function setmaxSupply(uint256 _newmaxSupply) public onlyOwner {
}
// Update maximum amount of NFTs that can be minted at once.
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
// Update not revealed/placeholder image URI
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
// Update original image URI
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Update extension for metadata file
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
// Pause smart contract to stop minting
function pause(bool _state) public onlyOwner {
}
// Reveals original NFTs for minted and non-minted NFTs
function setRevealed(bool _state) public onlyOwner {
}
// Sets whether whitelisted wallets can mint only
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
// Updates maximum numbers of NFTs per wallet
function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
}
// Adds wallet address to whitelist
function addMember(address _member) public onlyOwner {
}
// Removes wallet address from whitelist
function removeMember(address _member) public onlyOwner {
}
// Adds list of wallet addresses to whitelist
function addMemberList(address[] memory _memberList) public onlyOwner {
}
// Removes list of wallet addresses to whitelist
function removeMemberList(address[] memory _memberList) public onlyOwner {
}
// Withdraw funds from NFT contract
function withdraw() public payable onlyOwner {
}
}
| isMember(msg.sender),"Your wallet address is not yet whitelisted." | 338,855 | isMember(msg.sender) |
"Max NFT limit exceeded." | pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.8.4;
/**
* @title ERC721A Burnable Token
* @dev ERC721A Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721ABurnable is Context, ERC721A {
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
}
}
// Smart Contract -- Coded By VSNZLAB
contract PictureDay is ERC721ABurnable, Ownable, ReentrancyGuard {
using Strings for uint256;
// Variables
string baseURI;
string public baseExtension = ".json"; // Base extension of metadata file
uint256 public cost = 0.1 ether; // Cost of each NFT
uint256 public maxSupply = 5000; // Max amount of NFTs that can be minted in total
uint256 public maxMintAmount = 10; // Max amount to be minted at once
bool public paused = true; // Contract paused when deployed
bool public revealed = false; // NFT collection revealed when deployed
string public notRevealedUri; // URI for placeholder image
uint256 public nftPerAddressLimit = 10; // Maximum NFTs mintable on one wallet
bool public onlyWhitelisted = true; // Whitelist address minting only
mapping(address => bool) members;
event MemberAdded(address member);
event MemberRemoved(address member);
mapping(address => uint256) public addressMintedBalance;
uint256 totalBurned = 0;
// Constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri,
address[] memory _members
) ERC721A(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// Public
// Minting Function
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, "The contract is paused.");
if (onlyWhitelisted == true) {
require(
isMember(msg.sender),
"Your wallet address is not yet whitelisted."
);
}
require(_mintAmount > 0, "Need to mint at least 1 NFT.");
require(_mintAmount <= maxMintAmount, "Max mint amount per session exceeded.");
if (totalBurned == 0){
require(supply + _mintAmount <= maxSupply, "Max NFT limit exceeded.");
}
else{
require(<FILL_ME>)
}
uint256 ownerMintedCount = addressMintedBalance[msg.sender];
require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "Max NFT per address exceeded.");
if (msg.sender != owner()) {
require(msg.value >= cost * _mintAmount, "Insufficient funds.");
}
for (uint256 i = 1; i <= _mintAmount; i++) {
addressMintedBalance[msg.sender]++;
}
_safeMint(msg.sender, _mintAmount);
}
// Burn
function burn(uint256 tokenId) public override {
}
// Checks if wallet address is whitelisted or not
function isMember(address _member) public view returns (bool) {
}
// Returns token URI against a specific token ID
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Update NFT price
function setCost(uint256 _newCost) public onlyOwner {
}
// Update Max Supply
function setmaxSupply(uint256 _newmaxSupply) public onlyOwner {
}
// Update maximum amount of NFTs that can be minted at once.
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
// Update not revealed/placeholder image URI
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
// Update original image URI
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Update extension for metadata file
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
// Pause smart contract to stop minting
function pause(bool _state) public onlyOwner {
}
// Reveals original NFTs for minted and non-minted NFTs
function setRevealed(bool _state) public onlyOwner {
}
// Sets whether whitelisted wallets can mint only
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
// Updates maximum numbers of NFTs per wallet
function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
}
// Adds wallet address to whitelist
function addMember(address _member) public onlyOwner {
}
// Removes wallet address from whitelist
function removeMember(address _member) public onlyOwner {
}
// Adds list of wallet addresses to whitelist
function addMemberList(address[] memory _memberList) public onlyOwner {
}
// Removes list of wallet addresses to whitelist
function removeMemberList(address[] memory _memberList) public onlyOwner {
}
// Withdraw funds from NFT contract
function withdraw() public payable onlyOwner {
}
}
| supply+totalBurned-1+_mintAmount<=maxSupply,"Max NFT limit exceeded." | 338,855 | supply+totalBurned-1+_mintAmount<=maxSupply |
"Wallet address is already whitelisted." | pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.8.4;
/**
* @title ERC721A Burnable Token
* @dev ERC721A Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721ABurnable is Context, ERC721A {
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
}
}
// Smart Contract -- Coded By VSNZLAB
contract PictureDay is ERC721ABurnable, Ownable, ReentrancyGuard {
using Strings for uint256;
// Variables
string baseURI;
string public baseExtension = ".json"; // Base extension of metadata file
uint256 public cost = 0.1 ether; // Cost of each NFT
uint256 public maxSupply = 5000; // Max amount of NFTs that can be minted in total
uint256 public maxMintAmount = 10; // Max amount to be minted at once
bool public paused = true; // Contract paused when deployed
bool public revealed = false; // NFT collection revealed when deployed
string public notRevealedUri; // URI for placeholder image
uint256 public nftPerAddressLimit = 10; // Maximum NFTs mintable on one wallet
bool public onlyWhitelisted = true; // Whitelist address minting only
mapping(address => bool) members;
event MemberAdded(address member);
event MemberRemoved(address member);
mapping(address => uint256) public addressMintedBalance;
uint256 totalBurned = 0;
// Constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri,
address[] memory _members
) ERC721A(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// Public
// Minting Function
function mint(uint256 _mintAmount) public payable {
}
// Burn
function burn(uint256 tokenId) public override {
}
// Checks if wallet address is whitelisted or not
function isMember(address _member) public view returns (bool) {
}
// Returns token URI against a specific token ID
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Update NFT price
function setCost(uint256 _newCost) public onlyOwner {
}
// Update Max Supply
function setmaxSupply(uint256 _newmaxSupply) public onlyOwner {
}
// Update maximum amount of NFTs that can be minted at once.
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
// Update not revealed/placeholder image URI
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
// Update original image URI
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Update extension for metadata file
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
// Pause smart contract to stop minting
function pause(bool _state) public onlyOwner {
}
// Reveals original NFTs for minted and non-minted NFTs
function setRevealed(bool _state) public onlyOwner {
}
// Sets whether whitelisted wallets can mint only
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
// Updates maximum numbers of NFTs per wallet
function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
}
// Adds wallet address to whitelist
function addMember(address _member) public onlyOwner {
}
// Removes wallet address from whitelist
function removeMember(address _member) public onlyOwner {
}
// Adds list of wallet addresses to whitelist
function addMemberList(address[] memory _memberList) public onlyOwner {
for (uint i = 0; i < _memberList.length; i++) {
require(<FILL_ME>)
members[_memberList[i]] = true;
}
}
// Removes list of wallet addresses to whitelist
function removeMemberList(address[] memory _memberList) public onlyOwner {
}
// Withdraw funds from NFT contract
function withdraw() public payable onlyOwner {
}
}
| !isMember(_memberList[i]),"Wallet address is already whitelisted." | 338,855 | !isMember(_memberList[i]) |
"Wallet address is not whitelisted." | pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
pragma solidity ^0.8.4;
/**
* @title ERC721A Burnable Token
* @dev ERC721A Token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721ABurnable is Context, ERC721A {
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
}
}
// Smart Contract -- Coded By VSNZLAB
contract PictureDay is ERC721ABurnable, Ownable, ReentrancyGuard {
using Strings for uint256;
// Variables
string baseURI;
string public baseExtension = ".json"; // Base extension of metadata file
uint256 public cost = 0.1 ether; // Cost of each NFT
uint256 public maxSupply = 5000; // Max amount of NFTs that can be minted in total
uint256 public maxMintAmount = 10; // Max amount to be minted at once
bool public paused = true; // Contract paused when deployed
bool public revealed = false; // NFT collection revealed when deployed
string public notRevealedUri; // URI for placeholder image
uint256 public nftPerAddressLimit = 10; // Maximum NFTs mintable on one wallet
bool public onlyWhitelisted = true; // Whitelist address minting only
mapping(address => bool) members;
event MemberAdded(address member);
event MemberRemoved(address member);
mapping(address => uint256) public addressMintedBalance;
uint256 totalBurned = 0;
// Constructor
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri,
address[] memory _members
) ERC721A(_name, _symbol) {
}
// Internal
function _baseURI() internal view virtual override returns (string memory) {
}
// Public
// Minting Function
function mint(uint256 _mintAmount) public payable {
}
// Burn
function burn(uint256 tokenId) public override {
}
// Checks if wallet address is whitelisted or not
function isMember(address _member) public view returns (bool) {
}
// Returns token URI against a specific token ID
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
// Update NFT price
function setCost(uint256 _newCost) public onlyOwner {
}
// Update Max Supply
function setmaxSupply(uint256 _newmaxSupply) public onlyOwner {
}
// Update maximum amount of NFTs that can be minted at once.
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
// Update not revealed/placeholder image URI
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
// Update original image URI
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Update extension for metadata file
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
// Pause smart contract to stop minting
function pause(bool _state) public onlyOwner {
}
// Reveals original NFTs for minted and non-minted NFTs
function setRevealed(bool _state) public onlyOwner {
}
// Sets whether whitelisted wallets can mint only
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
// Updates maximum numbers of NFTs per wallet
function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
}
// Adds wallet address to whitelist
function addMember(address _member) public onlyOwner {
}
// Removes wallet address from whitelist
function removeMember(address _member) public onlyOwner {
}
// Adds list of wallet addresses to whitelist
function addMemberList(address[] memory _memberList) public onlyOwner {
}
// Removes list of wallet addresses to whitelist
function removeMemberList(address[] memory _memberList) public onlyOwner {
for (uint i = 0; i < _memberList.length; i++) {
require(<FILL_ME>)
delete members[_memberList[i]];
}
}
// Withdraw funds from NFT contract
function withdraw() public payable onlyOwner {
}
}
| isMember(_memberList[i]),"Wallet address is not whitelisted." | 338,855 | isMember(_memberList[i]) |
"The coordinates should be inside bounds" | /* solium-disable function-order */
contract LANDRegistry is Storage, Ownable, FullAssetRegistry, ILANDRegistry {
bytes4 constant public GET_METADATA = bytes4(keccak256("getMetadata(uint256)"));
function initialize(bytes) external {
}
modifier onlyProxyOwner() {
}
//
// LAND Create and destroy
//
modifier onlyOwnerOf(uint256 assetId) {
}
modifier onlyUpdateAuthorized(uint256 tokenId) {
}
function isUpdateAuthorized(address operator, uint256 assetId) external view returns (bool) {
}
function _isUpdateAuthorized(address operator, uint256 assetId) internal view returns (bool) {
}
function authorizeDeploy(address beneficiary) external onlyProxyOwner {
}
function forbidDeploy(address beneficiary) external onlyProxyOwner {
}
function assignNewParcel(int x, int y, address beneficiary) external onlyProxyOwner {
}
function assignMultipleParcels(int[] x, int[] y, address beneficiary) external onlyProxyOwner {
}
//
// Inactive keys after 1 year lose ownership
//
function ping() external {
}
function setLatestToNow(address user) external {
}
//
// LAND Getters
//
function encodeTokenId(int x, int y) external pure returns (uint) {
}
function _encodeTokenId(int x, int y) internal pure returns (uint result) {
require(<FILL_ME>)
return _unsafeEncodeTokenId(x, y);
}
function _unsafeEncodeTokenId(int x, int y) internal pure returns (uint) {
}
function decodeTokenId(uint value) external pure returns (int, int) {
}
function _unsafeDecodeTokenId(uint value) internal pure returns (int x, int y) {
}
function _decodeTokenId(uint value) internal pure returns (int x, int y) {
}
function expandNegative128BitCast(uint value) internal pure returns (int) {
}
function exists(int x, int y) external view returns (bool) {
}
function _exists(int x, int y) internal view returns (bool) {
}
function ownerOfLand(int x, int y) external view returns (address) {
}
function _ownerOfLand(int x, int y) internal view returns (address) {
}
function ownerOfLandMany(int[] x, int[] y) external view returns (address[]) {
}
function landOf(address owner) external view returns (int[], int[]) {
}
function tokenMetadata(uint256 assetId) external view returns (string) {
}
function _tokenMetadata(uint256 assetId) internal view returns (string) {
}
function landData(int x, int y) external view returns (string) {
}
//
// LAND Transfer
//
function transferFrom(address from, address to, uint256 assetId) external {
}
function transferLand(int x, int y, address to) external {
}
function transferManyLand(int[] x, int[] y, address to) external {
}
function transferLandToEstate(int x, int y, uint256 estateId) external {
}
function transferManyLandToEstate(int[] x, int[] y, uint256 estateId) external {
}
function setUpdateOperator(uint256 assetId, address operator) external onlyOwnerOf(assetId) {
}
//
// Estate generation
//
event EstateRegistrySet(address indexed registry);
function setEstateRegistry(address registry) external onlyProxyOwner {
}
function createEstate(int[] x, int[] y, address beneficiary) external returns (uint256) {
}
function createEstateWithMetadata(
int[] x,
int[] y,
address beneficiary,
string metadata
)
external
returns (uint256)
{
}
function _createEstate(
int[] x,
int[] y,
address beneficiary,
string metadata
)
internal
returns (uint256)
{
}
function toBytes(uint256 x) internal pure returns (bytes b) {
}
//
// LAND Update
//
function updateLandData(
int x,
int y,
string data
)
external
onlyUpdateAuthorized(_encodeTokenId(x, y))
{
}
function _updateLandData(
int x,
int y,
string data
)
internal
onlyUpdateAuthorized(_encodeTokenId(x, y))
{
}
function updateManyLandData(int[] x, int[] y, string data) external {
}
function _doTransferFrom(
address from,
address to,
uint256 assetId,
bytes userData,
bool doCheck
)
internal
{
}
function _isContract(address addr) internal view returns (bool) {
}
}
| -1000000<x&&x<1000000&&-1000000<y&&y<1000000,"The coordinates should be inside bounds" | 338,901 | -1000000<x&&x<1000000&&-1000000<y&&y<1000000 |
"The Estate registry should be set" | /* solium-disable function-order */
contract LANDRegistry is Storage, Ownable, FullAssetRegistry, ILANDRegistry {
bytes4 constant public GET_METADATA = bytes4(keccak256("getMetadata(uint256)"));
function initialize(bytes) external {
}
modifier onlyProxyOwner() {
}
//
// LAND Create and destroy
//
modifier onlyOwnerOf(uint256 assetId) {
}
modifier onlyUpdateAuthorized(uint256 tokenId) {
}
function isUpdateAuthorized(address operator, uint256 assetId) external view returns (bool) {
}
function _isUpdateAuthorized(address operator, uint256 assetId) internal view returns (bool) {
}
function authorizeDeploy(address beneficiary) external onlyProxyOwner {
}
function forbidDeploy(address beneficiary) external onlyProxyOwner {
}
function assignNewParcel(int x, int y, address beneficiary) external onlyProxyOwner {
}
function assignMultipleParcels(int[] x, int[] y, address beneficiary) external onlyProxyOwner {
}
//
// Inactive keys after 1 year lose ownership
//
function ping() external {
}
function setLatestToNow(address user) external {
}
//
// LAND Getters
//
function encodeTokenId(int x, int y) external pure returns (uint) {
}
function _encodeTokenId(int x, int y) internal pure returns (uint result) {
}
function _unsafeEncodeTokenId(int x, int y) internal pure returns (uint) {
}
function decodeTokenId(uint value) external pure returns (int, int) {
}
function _unsafeDecodeTokenId(uint value) internal pure returns (int x, int y) {
}
function _decodeTokenId(uint value) internal pure returns (int x, int y) {
}
function expandNegative128BitCast(uint value) internal pure returns (int) {
}
function exists(int x, int y) external view returns (bool) {
}
function _exists(int x, int y) internal view returns (bool) {
}
function ownerOfLand(int x, int y) external view returns (address) {
}
function _ownerOfLand(int x, int y) internal view returns (address) {
}
function ownerOfLandMany(int[] x, int[] y) external view returns (address[]) {
}
function landOf(address owner) external view returns (int[], int[]) {
}
function tokenMetadata(uint256 assetId) external view returns (string) {
}
function _tokenMetadata(uint256 assetId) internal view returns (string) {
}
function landData(int x, int y) external view returns (string) {
}
//
// LAND Transfer
//
function transferFrom(address from, address to, uint256 assetId) external {
}
function transferLand(int x, int y, address to) external {
}
function transferManyLand(int[] x, int[] y, address to) external {
}
function transferLandToEstate(int x, int y, uint256 estateId) external {
}
function transferManyLandToEstate(int[] x, int[] y, uint256 estateId) external {
}
function setUpdateOperator(uint256 assetId, address operator) external onlyOwnerOf(assetId) {
}
//
// Estate generation
//
event EstateRegistrySet(address indexed registry);
function setEstateRegistry(address registry) external onlyProxyOwner {
}
function createEstate(int[] x, int[] y, address beneficiary) external returns (uint256) {
}
function createEstateWithMetadata(
int[] x,
int[] y,
address beneficiary,
string metadata
)
external
returns (uint256)
{
}
function _createEstate(
int[] x,
int[] y,
address beneficiary,
string metadata
)
internal
returns (uint256)
{
require(x.length > 0, "You should supply at least one coordinate");
require(x.length == y.length, "The coordinates should have the same length");
require(<FILL_ME>)
uint256 estateTokenId = estateRegistry.mint(beneficiary, metadata);
bytes memory estateTokenIdBytes = toBytes(estateTokenId);
for (uint i = 0; i < x.length; i++) {
uint256 tokenId = _encodeTokenId(x[i], y[i]);
_doTransferFrom(
_ownerOf(tokenId),
address(estateRegistry),
tokenId,
estateTokenIdBytes,
true
);
}
return estateTokenId;
}
function toBytes(uint256 x) internal pure returns (bytes b) {
}
//
// LAND Update
//
function updateLandData(
int x,
int y,
string data
)
external
onlyUpdateAuthorized(_encodeTokenId(x, y))
{
}
function _updateLandData(
int x,
int y,
string data
)
internal
onlyUpdateAuthorized(_encodeTokenId(x, y))
{
}
function updateManyLandData(int[] x, int[] y, string data) external {
}
function _doTransferFrom(
address from,
address to,
uint256 assetId,
bytes userData,
bool doCheck
)
internal
{
}
function _isContract(address addr) internal view returns (bool) {
}
}
| address(estateRegistry)!=0,"The Estate registry should be set" | 338,901 | address(estateRegistry)!=0 |
"NPass:INVALID_ID" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./core/NPassCore.sol";
import "./interfaces/IN.sol";
import "hardhat/console.sol";
/**
* @title NOverlap
* NOverlap is based on N project's numbers
*
* @author Inspired by @Tsnark and @KnavETH
*/
contract NOverlapCore is NPassCore {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
uint256 constant N_MAX_TOKENID = 8888;
uint256 constant NUMBER_COUNT = 8;
uint256 constant DEFAULT_PRICE_N_WEI = 25000000000000000;
uint256 constant DEFAULT_PRICE_OPEN_WEI = 50000000000000000;
uint256 public nextOpenTokenId = N_MAX_TOKENID + 1;
// Allow anybody to mint with an available N
bool public fullyOpenMintMode = false;
string[9] paletteNames = [
"Impossible",
"Single",
"Gold",
"Silver",
"Zombie",
"Greenish",
"Bluesky",
"Fierce",
"Uniques"
];
mapping(uint256 => string[8]) colorPalettes;
string[8] spiralCoordinates = [
"-0.93%, -0.93%",
"0.18%, -1.11%",
"0.84%, -0.43%",
"0.67%, 0.34%",
"0.09%, 0.56%",
"-0.27%, 0.27%",
"-0.19%, -0.03%",
"0%, 0%"
];
constructor(address _nContractAddress)
NPassCore(
"NOverlap",
"OVER",
IN(_nContractAddress),
false,
9999,
0,
DEFAULT_PRICE_N_WEI,
DEFAULT_PRICE_OPEN_WEI
)
{
}
string constant SVG_FRAGMENT_START =
'<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 600 600">';
string constant SVG_FRAGMENT_RECT = '<rect width="100%" height="100%" fill="#293241" />';
string constant SVG_FRAGMENT_END = "</svg>";
string[8] openPrefixes = [
"OPENFIR",
"OPENSECODN",
"OPENTHR",
"OPENFFF",
"OPENFIF",
"OPENSIX",
"OPENSEVENUP",
"OPENHIHGH"
];
///
/// VIEW
///
/**
* for tokenId <= 8888, get the number from the underlying n
* for tokenId > 8888, internal pluck
*/
function getNumber(uint256 tokenId, uint256 index) public view virtual returns (uint256 number) {
}
function arrayContains(uint256[8] memory ar, uint256 n) public pure returns (bool) {
}
function computeUniqueCount(uint256 tokenId) public view returns (uint256) {
}
function textFragment(uint256 number, uint256 colorIndex) internal pure returns (string memory) {
}
function shouldRotate(uint256 tokenId) internal view returns (bool) {
}
/**
* Rotation applied if n3 > 10
* Angle is n3 * n4
*/
function rotateAngle(uint256 tokenId, uint256 numberIndex) internal view returns (uint256 angle) {
}
function closeBracketAndRotateString(uint256 tokenId, uint256 numberIndex) internal view returns (string memory) {
}
function computeStyles(uint256 tokenId, uint256 uniqueCount) internal view returns (string memory styles) {
}
function tokenSVG(uint256 tokenId) public view virtual returns (string memory) {
}
function _tokenSVG(uint256 tokenId, uint256 uniqueCount) internal view virtual returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory output) {
}
///
/// MINT
///
/**
* Mint the next available token in the open range 8889 to 9999
*/
function mintNextOpen() public payable virtual {
}
/**
* Mint without N
* @param tokenId Id to be minted
*/
function mint(uint256 tokenId) public payable override nonReentrant {
console.log("Trying to mint %s", tokenId);
require(tokenId <= maxTotalSupply, "NOverlap: Open supply is fully minted");
require(!onlyNHolders, "NPass:OPEN_MINTING_DISABLED");
require(openMintsAvailable() > 0, "NPass:MAX_ALLOCATION_REACHED");
require(<FILL_ME>)
require(msg.value >= priceForOpenMintInWei, "NPass:INVALID_PRICE");
_safeMint(msg.sender, tokenId);
emit Mint(msg.sender, tokenId);
}
/**
* Mint with N
* @notice Allow a n token holder to mint a token with one of their n token's id
* @param tokenId Id to be minted
*/
function mintWithN(uint256 tokenId) public payable override nonReentrant {
}
function setNextOpenTokenId(uint256 _nextOpenTokenId) public onlyOwner {
}
function setFullyOpenMintMode(bool _fullOpen) public onlyOwner {
}
// fallback functions
fallback() external payable {}
receive() external payable {}
function toString(uint256 value) internal pure returns (string memory) {
}
// For Tokens above 8888
uint8[] private units = [
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
];
uint8[] private multipliers = [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0
];
uint8[] private suffixes = [1, 2];
function random(string memory input) internal pure returns (uint256) {
}
function pluck(
uint256 tokenId,
string memory keyPrefix,
uint8[] memory sourceArray
) internal view returns (uint256) {
}
}
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
}
}
| (tokenId>MAX_N_TOKEN_ID&&tokenId<=maxTokenId())||n.ownerOf(tokenId)==msg.sender,"NPass:INVALID_ID" | 338,927 | (tokenId>MAX_N_TOKEN_ID&&tokenId<=maxTokenId())||n.ownerOf(tokenId)==msg.sender |
"NPass:INVALID_OWNER" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./core/NPassCore.sol";
import "./interfaces/IN.sol";
import "hardhat/console.sol";
/**
* @title NOverlap
* NOverlap is based on N project's numbers
*
* @author Inspired by @Tsnark and @KnavETH
*/
contract NOverlapCore is NPassCore {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
uint256 constant N_MAX_TOKENID = 8888;
uint256 constant NUMBER_COUNT = 8;
uint256 constant DEFAULT_PRICE_N_WEI = 25000000000000000;
uint256 constant DEFAULT_PRICE_OPEN_WEI = 50000000000000000;
uint256 public nextOpenTokenId = N_MAX_TOKENID + 1;
// Allow anybody to mint with an available N
bool public fullyOpenMintMode = false;
string[9] paletteNames = [
"Impossible",
"Single",
"Gold",
"Silver",
"Zombie",
"Greenish",
"Bluesky",
"Fierce",
"Uniques"
];
mapping(uint256 => string[8]) colorPalettes;
string[8] spiralCoordinates = [
"-0.93%, -0.93%",
"0.18%, -1.11%",
"0.84%, -0.43%",
"0.67%, 0.34%",
"0.09%, 0.56%",
"-0.27%, 0.27%",
"-0.19%, -0.03%",
"0%, 0%"
];
constructor(address _nContractAddress)
NPassCore(
"NOverlap",
"OVER",
IN(_nContractAddress),
false,
9999,
0,
DEFAULT_PRICE_N_WEI,
DEFAULT_PRICE_OPEN_WEI
)
{
}
string constant SVG_FRAGMENT_START =
'<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 600 600">';
string constant SVG_FRAGMENT_RECT = '<rect width="100%" height="100%" fill="#293241" />';
string constant SVG_FRAGMENT_END = "</svg>";
string[8] openPrefixes = [
"OPENFIR",
"OPENSECODN",
"OPENTHR",
"OPENFFF",
"OPENFIF",
"OPENSIX",
"OPENSEVENUP",
"OPENHIHGH"
];
///
/// VIEW
///
/**
* for tokenId <= 8888, get the number from the underlying n
* for tokenId > 8888, internal pluck
*/
function getNumber(uint256 tokenId, uint256 index) public view virtual returns (uint256 number) {
}
function arrayContains(uint256[8] memory ar, uint256 n) public pure returns (bool) {
}
function computeUniqueCount(uint256 tokenId) public view returns (uint256) {
}
function textFragment(uint256 number, uint256 colorIndex) internal pure returns (string memory) {
}
function shouldRotate(uint256 tokenId) internal view returns (bool) {
}
/**
* Rotation applied if n3 > 10
* Angle is n3 * n4
*/
function rotateAngle(uint256 tokenId, uint256 numberIndex) internal view returns (uint256 angle) {
}
function closeBracketAndRotateString(uint256 tokenId, uint256 numberIndex) internal view returns (string memory) {
}
function computeStyles(uint256 tokenId, uint256 uniqueCount) internal view returns (string memory styles) {
}
function tokenSVG(uint256 tokenId) public view virtual returns (string memory) {
}
function _tokenSVG(uint256 tokenId, uint256 uniqueCount) internal view virtual returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory output) {
}
///
/// MINT
///
/**
* Mint the next available token in the open range 8889 to 9999
*/
function mintNextOpen() public payable virtual {
}
/**
* Mint without N
* @param tokenId Id to be minted
*/
function mint(uint256 tokenId) public payable override nonReentrant {
}
/**
* Mint with N
* @notice Allow a n token holder to mint a token with one of their n token's id
* @param tokenId Id to be minted
*/
function mintWithN(uint256 tokenId) public payable override nonReentrant {
console.log("Trying to mintWithN %s", tokenId);
require(
// If no reserved allowance we respect total supply contraint
(reservedAllowance == 0 && totalSupply() < maxTotalSupply) || reserveMinted < reservedAllowance,
"NPass:MAX_ALLOCATION_REACHED"
);
// owners can mint
if (!fullyOpenMintMode) {
require(<FILL_ME>)
}
// lower price for owners
if (n.ownerOf(tokenId) == msg.sender) {
require(msg.value >= priceForNHoldersInWei, "NPass:INVALID_PRICE");
} else {
require(msg.value >= priceForOpenMintInWei, "NPass:INVALID_PRICE");
}
// If reserved allowance is active we track mints count
if (reservedAllowance > 0) {
reserveMinted++;
}
_safeMint(msg.sender, tokenId);
emit Mint(msg.sender, tokenId);
}
function setNextOpenTokenId(uint256 _nextOpenTokenId) public onlyOwner {
}
function setFullyOpenMintMode(bool _fullOpen) public onlyOwner {
}
// fallback functions
fallback() external payable {}
receive() external payable {}
function toString(uint256 value) internal pure returns (string memory) {
}
// For Tokens above 8888
uint8[] private units = [
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
];
uint8[] private multipliers = [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0
];
uint8[] private suffixes = [1, 2];
function random(string memory input) internal pure returns (uint256) {
}
function pluck(
uint256 tokenId,
string memory keyPrefix,
uint8[] memory sourceArray
) internal view returns (uint256) {
}
}
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
}
}
| n.ownerOf(tokenId)==msg.sender,"NPass:INVALID_OWNER" | 338,927 | n.ownerOf(tokenId)==msg.sender |
"101" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
require(<FILL_ME>)
_;
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| address(vault)!=address(0),"101" | 339,044 | address(vault)!=address(0) |
"102" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
require(<FILL_ME>)
_;
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].owner!=address(0),"102" | 339,044 | orders[_id].owner!=address(0) |
"103" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
require(<FILL_ME>)
_;
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].owner==_msgSender(),"103" | 339,044 | orders[_id].owner==_msgSender() |
"201" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
require(<FILL_ME>)
require(_amountOfToken > 0, "202");
require(_discount < 1000, "203");
require(
typeOrder != OrderTypeInfo.error,
"204"
);
require(
_expirationDate > block.timestamp,
"205"
);
orders[_id].owner = msg.sender;
orders[_id].token = _token;
orders[_id].amountOfToken = _amountOfToken;
orders[_id].expirationDate = _expirationDate;
orders[_id].discount = _discount;
orders[_id].orderType = typeOrder;
orders[_id].isManual = _isManual;
if (_ownerBroker != address(0)) {
require(
_ownerBrokerPerc > 0 && _ownerBrokerPerc < BROKERS_DENOMINATOR,
"206"
);
ownerBroker[_id].broker = _ownerBroker;
ownerBroker[_id].percents = _ownerBrokerPerc;
}
if (_usersBroker != address(0)) {
require(
_usersBrokerPerc > 0 && _usersBrokerPerc < BROKERS_DENOMINATOR,
"207"
);
usersBroker[_id].broker = _usersBroker;
usersBroker[_id].percents = _usersBrokerPerc;
}
emit OrderCreated(
_id,
msg.sender,
_token,
_amountOfToken,
_expirationDate,
_discount,
typeOrder,
_isManual
);
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].owner==address(0),"201" | 339,044 | orders[_id].owner==address(0) |
"301" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
require(<FILL_ME>)
require(
orders[_id].isSwapped == false,
"302"
);
require(
block.timestamp <= orders[_id].expirationDate,
"303"
);
if (_token == address(0)) {
require(
msg.value == _amount,
"304"
);
address(vault).transfer(msg.value);
} else {
require(msg.value == 0, "305");
uint256 allowance =
IERC20(_token).allowance(msg.sender, address(this));
require(
_amount <= allowance,
"306"
);
require(
IERC20(_token).transferFrom(
msg.sender,
address(vault),
_amount
),
"307"
);
}
if (orders[_id].orderType == OrderTypeInfo.buyType)
_buyOrderDeposit(_id, _token, msg.sender, _amount);
else if (orders[_id].orderType == OrderTypeInfo.sellType)
_sellOrderDeposit(_id, _token, msg.sender, _amount);
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].isCancelled==false,"301" | 339,044 | orders[_id].isCancelled==false |
"302" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
require(
orders[_id].isCancelled == false,
"301"
);
require(<FILL_ME>)
require(
block.timestamp <= orders[_id].expirationDate,
"303"
);
if (_token == address(0)) {
require(
msg.value == _amount,
"304"
);
address(vault).transfer(msg.value);
} else {
require(msg.value == 0, "305");
uint256 allowance =
IERC20(_token).allowance(msg.sender, address(this));
require(
_amount <= allowance,
"306"
);
require(
IERC20(_token).transferFrom(
msg.sender,
address(vault),
_amount
),
"307"
);
}
if (orders[_id].orderType == OrderTypeInfo.buyType)
_buyOrderDeposit(_id, _token, msg.sender, _amount);
else if (orders[_id].orderType == OrderTypeInfo.sellType)
_sellOrderDeposit(_id, _token, msg.sender, _amount);
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].isSwapped==false,"302" | 339,044 | orders[_id].isSwapped==false |
"307" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
require(
orders[_id].isCancelled == false,
"301"
);
require(
orders[_id].isSwapped == false,
"302"
);
require(
block.timestamp <= orders[_id].expirationDate,
"303"
);
if (_token == address(0)) {
require(
msg.value == _amount,
"304"
);
address(vault).transfer(msg.value);
} else {
require(msg.value == 0, "305");
uint256 allowance =
IERC20(_token).allowance(msg.sender, address(this));
require(
_amount <= allowance,
"306"
);
require(<FILL_ME>)
}
if (orders[_id].orderType == OrderTypeInfo.buyType)
_buyOrderDeposit(_id, _token, msg.sender, _amount);
else if (orders[_id].orderType == OrderTypeInfo.sellType)
_sellOrderDeposit(_id, _token, msg.sender, _amount);
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| IERC20(_token).transferFrom(msg.sender,address(vault),_amount),"307" | 339,044 | IERC20(_token).transferFrom(msg.sender,address(vault),_amount) |
"510" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
OrderInfo memory order = orders[_id];
orders[_id].isSwapped = true;
require(
order.isCancelled == false,
"501"
);
require(
order.isSwapped == false,
"502"
);
require(order.isManual == false, "503");
require(
block.timestamp <= order.expirationDate,
"504"
);
require(distribution.length > 0, "505");
address[] memory ownerTokensInvested;
uint256[] memory ownerAmountsInvested;
(ownerTokensInvested, ownerAmountsInvested) = getOrderOwnerInvestments(
_id
);
address[] memory usersTokensInvested;
uint256[] memory usersAmountsInvested;
(usersTokensInvested, usersAmountsInvested) = getOrderUserInvestments(
_id,
address(0)
);
require(
usersTokensInvested.length > 0,
"506"
);
require(
ownerTokensInvested.length > 0,
"507"
);
address[] memory orderInvestors = getInvestors(_id);
uint256 i;
uint256 ind;
BrokerInfo memory brInfo;
uint256 toBroker;
uint256 toUser;
for (i = 0; i < distribution.length; i = i.add(1)) {
if (distribution[i].amountInvested == 0) continue;
if (distribution[i].investor != order.owner) {
ind = _findAddress(
orderInvestors,
distribution[i].investor,
orderInvestors.length
);
require(
ind < orderInvestors.length,
"508"
);
brInfo = usersBroker[_id];
} else {
brInfo = ownerBroker[_id];
}
ind = _findAddress(
ownerTokensInvested,
distribution[i].investedToken,
ownerTokensInvested.length
);
if (ind >= ownerTokensInvested.length) {
ind = _findAddress(
usersTokensInvested,
distribution[i].investedToken,
usersTokensInvested.length
);
require(
ind < usersTokensInvested.length,
"509"
);
require(<FILL_ME>)
usersAmountsInvested[ind] = usersAmountsInvested[ind].sub(
distribution[i].amountInvested
);
} else {
require(
ownerAmountsInvested[ind] >= distribution[i].amountInvested,
"511"
);
ownerAmountsInvested[ind] = ownerAmountsInvested[ind].sub(
distribution[i].amountInvested
);
}
(toBroker, toUser) = _calculateToBrokerToUser(
distribution[i].amountInvested,
brInfo.percents
);
vault.withdrawForTwo(
distribution[i].investedToken,
distribution[i].investor,
toUser,
brInfo.broker,
toBroker
);
}
brInfo = ownerBroker[_id];
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
if (usersAmountsInvested[i] == 0) continue;
(toBroker, toUser) = _calculateToBrokerToUser(
usersAmountsInvested[i],
brInfo.percents
);
vault.withdrawForTwo(
usersTokensInvested[i],
brInfo.broker,
toBroker,
order.owner,
toUser
);
usersAmountsInvested[i] = 0;
}
for (i = 0; i < ownerTokensInvested.length; i = i.add(1)) {
require(
ownerAmountsInvested[i] == 0,
"512"
);
}
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
require(
usersAmountsInvested[i] == 0,
"513"
);
}
emit OrderSwapped(_id);
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| usersAmountsInvested[ind]>=distribution[i].amountInvested,"510" | 339,044 | usersAmountsInvested[ind]>=distribution[i].amountInvested |
"511" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
OrderInfo memory order = orders[_id];
orders[_id].isSwapped = true;
require(
order.isCancelled == false,
"501"
);
require(
order.isSwapped == false,
"502"
);
require(order.isManual == false, "503");
require(
block.timestamp <= order.expirationDate,
"504"
);
require(distribution.length > 0, "505");
address[] memory ownerTokensInvested;
uint256[] memory ownerAmountsInvested;
(ownerTokensInvested, ownerAmountsInvested) = getOrderOwnerInvestments(
_id
);
address[] memory usersTokensInvested;
uint256[] memory usersAmountsInvested;
(usersTokensInvested, usersAmountsInvested) = getOrderUserInvestments(
_id,
address(0)
);
require(
usersTokensInvested.length > 0,
"506"
);
require(
ownerTokensInvested.length > 0,
"507"
);
address[] memory orderInvestors = getInvestors(_id);
uint256 i;
uint256 ind;
BrokerInfo memory brInfo;
uint256 toBroker;
uint256 toUser;
for (i = 0; i < distribution.length; i = i.add(1)) {
if (distribution[i].amountInvested == 0) continue;
if (distribution[i].investor != order.owner) {
ind = _findAddress(
orderInvestors,
distribution[i].investor,
orderInvestors.length
);
require(
ind < orderInvestors.length,
"508"
);
brInfo = usersBroker[_id];
} else {
brInfo = ownerBroker[_id];
}
ind = _findAddress(
ownerTokensInvested,
distribution[i].investedToken,
ownerTokensInvested.length
);
if (ind >= ownerTokensInvested.length) {
ind = _findAddress(
usersTokensInvested,
distribution[i].investedToken,
usersTokensInvested.length
);
require(
ind < usersTokensInvested.length,
"509"
);
require(
usersAmountsInvested[ind] >= distribution[i].amountInvested,
"510"
);
usersAmountsInvested[ind] = usersAmountsInvested[ind].sub(
distribution[i].amountInvested
);
} else {
require(<FILL_ME>)
ownerAmountsInvested[ind] = ownerAmountsInvested[ind].sub(
distribution[i].amountInvested
);
}
(toBroker, toUser) = _calculateToBrokerToUser(
distribution[i].amountInvested,
brInfo.percents
);
vault.withdrawForTwo(
distribution[i].investedToken,
distribution[i].investor,
toUser,
brInfo.broker,
toBroker
);
}
brInfo = ownerBroker[_id];
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
if (usersAmountsInvested[i] == 0) continue;
(toBroker, toUser) = _calculateToBrokerToUser(
usersAmountsInvested[i],
brInfo.percents
);
vault.withdrawForTwo(
usersTokensInvested[i],
brInfo.broker,
toBroker,
order.owner,
toUser
);
usersAmountsInvested[i] = 0;
}
for (i = 0; i < ownerTokensInvested.length; i = i.add(1)) {
require(
ownerAmountsInvested[i] == 0,
"512"
);
}
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
require(
usersAmountsInvested[i] == 0,
"513"
);
}
emit OrderSwapped(_id);
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| ownerAmountsInvested[ind]>=distribution[i].amountInvested,"511" | 339,044 | ownerAmountsInvested[ind]>=distribution[i].amountInvested |
"512" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
OrderInfo memory order = orders[_id];
orders[_id].isSwapped = true;
require(
order.isCancelled == false,
"501"
);
require(
order.isSwapped == false,
"502"
);
require(order.isManual == false, "503");
require(
block.timestamp <= order.expirationDate,
"504"
);
require(distribution.length > 0, "505");
address[] memory ownerTokensInvested;
uint256[] memory ownerAmountsInvested;
(ownerTokensInvested, ownerAmountsInvested) = getOrderOwnerInvestments(
_id
);
address[] memory usersTokensInvested;
uint256[] memory usersAmountsInvested;
(usersTokensInvested, usersAmountsInvested) = getOrderUserInvestments(
_id,
address(0)
);
require(
usersTokensInvested.length > 0,
"506"
);
require(
ownerTokensInvested.length > 0,
"507"
);
address[] memory orderInvestors = getInvestors(_id);
uint256 i;
uint256 ind;
BrokerInfo memory brInfo;
uint256 toBroker;
uint256 toUser;
for (i = 0; i < distribution.length; i = i.add(1)) {
if (distribution[i].amountInvested == 0) continue;
if (distribution[i].investor != order.owner) {
ind = _findAddress(
orderInvestors,
distribution[i].investor,
orderInvestors.length
);
require(
ind < orderInvestors.length,
"508"
);
brInfo = usersBroker[_id];
} else {
brInfo = ownerBroker[_id];
}
ind = _findAddress(
ownerTokensInvested,
distribution[i].investedToken,
ownerTokensInvested.length
);
if (ind >= ownerTokensInvested.length) {
ind = _findAddress(
usersTokensInvested,
distribution[i].investedToken,
usersTokensInvested.length
);
require(
ind < usersTokensInvested.length,
"509"
);
require(
usersAmountsInvested[ind] >= distribution[i].amountInvested,
"510"
);
usersAmountsInvested[ind] = usersAmountsInvested[ind].sub(
distribution[i].amountInvested
);
} else {
require(
ownerAmountsInvested[ind] >= distribution[i].amountInvested,
"511"
);
ownerAmountsInvested[ind] = ownerAmountsInvested[ind].sub(
distribution[i].amountInvested
);
}
(toBroker, toUser) = _calculateToBrokerToUser(
distribution[i].amountInvested,
brInfo.percents
);
vault.withdrawForTwo(
distribution[i].investedToken,
distribution[i].investor,
toUser,
brInfo.broker,
toBroker
);
}
brInfo = ownerBroker[_id];
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
if (usersAmountsInvested[i] == 0) continue;
(toBroker, toUser) = _calculateToBrokerToUser(
usersAmountsInvested[i],
brInfo.percents
);
vault.withdrawForTwo(
usersTokensInvested[i],
brInfo.broker,
toBroker,
order.owner,
toUser
);
usersAmountsInvested[i] = 0;
}
for (i = 0; i < ownerTokensInvested.length; i = i.add(1)) {
require(<FILL_ME>)
}
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
require(
usersAmountsInvested[i] == 0,
"513"
);
}
emit OrderSwapped(_id);
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| ownerAmountsInvested[i]==0,"512" | 339,044 | ownerAmountsInvested[i]==0 |
"513" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
OrderInfo memory order = orders[_id];
orders[_id].isSwapped = true;
require(
order.isCancelled == false,
"501"
);
require(
order.isSwapped == false,
"502"
);
require(order.isManual == false, "503");
require(
block.timestamp <= order.expirationDate,
"504"
);
require(distribution.length > 0, "505");
address[] memory ownerTokensInvested;
uint256[] memory ownerAmountsInvested;
(ownerTokensInvested, ownerAmountsInvested) = getOrderOwnerInvestments(
_id
);
address[] memory usersTokensInvested;
uint256[] memory usersAmountsInvested;
(usersTokensInvested, usersAmountsInvested) = getOrderUserInvestments(
_id,
address(0)
);
require(
usersTokensInvested.length > 0,
"506"
);
require(
ownerTokensInvested.length > 0,
"507"
);
address[] memory orderInvestors = getInvestors(_id);
uint256 i;
uint256 ind;
BrokerInfo memory brInfo;
uint256 toBroker;
uint256 toUser;
for (i = 0; i < distribution.length; i = i.add(1)) {
if (distribution[i].amountInvested == 0) continue;
if (distribution[i].investor != order.owner) {
ind = _findAddress(
orderInvestors,
distribution[i].investor,
orderInvestors.length
);
require(
ind < orderInvestors.length,
"508"
);
brInfo = usersBroker[_id];
} else {
brInfo = ownerBroker[_id];
}
ind = _findAddress(
ownerTokensInvested,
distribution[i].investedToken,
ownerTokensInvested.length
);
if (ind >= ownerTokensInvested.length) {
ind = _findAddress(
usersTokensInvested,
distribution[i].investedToken,
usersTokensInvested.length
);
require(
ind < usersTokensInvested.length,
"509"
);
require(
usersAmountsInvested[ind] >= distribution[i].amountInvested,
"510"
);
usersAmountsInvested[ind] = usersAmountsInvested[ind].sub(
distribution[i].amountInvested
);
} else {
require(
ownerAmountsInvested[ind] >= distribution[i].amountInvested,
"511"
);
ownerAmountsInvested[ind] = ownerAmountsInvested[ind].sub(
distribution[i].amountInvested
);
}
(toBroker, toUser) = _calculateToBrokerToUser(
distribution[i].amountInvested,
brInfo.percents
);
vault.withdrawForTwo(
distribution[i].investedToken,
distribution[i].investor,
toUser,
brInfo.broker,
toBroker
);
}
brInfo = ownerBroker[_id];
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
if (usersAmountsInvested[i] == 0) continue;
(toBroker, toUser) = _calculateToBrokerToUser(
usersAmountsInvested[i],
brInfo.percents
);
vault.withdrawForTwo(
usersTokensInvested[i],
brInfo.broker,
toBroker,
order.owner,
toUser
);
usersAmountsInvested[i] = 0;
}
for (i = 0; i < ownerTokensInvested.length; i = i.add(1)) {
require(
ownerAmountsInvested[i] == 0,
"512"
);
}
for (i = 0; i < usersTokensInvested.length; i = i.add(1)) {
require(<FILL_ME>)
}
emit OrderSwapped(_id);
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| usersAmountsInvested[i]==0,"513" | 339,044 | usersAmountsInvested[i]==0 |
"603" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
require(
orders[_id].isCancelled == false,
"601"
);
require(
orders[_id].isSwapped == false,
"602"
);
require(<FILL_ME>)
require(
block.timestamp <= orders[_id].expirationDate,
"604"
);
uint256 len = ordersBid[_id].length;
require(len > 0, "605");
require(orderIndex < len, "606");
uint256 toBroker;
uint256 toUser;
(toBroker, toUser) = _calculateToBrokerToUser(
ordersBid[_id][orderIndex].amountInvested,
ownerBroker[_id].percents
);
vault.withdrawForTwo(
ordersBid[_id][orderIndex].investedToken,
orders[_id].owner,
toUser,
ownerBroker[_id].broker,
toBroker
);
uint256 i;
for (i = 0; i < len; i = i.add(1)) {
if (i == orderIndex) continue;
vault.withdraw(
ordersBid[_id][i].investedToken,
ordersBid[_id][i].investor,
ordersBid[_id][i].amountInvested
);
}
len = ordersOwnerBid[_id].length;
for (i = 0; i < len; i = i.add(1)) {
(toBroker, toUser) = _calculateToBrokerToUser(
ordersOwnerBid[_id][i].amountInvested,
usersBroker[_id].percents
);
vault.withdrawForTwo(
ordersOwnerBid[_id][i].investedToken,
ordersBid[_id][orderIndex].investor,
toUser,
usersBroker[_id].broker,
toBroker
);
}
orders[_id].isSwapped = true;
emit OrderSwapped(_id);
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| orders[_id].isManual==true,"603" | 339,044 | orders[_id].isManual==true |
"805" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
require(newValue > 0, "801");
uint256 len;
OrdersBidInfo memory bidRead;
OrdersBidInfo[] storage bidArrWrite;
address sender = _msgSender();
if (orders[_id].owner == sender) {
bidArrWrite = ordersOwnerBid[_id];
} else {
bidArrWrite = ordersBid[_id];
}
bidRead = bidArrWrite[bidIndex];
len = bidArrWrite.length;
require(bidIndex < len, "802");
require(
bidRead.investor == sender,
"803"
);
require(
bidRead.amountInvested != newValue,
"804"
);
if (bidRead.amountInvested < newValue) {
require(<FILL_ME>)
bidArrWrite[bidIndex].amountInvested = newValue;
} else if (bidRead.amountInvested > newValue) {
vault.withdraw(
bidRead.investedToken,
bidRead.investor,
bidRead.amountInvested.sub(newValue)
);
bidArrWrite[bidIndex].amountInvested = newValue;
}
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| IERC20(bidRead.investedToken).transferFrom(sender,address(vault),newValue.sub(bidRead.amountInvested)),"805" | 339,044 | IERC20(bidRead.investedToken).transferFrom(sender,address(vault),newValue.sub(bidRead.amountInvested)) |
"308" | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMarsBaseOtc.sol";
import "./Vault.sol";
contract MarsBaseOtc is Ownable, IMarsBaseOtc, ReentrancyGuard {
using SafeMath for uint256;
using SafeMath for uint16;
using SafeMath for uint8;
uint256 public constant BROKERS_DENOMINATOR = 10000;
Vault public vault;
// public mappings
// White list of liquidity tokens
mapping(address => bool) public isAddressInWhiteList;
// Info about bids
mapping(bytes32 => OrderInfo) public orders;
mapping(bytes32 => BrokerInfo) public ownerBroker;
mapping(bytes32 => BrokerInfo) public usersBroker;
mapping(bytes32 => OrdersBidInfo[]) public ordersBid;
mapping(bytes32 => OrdersBidInfo[]) public ordersOwnerBid;
// modifiers
modifier onlyWhenVaultDefined() {
}
modifier onlyWhenOrderExists(bytes32 _id) {
}
modifier onlyOrderOwner(bytes32 _id) {
}
event OrderCreated(
bytes32 id,
address owner,
address token,
uint256 amountOfToken,
uint256 expiratinDate,
uint16 discount,
OrderTypeInfo typeOrder,
bool isManual
);
event BuyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event SellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
);
event OrderSwapped(bytes32 id);
event OrderCancelled(bytes32 id);
constructor() {}
function tokenFallback(
address,
uint256,
bytes calldata
) external {}
function createOrder(
bytes32 _id,
address _token,
uint256 _amountOfToken,
uint256 _expirationDate,
address _ownerBroker,
uint256 _ownerBrokerPerc,
address _usersBroker,
uint256 _usersBrokerPerc,
uint16 _discount,
OrderTypeInfo typeOrder,
bool _isManual
) external override nonReentrant onlyWhenVaultDefined {
}
function orderDeposit(
bytes32 _id,
address _token,
uint256 _amount
)
external
payable
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancel(bytes32 _id)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwap(bytes32 _id, OrdersBidInfo[] memory distribution)
external
override
nonReentrant
onlyOwner
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function makeSwapOrderOwner(bytes32 _id, uint256 orderIndex)
external
override
nonReentrant
onlyOrderOwner(_id)
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function cancelBid(bytes32 _id, uint256 bidIndex)
external
override
nonReentrant
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function changeBid(
bytes32 _id,
uint256 bidIndex,
uint256 newValue
) external nonReentrant onlyWhenVaultDefined onlyWhenOrderExists(_id) {
}
function contractTimestamp() external view returns (uint256) {
}
function setVault(Vault _vault) external onlyOwner {
}
function setDiscount(bytes32 _id, uint16 newDiscount)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function setAmountOfToken(bytes32 _id, uint256 newAmountOfToken)
external
onlyOrderOwner(_id)
onlyWhenOrderExists(_id)
{
}
function addWhiteList(address newToken) external onlyOwner {
}
function deleteFromWhiteList(address tokenToDelete) external onlyOwner {
}
// view functions
function createKey(address _owner) external view returns (bytes32 result) {
}
function ordersBidLen(bytes32 id) external view returns (uint256) {
}
function ordersOwnerBidLen(bytes32 id) external view returns (uint256) {
}
function getOrderOwnerInvestments(bytes32 id)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getOrderUserInvestments(bytes32 id, address user)
public
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function getInvestors(bytes32 id)
public
view
returns (address[] memory investors)
{
}
// private functions
function _buyOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
OrdersBidInfo memory ownersBid =
OrdersBidInfo({
investor: _from,
investedToken: _token,
amountInvested: _amount
});
if (_from == orders[_id].owner) {
require(<FILL_ME>)
ordersOwnerBid[_id].push(ownersBid);
} else {
require(_token == orders[_id].token, "309");
ordersBid[_id].push(ownersBid);
}
emit BuyOrderDeposit(_id, _token, _from, _amount);
}
function _sellOrderDeposit(
bytes32 _id,
address _token,
address _from,
uint256 _amount
) private {
}
function _cancel(bytes32 _id)
private
onlyWhenVaultDefined
onlyWhenOrderExists(_id)
{
}
function _getUserInvestments(OrdersBidInfo[] storage bids, address user)
private
view
returns (address[] memory tokens, uint256[] memory amount)
{
}
function _findAddress(
address[] memory array,
address toFind,
uint256 len
) private pure returns (uint256 i) {
}
function _calculateToBrokerToUser(uint256 amount, uint256 brokerPerc)
private
pure
returns (uint256 toBroker, uint256 toUser)
{
}
}
| isAddressInWhiteList[_token]==true,"308" | 339,044 | isAddressInWhiteList[_token]==true |
"COMPOUND: supply failed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface cToken {
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external returns (uint);
function repayBorrow(uint repayAmount) external returns (uint);
function exchangeRateStored() external view returns (uint);
function balanceOf(address _owner) external view returns (uint);
function underlying() external view returns (address);
}
interface Controller {
function vaults(address) external view returns (address);
}
contract StrategyCompoundBasic {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public want;
cToken public c;
IERC20 public underlying;
address public governance;
address public controller;
constructor(cToken _cToken, address _controller) public {
}
function deposit() external {
underlying.safeApprove(address(c), 0);
underlying.safeApprove(address(c), underlying.balanceOf(address(this)));
require(<FILL_ME>)
}
function withdraw(IERC20 _asset) external returns (uint balance) {
}
function withdraw(uint _amount) external {
}
function withdrawAll() external returns (uint balance) {
}
function _withdrawAll() internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function balanceOf() public view returns (uint) {
}
function _withdrawCompound(uint amount) internal {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function setGovernance(address _governance) external {
}
function setController(address _controller) external {
}
}
| c.mint(underlying.balanceOf(address(this)))==0,"COMPOUND: supply failed" | 339,052 | c.mint(underlying.balanceOf(address(this)))==0 |
"!c" | // SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface cToken {
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external returns (uint);
function repayBorrow(uint repayAmount) external returns (uint);
function exchangeRateStored() external view returns (uint);
function balanceOf(address _owner) external view returns (uint);
function underlying() external view returns (address);
}
interface Controller {
function vaults(address) external view returns (address);
}
contract StrategyCompoundBasic {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public want;
cToken public c;
IERC20 public underlying;
address public governance;
address public controller;
constructor(cToken _cToken, address _controller) public {
}
function deposit() external {
}
function withdraw(IERC20 _asset) external returns (uint balance) {
require(msg.sender == controller, "!controller");
require(<FILL_ME>)
require(address(_asset) != address(underlying), "!underlying");
balance = _asset.balanceOf(address(this));
_asset.safeTransfer(controller, balance);
}
function withdraw(uint _amount) external {
}
function withdrawAll() external returns (uint balance) {
}
function _withdrawAll() internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function balanceOf() public view returns (uint) {
}
function _withdrawCompound(uint amount) internal {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function setGovernance(address _governance) external {
}
function setController(address _controller) external {
}
}
| address(_asset)!=address(c),"!c" | 339,052 | address(_asset)!=address(c) |
"!underlying" | // SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface cToken {
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external returns (uint);
function repayBorrow(uint repayAmount) external returns (uint);
function exchangeRateStored() external view returns (uint);
function balanceOf(address _owner) external view returns (uint);
function underlying() external view returns (address);
}
interface Controller {
function vaults(address) external view returns (address);
}
contract StrategyCompoundBasic {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public want;
cToken public c;
IERC20 public underlying;
address public governance;
address public controller;
constructor(cToken _cToken, address _controller) public {
}
function deposit() external {
}
function withdraw(IERC20 _asset) external returns (uint balance) {
require(msg.sender == controller, "!controller");
require(address(_asset) != address(c), "!c");
require(<FILL_ME>)
balance = _asset.balanceOf(address(this));
_asset.safeTransfer(controller, balance);
}
function withdraw(uint _amount) external {
}
function withdrawAll() external returns (uint balance) {
}
function _withdrawAll() internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function balanceOf() public view returns (uint) {
}
function _withdrawCompound(uint amount) internal {
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function setGovernance(address _governance) external {
}
function setController(address _controller) external {
}
}
| address(_asset)!=address(underlying),"!underlying" | 339,052 | address(_asset)!=address(underlying) |
"COMPOUND: withdraw failed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.5.17;
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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function toPayable(address account) internal pure returns (address payable) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface cToken {
function mint(uint mintAmount) external returns (uint);
function redeem(uint redeemTokens) external returns (uint);
function redeemUnderlying(uint redeemAmount) external returns (uint);
function borrow(uint borrowAmount) external returns (uint);
function repayBorrow(uint repayAmount) external returns (uint);
function exchangeRateStored() external view returns (uint);
function balanceOf(address _owner) external view returns (uint);
function underlying() external view returns (address);
}
interface Controller {
function vaults(address) external view returns (address);
}
contract StrategyCompoundBasic {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public want;
cToken public c;
IERC20 public underlying;
address public governance;
address public controller;
constructor(cToken _cToken, address _controller) public {
}
function deposit() external {
}
function withdraw(IERC20 _asset) external returns (uint balance) {
}
function withdraw(uint _amount) external {
}
function withdrawAll() external returns (uint balance) {
}
function _withdrawAll() internal {
}
function _withdrawSome(uint256 _amount) internal {
}
function balanceOf() public view returns (uint) {
}
function _withdrawCompound(uint amount) internal {
require(<FILL_ME>)
}
function balanceCompoundInToken() public view returns (uint256) {
}
function balanceCompound() public view returns (uint256) {
}
function setGovernance(address _governance) external {
}
function setController(address _controller) external {
}
}
| c.redeem(amount)==0,"COMPOUND: withdraw failed" | 339,052 | c.redeem(amount)==0 |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Owned
* @dev Ownership model
*/
contract Owned {
address public owner;
event OwnershipTransfered(address indexed owner);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title ERC20Token
* @dev Interface for erc20 standard
*/
contract ERC20Token {
using SafeMath for uint256;
string public constant name = "Ansforce Intelligence Token";
string public constant symbol = "AIT";
uint8 public constant decimals = 18;
uint256 public totalSupply = 0;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed from, uint256 value, address indexed to, bytes extraData);
constructor() public {
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address from, address to, uint256 value) internal {
// Check if the sender has enough balance
require(balanceOf[from] >= value);
// Check for overflow
require(<FILL_ME>)
// Save this for an amount double check assertion
uint256 previousBalances = balanceOf[from].add(balanceOf[to]);
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
// Asserts for duplicate check. Should never fail.
assert(balanceOf[from].add(balanceOf[to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `value` tokens to `to` from your account
*
* @param to The address of the recipient
* @param value the amount to send
*/
function transfer(address to, uint256 value) public {
}
/**
* Transfer tokens from other address
*
* Send `value` tokens to `to` in behalf of `from`
*
* @param from The address of the sender
* @param to The address of the recipient
* @param value the amount to send
*/
function transferFrom(address from, address to, uint256 value) public returns (bool success) {
}
/**
* Set allowance for other address
*
* Allows `spender` to spend no more than `value` tokens in your behalf
*
* @param spender The address authorized to spend
* @param value the max amount they can spend
* @param extraData some extra information to send to the approved contract
*/
function approve(address spender, uint256 value, bytes extraData) public returns (bool success) {
}
}
contract AnsforceIntelligenceToken is Owned, ERC20Token {
constructor() public {
}
function init(uint256 _supply, address _vault) public onlyOwner {
}
bool public stopped = false;
modifier isRunning {
}
function transfer(address to, uint256 value) isRunning public {
}
function stop() public onlyOwner {
}
function start() public onlyOwner {
}
mapping (address => uint256) public freezeOf;
/* This notifies clients about the amount frozen */
event Freeze(address indexed target, uint256 value);
/* This notifies clients about the amount unfrozen */
event Unfreeze(address indexed target, uint256 value);
function freeze(address target, uint256 _value) public onlyOwner returns (bool success) {
}
function unfreeze(address target, uint256 _value) public onlyOwner returns (bool success) {
}
}
| balanceOf[to]+value>balanceOf[to] | 339,062 | balanceOf[to]+value>balanceOf[to] |
"Only token sale contract can process this" | pragma solidity ^0.7.1;
/**
* @title Context
* @dev Provide context functions
*/
abstract contract Context {
address public owner; //Contract owner address
bool public isContractActive; //Make sure this contract can be used or not
/**
* Make sure the sender is the owner of contract
*/
modifier onlyOwner{
}
/**
* Make sure the contract is active to execute
*/
modifier contractActive{
}
/**
* @dev Constructor
*
* Implementations:
* 1. Set the owner of contract
* 2. Set contract is active
*/
constructor(){
}
/**
* Get sender address
*/
function _msgSender() internal view returns(address){
}
/**
* Get current time in unix timestamp
*/
function _now() internal view returns(uint){
}
/**
* Update contract status to make sure this contract can be executed or not
*/
function setContractStatus(bool status) external onlyOwner{
}
/**
* @dev Change contract's owner
* @return If success return true; else return false
*
* Requirements:
* 1. Only current owner can execute
* 2. `newOwner` is not zero address
* 3. `newOwner` is not current owner
*
* Implementations:
* 1. Validate requirements
* 2. Set current owner is newOwner
* 3. Emit Events
* 4. Return result
*/
function setOwner(address newOwner) external onlyOwner returns(bool){
}
/**
* @dev Event that notifies contract's owner has been changed to `newOwner`
*/
event OwnerChanged(address newOwner);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
}
abstract contract BaseContractData is Context{
address internal _tokenSaleContractAddress;
/**
@dev Make sure function can be called only be _tokenSaleContractAddress
*/
modifier onlyTokenSaleContract{
require(_tokenSaleContractAddress != address(0), "Token sale contract address has not been initialized yet");
require(<FILL_ME>)
_;
}
/**
@dev Set _tokenSaleContractAddress
*/
function setTokenSaleContractAddress(address contractAddress) external onlyOwner{
}
function _setTokenSaleContractAddress(address contractAddress) internal virtual{
}
}
/**
@title Share token sale data
@dev Stores all data of seed and private round
*/
contract ShareTokenSaleBalanceData is BaseContractData{
using SafeMath for uint;
address public _transferContractAddress;
modifier onlyTransferContract{
}
/**
* @dev Shareholder list
*/
address[] internal _shareholders;
/**
* @dev Stores shareholders' balances for each round
* Mapping: Round => (shareholder address => shareholder balance)
*/
mapping(uint => mapping(address => uint)) internal _shareholderBalances;
/**
* @dev Set transfer contract address
*/
function setTransferContractAddress (address contractAddress) external onlyOwner returns(bool){
}
/**
@dev Update all related data for purchasing
*
* Implementations:
* 1. Create purchase history
* 2. Decrease remained token for `round`
* 3. Increase shareholder's balance
*/
function updatePurchaseData(address account, uint round, uint tokenAmount) external onlyTokenSaleContract returns(bool){
}
/**
@dev Update all transfer data when a transfer request is maked
*
* Implementations
* 1. Add transfer history
* 2. Update transfer balance
* 3. Update share holder balance
*/
function updateTransferData(address from, address to, uint amount, uint round) external onlyTransferContract returns(bool){
}
/**
* @dev Get share holder's token balance
*/
function getShareholderBalance(address account, uint round) external view returns(uint){
}
/**
* @dev Get shareholder list
*/
function getShareholders() external view returns(address[] memory){
}
/**
* @dev Increase shareholder balance with `amount` of BNU for round `round`
*/
function _increaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Decrease shareholder balance with `amount` of BNU for round `round`
*/
function _decreaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Save new shareholder to _shareholders
*
* Requirements: `account` should be not address zero
*/
function _saveShareholder(address account) internal returns(bool){
}
}
// SPDX-License-Identifier: MIT
| _msgSender()==_tokenSaleContractAddress,"Only token sale contract can process this" | 339,098 | _msgSender()==_tokenSaleContractAddress |
"Only transfer contract can execute" | pragma solidity ^0.7.1;
/**
* @title Context
* @dev Provide context functions
*/
abstract contract Context {
address public owner; //Contract owner address
bool public isContractActive; //Make sure this contract can be used or not
/**
* Make sure the sender is the owner of contract
*/
modifier onlyOwner{
}
/**
* Make sure the contract is active to execute
*/
modifier contractActive{
}
/**
* @dev Constructor
*
* Implementations:
* 1. Set the owner of contract
* 2. Set contract is active
*/
constructor(){
}
/**
* Get sender address
*/
function _msgSender() internal view returns(address){
}
/**
* Get current time in unix timestamp
*/
function _now() internal view returns(uint){
}
/**
* Update contract status to make sure this contract can be executed or not
*/
function setContractStatus(bool status) external onlyOwner{
}
/**
* @dev Change contract's owner
* @return If success return true; else return false
*
* Requirements:
* 1. Only current owner can execute
* 2. `newOwner` is not zero address
* 3. `newOwner` is not current owner
*
* Implementations:
* 1. Validate requirements
* 2. Set current owner is newOwner
* 3. Emit Events
* 4. Return result
*/
function setOwner(address newOwner) external onlyOwner returns(bool){
}
/**
* @dev Event that notifies contract's owner has been changed to `newOwner`
*/
event OwnerChanged(address newOwner);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
}
abstract contract BaseContractData is Context{
address internal _tokenSaleContractAddress;
/**
@dev Make sure function can be called only be _tokenSaleContractAddress
*/
modifier onlyTokenSaleContract{
}
/**
@dev Set _tokenSaleContractAddress
*/
function setTokenSaleContractAddress(address contractAddress) external onlyOwner{
}
function _setTokenSaleContractAddress(address contractAddress) internal virtual{
}
}
/**
@title Share token sale data
@dev Stores all data of seed and private round
*/
contract ShareTokenSaleBalanceData is BaseContractData{
using SafeMath for uint;
address public _transferContractAddress;
modifier onlyTransferContract{
require(_transferContractAddress != address(0), "Transfer contract address has not been initialized yet");
require(<FILL_ME>)
_;
}
/**
* @dev Shareholder list
*/
address[] internal _shareholders;
/**
* @dev Stores shareholders' balances for each round
* Mapping: Round => (shareholder address => shareholder balance)
*/
mapping(uint => mapping(address => uint)) internal _shareholderBalances;
/**
* @dev Set transfer contract address
*/
function setTransferContractAddress (address contractAddress) external onlyOwner returns(bool){
}
/**
@dev Update all related data for purchasing
*
* Implementations:
* 1. Create purchase history
* 2. Decrease remained token for `round`
* 3. Increase shareholder's balance
*/
function updatePurchaseData(address account, uint round, uint tokenAmount) external onlyTokenSaleContract returns(bool){
}
/**
@dev Update all transfer data when a transfer request is maked
*
* Implementations
* 1. Add transfer history
* 2. Update transfer balance
* 3. Update share holder balance
*/
function updateTransferData(address from, address to, uint amount, uint round) external onlyTransferContract returns(bool){
}
/**
* @dev Get share holder's token balance
*/
function getShareholderBalance(address account, uint round) external view returns(uint){
}
/**
* @dev Get shareholder list
*/
function getShareholders() external view returns(address[] memory){
}
/**
* @dev Increase shareholder balance with `amount` of BNU for round `round`
*/
function _increaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Decrease shareholder balance with `amount` of BNU for round `round`
*/
function _decreaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Save new shareholder to _shareholders
*
* Requirements: `account` should be not address zero
*/
function _saveShareholder(address account) internal returns(bool){
}
}
// SPDX-License-Identifier: MIT
| _msgSender()==_transferContractAddress,"Only transfer contract can execute" | 339,098 | _msgSender()==_transferContractAddress |
"ShareTokenSaleData.updatePurchaseData: Can not create new shareholder" | pragma solidity ^0.7.1;
/**
* @title Context
* @dev Provide context functions
*/
abstract contract Context {
address public owner; //Contract owner address
bool public isContractActive; //Make sure this contract can be used or not
/**
* Make sure the sender is the owner of contract
*/
modifier onlyOwner{
}
/**
* Make sure the contract is active to execute
*/
modifier contractActive{
}
/**
* @dev Constructor
*
* Implementations:
* 1. Set the owner of contract
* 2. Set contract is active
*/
constructor(){
}
/**
* Get sender address
*/
function _msgSender() internal view returns(address){
}
/**
* Get current time in unix timestamp
*/
function _now() internal view returns(uint){
}
/**
* Update contract status to make sure this contract can be executed or not
*/
function setContractStatus(bool status) external onlyOwner{
}
/**
* @dev Change contract's owner
* @return If success return true; else return false
*
* Requirements:
* 1. Only current owner can execute
* 2. `newOwner` is not zero address
* 3. `newOwner` is not current owner
*
* Implementations:
* 1. Validate requirements
* 2. Set current owner is newOwner
* 3. Emit Events
* 4. Return result
*/
function setOwner(address newOwner) external onlyOwner returns(bool){
}
/**
* @dev Event that notifies contract's owner has been changed to `newOwner`
*/
event OwnerChanged(address newOwner);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
}
abstract contract BaseContractData is Context{
address internal _tokenSaleContractAddress;
/**
@dev Make sure function can be called only be _tokenSaleContractAddress
*/
modifier onlyTokenSaleContract{
}
/**
@dev Set _tokenSaleContractAddress
*/
function setTokenSaleContractAddress(address contractAddress) external onlyOwner{
}
function _setTokenSaleContractAddress(address contractAddress) internal virtual{
}
}
/**
@title Share token sale data
@dev Stores all data of seed and private round
*/
contract ShareTokenSaleBalanceData is BaseContractData{
using SafeMath for uint;
address public _transferContractAddress;
modifier onlyTransferContract{
}
/**
* @dev Shareholder list
*/
address[] internal _shareholders;
/**
* @dev Stores shareholders' balances for each round
* Mapping: Round => (shareholder address => shareholder balance)
*/
mapping(uint => mapping(address => uint)) internal _shareholderBalances;
/**
* @dev Set transfer contract address
*/
function setTransferContractAddress (address contractAddress) external onlyOwner returns(bool){
}
/**
@dev Update all related data for purchasing
*
* Implementations:
* 1. Create purchase history
* 2. Decrease remained token for `round`
* 3. Increase shareholder's balance
*/
function updatePurchaseData(address account, uint round, uint tokenAmount) external onlyTokenSaleContract returns(bool){
require(round == 0 || round == 1, "Round is invalid");
//Add share holder balance for round
_increaseShareholderBalance(account, tokenAmount, round);
//Save new shareholder if not existed
require(<FILL_ME>)
return true;
}
/**
@dev Update all transfer data when a transfer request is maked
*
* Implementations
* 1. Add transfer history
* 2. Update transfer balance
* 3. Update share holder balance
*/
function updateTransferData(address from, address to, uint amount, uint round) external onlyTransferContract returns(bool){
}
/**
* @dev Get share holder's token balance
*/
function getShareholderBalance(address account, uint round) external view returns(uint){
}
/**
* @dev Get shareholder list
*/
function getShareholders() external view returns(address[] memory){
}
/**
* @dev Increase shareholder balance with `amount` of BNU for round `round`
*/
function _increaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Decrease shareholder balance with `amount` of BNU for round `round`
*/
function _decreaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Save new shareholder to _shareholders
*
* Requirements: `account` should be not address zero
*/
function _saveShareholder(address account) internal returns(bool){
}
}
// SPDX-License-Identifier: MIT
| _saveShareholder(account),"ShareTokenSaleData.updatePurchaseData: Can not create new shareholder" | 339,098 | _saveShareholder(account) |
"ShareTokenSaleData.updateShareholderTransferData: Can not save new shareholder" | pragma solidity ^0.7.1;
/**
* @title Context
* @dev Provide context functions
*/
abstract contract Context {
address public owner; //Contract owner address
bool public isContractActive; //Make sure this contract can be used or not
/**
* Make sure the sender is the owner of contract
*/
modifier onlyOwner{
}
/**
* Make sure the contract is active to execute
*/
modifier contractActive{
}
/**
* @dev Constructor
*
* Implementations:
* 1. Set the owner of contract
* 2. Set contract is active
*/
constructor(){
}
/**
* Get sender address
*/
function _msgSender() internal view returns(address){
}
/**
* Get current time in unix timestamp
*/
function _now() internal view returns(uint){
}
/**
* Update contract status to make sure this contract can be executed or not
*/
function setContractStatus(bool status) external onlyOwner{
}
/**
* @dev Change contract's owner
* @return If success return true; else return false
*
* Requirements:
* 1. Only current owner can execute
* 2. `newOwner` is not zero address
* 3. `newOwner` is not current owner
*
* Implementations:
* 1. Validate requirements
* 2. Set current owner is newOwner
* 3. Emit Events
* 4. Return result
*/
function setOwner(address newOwner) external onlyOwner returns(bool){
}
/**
* @dev Event that notifies contract's owner has been changed to `newOwner`
*/
event OwnerChanged(address newOwner);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
/**
* @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(uint a, uint b) internal pure returns (uint) {
}
/**
* @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(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
}
}
abstract contract BaseContractData is Context{
address internal _tokenSaleContractAddress;
/**
@dev Make sure function can be called only be _tokenSaleContractAddress
*/
modifier onlyTokenSaleContract{
}
/**
@dev Set _tokenSaleContractAddress
*/
function setTokenSaleContractAddress(address contractAddress) external onlyOwner{
}
function _setTokenSaleContractAddress(address contractAddress) internal virtual{
}
}
/**
@title Share token sale data
@dev Stores all data of seed and private round
*/
contract ShareTokenSaleBalanceData is BaseContractData{
using SafeMath for uint;
address public _transferContractAddress;
modifier onlyTransferContract{
}
/**
* @dev Shareholder list
*/
address[] internal _shareholders;
/**
* @dev Stores shareholders' balances for each round
* Mapping: Round => (shareholder address => shareholder balance)
*/
mapping(uint => mapping(address => uint)) internal _shareholderBalances;
/**
* @dev Set transfer contract address
*/
function setTransferContractAddress (address contractAddress) external onlyOwner returns(bool){
}
/**
@dev Update all related data for purchasing
*
* Implementations:
* 1. Create purchase history
* 2. Decrease remained token for `round`
* 3. Increase shareholder's balance
*/
function updatePurchaseData(address account, uint round, uint tokenAmount) external onlyTokenSaleContract returns(bool){
}
/**
@dev Update all transfer data when a transfer request is maked
*
* Implementations
* 1. Add transfer history
* 2. Update transfer balance
* 3. Update share holder balance
*/
function updateTransferData(address from, address to, uint amount, uint round) external onlyTransferContract returns(bool){
require(round == 0 || round == 1, "ShareTokenSaleData.addTransferHistoryAndBalance: Round is invalid");
//Update shareholder balance
_decreaseShareholderBalance(from, amount, round);
_increaseShareholderBalance(to, amount, round);
//Save new shareholder if not existed
require(<FILL_ME>)
return true;
}
/**
* @dev Get share holder's token balance
*/
function getShareholderBalance(address account, uint round) external view returns(uint){
}
/**
* @dev Get shareholder list
*/
function getShareholders() external view returns(address[] memory){
}
/**
* @dev Increase shareholder balance with `amount` of BNU for round `round`
*/
function _increaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Decrease shareholder balance with `amount` of BNU for round `round`
*/
function _decreaseShareholderBalance(address account, uint amount, uint round) internal{
}
/**
* @dev Save new shareholder to _shareholders
*
* Requirements: `account` should be not address zero
*/
function _saveShareholder(address account) internal returns(bool){
}
}
// SPDX-License-Identifier: MIT
| _saveShareholder(to),"ShareTokenSaleData.updateShareholderTransferData: Can not save new shareholder" | 339,098 | _saveShareholder(to) |
null | pragma solidity ^0.6.12;
library SortedLinkedList {
using SafeMath for uint;
struct Item {
address user;
uint16 next;
uint8 id;
uint score;
}
uint16 internal constant GUARD = 0;
function addNode(Item[] storage items, address user, uint score, uint8 id) internal {
uint16 prev = findSortedIndex(items, score);
require(<FILL_ME>)
items.push(Item(user, items[prev].next, id, score));
items[prev].next = uint16(items.length.sub(1));
}
function updateNode(Item[] storage items, address user, uint score, uint8 id) internal {
}
function initNodes(Item[] storage items) internal {
}
function _verifyIndex(Item[] storage items, uint score, uint16 prev) internal view returns (bool) {
}
function findSortedIndex(Item[] storage items, uint score) internal view returns(uint16) {
}
function findCurrentAndPrevIndex(Item[] storage items, address user, uint8 id) internal view returns (uint16, uint16) {
}
function isInList(Item[] storage items, address user, uint8 id) internal view returns (bool) {
}
}
| _verifyIndex(items,score,prev) | 339,225 | _verifyIndex(items,score,prev) |
null | pragma solidity ^0.6.12;
library SortedLinkedList {
using SafeMath for uint;
struct Item {
address user;
uint16 next;
uint8 id;
uint score;
}
uint16 internal constant GUARD = 0;
function addNode(Item[] storage items, address user, uint score, uint8 id) internal {
}
function updateNode(Item[] storage items, address user, uint score, uint8 id) internal {
(uint16 current, uint16 oldPrev) = findCurrentAndPrevIndex(items, user, id);
require(<FILL_ME>)
require(items[current].user == user);
require(items[current].id == id);
score = score.add(items[current].score);
items[oldPrev].next = items[current].next;
addNode(items, user, score, id);
}
function initNodes(Item[] storage items) internal {
}
function _verifyIndex(Item[] storage items, uint score, uint16 prev) internal view returns (bool) {
}
function findSortedIndex(Item[] storage items, uint score) internal view returns(uint16) {
}
function findCurrentAndPrevIndex(Item[] storage items, address user, uint8 id) internal view returns (uint16, uint16) {
}
function isInList(Item[] storage items, address user, uint8 id) internal view returns (bool) {
}
}
| items[oldPrev].next==current | 339,225 | items[oldPrev].next==current |
null | pragma solidity ^0.6.12;
library SortedLinkedList {
using SafeMath for uint;
struct Item {
address user;
uint16 next;
uint8 id;
uint score;
}
uint16 internal constant GUARD = 0;
function addNode(Item[] storage items, address user, uint score, uint8 id) internal {
}
function updateNode(Item[] storage items, address user, uint score, uint8 id) internal {
(uint16 current, uint16 oldPrev) = findCurrentAndPrevIndex(items, user, id);
require(items[oldPrev].next == current);
require(<FILL_ME>)
require(items[current].id == id);
score = score.add(items[current].score);
items[oldPrev].next = items[current].next;
addNode(items, user, score, id);
}
function initNodes(Item[] storage items) internal {
}
function _verifyIndex(Item[] storage items, uint score, uint16 prev) internal view returns (bool) {
}
function findSortedIndex(Item[] storage items, uint score) internal view returns(uint16) {
}
function findCurrentAndPrevIndex(Item[] storage items, address user, uint8 id) internal view returns (uint16, uint16) {
}
function isInList(Item[] storage items, address user, uint8 id) internal view returns (bool) {
}
}
| items[current].user==user | 339,225 | items[current].user==user |
null | pragma solidity ^0.6.12;
library SortedLinkedList {
using SafeMath for uint;
struct Item {
address user;
uint16 next;
uint8 id;
uint score;
}
uint16 internal constant GUARD = 0;
function addNode(Item[] storage items, address user, uint score, uint8 id) internal {
}
function updateNode(Item[] storage items, address user, uint score, uint8 id) internal {
(uint16 current, uint16 oldPrev) = findCurrentAndPrevIndex(items, user, id);
require(items[oldPrev].next == current);
require(items[current].user == user);
require(<FILL_ME>)
score = score.add(items[current].score);
items[oldPrev].next = items[current].next;
addNode(items, user, score, id);
}
function initNodes(Item[] storage items) internal {
}
function _verifyIndex(Item[] storage items, uint score, uint16 prev) internal view returns (bool) {
}
function findSortedIndex(Item[] storage items, uint score) internal view returns(uint16) {
}
function findCurrentAndPrevIndex(Item[] storage items, address user, uint8 id) internal view returns (uint16, uint16) {
}
function isInList(Item[] storage items, address user, uint8 id) internal view returns (bool) {
}
}
| items[current].id==id | 339,225 | items[current].id==id |
"For the token to be able to transfer: it's required that the crowdsale is in released state; or the sender is a transfer agent." | pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
}
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if the sale is a success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping(address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
require(<FILL_ME>)
_;
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final sale contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
}
}
contract UpgradeableToken is StandardToken {
using SafeMath for uint256;
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can begin
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns (UpgradeState) {
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
}
bool canUpgrade_ = true;
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public view returns (bool) {
}
}
contract Jobchain is ReleasableToken, MintableToken, UpgradeableToken {
event UpdatedTokenInformation(string newName, string newSymbol);
string public name;
string public symbol;
uint8 public decimals;
address public VerificationNodesWallet;
address public LaunchIncentiveWallet;
address public capitalReserveWallet;
address public ecosystemdevelopmentWallet;
address public InitialFundingWallet;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
constructor(string _name, string _symbol, uint256 _initialSupply, uint8 _decimals, bool _mintable,
address _VerificationNodesWallet,
address _LaunchIncentiveWallet,
address _capitalReserveWallet,
address _ecosystemdevelopmentWallet,
address _InitialFundingWallet)
public UpgradeableToken(msg.sender) {
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public view returns (bool) {
}
// Total supply
function totalSupply() public view returns (uint) {
}
}
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
}
function upgradeFrom(address _from, uint256 _value) public;
}
| released||transferAgents[_sender],"For the token to be able to transfer: it's required that the crowdsale is in released state; or the sender is a transfer agent." | 339,383 | released||transferAgents[_sender] |
"Upgrade state is required to not be upgrading when setting upgrade agent." | pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
}
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if the sale is a success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping(address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final sale contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
}
}
contract UpgradeableToken is StandardToken {
using SafeMath for uint256;
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can begin
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
require(canUpgrade(), "It's required to be in canUpgrade() condition when setting upgrade agent.");
require(agent != address(0), "Agent is required to be an non-empty address when setting upgrade agent.");
// Only a master can designate the next agent
require(msg.sender == upgradeMaster, "Message sender is required to be the upgradeMaster when setting upgrade agent.");
// Upgrade has already begun for an agent
require(<FILL_ME>)
require(address(upgradeAgent) == address(0), "upgradeAgent once set, cannot be reset");
upgradeAgent = UpgradeAgent(agent);
// Bad interface
require(upgradeAgent.isUpgradeAgent(), "The provided updateAgent contract is required to be compliant to the UpgradeAgent interface method when setting upgrade agent.");
// Make sure that token supplies match in source and target
require(upgradeAgent.originalSupply() == totalSupply_, "The provided upgradeAgent contract's originalSupply is required to be equivalent to existing contract's totalSupply_ when setting upgrade agent.");
emit UpgradeAgentSet(upgradeAgent);
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns (UpgradeState) {
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
}
bool canUpgrade_ = true;
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public view returns (bool) {
}
}
contract Jobchain is ReleasableToken, MintableToken, UpgradeableToken {
event UpdatedTokenInformation(string newName, string newSymbol);
string public name;
string public symbol;
uint8 public decimals;
address public VerificationNodesWallet;
address public LaunchIncentiveWallet;
address public capitalReserveWallet;
address public ecosystemdevelopmentWallet;
address public InitialFundingWallet;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
constructor(string _name, string _symbol, uint256 _initialSupply, uint8 _decimals, bool _mintable,
address _VerificationNodesWallet,
address _LaunchIncentiveWallet,
address _capitalReserveWallet,
address _ecosystemdevelopmentWallet,
address _InitialFundingWallet)
public UpgradeableToken(msg.sender) {
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public view returns (bool) {
}
// Total supply
function totalSupply() public view returns (uint) {
}
}
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
}
function upgradeFrom(address _from, uint256 _value) public;
}
| getUpgradeState()!=UpgradeState.ReadyToUpgrade,"Upgrade state is required to not be upgrading when setting upgrade agent." | 339,383 | getUpgradeState()!=UpgradeState.ReadyToUpgrade |
"upgradeAgent once set, cannot be reset" | pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
}
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if the sale is a success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping(address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final sale contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
}
}
contract UpgradeableToken is StandardToken {
using SafeMath for uint256;
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can begin
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
require(canUpgrade(), "It's required to be in canUpgrade() condition when setting upgrade agent.");
require(agent != address(0), "Agent is required to be an non-empty address when setting upgrade agent.");
// Only a master can designate the next agent
require(msg.sender == upgradeMaster, "Message sender is required to be the upgradeMaster when setting upgrade agent.");
// Upgrade has already begun for an agent
require(getUpgradeState() != UpgradeState.ReadyToUpgrade, "Upgrade state is required to not be upgrading when setting upgrade agent.");
require(<FILL_ME>)
upgradeAgent = UpgradeAgent(agent);
// Bad interface
require(upgradeAgent.isUpgradeAgent(), "The provided updateAgent contract is required to be compliant to the UpgradeAgent interface method when setting upgrade agent.");
// Make sure that token supplies match in source and target
require(upgradeAgent.originalSupply() == totalSupply_, "The provided upgradeAgent contract's originalSupply is required to be equivalent to existing contract's totalSupply_ when setting upgrade agent.");
emit UpgradeAgentSet(upgradeAgent);
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns (UpgradeState) {
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
}
bool canUpgrade_ = true;
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public view returns (bool) {
}
}
contract Jobchain is ReleasableToken, MintableToken, UpgradeableToken {
event UpdatedTokenInformation(string newName, string newSymbol);
string public name;
string public symbol;
uint8 public decimals;
address public VerificationNodesWallet;
address public LaunchIncentiveWallet;
address public capitalReserveWallet;
address public ecosystemdevelopmentWallet;
address public InitialFundingWallet;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
constructor(string _name, string _symbol, uint256 _initialSupply, uint8 _decimals, bool _mintable,
address _VerificationNodesWallet,
address _LaunchIncentiveWallet,
address _capitalReserveWallet,
address _ecosystemdevelopmentWallet,
address _InitialFundingWallet)
public UpgradeableToken(msg.sender) {
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public view returns (bool) {
}
// Total supply
function totalSupply() public view returns (uint) {
}
}
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
}
function upgradeFrom(address _from, uint256 _value) public;
}
| address(upgradeAgent)==address(0),"upgradeAgent once set, cannot be reset" | 339,383 | address(upgradeAgent)==address(0) |
"The provided upgradeAgent contract's originalSupply is required to be equivalent to existing contract's totalSupply_ when setting upgrade agent." | pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
}
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if the sale is a success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping(address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final sale contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
}
}
contract UpgradeableToken is StandardToken {
using SafeMath for uint256;
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can begin
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
require(canUpgrade(), "It's required to be in canUpgrade() condition when setting upgrade agent.");
require(agent != address(0), "Agent is required to be an non-empty address when setting upgrade agent.");
// Only a master can designate the next agent
require(msg.sender == upgradeMaster, "Message sender is required to be the upgradeMaster when setting upgrade agent.");
// Upgrade has already begun for an agent
require(getUpgradeState() != UpgradeState.ReadyToUpgrade, "Upgrade state is required to not be upgrading when setting upgrade agent.");
require(address(upgradeAgent) == address(0), "upgradeAgent once set, cannot be reset");
upgradeAgent = UpgradeAgent(agent);
// Bad interface
require(upgradeAgent.isUpgradeAgent(), "The provided updateAgent contract is required to be compliant to the UpgradeAgent interface method when setting upgrade agent.");
// Make sure that token supplies match in source and target
require(<FILL_ME>)
emit UpgradeAgentSet(upgradeAgent);
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns (UpgradeState) {
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
}
bool canUpgrade_ = true;
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public view returns (bool) {
}
}
contract Jobchain is ReleasableToken, MintableToken, UpgradeableToken {
event UpdatedTokenInformation(string newName, string newSymbol);
string public name;
string public symbol;
uint8 public decimals;
address public VerificationNodesWallet;
address public LaunchIncentiveWallet;
address public capitalReserveWallet;
address public ecosystemdevelopmentWallet;
address public InitialFundingWallet;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
constructor(string _name, string _symbol, uint256 _initialSupply, uint8 _decimals, bool _mintable,
address _VerificationNodesWallet,
address _LaunchIncentiveWallet,
address _capitalReserveWallet,
address _ecosystemdevelopmentWallet,
address _InitialFundingWallet)
public UpgradeableToken(msg.sender) {
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public view returns (bool) {
}
// Total supply
function totalSupply() public view returns (uint) {
}
}
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
}
function upgradeFrom(address _from, uint256 _value) public;
}
| upgradeAgent.originalSupply()==totalSupply_,"The provided upgradeAgent contract's originalSupply is required to be equivalent to existing contract's totalSupply_ when setting upgrade agent." | 339,383 | upgradeAgent.originalSupply()==totalSupply_ |
"_initialSupply has to be a mulitple of 10" | pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
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 BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
}
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if the sale is a success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping(address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final sale contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
}
}
contract UpgradeableToken is StandardToken {
using SafeMath for uint256;
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can begin
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
constructor(address _upgradeMaster) public {
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public view returns (UpgradeState) {
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
}
bool canUpgrade_ = true;
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public view returns (bool) {
}
}
contract Jobchain is ReleasableToken, MintableToken, UpgradeableToken {
event UpdatedTokenInformation(string newName, string newSymbol);
string public name;
string public symbol;
uint8 public decimals;
address public VerificationNodesWallet;
address public LaunchIncentiveWallet;
address public capitalReserveWallet;
address public ecosystemdevelopmentWallet;
address public InitialFundingWallet;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
constructor(string _name, string _symbol, uint256 _initialSupply, uint8 _decimals, bool _mintable,
address _VerificationNodesWallet,
address _LaunchIncentiveWallet,
address _capitalReserveWallet,
address _ecosystemdevelopmentWallet,
address _InitialFundingWallet)
public UpgradeableToken(msg.sender) {
// Create any address, can be transferred
// to team multisig via changeOwner(),
// also remember to call setUpgradeMaster()
owner = msg.sender;
releaseAgent = owner;
name = _name;
symbol = _symbol;
decimals = _decimals;
VerificationNodesWallet = _VerificationNodesWallet;
LaunchIncentiveWallet = _LaunchIncentiveWallet;
capitalReserveWallet = _capitalReserveWallet;
ecosystemdevelopmentWallet = _ecosystemdevelopmentWallet;
InitialFundingWallet = _InitialFundingWallet;
if (_initialSupply > 0) {
require(<FILL_ME>)
uint256 twentyfivePerCent = _initialSupply.mul(25).div(100);
uint256 twentyPerCent = _initialSupply.mul(2).div(10);
uint256 tenPerCent = _initialSupply.div(10);
mint(VerificationNodesWallet, twentyPerCent);
mint(LaunchIncentiveWallet, twentyfivePerCent);
mint(capitalReserveWallet, twentyfivePerCent);
mint(ecosystemdevelopmentWallet, twentyPerCent);
mint(InitialFundingWallet, tenPerCent);
}
// No more new supply allowed after the token creation
if (!_mintable) {
finishMinting();
require(totalSupply_ > 0, "Total supply is required to be above 0 if the token is not mintable.");
}
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public view returns (bool) {
}
// Total supply
function totalSupply() public view returns (uint) {
}
}
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public pure returns (bool) {
}
function upgradeFrom(address _from, uint256 _value) public;
}
| (_initialSupply%10)==0,"_initialSupply has to be a mulitple of 10" | 339,383 | (_initialSupply%10)==0 |
null | pragma solidity ^0.5.0;
contract Context {
constructor () internal { }
function _msgSender() internal view returns (address) {
}
function _msgData() internal view returns (bytes memory) {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20Detailed {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
contract SuperchainToken is Context, IERC20, ERC20Detailed("Superchain Token", "SUP", 18) {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
constructor(address founder) public{
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool) {
require(<FILL_ME>)
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
}
| (amount==0)||(_allowances[_msgSender()][spender]==0) | 339,509 | (amount==0)||(_allowances[_msgSender()][spender]==0) |
"caller is not the owner or master" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface TokenInterface {
function balanceOf(address account) external view returns (uint);
function delegate(address delegatee) external;
function transfer(address dst, uint rawAmount) external returns (bool);
}
interface IndexInterface {
function master() external view returns (address);
}
interface InstaVestingInterface {
function vestingAmount() external view returns (uint);
function factory() external view returns (address);
}
contract InstaVestingFactory is Ownable {
TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb);
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
InstaVestingFactory public constant instaVestingFactory = InstaVestingFactory(0x3b05a5295Aa749D78858E33ECe3b97bB3Ef4F029);
constructor (address _owner) public {
}
/**
* @dev Throws if the sender not is Master Address from InstaIndex or owner
*/
modifier isOwner {
require(<FILL_ME>)
_;
}
function fundVestingContracts(
address[] memory vestings
) public isOwner {
}
function withdraw() public isOwner {
}
}
| _msgSender()==instaIndex.master()||owner()==_msgSender(),"caller is not the owner or master" | 339,649 | _msgSender()==instaIndex.master()||owner()==_msgSender() |
"VestingFunder::fundVestingContracts: insufficient balance" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface TokenInterface {
function balanceOf(address account) external view returns (uint);
function delegate(address delegatee) external;
function transfer(address dst, uint rawAmount) external returns (bool);
}
interface IndexInterface {
function master() external view returns (address);
}
interface InstaVestingInterface {
function vestingAmount() external view returns (uint);
function factory() external view returns (address);
}
contract InstaVestingFactory is Ownable {
TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb);
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
InstaVestingFactory public constant instaVestingFactory = InstaVestingFactory(0x3b05a5295Aa749D78858E33ECe3b97bB3Ef4F029);
constructor (address _owner) public {
}
/**
* @dev Throws if the sender not is Master Address from InstaIndex or owner
*/
modifier isOwner {
}
function fundVestingContracts(
address[] memory vestings
) public isOwner {
uint _length = vestings.length;
for (uint i = 0; i < _length; i++) {
uint256 balanceOf = token.balanceOf(vestings[i]);
uint256 vestingAmount = InstaVestingInterface(vestings[i]).vestingAmount();
require(0x3b05a5295Aa749D78858E33ECe3b97bB3Ef4F029 == InstaVestingInterface(vestings[i]).factory(), "VestingFunder::fundVestingContracts: Other vesting contract");
require(<FILL_ME>)
}
}
function withdraw() public isOwner {
}
}
| token.transfer(vestings[i],(vestingAmount-balanceOf)),"VestingFunder::fundVestingContracts: insufficient balance" | 339,649 | token.transfer(vestings[i],(vestingAmount-balanceOf)) |
"No more XQST.ME to Mint" | pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _setOwner(address newOwner) private {
}
}
pragma solidity >=0.7.0 <0.9.0;
contract XQSTME is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.07 ether;
uint256 public maxSupply = 10000;
uint256 public maxMintAmount = 10;
uint256 private _reserved = 1000;
bool public paused = true;
bool public paused_premint = true;
bool public revealed = false;
string public notRevealedUri;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused, 'Mint for XQST.ME is not active');
require(_mintAmount > 0);
require(_mintAmount <= maxMintAmount, "You can't mint more than 10 XQST.ME");
require(<FILL_ME>)
if (msg.sender != owner()) {
require(msg.value >= cost * _mintAmount);
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function preSaleMint(uint256 _mintAmount) public payable {
}
function giveAway(address _to) external onlyOwner() {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function reveal() public onlyOwner() {
}
function setCost(uint256 _newCost) public onlyOwner() {
}
function setReserved(uint256 _new_reserved) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function pause_premint(bool _state) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function totalReservedLeft() public view returns (uint256) {
}
}
| supply+_mintAmount+_reserved<=maxSupply,"No more XQST.ME to Mint" | 339,664 | supply+_mintAmount+_reserved<=maxSupply |
'Premint for XQST.ME is not active' | pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _setOwner(address newOwner) private {
}
}
pragma solidity >=0.7.0 <0.9.0;
contract XQSTME is ERC721Enumerable, Ownable {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.07 ether;
uint256 public maxSupply = 10000;
uint256 public maxMintAmount = 10;
uint256 private _reserved = 1000;
bool public paused = true;
bool public paused_premint = true;
bool public revealed = false;
string public notRevealedUri;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint256 _mintAmount) public payable {
}
function preSaleMint(uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(<FILL_ME>)
require(supply + _mintAmount + _reserved <= maxSupply, "No more XQST.ME to PreMint");
require(_mintAmount == 1 || _mintAmount == 10 || _mintAmount == 20 || _mintAmount == 50 || _mintAmount == 100, "You can only preMint 1, 10, 20, 50 or 100 XQST.ME");
if ( _mintAmount == 1) {
require(msg.value >= cost * _mintAmount, 'Insuffient ETH amount sent.');
} else if ( _mintAmount == 10) {
require(msg.value >= cost * _mintAmount * 8 / 10, 'Insuffient ETH amount sent.');
} else if( _mintAmount == 20 ){
require(msg.value >= cost * _mintAmount * 75 / 100, 'Insuffient ETH amount sent.');
} else if( _mintAmount == 50 ){
require(msg.value >= cost * _mintAmount * 7 / 10, 'Insuffient ETH amount sent.');
} else if( _mintAmount == 100 ){
require(msg.value >= cost * _mintAmount * 65 / 100, 'Insuffient ETH amount sent.');
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
}
}
function giveAway(address _to) external onlyOwner() {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function reveal() public onlyOwner() {
}
function setCost(uint256 _newCost) public onlyOwner() {
}
function setReserved(uint256 _new_reserved) public onlyOwner() {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner() {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function pause_premint(bool _state) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function totalReservedLeft() public view returns (uint256) {
}
}
| !paused_premint,'Premint for XQST.ME is not active' | 339,664 | !paused_premint |
"leethToken balance insufficient" | /*
|| <🤖️> Smart Terms of Service (STOS) <📜️> ||
DEAR MSG.SENDER(S):
/ STOS is a project in beta.
// Please audit and use at your own risk.
/// Entry into STOS shall not create an attorney/client relationship.
//// Likewise, STOS should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || lexDAO LLC
*/
pragma solidity 0.5.17;
interface IToken { // brief ERC-20 interface
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
/*********************
SMART TERMS OF SERVICE
> `$RCLE Legal Wrapper
*********************/
contract RCLETermsOfService {
// internal token references
address public leethToken = 0x5A844590c5b8f40ae56190771d06c60b9ab1Da1C; // $RCLE
IToken private leeth = IToken(leethToken);
address public ownerToken = 0xa6CB74128e193DA7D82C43056a2dE4a5a672EAF7; // $RCKEY
IToken private owner = IToken(ownerToken);
// stos
uint256 inducementRate;
uint256 offerAmount;
uint8 public version;
string public emoji = "🎩📜";
string public offer;
string public terms;
// signature tracking
uint256 public signature;
mapping (uint256 => Signature) public sigs;
struct Signature {
address signatory;
uint256 number;
uint8 version;
string details;
string terms;
bool redemption;
}
event Signed(address indexed signatory, uint256 indexed number, string indexed details);
event InducementRateUpgraded(uint256 indexed inducementRate);
event OfferUpgraded(string indexed offer);
event OfferAmountUpgraded(uint256 indexed offerAmount);
event SignatureUpgraded(address indexed signatory, uint256 indexed number, string indexed details);
event TermsUpgraded(uint8 indexed version, string indexed terms);
constructor (uint256 _inducementRate, uint256 _offerAmount, string memory _offer, string memory _terms) public {
}
/***************
STOS FUNCTIONS
***************/
function signOffer(string memory details) public {
}
function signTerms(string memory details) public {
require(<FILL_ME>)
uint256 number = signature + 1;
signature = signature + 1;
sigs[number] = Signature(
msg.sender,
number,
version,
details,
terms,
false);
leeth.transfer(msg.sender, leeth.balanceOf(msg.sender) / inducementRate);
emit Signed(msg.sender, number, details);
}
function upgradeSignature(uint256 number, string memory details) public {
}
/***************
MGMT FUNCTIONS
***************/
// offer / terms
function upgradeOffer(string memory _offer) public {
}
function upgradeTerms(string memory _terms) public {
}
// leeth mgmt
function upgradeInducementRate(uint256 _inducementRate) public {
}
function upgradeOfferAmount(uint256 _offerAmount) public {
}
function withdrawLEETH() public {
}
}
| leeth.balanceOf(msg.sender)>0,"leethToken balance insufficient" | 339,745 | leeth.balanceOf(msg.sender)>0 |
"ownerToken balance insufficient" | /*
|| <🤖️> Smart Terms of Service (STOS) <📜️> ||
DEAR MSG.SENDER(S):
/ STOS is a project in beta.
// Please audit and use at your own risk.
/// Entry into STOS shall not create an attorney/client relationship.
//// Likewise, STOS should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
~presented by Open, ESQ || lexDAO LLC
*/
pragma solidity 0.5.17;
interface IToken { // brief ERC-20 interface
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
/*********************
SMART TERMS OF SERVICE
> `$RCLE Legal Wrapper
*********************/
contract RCLETermsOfService {
// internal token references
address public leethToken = 0x5A844590c5b8f40ae56190771d06c60b9ab1Da1C; // $RCLE
IToken private leeth = IToken(leethToken);
address public ownerToken = 0xa6CB74128e193DA7D82C43056a2dE4a5a672EAF7; // $RCKEY
IToken private owner = IToken(ownerToken);
// stos
uint256 inducementRate;
uint256 offerAmount;
uint8 public version;
string public emoji = "🎩📜";
string public offer;
string public terms;
// signature tracking
uint256 public signature;
mapping (uint256 => Signature) public sigs;
struct Signature {
address signatory;
uint256 number;
uint8 version;
string details;
string terms;
bool redemption;
}
event Signed(address indexed signatory, uint256 indexed number, string indexed details);
event InducementRateUpgraded(uint256 indexed inducementRate);
event OfferUpgraded(string indexed offer);
event OfferAmountUpgraded(uint256 indexed offerAmount);
event SignatureUpgraded(address indexed signatory, uint256 indexed number, string indexed details);
event TermsUpgraded(uint8 indexed version, string indexed terms);
constructor (uint256 _inducementRate, uint256 _offerAmount, string memory _offer, string memory _terms) public {
}
/***************
STOS FUNCTIONS
***************/
function signOffer(string memory details) public {
}
function signTerms(string memory details) public {
}
function upgradeSignature(uint256 number, string memory details) public {
}
/***************
MGMT FUNCTIONS
***************/
// offer / terms
function upgradeOffer(string memory _offer) public {
require(<FILL_ME>)
offer = _offer;
emit OfferUpgraded(offer);
}
function upgradeTerms(string memory _terms) public {
}
// leeth mgmt
function upgradeInducementRate(uint256 _inducementRate) public {
}
function upgradeOfferAmount(uint256 _offerAmount) public {
}
function withdrawLEETH() public {
}
}
| owner.balanceOf(msg.sender)>0,"ownerToken balance insufficient" | 339,745 | owner.balanceOf(msg.sender)>0 |
"Contract does not have any balance" | pragma solidity ^0.5.0;
import "./MultiSigWallet.sol";
import "./ERC20.sol";
contract ERC20MultiSigWallet is MultiSigWallet {
constructor(address[] memory _owners, uint256 _required) public MultiSigWallet(_owners, _required) {
}
/// @dev Withdraws token balance from the wallet
/// @param _token Address of ERC20 token to withdraw.
/// @param _to Address of receiver
/// @param _amount Amount to withdraw
function withdraw(address _token, address _to, uint256 _amount) public onlyWallet {
require(_token != address(0), "Token address cannot be 0");
require(_to != address(0), "recipient address cannot be 0");
require(_amount > 0, "amount cannot be 0");
require(<FILL_ME>)
require(ERC20(_token).balanceOf(address(this)) > _amount, "Contract does not have such balance");
ERC20(_token).transfer(_to, _amount);
}
}
| ERC20(_token).balanceOf(address(this))>0,"Contract does not have any balance" | 339,808 | ERC20(_token).balanceOf(address(this))>0 |
"Contract does not have such balance" | pragma solidity ^0.5.0;
import "./MultiSigWallet.sol";
import "./ERC20.sol";
contract ERC20MultiSigWallet is MultiSigWallet {
constructor(address[] memory _owners, uint256 _required) public MultiSigWallet(_owners, _required) {
}
/// @dev Withdraws token balance from the wallet
/// @param _token Address of ERC20 token to withdraw.
/// @param _to Address of receiver
/// @param _amount Amount to withdraw
function withdraw(address _token, address _to, uint256 _amount) public onlyWallet {
require(_token != address(0), "Token address cannot be 0");
require(_to != address(0), "recipient address cannot be 0");
require(_amount > 0, "amount cannot be 0");
require(ERC20(_token).balanceOf(address(this)) > 0, "Contract does not have any balance");
require(<FILL_ME>)
ERC20(_token).transfer(_to, _amount);
}
}
| ERC20(_token).balanceOf(address(this))>_amount,"Contract does not have such balance" | 339,808 | ERC20(_token).balanceOf(address(this))>_amount |
"Deposits for account are locked" | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
import "./libraries/SafeMath.sol";
import "./libraries/ERC20.sol";
import "./libraries/Ownable.sol";
interface IsAXE {
function rebase( uint256 axeProfit_, uint epoch_) external returns (uint256);
function circulatingSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function gonsForBalance( uint amount ) external view returns ( uint );
function balanceForGons( uint gons ) external view returns ( uint );
function index() external view returns ( uint );
}
interface IWarmup {
function retrieve( address staker_, uint amount_ ) external;
}
interface IDistributor {
function distribute() external returns ( bool );
}
contract AxeStaking is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address public immutable AXE;
address public immutable sAXE;
struct Epoch {
uint length; // in seconds
uint number;
uint endTime; // unix epoch time in seconds
uint distribute;
}
Epoch public epoch;
address public distributor;
address public locker;
uint public totalBonus;
address public warmupContract;
uint public warmupPeriod;
constructor (
address _AXE,
address _sAXE,
uint _epochLength,
uint _firstEpochNumber,
uint _firstEpochTime
) {
}
struct Claim {
uint deposit;
uint gons;
uint expiry;
bool lock; // prevents malicious delays
}
mapping( address => Claim ) public warmupInfo;
/**
@notice stake AXE to enter warmup
@param _amount uint
@return bool
*/
function stake( uint _amount, address _recipient ) external returns ( bool ) {
rebase();
IERC20( AXE ).safeTransferFrom( msg.sender, address(this), _amount );
Claim memory info = warmupInfo[ _recipient ];
require(<FILL_ME>)
warmupInfo[ _recipient ] = Claim ({
deposit: info.deposit.add( _amount ),
gons: info.gons.add( IsAXE( sAXE ).gonsForBalance( _amount ) ),
expiry: epoch.number.add( warmupPeriod ),
lock: false
});
IERC20( sAXE ).safeTransfer( warmupContract, _amount );
return true;
}
/**
@notice retrieve sAXE from warmup
@param _recipient address
*/
function claim ( address _recipient ) public {
}
/**
@notice forfeit sAXE in warmup and retrieve AXE
*/
function forfeit() external {
}
/**
@notice prevent new deposits to address (protection from malicious activity)
*/
function toggleDepositLock() external {
}
/**
@notice redeem sAXE for AXE
@param _amount uint
@param _trigger bool
*/
function unstake( uint _amount, bool _trigger ) external {
}
/**
@notice returns the sAXE index, which tracks rebase growth
@return uint
*/
function index() public view returns ( uint ) {
}
/**
@notice trigger rebase if epoch over
*/
function rebase() public {
}
/**
@notice returns contract AXE holdings, including bonuses provided
@return uint
*/
function contractBalance() public view returns ( uint ) {
}
/**
@notice provide bonus to locked staking contract
@param _amount uint
*/
function giveLockBonus( uint _amount ) external {
}
/**
@notice reclaim bonus from locked staking contract
@param _amount uint
*/
function returnLockBonus( uint _amount ) external {
}
enum CONTRACTS { DISTRIBUTOR, WARMUP, LOCKER }
/**
@notice sets the contract address for LP staking
@param _contract address
*/
function setContract( CONTRACTS _contract, address _address ) external onlyOwner() {
}
/**
* @notice set warmup period for new stakers
* @param _warmupPeriod uint
*/
function setWarmup( uint _warmupPeriod ) external onlyOwner() {
}
}
| !info.lock,"Deposits for account are locked" | 339,817 | !info.lock |
"PxG: Invalid signature" | pragma solidity >=0.4.22 <0.9.0;
/**
PPPPPPPPPPPPPPPPP iiii lllllll lllllll hhhhhhh
P::::::::::::::::P i::::i l:::::l l:::::l h:::::h
P::::::PPPPPP:::::P iiii l:::::l l:::::l h:::::h
PP:::::P P:::::P l:::::l l:::::l h:::::h
P::::P P:::::Piiiiiii xxxxxxx xxxxxxx eeeeeeeeeeee l::::l ggggggggg gggggl::::lyyyyyyy yyyyyyyppppp ppppppppp h::::h hhhhh ssssssssss
P::::P P:::::Pi:::::i x:::::x x:::::xee::::::::::::ee l::::l g:::::::::ggg::::gl::::l y:::::y y:::::y p::::ppp:::::::::p h::::hh:::::hhh ss::::::::::s
P::::PPPPPP:::::P i::::i x:::::x x:::::xe::::::eeeee:::::eel::::l g:::::::::::::::::gl::::l y:::::y y:::::y p:::::::::::::::::p h::::::::::::::hh ss:::::::::::::s
P:::::::::::::PP i::::i x:::::xx:::::xe::::::e e:::::el::::l g::::::ggggg::::::ggl::::l y:::::y y:::::y pp::::::ppppp::::::ph:::::::hhh::::::h s::::::ssss:::::s
P::::PPPPPPPPP i::::i x::::::::::x e:::::::eeeee::::::el::::l g:::::g g:::::g l::::l y:::::y y:::::y p:::::p p:::::ph::::::h h::::::h s:::::s ssssss
P::::P i::::i x::::::::x e:::::::::::::::::e l::::l g:::::g g:::::g l::::l y:::::y y:::::y p:::::p p:::::ph:::::h h:::::h s::::::s
P::::P i::::i x::::::::x e::::::eeeeeeeeeee l::::l g:::::g g:::::g l::::l y:::::y:::::y p:::::p p:::::ph:::::h h:::::h s::::::s
P::::P i::::i x::::::::::x e:::::::e l::::l g::::::g g:::::g l::::l y:::::::::y p:::::p p::::::ph:::::h h:::::hssssss s:::::s
PP::::::PP i::::::i x:::::xx:::::xe::::::::e l::::::lg:::::::ggggg:::::gl::::::l y:::::::y p:::::ppppp:::::::ph:::::h h:::::hs:::::ssss::::::s
P::::::::P i::::::i x:::::x x:::::xe::::::::eeeeeeee l::::::l g::::::::::::::::gl::::::l y:::::y p::::::::::::::::p h:::::h h:::::hs::::::::::::::s
P::::::::P i::::::i x:::::x x:::::xee:::::::::::::e l::::::l gg::::::::::::::gl::::::l y:::::y p::::::::::::::pp h:::::h h:::::h s:::::::::::ss
PPPPPPPPPP iiiiiiiixxxxxxx xxxxxxx eeeeeeeeeeeeee llllllll gggggggg::::::gllllllll y:::::y p::::::pppppppp hhhhhhh hhhhhhh sssssssssss
g:::::g y:::::y p:::::p
gggggg g:::::g y:::::y p:::::p
g:::::gg gg:::::g y:::::y p:::::::p
g::::::ggg:::::::g y:::::y p:::::::p
gg:::::::::::::g yyyyyyy p:::::::p
ggg::::::ggg ppppppppp
gggggg
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
##############################((((((((((((((((((((##############################
##############################((((((((((((((((((((##############################
####################((((((((((####################((((((((((####################
####################((((((((((####################((((((((((####################
###############(((((#####(((((####################(((((#####(((((###############
###############(((((#####(((((####################(((((#####(((((###############
###############(((((##########(((((##########(((((##########(((((###############
###############(((((##########(((((##########(((((##########(((((###############
###############(((((##########(((((##########(((((##########(((((###############
###############(((((##########(((((##########(((((##########(((((###############
####################((((((((((####################((((((((((####################
####################((((((((((####################((((((((((####################
###############(((((##########((((((((((((((((((((##########(((((###############
###############(((((##########((((((((((((((((((((##########(((((###############
###############(((((###############((((((((((###############(((((###############
###############(((((###############((((((((((###############(((((###############
####################(((((((((((((((##########(((((((((((((((####################
####################(((((((((((((((##########(((((((((((((((####################
###################################((((((((((###################################
###################################((((((((((###################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
################################################################################
10,000 on-chain avatar NFTs created using a cellular automaton.
A cellular automaton consists of a regular grid of cells, each in one of a finite number of states,
such as on and off. The grid can be in any finite number of dimensions. For each cell, a set of cells
called its neighborhood is defined relative to the specified cell. An initial state (time t = 0) is
selected by assigning a state for each cell. A new generation is created (advancing t by 1), according
to some fixed rule (generally, a mathematical function) that determines the new state of each cell in terms
of the current state of the cell and the states of the cells in its neighborhood. Typically, the rule
for updating the state of cells is the same for each cell and does not change over time, and is
applied to the whole grid simultaneously.
https://pixelglyphs.io
*/
contract PixelGlyphs is ERC721Enumerable, Ownable {
using ECDSA for bytes32;
uint256 spriteSize = 10;
uint256 globalId = 0;
address SIGNER;
uint256 public PRICE_PER_MINT = 0.009 ether;
uint256 public PRICE_PER_NAME = 0.0025 ether;
string BASE_URI;
uint256 public namingBlockStart;
uint256 public namingBlockEnd;
mapping(uint256 => string) public names;
constructor(address signer, string memory baseUri)
ERC721("PixelGlyphs", "PxG")
{
}
event Created(
uint256 indexed tokenId,
uint256[5][10] glyph,
uint256[3][3] colors
);
event Named(uint256 indexed tokenId, string name);
function nameGlyph(uint256 tokenId, string memory name) public payable {
}
// This will begin The Great Naming Ceremony
function setNamingBlock(uint256 blockNumber) public onlyOwner {
}
function _mintInternal(
uint256[] memory seed,
uint256[] memory cSeed,
bytes32 uuid,
uint256 timestamp,
bytes memory sig,
address to
) internal {
bytes32 hash = keccak256(abi.encodePacked(seed, cSeed, timestamp, uuid));
require(<FILL_ME>)
require(globalId < 10000, "PxG: All glyphs minted");
uint256[5][10] memory matrix;
for (uint256 i = 0; i < spriteSize; i++) {
uint256[5] memory row;
matrix[i] = row;
if (i == 0 || i == spriteSize - 1) continue;
row[0] = 0;
for (uint256 j = 1; j < row.length; j++) {
row[j] = seed[i * row.length + j] % 2;
}
}
for (uint256 index = 0; index < 2; index++) {
matrix = step(matrix);
}
uint256[3][3] memory colors;
for (uint256 i = 0; i < colors.length; i++) {
for (uint256 j = 0; j < colors[i].length; j++) {
colors[i][j] = cSeed[i * 3 + j] % 255;
}
}
_safeMint(to, ++globalId);
emit Created(globalId, matrix, colors);
}
function mintTo(
uint256[] memory seed,
uint256[] memory cSeed,
bytes32 uuid,
uint256 timestamp,
bytes memory sig,
address to
) public onlyOwner {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function mint(
uint256[][] memory seeds,
uint256[][] memory cSeeds,
bytes32[] memory uuids,
uint256 timestamp,
bytes[] memory sigs
) public payable {
}
mapping(address => uint256) public equipped;
event Equip(address indexed owner, uint256 tokenId);
function equip(uint256 tokenId) public {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal override {
}
function countNeighbors(
uint256[5][10] memory matrix,
uint256 x,
uint256 y
) internal pure returns (uint256) {
}
function step(uint256[5][10] memory prev)
internal
pure
returns (uint256[5][10] memory)
{
}
function withdraw(address sendTo) public onlyOwner {
}
function updateSigner(address signer) public onlyOwner {
}
function updatePricePerMint(uint256 price) public onlyOwner {
}
function setGenerationString(bytes calldata str) public onlyOwner {}
}
| hash.toEthSignedMessageHash().recover(sig)==SIGNER,"PxG: Invalid signature" | 339,870 | hash.toEthSignedMessageHash().recover(sig)==SIGNER |
"You are not whitelisted!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract Kaori is ERC721A, Ownable {
using Strings for uint256;
uint256 public price = 0.088 ether;
uint256 public constant maxSupply = 1000;
uint256 private constant maxMintAmountPerTx = 2;
uint256 private constant maxMintAmountPerWallet = 2;
string public baseURL;
string private baseExtension = ".json";
string public HiddenURL;
bytes32 public hashRoot;
bool public presaleMintIsActive = false;
bool public publicMintIsActive = false;
bool public revealed = true;
constructor() ERC721A("Kaori", "TDOK") {}
// ================= Mint Function =======================
function whitelistMint(uint256 _mintAmount, bytes32[] calldata _merkleProof)
external
payable
{
require(presaleMintIsActive, "Presale not active yet!");
require(
_mintAmount > 0 && _mintAmount <= maxMintAmountPerTx,
"Invalid mint amount!"
);
require(
totalSupply() + _mintAmount <= maxSupply,
"Max supply exceeded!"
);
require(msg.value >= price * _mintAmount, "Insufficient funds!");
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(<FILL_ME>)
uint256 mintedByWallet = _getAux(msg.sender) + _mintAmount;
require(
mintedByWallet <= maxMintAmountPerWallet,
"Max mint per wallet exceeded!"
);
_setAux(msg.sender, mintedByWallet);
_safeMint(msg.sender, _mintAmount);
}
function publicMint(uint256 _mintAmount) external payable {
}
// =================== Owner only function ==================
function flipPresaleMint() external onlyOwner {
}
function flipPublicMint() external onlyOwner {
}
function reveal() external onlyOwner {
}
function devMint(uint256 _mintAmount) external onlyOwner {
}
function setPrice(uint256 _newPrice) external onlyOwner {
}
function setbaseURL(string memory uri) external onlyOwner {
}
function setHiddenURL(string memory uri) external onlyOwner {
}
function setHashRoot(bytes32 hp) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// =================== View only function ======================
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| MerkleProof.verify(_merkleProof,hashRoot,leaf),"You are not whitelisted!" | 339,874 | MerkleProof.verify(_merkleProof,hashRoot,leaf) |
"Already claimed" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/// @title Ed Fornieles Studio Certificates
/// @author Jake Allen
/// @notice https://www.edfornielesstudios.com/
contract StudioCerts is Ownable {
using ECDSA for bytes32;
/// @notice link to original 2018 contract for provenance
address public originalContract = 0x6959396DC62b52C64e9A99c8227322D2305ae89e;
/// @notice merkle root of valid certificate addresses
bytes32 public merkleRoot = 0x19b05c521116c0d1cdde3e9e63a17ba836335503e7b6f32a154f42435ef13d91;
/// @notice certificate address => already claimed. certs are one time use.
mapping(address => bool) public hasClaimed;
/// @notice keeps track of how many certificates have been redeemed
uint256 public claimedCount;
/// @notice dev address, used for payments
address public dev = 0x97bB1eFC534fF3dC0DDF5fb83743605d5FAEcB27;
/// @notice artist address, used for payments
address public artist = 0x18CE6cD5c283dCa2F50c8347420607a4e59716A6;
/// @notice the current cost of a studio certificate
uint256 public price = .2 ether;
/// @notice the quantities sold for each edition. 0 index = 1st edition, etc.
uint256[] public editionsSold = [30, 41, 29, 40, 36];
/// @notice the total quantities allowed for each edition. 0 index = 1st edition, etc.
uint256[] public editionsAllowed = [100, 100, 100, 100, 100];
/// @notice emitted after a successful redemption
event Redeem(address indexed payee, address indexed certificateAddress);
/// @notice redeem a certificate and receive payment
/// @dev receives a signature and a payout address, which validates that the
/// signature was produced by a private key corresponding to a valid (i.e.
/// in our merkle tree) public certificate address
/// @param merkleProof the merkleProof corresponding to the certificate address
/// @param signedHash the signature produced by hashing and signing the
/// payoutAddress
/// @param payoutAddress the address to send payment to. will be hashed and
/// compared with signature for verification.
function redeem(
bytes32[] calldata merkleProof,
bytes calldata signedHash,
address payoutAddress
) external {
// checks
// verify that end user signed a message with a cert private key, and
// that the signed message correponds to the redeemAddress where we'll
// send the payout
address certAddress = keccak256(abi.encodePacked(payoutAddress))
.toEthSignedMessageHash()
.recover(signedHash);
// verify merkle proof and ensure not already claimed
require(<FILL_ME>)
require(checkMerkleProof(merkleProof, certAddress), "Invalid proof");
// capture the amount owed before we reduce supply
uint256 payoutAmount = currentPayout();
// effects. invalidate certificate address and reduce circulating supply
hasClaimed[certAddress] = true;
claimedCount++;
// interactions. payout the redeemAddress (NOT the recovered signer address)
payable(payoutAddress).transfer(payoutAmount);
// emit redeem event
emit Redeem(payoutAddress, certAddress);
}
/// @notice check whether the merkleProof is valid for a given address
function checkMerkleProof(
bytes32[] calldata merkleProof,
address _address
) public view returns (bool) {
}
/// @notice calculate current payout amount
/// @dev loop through the editionsSold counts, add them up, then subtract the
/// number claimed. divide total contract balance by this number of circulating
/// certs.
function currentPayout() public view returns (uint256) {
}
/// @notice purchase studio certificates
/// @param quantity an array of the quantity, indexed by edition. 0 = first
/// edition, etc. [0,2,0,0,0] for example means 2 second editions.
function purchase(uint256[] calldata quantity) external payable {
}
/// @notice rescue funds
/// @dev let owner withdraw all funds in case of emergency or contract upgrade.
/// this introduces a layer of trust, but this is acceptable since this entire
/// project requires trust.
function emergencyRescue() external onlyOwner {
}
/// @notice let owner set the merkle root
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/// @notice update the price of a studio certificate
function updatePrice(uint256 newPrice) external onlyOwner {
}
/// @notice update the artist address
function updateArtist(address _address) external onlyOwner {
}
/// @notice update the dev address
function updateDev(address _address) external onlyOwner {
}
/// @notice edit existing editions
/// @param index the edition number, zero-indexed. 0 = 1st edition, etc.
/// @param numberSold the number of this edition sold.
/// @param maxSupply the count of this edition.
function updateEdition(uint256 index, uint256 numberSold, uint256 maxSupply) external onlyOwner {
}
/// @notice add new editions
/// @param numberSold the number of this edition sold. normally 0 for new editions.
/// @param maxSupply the total amount printed of this edition.
function addEdition(uint256 numberSold, uint256 maxSupply) external onlyOwner {
}
/// @notice refund a purchase (in case of shipping errors)
/// @param amount formatted in wei
/// @param _address the address of the refund recipient
function refund(uint256 amount, address _address) external onlyOwner {
}
/// @notice pay dev split
function payDevSplit(uint256 amount) internal {
}
/// @notice pay artist split
function payArtistSplit(uint256 amount) internal {
}
/// @notice fallback function for receiving eth
receive() external payable {}
}
| !hasClaimed[certAddress],"Already claimed" | 339,912 | !hasClaimed[certAddress] |
"Invalid proof" | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/// @title Ed Fornieles Studio Certificates
/// @author Jake Allen
/// @notice https://www.edfornielesstudios.com/
contract StudioCerts is Ownable {
using ECDSA for bytes32;
/// @notice link to original 2018 contract for provenance
address public originalContract = 0x6959396DC62b52C64e9A99c8227322D2305ae89e;
/// @notice merkle root of valid certificate addresses
bytes32 public merkleRoot = 0x19b05c521116c0d1cdde3e9e63a17ba836335503e7b6f32a154f42435ef13d91;
/// @notice certificate address => already claimed. certs are one time use.
mapping(address => bool) public hasClaimed;
/// @notice keeps track of how many certificates have been redeemed
uint256 public claimedCount;
/// @notice dev address, used for payments
address public dev = 0x97bB1eFC534fF3dC0DDF5fb83743605d5FAEcB27;
/// @notice artist address, used for payments
address public artist = 0x18CE6cD5c283dCa2F50c8347420607a4e59716A6;
/// @notice the current cost of a studio certificate
uint256 public price = .2 ether;
/// @notice the quantities sold for each edition. 0 index = 1st edition, etc.
uint256[] public editionsSold = [30, 41, 29, 40, 36];
/// @notice the total quantities allowed for each edition. 0 index = 1st edition, etc.
uint256[] public editionsAllowed = [100, 100, 100, 100, 100];
/// @notice emitted after a successful redemption
event Redeem(address indexed payee, address indexed certificateAddress);
/// @notice redeem a certificate and receive payment
/// @dev receives a signature and a payout address, which validates that the
/// signature was produced by a private key corresponding to a valid (i.e.
/// in our merkle tree) public certificate address
/// @param merkleProof the merkleProof corresponding to the certificate address
/// @param signedHash the signature produced by hashing and signing the
/// payoutAddress
/// @param payoutAddress the address to send payment to. will be hashed and
/// compared with signature for verification.
function redeem(
bytes32[] calldata merkleProof,
bytes calldata signedHash,
address payoutAddress
) external {
// checks
// verify that end user signed a message with a cert private key, and
// that the signed message correponds to the redeemAddress where we'll
// send the payout
address certAddress = keccak256(abi.encodePacked(payoutAddress))
.toEthSignedMessageHash()
.recover(signedHash);
// verify merkle proof and ensure not already claimed
require(!hasClaimed[certAddress], "Already claimed");
require(<FILL_ME>)
// capture the amount owed before we reduce supply
uint256 payoutAmount = currentPayout();
// effects. invalidate certificate address and reduce circulating supply
hasClaimed[certAddress] = true;
claimedCount++;
// interactions. payout the redeemAddress (NOT the recovered signer address)
payable(payoutAddress).transfer(payoutAmount);
// emit redeem event
emit Redeem(payoutAddress, certAddress);
}
/// @notice check whether the merkleProof is valid for a given address
function checkMerkleProof(
bytes32[] calldata merkleProof,
address _address
) public view returns (bool) {
}
/// @notice calculate current payout amount
/// @dev loop through the editionsSold counts, add them up, then subtract the
/// number claimed. divide total contract balance by this number of circulating
/// certs.
function currentPayout() public view returns (uint256) {
}
/// @notice purchase studio certificates
/// @param quantity an array of the quantity, indexed by edition. 0 = first
/// edition, etc. [0,2,0,0,0] for example means 2 second editions.
function purchase(uint256[] calldata quantity) external payable {
}
/// @notice rescue funds
/// @dev let owner withdraw all funds in case of emergency or contract upgrade.
/// this introduces a layer of trust, but this is acceptable since this entire
/// project requires trust.
function emergencyRescue() external onlyOwner {
}
/// @notice let owner set the merkle root
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/// @notice update the price of a studio certificate
function updatePrice(uint256 newPrice) external onlyOwner {
}
/// @notice update the artist address
function updateArtist(address _address) external onlyOwner {
}
/// @notice update the dev address
function updateDev(address _address) external onlyOwner {
}
/// @notice edit existing editions
/// @param index the edition number, zero-indexed. 0 = 1st edition, etc.
/// @param numberSold the number of this edition sold.
/// @param maxSupply the count of this edition.
function updateEdition(uint256 index, uint256 numberSold, uint256 maxSupply) external onlyOwner {
}
/// @notice add new editions
/// @param numberSold the number of this edition sold. normally 0 for new editions.
/// @param maxSupply the total amount printed of this edition.
function addEdition(uint256 numberSold, uint256 maxSupply) external onlyOwner {
}
/// @notice refund a purchase (in case of shipping errors)
/// @param amount formatted in wei
/// @param _address the address of the refund recipient
function refund(uint256 amount, address _address) external onlyOwner {
}
/// @notice pay dev split
function payDevSplit(uint256 amount) internal {
}
/// @notice pay artist split
function payArtistSplit(uint256 amount) internal {
}
/// @notice fallback function for receiving eth
receive() external payable {}
}
| checkMerkleProof(merkleProof,certAddress),"Invalid proof" | 339,912 | checkMerkleProof(merkleProof,certAddress) |
"already-sent" | /*
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 {
require(<FILL_ME>)
require(makerApproved(), "vote-didn't-pass");
require(compoundApproved() || softGrace(), "wait-for-compound");
sentMaker = true;
require(BPRO.transfer(MAKER_DISTRIBUTOR, QTY), "transfer-failed");
}
function sendCompound() external {
}
}
| !sentMaker,"already-sent" | 339,918 | !sentMaker |
"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 {
require(! sentMaker, "already-sent");
require(<FILL_ME>)
require(compoundApproved() || softGrace(), "wait-for-compound");
sentMaker = true;
require(BPRO.transfer(MAKER_DISTRIBUTOR, QTY), "transfer-failed");
}
function sendCompound() external {
}
}
| makerApproved(),"vote-didn't-pass" | 339,918 | makerApproved() |
"wait-for-compound" | /*
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 {
require(! sentMaker, "already-sent");
require(makerApproved(), "vote-didn't-pass");
require(<FILL_ME>)
sentMaker = true;
require(BPRO.transfer(MAKER_DISTRIBUTOR, QTY), "transfer-failed");
}
function sendCompound() external {
}
}
| compoundApproved()||softGrace(),"wait-for-compound" | 339,918 | compoundApproved()||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 {
require(! sentMaker, "already-sent");
require(makerApproved(), "vote-didn't-pass");
require(compoundApproved() || softGrace(), "wait-for-compound");
sentMaker = true;
require(<FILL_ME>)
}
function sendCompound() external {
}
}
| BPRO.transfer(MAKER_DISTRIBUTOR,QTY),"transfer-failed" | 339,918 | BPRO.transfer(MAKER_DISTRIBUTOR,QTY) |
"already-sent" | /*
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(<FILL_ME>)
require(compoundApproved(), "vote-didn't-pass");
require(makerApproved() || softGrace(), "wait-for-maker");
sentCompound = true;
require(BPRO.transfer(COMPOUND_DISTRIBUTOR, QTY), "transfer-failed");
}
}
| !sentCompound,"already-sent" | 339,918 | !sentCompound |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.