comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.4.24;
/**
* @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) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
require(_token != address(0x0));
require(<FILL_ME>)
require(!tranche);
token = _token;
freeAmount = getMainBalance();
mainLockup = _lockup;
tranche = true;
lockupIsSet = true;
return true;
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| !lockupIsSet | 358,761 | !lockupIsSet |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
require(_token != address(0x0));
require(!lockupIsSet);
require(<FILL_ME>)
token = _token;
freeAmount = getMainBalance();
mainLockup = _lockup;
tranche = true;
lockupIsSet = true;
return true;
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| !tranche | 358,761 | !tranche |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
require(<FILL_ME>)
require(_newKey != 0x0);
for(uint i=0; i<4; i++){
if(massSafeKeys[i]==_oldKey){
massSafeKeys[i] = _newKey;
}
}
safeKeys[_oldKey] = false;
safeKeys[_newKey] = true;
if(_oldKey==lastSafeKey){
lastSafeKey = _newKey;
}
return true;
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| safeKeys[_oldKey] | 358,761 | safeKeys[_oldKey] |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
require(<FILL_ME>)
require(now >= userCells[msg.sender].lockup);
userCells[msg.sender].balance = userCells[msg.sender].balance.sub(_balance);
token.transfer(msg.sender, _balance);
emit Withdraw(msg.sender, _balance);
return true;
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| userCells[msg.sender].balance>=_balance | 358,761 | userCells[msg.sender].balance>=_balance |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
require(userCells[msg.sender].balance >= _balance);
require(<FILL_ME>)
require(userCells[_to].exist);
userCells[msg.sender].balance = userCells[msg.sender].balance.sub(_balance);
userCells[_to].balance = userCells[_to].balance.add(_balance);
emit InternalTransfer(msg.sender, _to, _balance);
return true;
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| userCells[_to].lockup>=userCells[msg.sender].lockup | 358,761 | userCells[_to].lockup>=userCells[msg.sender].lockup |
null | pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
// token contract interface
interface Token{
function balanceOf(address user) external returns(uint256);
function transfer(address to, uint256 amount) external returns(bool);
}
contract Safe{
using SafeMath for uint256;
// counter for signing transactions
uint8 public count;
uint256 internal end;
uint256 internal timeOutAuthentication;
// arrays of safe keys
mapping (address => bool) internal safeKeys;
address [] internal massSafeKeys = new address[](4);
// array of keys that signed the transaction
mapping (address => bool) internal signKeys;
// free amount in safe
uint256 internal freeAmount;
// event transferring money to safe
bool internal tranche;
// fixing lockup in safe
bool internal lockupIsSet;
// lockup of safe
uint256 internal mainLockup;
address internal lastSafeKey;
Token public token;
// Amount of cells
uint256 public countOfCell;
// cell structure
struct _Cell{
uint256 lockup;
uint256 balance;
bool exist;
uint256 timeOfDeposit;
}
// cell addresses
mapping (address => _Cell) internal userCells;
event CreateCell(address indexed key);
event Deposit(address indexed key, uint256 balance);
event Delete(address indexed key);
event Edit(address indexed key, uint256 lockup);
event Withdraw(address indexed who, uint256 balance);
event InternalTransfer(address indexed from, address indexed to, uint256 balance);
modifier firstLevel() {
}
modifier secondLevel() {
}
modifier thirdLevel() {
}
constructor (address _first, address _second, address _third, address _fourth) public {
}
function AuthStart() public returns(bool){
}
// completion of operation with safe-keys
function AuthEnd() public returns(bool){
}
function getTimeOutAuthentication() firstLevel public view returns(uint256){
}
function getFreeAmount() firstLevel public view returns(uint256){
}
function getLockupCell(address _user) firstLevel public view returns(uint256){
}
function getBalanceCell(address _user) firstLevel public view returns(uint256){
}
function getExistCell(address _user) firstLevel public view returns(bool){
}
function getSafeKey(uint i) firstLevel view public returns(address){
}
// withdrawal tokens from safe for issuer
function AssetWithdraw(address _to, uint256 _balance) secondLevel public returns(bool){
}
function setCell(address _cell, uint256 _lockup) secondLevel public returns(bool){
}
function deleteCell(address _key) secondLevel public returns(bool){
}
// change parameters of the cell
function editCell(address _key, uint256 _lockup) secondLevel public returns(bool){
}
function depositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
function changeDepositCell(address _key, uint256 _balance) secondLevel public returns(bool){
}
// installation of a lockup for safe,
// fixing free amount on balance,
// token installation
// (run once)
function setContract(Token _token, uint256 _lockup) thirdLevel public returns(bool){
}
// change of safe-key
function changeKey(address _oldKey, address _newKey) thirdLevel public returns(bool){
}
function setTimeOutAuthentication(uint256 _time) thirdLevel public returns(bool){
}
function withdrawCell(uint256 _balance) public returns(bool){
}
// transferring tokens from one cell to another
function transferCell(address _to, uint256 _balance) public returns(bool){
require(userCells[msg.sender].balance >= _balance);
require(userCells[_to].lockup>=userCells[msg.sender].lockup);
require(<FILL_ME>)
userCells[msg.sender].balance = userCells[msg.sender].balance.sub(_balance);
userCells[_to].balance = userCells[_to].balance.add(_balance);
emit InternalTransfer(msg.sender, _to, _balance);
return true;
}
// information on balance of cell for holder
function getInfoCellBalance() view public returns(uint256){
}
// information on lockup of cell for holder
function getInfoCellLockup() view public returns(uint256){
}
function getMainBalance() public view returns(uint256){
}
function getMainLockup() public view returns(uint256){
}
function isTimeOver() view public returns(bool){
}
}
| userCells[_to].exist | 358,761 | userCells[_to].exist |
"Transaction will exceed maximum supply of HappySharks" | pragma solidity ^0.8.0;
/// @author Hammad Ghazi
contract HappySharks is ERC721Enumerable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenId;
uint256 public constant MAX_HS = 10000;
uint256 public price = 35000000000000000; //0.035 Ether
string baseTokenURI;
bool public saleOpen = false;
event HappySharksMinted(uint256 totalMinted);
constructor(string memory baseURI) ERC721("Happy Sharks", "HS") {
}
//Get token Ids of all tokens owned by _owner
function walletOfOwner(address _owner)
external
view
returns (uint256[] memory)
{
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function setPrice(uint256 _newPrice) public onlyOwner {
}
//Close sale if open, open sale if closed
function flipSaleState() public onlyOwner {
}
function withdrawAll() public onlyOwner {
}
//mint HappySharks
function mintHappySharks(uint256 _count) public payable {
if (msg.sender != owner()) {
require(saleOpen, "Sale is not open yet");
}
require(
_count > 0 && _count <= 20,
"Min 1 & Max 20 HappySharks can be minted per transaction"
);
require(<FILL_ME>)
require(
msg.value >= price * _count,
"Ether sent with this transaction is not correct"
);
address _to = msg.sender;
for (uint256 i = 0; i < _count; i++) {
_mint(_to);
}
}
function _mint(address _to) private {
}
function _baseURI() internal view virtual override returns (string memory) {
}
}
| totalSupply()+_count<=MAX_HS,"Transaction will exceed maximum supply of HappySharks" | 358,809 | totalSupply()+_count<=MAX_HS |
"Moloch::onlyMember - not a member" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
require(<FILL_ME>)
_;
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| members[msg.sender].shares>0,"Moloch::onlyMember - not a member" | 358,813 | members[msg.sender].shares>0 |
"Moloch::onlyDelegate - not a delegate" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
require(<FILL_ME>)
_;
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| members[memberAddressByDelegateKey[msg.sender]].shares>0,"Moloch::onlyDelegate - not a delegate" | 358,813 | members[memberAddressByDelegateKey[msg.sender]].shares>0 |
"Moloch::submitProposal - too many shares requested" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
require(applicant != address(0), "Moloch::submitProposal - applicant cannot be 0");
// Make sure we won't run into overflows when doing calculations with shares.
// Note that totalShares + totalSharesRequested + sharesRequested is an upper bound
// on the number of shares that can exist until this proposal has been processed.
require(<FILL_ME>)
totalSharesRequested = totalSharesRequested.add(sharesRequested);
address memberAddress = memberAddressByDelegateKey[msg.sender];
// collect proposal deposit from proposer and store it in the Moloch until the proposal is processed
require(approvedToken.transferFrom(msg.sender, address(this), proposalDeposit), "Moloch::submitProposal - proposal deposit token transfer failed");
// collect tribute from applicant and store it in the Moloch until the proposal is processed
require(approvedToken.transferFrom(applicant, address(this), tokenTribute), "Moloch::submitProposal - tribute token transfer failed");
// compute startingPeriod for proposal
uint256 startingPeriod = max(
getCurrentPeriod(),
proposalQueue.length == 0 ? 0 : proposalQueue[proposalQueue.length.sub(1)].startingPeriod
).add(1);
// create proposal ...
Proposal memory proposal = Proposal({
proposer: memberAddress,
applicant: applicant,
sharesRequested: sharesRequested,
startingPeriod: startingPeriod,
yesVotes: 0,
noVotes: 0,
processed: false,
didPass: false,
aborted: false,
tokenTribute: tokenTribute,
details: details,
maxTotalSharesAtYesVote: 0
});
// ... and append it to the queue
proposalQueue.push(proposal);
uint256 proposalIndex = proposalQueue.length.sub(1);
emit SubmitProposal(proposalIndex, msg.sender, memberAddress, applicant, tokenTribute, sharesRequested);
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| totalShares.add(totalSharesRequested).add(sharesRequested)<=MAX_NUMBER_OF_SHARES,"Moloch::submitProposal - too many shares requested" | 358,813 | totalShares.add(totalSharesRequested).add(sharesRequested)<=MAX_NUMBER_OF_SHARES |
"Moloch::submitProposal - proposal deposit token transfer failed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
require(applicant != address(0), "Moloch::submitProposal - applicant cannot be 0");
// Make sure we won't run into overflows when doing calculations with shares.
// Note that totalShares + totalSharesRequested + sharesRequested is an upper bound
// on the number of shares that can exist until this proposal has been processed.
require(totalShares.add(totalSharesRequested).add(sharesRequested) <= MAX_NUMBER_OF_SHARES, "Moloch::submitProposal - too many shares requested");
totalSharesRequested = totalSharesRequested.add(sharesRequested);
address memberAddress = memberAddressByDelegateKey[msg.sender];
// collect proposal deposit from proposer and store it in the Moloch until the proposal is processed
require(<FILL_ME>)
// collect tribute from applicant and store it in the Moloch until the proposal is processed
require(approvedToken.transferFrom(applicant, address(this), tokenTribute), "Moloch::submitProposal - tribute token transfer failed");
// compute startingPeriod for proposal
uint256 startingPeriod = max(
getCurrentPeriod(),
proposalQueue.length == 0 ? 0 : proposalQueue[proposalQueue.length.sub(1)].startingPeriod
).add(1);
// create proposal ...
Proposal memory proposal = Proposal({
proposer: memberAddress,
applicant: applicant,
sharesRequested: sharesRequested,
startingPeriod: startingPeriod,
yesVotes: 0,
noVotes: 0,
processed: false,
didPass: false,
aborted: false,
tokenTribute: tokenTribute,
details: details,
maxTotalSharesAtYesVote: 0
});
// ... and append it to the queue
proposalQueue.push(proposal);
uint256 proposalIndex = proposalQueue.length.sub(1);
emit SubmitProposal(proposalIndex, msg.sender, memberAddress, applicant, tokenTribute, sharesRequested);
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transferFrom(msg.sender,address(this),proposalDeposit),"Moloch::submitProposal - proposal deposit token transfer failed" | 358,813 | approvedToken.transferFrom(msg.sender,address(this),proposalDeposit) |
"Moloch::submitProposal - tribute token transfer failed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
require(applicant != address(0), "Moloch::submitProposal - applicant cannot be 0");
// Make sure we won't run into overflows when doing calculations with shares.
// Note that totalShares + totalSharesRequested + sharesRequested is an upper bound
// on the number of shares that can exist until this proposal has been processed.
require(totalShares.add(totalSharesRequested).add(sharesRequested) <= MAX_NUMBER_OF_SHARES, "Moloch::submitProposal - too many shares requested");
totalSharesRequested = totalSharesRequested.add(sharesRequested);
address memberAddress = memberAddressByDelegateKey[msg.sender];
// collect proposal deposit from proposer and store it in the Moloch until the proposal is processed
require(approvedToken.transferFrom(msg.sender, address(this), proposalDeposit), "Moloch::submitProposal - proposal deposit token transfer failed");
// collect tribute from applicant and store it in the Moloch until the proposal is processed
require(<FILL_ME>)
// compute startingPeriod for proposal
uint256 startingPeriod = max(
getCurrentPeriod(),
proposalQueue.length == 0 ? 0 : proposalQueue[proposalQueue.length.sub(1)].startingPeriod
).add(1);
// create proposal ...
Proposal memory proposal = Proposal({
proposer: memberAddress,
applicant: applicant,
sharesRequested: sharesRequested,
startingPeriod: startingPeriod,
yesVotes: 0,
noVotes: 0,
processed: false,
didPass: false,
aborted: false,
tokenTribute: tokenTribute,
details: details,
maxTotalSharesAtYesVote: 0
});
// ... and append it to the queue
proposalQueue.push(proposal);
uint256 proposalIndex = proposalQueue.length.sub(1);
emit SubmitProposal(proposalIndex, msg.sender, memberAddress, applicant, tokenTribute, sharesRequested);
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transferFrom(applicant,address(this),tokenTribute),"Moloch::submitProposal - tribute token transfer failed" | 358,813 | approvedToken.transferFrom(applicant,address(this),tokenTribute) |
"Moloch::submitVote - voting period has not started" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
address memberAddress = memberAddressByDelegateKey[msg.sender];
Member storage member = members[memberAddress];
require(proposalIndex < proposalQueue.length, "Moloch::submitVote - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(uintVote < 3, "Moloch::submitVote - uintVote must be less than 3");
Vote vote = Vote(uintVote);
require(<FILL_ME>)
require(!hasVotingPeriodExpired(proposal.startingPeriod), "Moloch::submitVote - proposal voting period has expired");
require(proposal.votesByMember[memberAddress] == Vote.Null, "Moloch::submitVote - member has already voted on this proposal");
require(vote == Vote.Yes || vote == Vote.No, "Moloch::submitVote - vote must be either Yes or No");
require(!proposal.aborted, "Moloch::submitVote - proposal has been aborted");
// store vote
proposal.votesByMember[memberAddress] = vote;
// count vote
if (vote == Vote.Yes) {
proposal.yesVotes = proposal.yesVotes.add(member.shares);
// set highest index (latest) yes vote - must be processed for member to ragequit
if (proposalIndex > member.highestIndexYesVote) {
member.highestIndexYesVote = proposalIndex;
}
// set maximum of total shares encountered at a yes vote - used to bound dilution for yes voters
if (totalShares > proposal.maxTotalSharesAtYesVote) {
proposal.maxTotalSharesAtYesVote = totalShares;
}
} else if (vote == Vote.No) {
proposal.noVotes = proposal.noVotes.add(member.shares);
}
emit SubmitVote(proposalIndex, msg.sender, memberAddress, uintVote);
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| getCurrentPeriod()>=proposal.startingPeriod,"Moloch::submitVote - voting period has not started" | 358,813 | getCurrentPeriod()>=proposal.startingPeriod |
"Moloch::submitVote - proposal voting period has expired" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
address memberAddress = memberAddressByDelegateKey[msg.sender];
Member storage member = members[memberAddress];
require(proposalIndex < proposalQueue.length, "Moloch::submitVote - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(uintVote < 3, "Moloch::submitVote - uintVote must be less than 3");
Vote vote = Vote(uintVote);
require(getCurrentPeriod() >= proposal.startingPeriod, "Moloch::submitVote - voting period has not started");
require(<FILL_ME>)
require(proposal.votesByMember[memberAddress] == Vote.Null, "Moloch::submitVote - member has already voted on this proposal");
require(vote == Vote.Yes || vote == Vote.No, "Moloch::submitVote - vote must be either Yes or No");
require(!proposal.aborted, "Moloch::submitVote - proposal has been aborted");
// store vote
proposal.votesByMember[memberAddress] = vote;
// count vote
if (vote == Vote.Yes) {
proposal.yesVotes = proposal.yesVotes.add(member.shares);
// set highest index (latest) yes vote - must be processed for member to ragequit
if (proposalIndex > member.highestIndexYesVote) {
member.highestIndexYesVote = proposalIndex;
}
// set maximum of total shares encountered at a yes vote - used to bound dilution for yes voters
if (totalShares > proposal.maxTotalSharesAtYesVote) {
proposal.maxTotalSharesAtYesVote = totalShares;
}
} else if (vote == Vote.No) {
proposal.noVotes = proposal.noVotes.add(member.shares);
}
emit SubmitVote(proposalIndex, msg.sender, memberAddress, uintVote);
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| !hasVotingPeriodExpired(proposal.startingPeriod),"Moloch::submitVote - proposal voting period has expired" | 358,813 | !hasVotingPeriodExpired(proposal.startingPeriod) |
"Moloch::submitVote - member has already voted on this proposal" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
address memberAddress = memberAddressByDelegateKey[msg.sender];
Member storage member = members[memberAddress];
require(proposalIndex < proposalQueue.length, "Moloch::submitVote - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(uintVote < 3, "Moloch::submitVote - uintVote must be less than 3");
Vote vote = Vote(uintVote);
require(getCurrentPeriod() >= proposal.startingPeriod, "Moloch::submitVote - voting period has not started");
require(!hasVotingPeriodExpired(proposal.startingPeriod), "Moloch::submitVote - proposal voting period has expired");
require(<FILL_ME>)
require(vote == Vote.Yes || vote == Vote.No, "Moloch::submitVote - vote must be either Yes or No");
require(!proposal.aborted, "Moloch::submitVote - proposal has been aborted");
// store vote
proposal.votesByMember[memberAddress] = vote;
// count vote
if (vote == Vote.Yes) {
proposal.yesVotes = proposal.yesVotes.add(member.shares);
// set highest index (latest) yes vote - must be processed for member to ragequit
if (proposalIndex > member.highestIndexYesVote) {
member.highestIndexYesVote = proposalIndex;
}
// set maximum of total shares encountered at a yes vote - used to bound dilution for yes voters
if (totalShares > proposal.maxTotalSharesAtYesVote) {
proposal.maxTotalSharesAtYesVote = totalShares;
}
} else if (vote == Vote.No) {
proposal.noVotes = proposal.noVotes.add(member.shares);
}
emit SubmitVote(proposalIndex, msg.sender, memberAddress, uintVote);
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| proposal.votesByMember[memberAddress]==Vote.Null,"Moloch::submitVote - member has already voted on this proposal" | 358,813 | proposal.votesByMember[memberAddress]==Vote.Null |
"Moloch::submitVote - proposal has been aborted" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
address memberAddress = memberAddressByDelegateKey[msg.sender];
Member storage member = members[memberAddress];
require(proposalIndex < proposalQueue.length, "Moloch::submitVote - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(uintVote < 3, "Moloch::submitVote - uintVote must be less than 3");
Vote vote = Vote(uintVote);
require(getCurrentPeriod() >= proposal.startingPeriod, "Moloch::submitVote - voting period has not started");
require(!hasVotingPeriodExpired(proposal.startingPeriod), "Moloch::submitVote - proposal voting period has expired");
require(proposal.votesByMember[memberAddress] == Vote.Null, "Moloch::submitVote - member has already voted on this proposal");
require(vote == Vote.Yes || vote == Vote.No, "Moloch::submitVote - vote must be either Yes or No");
require(<FILL_ME>)
// store vote
proposal.votesByMember[memberAddress] = vote;
// count vote
if (vote == Vote.Yes) {
proposal.yesVotes = proposal.yesVotes.add(member.shares);
// set highest index (latest) yes vote - must be processed for member to ragequit
if (proposalIndex > member.highestIndexYesVote) {
member.highestIndexYesVote = proposalIndex;
}
// set maximum of total shares encountered at a yes vote - used to bound dilution for yes voters
if (totalShares > proposal.maxTotalSharesAtYesVote) {
proposal.maxTotalSharesAtYesVote = totalShares;
}
} else if (vote == Vote.No) {
proposal.noVotes = proposal.noVotes.add(member.shares);
}
emit SubmitVote(proposalIndex, msg.sender, memberAddress, uintVote);
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| !proposal.aborted,"Moloch::submitVote - proposal has been aborted" | 358,813 | !proposal.aborted |
"Moloch::processProposal - proposal is not ready to be processed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(<FILL_ME>)
require(proposal.processed == false, "Moloch::processProposal - proposal has already been processed");
require(proposalIndex == 0 || proposalQueue[proposalIndex.sub(1)].processed, "Moloch::processProposal - previous proposal must be processed");
proposal.processed = true;
totalSharesRequested = totalSharesRequested.sub(proposal.sharesRequested);
bool didPass = proposal.yesVotes > proposal.noVotes;
// Make the proposal fail if the dilutionBound is exceeded
if (totalShares.mul(dilutionBound) < proposal.maxTotalSharesAtYesVote) {
didPass = false;
}
// PROPOSAL PASSED
if (didPass && !proposal.aborted) {
proposal.didPass = true;
// if the applicant is already a member, add to their existing shares
if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
// the applicant is a new member, create a new record for them
} else {
// if the applicant address is already taken by a member's delegateKey, reset it to their member address
if (members[memberAddressByDelegateKey[proposal.applicant]].exists) {
address memberToOverride = memberAddressByDelegateKey[proposal.applicant];
memberAddressByDelegateKey[memberToOverride] = memberToOverride;
members[memberToOverride].delegateKey = memberToOverride;
}
// use applicant address as delegateKey by default
members[proposal.applicant] = Member(proposal.applicant, proposal.sharesRequested, true, 0);
memberAddressByDelegateKey[proposal.applicant] = proposal.applicant;
}
// mint new shares
totalShares = totalShares.add(proposal.sharesRequested);
// transfer tokens to guild bank
require(
approvedToken.transfer(address(guildBank), proposal.tokenTribute),
"Moloch::processProposal - token transfer to guild bank failed"
);
// PROPOSAL FAILED OR ABORTED
} else {
// return all tokens to the applicant
require(
approvedToken.transfer(proposal.applicant, proposal.tokenTribute),
"Moloch::processProposal - failing vote token transfer failed"
);
}
// send msg.sender the processingReward
require(
approvedToken.transfer(msg.sender, processingReward),
"Moloch::processProposal - failed to send processing reward to msg.sender"
);
// return deposit to proposer (subtract processing reward)
require(
approvedToken.transfer(proposal.proposer, proposalDeposit.sub(processingReward)),
"Moloch::processProposal - failed to return proposal deposit to proposer"
);
emit ProcessProposal(
proposalIndex,
proposal.applicant,
proposal.proposer,
proposal.tokenTribute,
proposal.sharesRequested,
didPass
);
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| getCurrentPeriod()>=proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength),"Moloch::processProposal - proposal is not ready to be processed" | 358,813 | getCurrentPeriod()>=proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength) |
"Moloch::processProposal - token transfer to guild bank failed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(getCurrentPeriod() >= proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength), "Moloch::processProposal - proposal is not ready to be processed");
require(proposal.processed == false, "Moloch::processProposal - proposal has already been processed");
require(proposalIndex == 0 || proposalQueue[proposalIndex.sub(1)].processed, "Moloch::processProposal - previous proposal must be processed");
proposal.processed = true;
totalSharesRequested = totalSharesRequested.sub(proposal.sharesRequested);
bool didPass = proposal.yesVotes > proposal.noVotes;
// Make the proposal fail if the dilutionBound is exceeded
if (totalShares.mul(dilutionBound) < proposal.maxTotalSharesAtYesVote) {
didPass = false;
}
// PROPOSAL PASSED
if (didPass && !proposal.aborted) {
proposal.didPass = true;
// if the applicant is already a member, add to their existing shares
if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
// the applicant is a new member, create a new record for them
} else {
// if the applicant address is already taken by a member's delegateKey, reset it to their member address
if (members[memberAddressByDelegateKey[proposal.applicant]].exists) {
address memberToOverride = memberAddressByDelegateKey[proposal.applicant];
memberAddressByDelegateKey[memberToOverride] = memberToOverride;
members[memberToOverride].delegateKey = memberToOverride;
}
// use applicant address as delegateKey by default
members[proposal.applicant] = Member(proposal.applicant, proposal.sharesRequested, true, 0);
memberAddressByDelegateKey[proposal.applicant] = proposal.applicant;
}
// mint new shares
totalShares = totalShares.add(proposal.sharesRequested);
// transfer tokens to guild bank
require(<FILL_ME>)
// PROPOSAL FAILED OR ABORTED
} else {
// return all tokens to the applicant
require(
approvedToken.transfer(proposal.applicant, proposal.tokenTribute),
"Moloch::processProposal - failing vote token transfer failed"
);
}
// send msg.sender the processingReward
require(
approvedToken.transfer(msg.sender, processingReward),
"Moloch::processProposal - failed to send processing reward to msg.sender"
);
// return deposit to proposer (subtract processing reward)
require(
approvedToken.transfer(proposal.proposer, proposalDeposit.sub(processingReward)),
"Moloch::processProposal - failed to return proposal deposit to proposer"
);
emit ProcessProposal(
proposalIndex,
proposal.applicant,
proposal.proposer,
proposal.tokenTribute,
proposal.sharesRequested,
didPass
);
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transfer(address(guildBank),proposal.tokenTribute),"Moloch::processProposal - token transfer to guild bank failed" | 358,813 | approvedToken.transfer(address(guildBank),proposal.tokenTribute) |
"Moloch::processProposal - failing vote token transfer failed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(getCurrentPeriod() >= proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength), "Moloch::processProposal - proposal is not ready to be processed");
require(proposal.processed == false, "Moloch::processProposal - proposal has already been processed");
require(proposalIndex == 0 || proposalQueue[proposalIndex.sub(1)].processed, "Moloch::processProposal - previous proposal must be processed");
proposal.processed = true;
totalSharesRequested = totalSharesRequested.sub(proposal.sharesRequested);
bool didPass = proposal.yesVotes > proposal.noVotes;
// Make the proposal fail if the dilutionBound is exceeded
if (totalShares.mul(dilutionBound) < proposal.maxTotalSharesAtYesVote) {
didPass = false;
}
// PROPOSAL PASSED
if (didPass && !proposal.aborted) {
proposal.didPass = true;
// if the applicant is already a member, add to their existing shares
if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
// the applicant is a new member, create a new record for them
} else {
// if the applicant address is already taken by a member's delegateKey, reset it to their member address
if (members[memberAddressByDelegateKey[proposal.applicant]].exists) {
address memberToOverride = memberAddressByDelegateKey[proposal.applicant];
memberAddressByDelegateKey[memberToOverride] = memberToOverride;
members[memberToOverride].delegateKey = memberToOverride;
}
// use applicant address as delegateKey by default
members[proposal.applicant] = Member(proposal.applicant, proposal.sharesRequested, true, 0);
memberAddressByDelegateKey[proposal.applicant] = proposal.applicant;
}
// mint new shares
totalShares = totalShares.add(proposal.sharesRequested);
// transfer tokens to guild bank
require(
approvedToken.transfer(address(guildBank), proposal.tokenTribute),
"Moloch::processProposal - token transfer to guild bank failed"
);
// PROPOSAL FAILED OR ABORTED
} else {
// return all tokens to the applicant
require(<FILL_ME>)
}
// send msg.sender the processingReward
require(
approvedToken.transfer(msg.sender, processingReward),
"Moloch::processProposal - failed to send processing reward to msg.sender"
);
// return deposit to proposer (subtract processing reward)
require(
approvedToken.transfer(proposal.proposer, proposalDeposit.sub(processingReward)),
"Moloch::processProposal - failed to return proposal deposit to proposer"
);
emit ProcessProposal(
proposalIndex,
proposal.applicant,
proposal.proposer,
proposal.tokenTribute,
proposal.sharesRequested,
didPass
);
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transfer(proposal.applicant,proposal.tokenTribute),"Moloch::processProposal - failing vote token transfer failed" | 358,813 | approvedToken.transfer(proposal.applicant,proposal.tokenTribute) |
"Moloch::processProposal - failed to send processing reward to msg.sender" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(getCurrentPeriod() >= proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength), "Moloch::processProposal - proposal is not ready to be processed");
require(proposal.processed == false, "Moloch::processProposal - proposal has already been processed");
require(proposalIndex == 0 || proposalQueue[proposalIndex.sub(1)].processed, "Moloch::processProposal - previous proposal must be processed");
proposal.processed = true;
totalSharesRequested = totalSharesRequested.sub(proposal.sharesRequested);
bool didPass = proposal.yesVotes > proposal.noVotes;
// Make the proposal fail if the dilutionBound is exceeded
if (totalShares.mul(dilutionBound) < proposal.maxTotalSharesAtYesVote) {
didPass = false;
}
// PROPOSAL PASSED
if (didPass && !proposal.aborted) {
proposal.didPass = true;
// if the applicant is already a member, add to their existing shares
if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
// the applicant is a new member, create a new record for them
} else {
// if the applicant address is already taken by a member's delegateKey, reset it to their member address
if (members[memberAddressByDelegateKey[proposal.applicant]].exists) {
address memberToOverride = memberAddressByDelegateKey[proposal.applicant];
memberAddressByDelegateKey[memberToOverride] = memberToOverride;
members[memberToOverride].delegateKey = memberToOverride;
}
// use applicant address as delegateKey by default
members[proposal.applicant] = Member(proposal.applicant, proposal.sharesRequested, true, 0);
memberAddressByDelegateKey[proposal.applicant] = proposal.applicant;
}
// mint new shares
totalShares = totalShares.add(proposal.sharesRequested);
// transfer tokens to guild bank
require(
approvedToken.transfer(address(guildBank), proposal.tokenTribute),
"Moloch::processProposal - token transfer to guild bank failed"
);
// PROPOSAL FAILED OR ABORTED
} else {
// return all tokens to the applicant
require(
approvedToken.transfer(proposal.applicant, proposal.tokenTribute),
"Moloch::processProposal - failing vote token transfer failed"
);
}
// send msg.sender the processingReward
require(<FILL_ME>)
// return deposit to proposer (subtract processing reward)
require(
approvedToken.transfer(proposal.proposer, proposalDeposit.sub(processingReward)),
"Moloch::processProposal - failed to return proposal deposit to proposer"
);
emit ProcessProposal(
proposalIndex,
proposal.applicant,
proposal.proposer,
proposal.tokenTribute,
proposal.sharesRequested,
didPass
);
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transfer(msg.sender,processingReward),"Moloch::processProposal - failed to send processing reward to msg.sender" | 358,813 | approvedToken.transfer(msg.sender,processingReward) |
"Moloch::processProposal - failed to return proposal deposit to proposer" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::processProposal - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(getCurrentPeriod() >= proposal.startingPeriod.add(votingPeriodLength).add(gracePeriodLength), "Moloch::processProposal - proposal is not ready to be processed");
require(proposal.processed == false, "Moloch::processProposal - proposal has already been processed");
require(proposalIndex == 0 || proposalQueue[proposalIndex.sub(1)].processed, "Moloch::processProposal - previous proposal must be processed");
proposal.processed = true;
totalSharesRequested = totalSharesRequested.sub(proposal.sharesRequested);
bool didPass = proposal.yesVotes > proposal.noVotes;
// Make the proposal fail if the dilutionBound is exceeded
if (totalShares.mul(dilutionBound) < proposal.maxTotalSharesAtYesVote) {
didPass = false;
}
// PROPOSAL PASSED
if (didPass && !proposal.aborted) {
proposal.didPass = true;
// if the applicant is already a member, add to their existing shares
if (members[proposal.applicant].exists) {
members[proposal.applicant].shares = members[proposal.applicant].shares.add(proposal.sharesRequested);
// the applicant is a new member, create a new record for them
} else {
// if the applicant address is already taken by a member's delegateKey, reset it to their member address
if (members[memberAddressByDelegateKey[proposal.applicant]].exists) {
address memberToOverride = memberAddressByDelegateKey[proposal.applicant];
memberAddressByDelegateKey[memberToOverride] = memberToOverride;
members[memberToOverride].delegateKey = memberToOverride;
}
// use applicant address as delegateKey by default
members[proposal.applicant] = Member(proposal.applicant, proposal.sharesRequested, true, 0);
memberAddressByDelegateKey[proposal.applicant] = proposal.applicant;
}
// mint new shares
totalShares = totalShares.add(proposal.sharesRequested);
// transfer tokens to guild bank
require(
approvedToken.transfer(address(guildBank), proposal.tokenTribute),
"Moloch::processProposal - token transfer to guild bank failed"
);
// PROPOSAL FAILED OR ABORTED
} else {
// return all tokens to the applicant
require(
approvedToken.transfer(proposal.applicant, proposal.tokenTribute),
"Moloch::processProposal - failing vote token transfer failed"
);
}
// send msg.sender the processingReward
require(
approvedToken.transfer(msg.sender, processingReward),
"Moloch::processProposal - failed to send processing reward to msg.sender"
);
// return deposit to proposer (subtract processing reward)
require(<FILL_ME>)
emit ProcessProposal(
proposalIndex,
proposal.applicant,
proposal.proposer,
proposal.tokenTribute,
proposal.sharesRequested,
didPass
);
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transfer(proposal.proposer,proposalDeposit.sub(processingReward)),"Moloch::processProposal - failed to return proposal deposit to proposer" | 358,813 | approvedToken.transfer(proposal.proposer,proposalDeposit.sub(processingReward)) |
"Moloch::ragequit - cant ragequit until highest index proposal member voted YES on is processed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
uint256 initialTotalShares = totalShares;
Member storage member = members[msg.sender];
require(member.shares >= sharesToBurn, "Moloch::ragequit - insufficient shares");
require(<FILL_ME>)
// burn shares
member.shares = member.shares.sub(sharesToBurn);
totalShares = totalShares.sub(sharesToBurn);
// instruct guildBank to transfer fair share of tokens to the ragequitter
require(
guildBank.withdraw(msg.sender, sharesToBurn, initialTotalShares),
"Moloch::ragequit - withdrawal of tokens from guildBank failed"
);
emit Ragequit(msg.sender, sharesToBurn);
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| canRagequit(member.highestIndexYesVote),"Moloch::ragequit - cant ragequit until highest index proposal member voted YES on is processed" | 358,813 | canRagequit(member.highestIndexYesVote) |
"Moloch::ragequit - withdrawal of tokens from guildBank failed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
uint256 initialTotalShares = totalShares;
Member storage member = members[msg.sender];
require(member.shares >= sharesToBurn, "Moloch::ragequit - insufficient shares");
require(canRagequit(member.highestIndexYesVote), "Moloch::ragequit - cant ragequit until highest index proposal member voted YES on is processed");
// burn shares
member.shares = member.shares.sub(sharesToBurn);
totalShares = totalShares.sub(sharesToBurn);
// instruct guildBank to transfer fair share of tokens to the ragequitter
require(<FILL_ME>)
emit Ragequit(msg.sender, sharesToBurn);
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| guildBank.withdraw(msg.sender,sharesToBurn,initialTotalShares),"Moloch::ragequit - withdrawal of tokens from guildBank failed" | 358,813 | guildBank.withdraw(msg.sender,sharesToBurn,initialTotalShares) |
"Moloch::abort - abort window must not have passed" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::abort - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(msg.sender == proposal.applicant, "Moloch::abort - msg.sender must be applicant");
require(<FILL_ME>)
require(!proposal.aborted, "Moloch::abort - proposal must not have already been aborted");
uint256 tokensToAbort = proposal.tokenTribute;
proposal.tokenTribute = 0;
proposal.aborted = true;
// return all tokens to the applicant
require(
approvedToken.transfer(proposal.applicant, tokensToAbort),
"Moloch::processProposal - failed to return tribute to applicant"
);
emit Abort(proposalIndex, msg.sender);
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| getCurrentPeriod()<proposal.startingPeriod.add(abortWindow),"Moloch::abort - abort window must not have passed" | 358,813 | getCurrentPeriod()<proposal.startingPeriod.add(abortWindow) |
"Moloch::processProposal - failed to return tribute to applicant" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
require(proposalIndex < proposalQueue.length, "Moloch::abort - proposal does not exist");
Proposal storage proposal = proposalQueue[proposalIndex];
require(msg.sender == proposal.applicant, "Moloch::abort - msg.sender must be applicant");
require(getCurrentPeriod() < proposal.startingPeriod.add(abortWindow), "Moloch::abort - abort window must not have passed");
require(!proposal.aborted, "Moloch::abort - proposal must not have already been aborted");
uint256 tokensToAbort = proposal.tokenTribute;
proposal.tokenTribute = 0;
proposal.aborted = true;
// return all tokens to the applicant
require(<FILL_ME>)
emit Abort(proposalIndex, msg.sender);
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| approvedToken.transfer(proposal.applicant,tokensToAbort),"Moloch::processProposal - failed to return tribute to applicant" | 358,813 | approvedToken.transfer(proposal.applicant,tokensToAbort) |
"Moloch::updateDelegateKey - cant overwrite existing members" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
require(newDelegateKey != address(0), "Moloch::updateDelegateKey - newDelegateKey cannot be 0");
// skip checks if member is setting the delegate key to their member address
if (newDelegateKey != msg.sender) {
require(<FILL_ME>)
require(!members[memberAddressByDelegateKey[newDelegateKey]].exists, "Moloch::updateDelegateKey - cant overwrite existing delegate keys");
}
Member storage member = members[msg.sender];
memberAddressByDelegateKey[member.delegateKey] = address(0);
memberAddressByDelegateKey[newDelegateKey] = msg.sender;
member.delegateKey = newDelegateKey;
emit UpdateDelegateKey(msg.sender, newDelegateKey);
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| !members[newDelegateKey].exists,"Moloch::updateDelegateKey - cant overwrite existing members" | 358,813 | !members[newDelegateKey].exists |
"Moloch::updateDelegateKey - cant overwrite existing delegate keys" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
require(newDelegateKey != address(0), "Moloch::updateDelegateKey - newDelegateKey cannot be 0");
// skip checks if member is setting the delegate key to their member address
if (newDelegateKey != msg.sender) {
require(!members[newDelegateKey].exists, "Moloch::updateDelegateKey - cant overwrite existing members");
require(<FILL_ME>)
}
Member storage member = members[msg.sender];
memberAddressByDelegateKey[member.delegateKey] = address(0);
memberAddressByDelegateKey[newDelegateKey] = msg.sender;
member.delegateKey = newDelegateKey;
emit UpdateDelegateKey(msg.sender, newDelegateKey);
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| !members[memberAddressByDelegateKey[newDelegateKey]].exists,"Moloch::updateDelegateKey - cant overwrite existing delegate keys" | 358,813 | !members[memberAddressByDelegateKey[newDelegateKey]].exists |
"Moloch::getMemberProposalVote - member doesn't exist" | pragma solidity ^0.5.3;
contract Moloch {
using SafeMath for uint256;
/***************
GLOBAL CONSTANTS
***************/
uint256 public periodDuration; // default = 17280 = 4.8 hours in seconds (5 periods per day)
uint256 public votingPeriodLength; // default = 35 periods (7 days)
uint256 public gracePeriodLength; // default = 35 periods (7 days)
uint256 public abortWindow; // default = 5 periods (1 day)
uint256 public proposalDeposit; // default = 10 ETH (~$1,000 worth of ETH at contract deployment)
uint256 public dilutionBound; // default = 3 - maximum multiplier a YES voter will be obligated to pay in case of mass ragequit
uint256 public processingReward; // default = 0.1 - amount of ETH to give to whoever processes a proposal
uint256 public summoningTime; // needed to determine the current period
IERC20 public approvedToken; // approved token contract reference; default = wETH
GuildBank public guildBank; // guild bank contract reference
// HARD-CODED LIMITS
// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations
// with periods or shares, yet big enough to not limit reasonable use cases.
uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period
uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period
uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound
uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted
/***************
EVENTS
***************/
event SubmitProposal(uint256 proposalIndex, address indexed delegateKey, address indexed memberAddress, address indexed applicant, uint256 tokenTribute, uint256 sharesRequested);
event SubmitVote(uint256 indexed proposalIndex, address indexed delegateKey, address indexed memberAddress, uint8 uintVote);
event ProcessProposal(uint256 indexed proposalIndex, address indexed applicant, address indexed memberAddress, uint256 tokenTribute, uint256 sharesRequested, bool didPass);
event Ragequit(address indexed memberAddress, uint256 sharesToBurn);
event Abort(uint256 indexed proposalIndex, address applicantAddress);
event UpdateDelegateKey(address indexed memberAddress, address newDelegateKey);
event SummonComplete(address indexed summoner, uint256 shares);
/******************
INTERNAL ACCOUNTING
******************/
uint256 public totalShares = 0; // total shares across all members
uint256 public totalSharesRequested = 0; // total shares that have been requested in unprocessed proposals
enum Vote {
Null, // default value, counted as abstention
Yes,
No
}
struct Member {
address delegateKey; // the key responsible for submitting proposals and voting - defaults to member address unless updated
uint256 shares; // the # of shares assigned to this member
bool exists; // always true once a member has been created
uint256 highestIndexYesVote; // highest proposal index # on which the member voted YES
}
struct Proposal {
address proposer; // the member who submitted the proposal
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool processed; // true only if the proposal has been processed
bool didPass; // true only if the proposal passed
bool aborted; // true only if applicant calls "abort" fn before end of voting period
uint256 tokenTribute; // amount of tokens offered as tribute
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
mapping (address => Vote) votesByMember; // the votes on this proposal by each member
}
mapping (address => Member) public members;
mapping (address => address) public memberAddressByDelegateKey;
Proposal[] public proposalQueue;
/********
MODIFIERS
********/
modifier onlyMember {
}
modifier onlyDelegate {
}
/********
FUNCTIONS
********/
constructor(
address summoner,
address _approvedToken,
uint256 _periodDuration,
uint256 _votingPeriodLength,
uint256 _gracePeriodLength,
uint256 _abortWindow,
uint256 _proposalDeposit,
uint256 _dilutionBound,
uint256 _processingReward
) public {
}
/*****************
PROPOSAL FUNCTIONS
*****************/
function submitProposal(
address applicant,
uint256 tokenTribute,
uint256 sharesRequested,
string memory details
)
public
onlyDelegate
{
}
function submitVote(uint256 proposalIndex, uint8 uintVote) public onlyDelegate {
}
function processProposal(uint256 proposalIndex) public {
}
function ragequit(uint256 sharesToBurn) public onlyMember {
}
function abort(uint256 proposalIndex) public {
}
function updateDelegateKey(address newDelegateKey) public onlyMember {
}
/***************
GETTER FUNCTIONS
***************/
function max(uint256 x, uint256 y) internal pure returns (uint256) {
}
function getCurrentPeriod() public view returns (uint256) {
}
function getProposalQueueLength() public view returns (uint256) {
}
// can only ragequit if the latest proposal you voted YES on has been processed
function canRagequit(uint256 highestIndexYesVote) public view returns (bool) {
}
function hasVotingPeriodExpired(uint256 startingPeriod) public view returns (bool) {
}
function getMemberProposalVote(address memberAddress, uint256 proposalIndex) public view returns (Vote) {
require(<FILL_ME>)
require(proposalIndex < proposalQueue.length, "Moloch::getMemberProposalVote - proposal doesn't exist");
return proposalQueue[proposalIndex].votesByMember[memberAddress];
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
}
}
contract GuildBank is Ownable {
using SafeMath for uint256;
IERC20 public approvedToken; // approved token contract reference
event Withdrawal(address indexed receiver, uint256 amount);
constructor(address approvedTokenAddress) public {
}
function withdraw(address receiver, uint256 shares, uint256 totalShares) public onlyOwner returns (bool) {
}
}
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
| members[memberAddress].exists,"Moloch::getMemberProposalVote - member doesn't exist" | 358,813 | members[memberAddress].exists |
"Max supply reached" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
require(<FILL_ME>)
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
require(metaCITZNTokenIdsMinted[_metaCitznTokenId] == false, "metaCITZN token provided has already been utilized to mint");
require(metacitznContract.ownerOf(_metaCitznTokenId) == msg.sender, "You are not the owner of this token" );
}
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
metaCITZNTokenIdsMinted[_metaCitznTokenId] = true;
uint256 collectionId = getRandomCollectionId();
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| totalTokenSupply+_metaCitznTokenIds.length<TOTAL_MAX_SUPPLY+1,"Max supply reached" | 358,957 | totalTokenSupply+_metaCitznTokenIds.length<TOTAL_MAX_SUPPLY+1 |
"metaCITZN token provided has already been utilized to mint" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
require(totalTokenSupply + _metaCitznTokenIds.length < TOTAL_MAX_SUPPLY + 1, "Max supply reached");
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
require(<FILL_ME>)
require(metacitznContract.ownerOf(_metaCitznTokenId) == msg.sender, "You are not the owner of this token" );
}
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
metaCITZNTokenIdsMinted[_metaCitznTokenId] = true;
uint256 collectionId = getRandomCollectionId();
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| metaCITZNTokenIdsMinted[_metaCitznTokenId]==false,"metaCITZN token provided has already been utilized to mint" | 358,957 | metaCITZNTokenIdsMinted[_metaCitznTokenId]==false |
"You are not the owner of this token" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
require(totalTokenSupply + _metaCitznTokenIds.length < TOTAL_MAX_SUPPLY + 1, "Max supply reached");
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
require(metaCITZNTokenIdsMinted[_metaCitznTokenId] == false, "metaCITZN token provided has already been utilized to mint");
require(<FILL_ME>)
}
for (uint256 i = 0; i < _metaCitznTokenIds.length; i++) {
uint256 _metaCitznTokenId = _metaCitznTokenIds[i];
metaCITZNTokenIdsMinted[_metaCitznTokenId] = true;
uint256 collectionId = getRandomCollectionId();
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| metacitznContract.ownerOf(_metaCitznTokenId)==msg.sender,"You are not the owner of this token" | 358,957 | metacitznContract.ownerOf(_metaCitznTokenId)==msg.sender |
"1 WL mint per wallet allocation exceeded" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
require(<FILL_ME>)
require(totalTokenSupply + 1 < TOTAL_MAX_SUPPLY + 1, "Purchase would exceed max supply");
bytes32 messageHash = hashMessage(msg.sender, _nonce);
require(messageHash.recover(_signature) == signatureVerifier, "Unrecognizable Hash");
addressToAmountWLMintedSoFar[msg.sender] += 1;
uint256 collectionId = getRandomCollectionId();
emit randomCollectionEvent(msg.sender, _signature, _nonce, collectionId) ;
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| addressToAmountWLMintedSoFar[msg.sender]+1<2,"1 WL mint per wallet allocation exceeded" | 358,957 | addressToAmountWLMintedSoFar[msg.sender]+1<2 |
"Purchase would exceed max supply" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
require(addressToAmountWLMintedSoFar[msg.sender] + 1 < 2, "1 WL mint per wallet allocation exceeded");
require(<FILL_ME>)
bytes32 messageHash = hashMessage(msg.sender, _nonce);
require(messageHash.recover(_signature) == signatureVerifier, "Unrecognizable Hash");
addressToAmountWLMintedSoFar[msg.sender] += 1;
uint256 collectionId = getRandomCollectionId();
emit randomCollectionEvent(msg.sender, _signature, _nonce, collectionId) ;
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| totalTokenSupply+1<TOTAL_MAX_SUPPLY+1,"Purchase would exceed max supply" | 358,957 | totalTokenSupply+1<TOTAL_MAX_SUPPLY+1 |
"Unrecognizable Hash" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
require(addressToAmountWLMintedSoFar[msg.sender] + 1 < 2, "1 WL mint per wallet allocation exceeded");
require(totalTokenSupply + 1 < TOTAL_MAX_SUPPLY + 1, "Purchase would exceed max supply");
bytes32 messageHash = hashMessage(msg.sender, _nonce);
require(<FILL_ME>)
addressToAmountWLMintedSoFar[msg.sender] += 1;
uint256 collectionId = getRandomCollectionId();
emit randomCollectionEvent(msg.sender, _signature, _nonce, collectionId) ;
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
tokenSupply[collectionId]++;
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| messageHash.recover(_signature)==signatureVerifier,"Unrecognizable Hash" | 358,957 | messageHash.recover(_signature)==signatureVerifier |
"invalid id" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
require(<FILL_ME>)
return string(abi.encodePacked(_tokenBaseURI, _tokenId.toString(), ".json"));
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| isValidTokenId(_tokenId),"invalid id" | 358,957 | isValidTokenId(_tokenId) |
"invalid id" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
require(<FILL_ME>)
return tokenSupply[_id];
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| isValidTokenId(_id),"invalid id" | 358,957 | isValidTokenId(_id) |
"Purchase would exceed max supply" | pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/*
______ _______ _______ ______ __ __ _______ _______ _______ __ __ _______ ______ _______ _______
| | | || _ || _ | | |_| || || || _ || | | || || _ | | || |
| _ || ___|| |_| || | || | || ___||_ _|| |_| || |_| || ___|| | || | _____|| ___|
| | | || |___ | || |_||_ | || |___ | | | || || |___ | |_||_ | |_____ | |___
| |_| || ___|| || __ | | || ___| | | | || || ___|| __ ||_____ || ___|
| || |___ | _ || | | | | ||_|| || |___ | | | _ | | | | |___ | | | | _____| || |___
|______| |_______||__| |__||___| |_| |_| |_||_______| |___| |__| |__| |___| |_______||___| |_||_______||_______|
A METACITZN COLLECTION
developed by base64.tech
*/
contract DearMetaverse is ERC1155, Ownable, Pausable {
using ECDSA for bytes32;
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 2000;
uint256 public constant MIN_TOKEN_INDEX = 0;
uint256 public constant MAX_TOKEN_INDEX = 22;
string public constant name = "DearMetaverse";
string public constant symbol = "DM";
address constant METACITZN_CONTRACT = 0x2FFfDa1d3268681BB8B518E5ee6c049C1C53bdA9;
IERC721 public metacitznContract;
address public signatureVerifier;
uint256 public totalTokenSupply = 0;
mapping(address => uint256) public addressToAmountWLMintedSoFar;
mapping(uint256 => uint256) public tokenSupply;
mapping(uint256 => bool) public metaCITZNTokenIdsMinted;
uint[] unmintedIndexArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];
uint[] unmintedIndexCountArray = [85,85,85,85,85,85,85,85,85,85,85,85,85,85,90,90,90,90,90,90,90,90,90];
string private _tokenBaseURI;
event PermanentURI(string _value, uint256 indexed _id);
event randomCollectionEvent(address, bytes, uint256, uint256);
event randomCollectionGenerationEvent(uint256);
constructor() ERC1155("") {
}
function isValidTokenId(uint256 _id) internal pure returns (bool) {
}
function getRandomCollectionId() internal returns (uint256) {
}
function getRandomTokenIndex(uint256 _range) view internal returns (uint256) {
}
function metaCitznMint(uint256[] memory _metaCitznTokenIds) whenNotPaused external {
}
function hashMessage(address sender, uint256 nonce) public pure returns(bytes32) {
}
function whitelistMint(bytes memory _signature, uint256 _nonce) whenNotPaused external {
}
function uri(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply(uint256 _id) external view returns (uint256) {
}
function getUnmintedIndexLength() external view returns (uint256) {
}
/* OWNER FUNCTIONS */
function ownerMint(uint256 _numberToMint) external onlyOwner {
require(<FILL_ME>)
for(uint256 i = 0; i < _numberToMint; i++) {
uint256 collectionId = getRandomCollectionId();
_mint(msg.sender, collectionId, 1, "");
totalTokenSupply++;
}
}
function ownerMintToAddress(address _recipient, uint256 _numberToMint) external onlyOwner {
}
function setMetacitznContract(IERC721 _metacitznContract) external onlyOwner {
}
function setSignatureVerifier(address _signatureVerifier) external onlyOwner {
}
function freezeMetadata(uint256 _id) external onlyOwner {
}
function setBaseURI(string memory _URI) external onlyOwner {
}
function pause() external onlyOwner {
}
function unpause() external onlyOwner {
}
}
| totalTokenSupply+_numberToMint<TOTAL_MAX_SUPPLY+1,"Purchase would exceed max supply" | 358,957 | totalTokenSupply+_numberToMint<TOTAL_MAX_SUPPLY+1 |
"Not enough tokens in contract balance to cover withdrawl" | // SPDX-License-Identifier: GPL-3.0
// Author: Matt Hooft
// https://github.com/Civitas-Fundamenta
// [email protected]
// This is a token vesting contract that can add multiple beneficiaries. It uses
// Unix timestamps to keep track of release times and only the beneficiary is
// allowed to remove the tokens. For emergency purposes the ability to change the
// beneficiary address has been added as well as the ability for users with the
// proper roles to recover Ether and ERC20 tokens that are mistakenly deposited
// to the conract. The required roles will only be granted/used if/when needed
// with community consent. Until then no users will be granted the roles capable
// of token movement. This is a comprimise to allow recovery of tokens/ether
// that are sent to the contract by mistake.
pragma solidity ^0.7.3;
contract Vesting is AccessControl {
using SafeERC20 for IERC20;
using SafeMath for uint256;
//-----------RBAC--------------
bytes32 public constant _ADMIN = keccak256("_ADMIN");
bytes32 public constant _MOVE = keccak256("_MOVE");
bytes32 public constant _RESCUE = keccak256("_RESCUE");
//---------Interface-----------
IERC20 private token;
//------structs/mappings-------
/**
* @dev struct to keep track of beneficiaries
* release times and balances.
*/
struct Beneficiaries {
address beneficiary;
uint ReleaseTime;
uint LockedAmount;
}
mapping (address => Beneficiaries) beneficiary;
//-----------Events--------------
event beneficiaryAdded (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _blockHeight);
event beneficiaryWithdraw (address _beneficiary, uint _WithdrawnAmount, uint _blockHeight);
event releaseTimeIncreased (address _beneficiary, uint _newReleaseTime, uint _blockHeight);
event beneficiaryChanged (address _currentBeneficiary, address _newBeneficiary, uint _blockHeight);
event tokensRescued (address _pebcak, address _tokenContract, uint _amountRescued, uint _blockHeight);
//------constructor--------------
constructor() {
}
//------contract functions-------
function setToken(IERC20 _token) public {
}
/**
* @dev adds beneficiary
*/
function addbeneficary(address _beneficiary, uint _ReleaseTime, uint _LockedAmount) public {
}
/**
* @dev returns if msg.sender is a beneficiary and if so
* returns beneficiary information
*/
/**
* @dev check if a user is a beneficiary and if so
* return beneficiary information
*/
function isBeneficiary(address _beneficiaryAddress) external view returns (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _timeRemainingInSeconds) {
}
/**
* @dev allows Beneficiaries to wthdraw vested tokens
* if the release time is satisfied.
*/
function withdrawVesting() external {
Beneficiaries storage b = beneficiary[msg.sender];
if (b.LockedAmount == 0)
revert ("You are not a beneficiary or do not have any tokens vesting");
else if(b.ReleaseTime > block.timestamp)
revert("It isn't time yet speedracer...");
else if (b.ReleaseTime < block.timestamp)
require(<FILL_ME>)
token.safeTransfer(b.beneficiary, b.LockedAmount);
emit beneficiaryWithdraw (b.beneficiary, b.LockedAmount, block.number);
beneficiary[msg.sender] = Beneficiaries(address(0), 0, 0);
}
/**
* @dev flexibility is nice so we will allow the ability
* for beneficiaries to increase vesting time. You cannot
* decrease however.
*/
function increaseReleaseTime(uint _newReleaseTime, address _beneficiary) public {
}
/**
* @dev emergency function to change beneficiary addresses if
* they pull a bozo and lose or compromise keys before the release
* time has been reached.
*/
function changeBeneficiary(address _newBeneficiary, address _currentBeneficiary) public {
}
/**
* @dev returns contract balance
*/
function contractBalance() public view returns (uint _balance) {
}
//-----------Rescue--------------
/**
* @dev emergency functions to transfer Ether and ERC20 tokens that
* are mistakenly sent to the contract.
*/
function mistakenERC20DepositRescue(address _ERC20, address _pebcak, uint _ERC20Amount) public {
}
function mistakenDepositRescue(address payable _pebcak, uint _etherAmount) public {
}
}
| contractBalance()>=b.LockedAmount,"Not enough tokens in contract balance to cover withdrawl" | 358,962 | contractBalance()>=b.LockedAmount |
null | // SPDX-License-Identifier: GPL-3.0
// Author: Matt Hooft
// https://github.com/Civitas-Fundamenta
// [email protected]
// This is a token vesting contract that can add multiple beneficiaries. It uses
// Unix timestamps to keep track of release times and only the beneficiary is
// allowed to remove the tokens. For emergency purposes the ability to change the
// beneficiary address has been added as well as the ability for users with the
// proper roles to recover Ether and ERC20 tokens that are mistakenly deposited
// to the conract. The required roles will only be granted/used if/when needed
// with community consent. Until then no users will be granted the roles capable
// of token movement. This is a comprimise to allow recovery of tokens/ether
// that are sent to the contract by mistake.
pragma solidity ^0.7.3;
contract Vesting is AccessControl {
using SafeERC20 for IERC20;
using SafeMath for uint256;
//-----------RBAC--------------
bytes32 public constant _ADMIN = keccak256("_ADMIN");
bytes32 public constant _MOVE = keccak256("_MOVE");
bytes32 public constant _RESCUE = keccak256("_RESCUE");
//---------Interface-----------
IERC20 private token;
//------structs/mappings-------
/**
* @dev struct to keep track of beneficiaries
* release times and balances.
*/
struct Beneficiaries {
address beneficiary;
uint ReleaseTime;
uint LockedAmount;
}
mapping (address => Beneficiaries) beneficiary;
//-----------Events--------------
event beneficiaryAdded (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _blockHeight);
event beneficiaryWithdraw (address _beneficiary, uint _WithdrawnAmount, uint _blockHeight);
event releaseTimeIncreased (address _beneficiary, uint _newReleaseTime, uint _blockHeight);
event beneficiaryChanged (address _currentBeneficiary, address _newBeneficiary, uint _blockHeight);
event tokensRescued (address _pebcak, address _tokenContract, uint _amountRescued, uint _blockHeight);
//------constructor--------------
constructor() {
}
//------contract functions-------
function setToken(IERC20 _token) public {
}
/**
* @dev adds beneficiary
*/
function addbeneficary(address _beneficiary, uint _ReleaseTime, uint _LockedAmount) public {
}
/**
* @dev returns if msg.sender is a beneficiary and if so
* returns beneficiary information
*/
/**
* @dev check if a user is a beneficiary and if so
* return beneficiary information
*/
function isBeneficiary(address _beneficiaryAddress) external view returns (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _timeRemainingInSeconds) {
}
/**
* @dev allows Beneficiaries to wthdraw vested tokens
* if the release time is satisfied.
*/
function withdrawVesting() external {
}
/**
* @dev flexibility is nice so we will allow the ability
* for beneficiaries to increase vesting time. You cannot
* decrease however.
*/
function increaseReleaseTime(uint _newReleaseTime, address _beneficiary) public {
}
/**
* @dev emergency function to change beneficiary addresses if
* they pull a bozo and lose or compromise keys before the release
* time has been reached.
*/
function changeBeneficiary(address _newBeneficiary, address _currentBeneficiary) public {
}
/**
* @dev returns contract balance
*/
function contractBalance() public view returns (uint _balance) {
}
//-----------Rescue--------------
/**
* @dev emergency functions to transfer Ether and ERC20 tokens that
* are mistakenly sent to the contract.
*/
function mistakenERC20DepositRescue(address _ERC20, address _pebcak, uint _ERC20Amount) public {
require(<FILL_ME>)
IERC20(_ERC20).safeTransfer(_pebcak, _ERC20Amount);
emit tokensRescued (_pebcak, _ERC20, _ERC20Amount, block.number);
}
function mistakenDepositRescue(address payable _pebcak, uint _etherAmount) public {
}
}
| hasRole(_MOVE,msg.sender) | 358,962 | hasRole(_MOVE,msg.sender) |
null | // SPDX-License-Identifier: GPL-3.0
// Author: Matt Hooft
// https://github.com/Civitas-Fundamenta
// [email protected]
// This is a token vesting contract that can add multiple beneficiaries. It uses
// Unix timestamps to keep track of release times and only the beneficiary is
// allowed to remove the tokens. For emergency purposes the ability to change the
// beneficiary address has been added as well as the ability for users with the
// proper roles to recover Ether and ERC20 tokens that are mistakenly deposited
// to the conract. The required roles will only be granted/used if/when needed
// with community consent. Until then no users will be granted the roles capable
// of token movement. This is a comprimise to allow recovery of tokens/ether
// that are sent to the contract by mistake.
pragma solidity ^0.7.3;
contract Vesting is AccessControl {
using SafeERC20 for IERC20;
using SafeMath for uint256;
//-----------RBAC--------------
bytes32 public constant _ADMIN = keccak256("_ADMIN");
bytes32 public constant _MOVE = keccak256("_MOVE");
bytes32 public constant _RESCUE = keccak256("_RESCUE");
//---------Interface-----------
IERC20 private token;
//------structs/mappings-------
/**
* @dev struct to keep track of beneficiaries
* release times and balances.
*/
struct Beneficiaries {
address beneficiary;
uint ReleaseTime;
uint LockedAmount;
}
mapping (address => Beneficiaries) beneficiary;
//-----------Events--------------
event beneficiaryAdded (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _blockHeight);
event beneficiaryWithdraw (address _beneficiary, uint _WithdrawnAmount, uint _blockHeight);
event releaseTimeIncreased (address _beneficiary, uint _newReleaseTime, uint _blockHeight);
event beneficiaryChanged (address _currentBeneficiary, address _newBeneficiary, uint _blockHeight);
event tokensRescued (address _pebcak, address _tokenContract, uint _amountRescued, uint _blockHeight);
//------constructor--------------
constructor() {
}
//------contract functions-------
function setToken(IERC20 _token) public {
}
/**
* @dev adds beneficiary
*/
function addbeneficary(address _beneficiary, uint _ReleaseTime, uint _LockedAmount) public {
}
/**
* @dev returns if msg.sender is a beneficiary and if so
* returns beneficiary information
*/
/**
* @dev check if a user is a beneficiary and if so
* return beneficiary information
*/
function isBeneficiary(address _beneficiaryAddress) external view returns (address _beneficiary, uint _ReleaseTime, uint _LockedAmount, uint _timeRemainingInSeconds) {
}
/**
* @dev allows Beneficiaries to wthdraw vested tokens
* if the release time is satisfied.
*/
function withdrawVesting() external {
}
/**
* @dev flexibility is nice so we will allow the ability
* for beneficiaries to increase vesting time. You cannot
* decrease however.
*/
function increaseReleaseTime(uint _newReleaseTime, address _beneficiary) public {
}
/**
* @dev emergency function to change beneficiary addresses if
* they pull a bozo and lose or compromise keys before the release
* time has been reached.
*/
function changeBeneficiary(address _newBeneficiary, address _currentBeneficiary) public {
}
/**
* @dev returns contract balance
*/
function contractBalance() public view returns (uint _balance) {
}
//-----------Rescue--------------
/**
* @dev emergency functions to transfer Ether and ERC20 tokens that
* are mistakenly sent to the contract.
*/
function mistakenERC20DepositRescue(address _ERC20, address _pebcak, uint _ERC20Amount) public {
}
function mistakenDepositRescue(address payable _pebcak, uint _etherAmount) public {
require(<FILL_ME>)
_pebcak.transfer(_etherAmount);
}
}
| hasRole(_RESCUE,msg.sender) | 358,962 | hasRole(_RESCUE,msg.sender) |
"the conversion did not happen as planned" | // Copyright (C) 2019, 2020 dipeshsukhani, nodarjonashi, toshsharma, suhailg
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// Visit <https://www.gnu.org/licenses/>for a copy of the GNU Affero General Public License
/**
* WARNING: This is an upgradable contract. Be careful not to disrupt
* the existing storage layout when making upgrades to the contract. In particular,
* existing fields should not be removed and should not have their types changed.
* The order of field declarations must not be changed, and new fields must be added
* below all existing declarations.
*
* The base contracts and the order in which they are declared must not be changed.
* New fields must not be added to base contracts (unless the base contract has
* reserved placeholder fields for this purpose).
*
* See https://docs.zeppelinos.org/docs/writing_contracts.html for more info.
*/
pragma solidity ^0.5.0;
///@author DeFiZap
///@notice this contract implements one click conversion from ETH to unipool liquidity tokens
interface IuniswapFactory_UniPoolGeneralv3 {
function getExchange(address token)
external
view
returns (address exchange);
}
interface IuniswapExchange_UniPoolGeneralv3 {
function getEthToTokenInputPrice(uint256 eth_sold)
external
view
returns (uint256 tokens_bought);
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline)
external
payable
returns (uint256 tokens_bought);
function balanceOf(address _owner) external view returns (uint256);
function transfer(address _to, uint256 _value) external returns (bool);
function addLiquidity(
uint256 min_liquidity,
uint256 max_tokens,
uint256 deadline
) external payable returns (uint256);
function tokenToEthSwapInput(
uint256 tokens_sold,
uint256 min_eth,
uint256 deadline
) external returns (uint256 eth_bought);
function tokenToEthTransferInput(
uint256 tokens_sold,
uint256 min_eth,
uint256 deadline,
address recipient
) external returns (uint256 eth_bought);
}
contract UniSwapAddLiquityV3_General is Initializable, ReentrancyGuard {
using SafeMath for uint256;
// state variables
// - THESE MUST ALWAYS STAY IN THE SAME LAYOUT
bool private stopped;
address payable public owner;
IuniswapFactory_UniPoolGeneralv3 public UniSwapFactoryAddress;
uint16 public goodwill;
// events
event ERC20TokenHoldingsOnConversion(uint256);
event uniswapGeneralv3_details(
address indexed _user,
address indexed _tokenContractAddress,
address indexed _uniswapExchangeAddress,
uint256 _ethDeployed,
uint256 _liquidityTokens
);
// circuit breaker modifiers
modifier stopInEmergency {
}
modifier onlyOwner() {
}
function initialize(address _UniSwapFactoryAddress) public initializer {
}
function set_new_UniSwapFactoryAddress(address _new_UniSwapFactoryAddress)
public
onlyOwner
{
}
function LetsInvest(address _TokenContractAddress, address _towhomtoissue)
public
payable
stopInEmergency
returns (uint256)
{
IERC20 ERC20TokenAddress = IERC20(_TokenContractAddress);
IuniswapExchange_UniPoolGeneralv3 UniSwapExchangeContractAddress = IuniswapExchange_UniPoolGeneralv3(
UniSwapFactoryAddress.getExchange(_TokenContractAddress)
);
// determining the portion of the incoming ETH to be converted to the ERC20 Token
uint256 conversionPortion = SafeMath.div(
SafeMath.mul(msg.value, 503),
1000
);
uint256 non_conversionPortion = SafeMath.sub(
msg.value,
conversionPortion
);
// coversion of ETH to the ERC20 Token
uint256 min_Tokens = SafeMath.div(
SafeMath.mul(
UniSwapExchangeContractAddress.getEthToTokenInputPrice(
conversionPortion
),
98
),
100
);
UniSwapExchangeContractAddress.ethToTokenSwapInput.value(
conversionPortion
)(min_Tokens, SafeMath.add(now, 1800));
ERC20TokenAddress.approve(
address(UniSwapExchangeContractAddress),
ERC20TokenAddress.balanceOf(address(this))
);
require(<FILL_ME>)
emit ERC20TokenHoldingsOnConversion(
ERC20TokenAddress.balanceOf(address(this))
);
// adding Liquidity
uint256 max_tokens_ans = getMaxTokens(
address(UniSwapExchangeContractAddress),
ERC20TokenAddress,
non_conversionPortion
);
uint256 LiquidityTokens = UniSwapExchangeContractAddress
.addLiquidity
.value(non_conversionPortion)(
1,
max_tokens_ans,
SafeMath.add(now, 1800)
);
// transferring Liquidity
UniSwapExchangeContractAddress.transfer(
_towhomtoissue,
UniSwapExchangeContractAddress.balanceOf(address(this))
);
// converting the residual
UniSwapExchangeContractAddress.tokenToEthTransferInput(
ERC20TokenAddress.balanceOf(address(this)),
1,
SafeMath.add(now, 1800),
_towhomtoissue
);
ERC20TokenAddress.approve(address(UniSwapExchangeContractAddress), 0);
emit uniswapGeneralv3_details(
_towhomtoissue,
address(ERC20TokenAddress),
address(UniSwapExchangeContractAddress),
msg.value,
LiquidityTokens
);
return LiquidityTokens;
}
function getMaxTokens(
address _UniSwapExchangeContractAddress,
IERC20 _ERC20TokenAddress,
uint256 _value
) internal view returns (uint256) {
}
function inCaseTokengetsStuck(IERC20 _TokenAddress) public onlyOwner {
}
// - fallback function let you / anyone send ETH to this wallet without the need to call any function
function() external payable {
}
// - to Pause the contract
function toggleContractActive() public onlyOwner {
}
// - to withdraw any ETH balance sitting in the contract
function withdraw() public onlyOwner {
}
// - to kill the contract
function destruct() public onlyOwner {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address payable newOwner) public onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address payable newOwner) internal {
}
}
| ERC20TokenAddress.balanceOf(address(this))>0,"the conversion did not happen as planned" | 358,979 | ERC20TokenAddress.balanceOf(address(this))>0 |
"201" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
uint8 i = tulipType(name);
//require(amount >= 1, "199");//Cannot stake less than 1
require(<FILL_ME>)
//You must withdraw or harvest the previous crop
if(i == 1 && !forSeeds){
require((amount % 100) == 0, "203");//Has to be multiple of 100
}
_token[i].safeTransferFrom(msg.sender, address(this), amount.mul(_decimalConverter));
_totalSupply[i] = _totalSupply[i].add(amount);
_tulipToken[i][garden].planted[msg.sender] = _tulipToken[i][garden].planted[msg.sender].add(amount);
_totalGrowing[i] = _totalGrowing[i] + amount;
if(forSeeds && i != 0){
_tulipToken[i][garden].periodFinish[msg.sender] = now.add(7 * _timeScale);
_tulipToken[i][garden].forSeeds[msg.sender] = true;
}
else{
setTimeStamp(i, garden);
}
emit Staked(msg.sender, amount);
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| _tulipToken[i][garden].planted[msg.sender]==0&&now>_tulipToken[i][garden].periodFinish[msg.sender],"201" | 358,986 | _tulipToken[i][garden].planted[msg.sender]==0&&now>_tulipToken[i][garden].periodFinish[msg.sender] |
"203" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
uint8 i = tulipType(name);
//require(amount >= 1, "199");//Cannot stake less than 1
require(_tulipToken[i][garden].planted[msg.sender] == 0 && now > _tulipToken[i][garden].periodFinish[msg.sender],
"201");//You must withdraw or harvest the previous crop
if(i == 1 && !forSeeds){
require(<FILL_ME>)//Has to be multiple of 100
}
_token[i].safeTransferFrom(msg.sender, address(this), amount.mul(_decimalConverter));
_totalSupply[i] = _totalSupply[i].add(amount);
_tulipToken[i][garden].planted[msg.sender] = _tulipToken[i][garden].planted[msg.sender].add(amount);
_totalGrowing[i] = _totalGrowing[i] + amount;
if(forSeeds && i != 0){
_tulipToken[i][garden].periodFinish[msg.sender] = now.add(7 * _timeScale);
_tulipToken[i][garden].forSeeds[msg.sender] = true;
}
else{
setTimeStamp(i, garden);
}
emit Staked(msg.sender, amount);
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| (amount%100)==0,"203" | 358,986 | (amount%100)==0 |
"226" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
}
function withdraw(string memory name, uint8 garden) public {
uint8 i = tulipType(name);
require(<FILL_ME>)//Cannot withdraw a decomposing bed
if(now > _tulipToken[i][garden].periodFinish[msg.sender] && _tulipToken[i][garden].periodFinish[msg.sender] > 0 && _tulipToken[i][garden].forSeeds[msg.sender]){
harvestHelper(name, garden, true);
}
else{
_totalGrowing[i] = _totalGrowing[i].sub(_tulipToken[i][garden].planted[msg.sender]);
}
_token[i].safeTransfer(msg.sender, _tulipToken[i][garden].planted[msg.sender].mul(_decimalConverter));
_tulipToken[i][garden].forSeeds[msg.sender] = false;
emit Withdrawn(msg.sender, _tulipToken[i][garden].planted[msg.sender]);
zeroHoldings(i, garden);
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| !_tulipToken[i][garden].isDecomposing[msg.sender],"226" | 358,986 | !_tulipToken[i][garden].isDecomposing[msg.sender] |
"245" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
require(<FILL_ME>)//Cannot withdraw a decomposing bed
harvestHelper(name, garden, false);
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| !_tulipToken[tulipType(name)][garden].isDecomposing[msg.sender],"245" | 358,986 | !_tulipToken[tulipType(name)][garden].isDecomposing[msg.sender] |
"293" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
uint8 i = tulipType(name);
//require(amount >= 1, "291");//Cannot stake less than 1
require(<FILL_ME>)
//Claim your last decomposing reward!
require(i > 0, "310");//Cannot decompose a seed!
_token[i].safeTransferFrom(msg.sender, address(this), amount.mul(_decimalConverter));
_totalSupply[i] = _totalSupply[i].add(amount);
_tulipToken[i][garden].planted[msg.sender] = amount;
_tulipToken[i][garden].periodFinish[msg.sender] = now.add(1 * _timeScale);
_tulipToken[i][garden].isDecomposing[msg.sender] = true;
emit Decomposing(msg.sender, amount);
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| _tulipToken[i][garden].planted[msg.sender]==0&&(_tulipToken[i][garden].periodFinish[msg.sender]==0||now>_tulipToken[i][garden].periodFinish[msg.sender]),"293" | 358,986 | _tulipToken[i][garden].planted[msg.sender]==0&&(_tulipToken[i][garden].periodFinish[msg.sender]==0||now>_tulipToken[i][garden].periodFinish[msg.sender]) |
"308" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
uint8 i = tulipType(name);
require(<FILL_ME>)//This token is not decomposing
require(i > 0, "310");//Cannot decompose a seed! //redundant
//require(_tulipToken[i][garden].planted[msg.sender] > 0, "311");//Cannot decompose 0
require(now > _tulipToken[i][garden].periodFinish[msg.sender], "312");//Cannot claim decomposition!
uint256 amount = _tulipToken[i][garden].planted[msg.sender].mul(_decimalConverter);
uint256 subAmount;
uint8 scalingCoef;
// Checks if token is pink (i = 1) or reds
if(i == 1){
subAmount = (amount * 4).div(5);
scalingCoef = 1;
}
else{
subAmount = (amount * 9).div(10);
scalingCoef = 100;
}
// Burns 80% or 90% + (50% * leftovers (this is gone forever from ecosystem))
_token[i].contractBurn(address(this), subAmount + (amount - subAmount).div(2));
_totalDecomposed[i - 1] = _totalDecomposed[i - 1].add(amount.div(_decimalConverter));
// Mints the new amount of seeds to owners account
_token[0].contractMint(msg.sender, subAmount.mul(scalingCoef));
_totalGrown[0] = _totalGrown[0].add(amount.div(_decimalConverter).mul(scalingCoef));
// Transfers the remainder to us
_token[i].safeTransfer(_benefitiaryAddress, (amount - subAmount).div(2));
_tulipToken[i][garden].planted[msg.sender] = 0;
_totalSupply[i] = _totalSupply[i].sub(amount.div(_decimalConverter));
_tulipToken[i][garden].isDecomposing[msg.sender] = false;
emit ClaimedDecomposing(msg.sender, subAmount);
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| _tulipToken[i][garden].isDecomposing[msg.sender],"308" | 358,986 | _tulipToken[i][garden].isDecomposing[msg.sender] |
"464" | pragma solidity ^0.5.16;
contract GardenContractV2 is Ownable {
using SafeMath for uint256;
using SafeERC20 for TulipToken;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
address internal _benefitiaryAddress = 0x68c1A22aD90f168aa19F800bFB115fB4D52F4AD9; //Founder Address
uint256 internal _epochBlockStart = 1600610400;
uint256 internal _timeScale = (1 days);
//uint8 private _pinkTulipDivider = 100;
uint256 private _decimalConverter = 10**9;
uint256[3] internal _totalGrowing;
uint256[3] internal _totalGrown; /* REMEMBER THE DIFFERENCE */
uint256[3] internal _totalBurnt;
uint256[2] internal _totalDecomposed;
TulipToken[3] private _token;
uint256[3] private _totalSupply;
struct tulipToken{
mapping(address => bool) forSeeds;
mapping(address => uint256) planted;
mapping(address => uint256) periodFinish; //combine with decomposing
mapping(address => bool) isDecomposing;
}
tulipToken[10][3] private _tulipToken;
/* ========== CONSTRUCTOR ========== */
constructor(address _seedToken, address _basicTulipToken, address _advTulipToken) public Ownable() {
}
/* ========== VIEWS ========== */
/* ========== internal ========== */
function totalGardenSupply(string calldata name) external view returns (uint256) {
}
function totalBedSupply(string calldata name, uint8 garden) external view returns (uint256, bool, bool) {
}
function totalTLPGrowing(string calldata name) external view returns (uint256) {
}
function totalTLPDecomposed(string calldata name) external view returns (uint256) {
}
function totalTLPGrown(string calldata name) external view returns (uint256) {
}
function totalTLPBurnt(string calldata name) external view returns (uint256) {
}
function growthRemaining(address account, string calldata name, uint8 garden) external view returns (uint256) {
}
function timeUntilNextTLP(string calldata name, uint8 garden) external view returns (uint256) {
}
function balanceOf(address account, string calldata name) external view returns (uint256)
{
}
function getTotalrTLPHarvest(uint8 garden) external view returns (uint256){
}
function getTotalpTLPHarvest(uint8 garden) external view returns (uint256[2] memory){
}
function getTotalsTLPHarvest(uint8 garden) external view returns (uint256){
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ========== internal garden ========== */
function plant(uint256 amount, string calldata name, uint8 garden, bool forSeeds) external {
}
function withdraw(string memory name, uint8 garden) public {
}
function harvest(string memory name, uint8 garden) public {
}
function harvestAllBeds(string memory name) public {
}
function decompose(string memory name, uint8 garden, uint256 amount) public {
}
// test morning
function claimDecompose(string memory name, uint8 garden) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
/* ========== internal functions ========== */
function addTokenOwner(address _tokenAddress, address _newOwner) external onlyOwner
{
}
function renounceTokenOwner(address _tokenAddress) external onlyOwner
{
}
function changeOwner(address _newOwner) external onlyOwner {
}
function changeBenefitiary(address _newOwner) external onlyOwner
{
}
/* ========== HELPER FUNCTIONS ========== */
function tulipType(string memory name) internal pure returns (uint8) {
}
function setTimeStamp(uint8 i, uint8 garden) internal{
}
function zeroHoldings(uint8 i, uint8 garden) internal{
}
function operationBurnMint(uint8 token, uint8 garden, uint256 amount) internal{
}
function utilityBedHarvest(uint8 token) internal returns(uint256[6] memory){
}
function harvestHelper(string memory name, uint8 garden, bool withdrawing) internal {
uint8 i = tulipType(name);
if(!withdrawing){
require(<FILL_ME>) //Cannot harvest 0
require(now > _tulipToken[i][garden].periodFinish[msg.sender], "465");//Cannot harvest until bloomed!
}
uint256 tempAmount;
/* rTLP harvest condition */
if (i == 2) {
tempAmount = redTulipRewardAmount(garden);
_token[0].contractMint(msg.sender, tempAmount);
_tulipToken[i][garden].periodFinish[msg.sender] = now.add(7 * _timeScale);
}
else {
/* pTLP harvest condition */
if(i == 1){
if(_tulipToken[i][garden].forSeeds[msg.sender]){
tempAmount = pinkTulipRewardAmount(garden);
_token[0].contractMint(msg.sender, tempAmount);
_tulipToken[i][garden].periodFinish[msg.sender] = now.add(7 * _timeScale);
}
else{
tempAmount = _tulipToken[i][garden].planted[msg.sender].div(100);
operationBurnMint(i, garden, tempAmount);
zeroHoldings(i, garden);
}
}
/* sTLP harvest condition */
else{
tempAmount = _tulipToken[i][garden].planted[msg.sender];
operationBurnMint(i, garden, tempAmount);
zeroHoldings(i, garden);
}
}
_totalGrowing[i] = _totalGrowing[i].sub(_tulipToken[i][garden].planted[msg.sender]);
emit RewardPaid(msg.sender, tempAmount);
}
/* ========== REAL FUNCTIONS ========== */
function setRewardDurationSeeds(uint8 garden) internal returns (bool) {
}
function redTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/***************************ONLY WHEN forSeeds is TRUE*****************************8*/
function pinkTulipRewardAmount(uint8 garden) internal view returns (uint256) {
}
/* ========== EVENTS ========== */
event Staked(address indexed user, uint256 amount); //add timestamps
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Decomposing(address indexed user, uint256 amount);
event ClaimedDecomposing(address indexed user, uint256 reward);
}
| _tulipToken[i][garden].planted[msg.sender]>0,"464" | 358,986 | _tulipToken[i][garden].planted[msg.sender]>0 |
"Must not be paused" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
require(<FILL_ME>)
_;
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| !globalPaused,"Must not be paused" | 359,004 | !globalPaused |
"Doesn't support NFT interface" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
require(<FILL_ME>)
nftAddress = _nftAddress;
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| IERC165(_nftAddress).supportsInterface(interfaceId),"Doesn't support NFT interface" | 359,004 | IERC165(_nftAddress).supportsInterface(interfaceId) |
"Auction doesn't exist" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
require(<FILL_ME>)
auctions[tokenId].paused = paused;
emit UpdateAuction(tokenId, paused);
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| auctions[tokenId].exists,"Auction doesn't exist" | 359,004 | auctions[tokenId].exists |
"Auction already exists" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
require(<FILL_ME>)
require(adminSplit < 100, "Percentage has to be less than 100");
tokenIds.push(tokenId);
auctions[tokenId].paused = paused;
auctions[tokenId].exists = true;
auctions[tokenId].duration = duration;
auctions[tokenId].reservePrice = reservePrice;
auctions[tokenId].adminSplit = adminSplit;
auctions[tokenId].creator = msg.sender;
auctions[tokenId].admin = admin;
auctions[tokenId].proceedsRecipient = proceedsRecipient;
IERC721(nftAddress).transferFrom(msg.sender, address(this), tokenId);
emit AuctionCreated(tokenId, nftAddress, duration, reservePrice, msg.sender);
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| !auctions[tokenId].exists,"Auction already exists" | 359,004 | !auctions[tokenId].exists |
"Auction paused" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(<FILL_ME>)
require(
msg.value >= auctions[tokenId].reservePrice,
"Must send reservePrice or more"
);
require(
auctions[tokenId].firstBidTime == 0 ||
block.timestamp <
auctions[tokenId].firstBidTime + auctions[tokenId].duration,
"Auction expired"
);
uint256 lastValue = auctions[tokenId].amount;
bool firstBid;
address payable lastBidder;
// allows for auctions with starting price of 0
if (lastValue != 0) {
require(msg.value > lastValue, "Must send more than last bid");
require(
msg.value.sub(lastValue) >= minBid,
"Must send more than last bid by minBid Amount"
);
lastBidder = auctions[tokenId].bidder;
} else {
firstBid = true;
auctions[tokenId].firstBidTime = block.timestamp;
}
auctions[tokenId].amount = msg.value;
auctions[tokenId].bidder = msg.sender;
bool extended;
// at this point we know that the timestamp is less than start + duration
// we want to know by how much the timestamp is less than start + duration
// if the difference is less than the timeBuffer, update duration to time buffer
if (
(auctions[tokenId].firstBidTime.add(auctions[tokenId].duration))
.sub(block.timestamp) < timeBuffer
) {
// take the difference between now and starting point, add timeBuffer and set as duration
auctions[tokenId].duration = block.timestamp.sub(auctions[tokenId].firstBidTime).add(timeBuffer);
extended = true;
}
emit AuctionBid(
tokenId,
nftAddress,
msg.sender,
msg.value,
block.timestamp,
firstBid,
extended
);
if (!firstBid) {
// in case the bidder is a contract that doesn't allow receiving
if (!lastBidder.send(lastValue)) {
auctions[tokenId].admin.transfer(lastValue);
}
}
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| !auctions[tokenId].paused,"Auction paused" | 359,004 | !auctions[tokenId].paused |
"Auction expired" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(!auctions[tokenId].paused, "Auction paused");
require(
msg.value >= auctions[tokenId].reservePrice,
"Must send reservePrice or more"
);
require(<FILL_ME>)
uint256 lastValue = auctions[tokenId].amount;
bool firstBid;
address payable lastBidder;
// allows for auctions with starting price of 0
if (lastValue != 0) {
require(msg.value > lastValue, "Must send more than last bid");
require(
msg.value.sub(lastValue) >= minBid,
"Must send more than last bid by minBid Amount"
);
lastBidder = auctions[tokenId].bidder;
} else {
firstBid = true;
auctions[tokenId].firstBidTime = block.timestamp;
}
auctions[tokenId].amount = msg.value;
auctions[tokenId].bidder = msg.sender;
bool extended;
// at this point we know that the timestamp is less than start + duration
// we want to know by how much the timestamp is less than start + duration
// if the difference is less than the timeBuffer, update duration to time buffer
if (
(auctions[tokenId].firstBidTime.add(auctions[tokenId].duration))
.sub(block.timestamp) < timeBuffer
) {
// take the difference between now and starting point, add timeBuffer and set as duration
auctions[tokenId].duration = block.timestamp.sub(auctions[tokenId].firstBidTime).add(timeBuffer);
extended = true;
}
emit AuctionBid(
tokenId,
nftAddress,
msg.sender,
msg.value,
block.timestamp,
firstBid,
extended
);
if (!firstBid) {
// in case the bidder is a contract that doesn't allow receiving
if (!lastBidder.send(lastValue)) {
auctions[tokenId].admin.transfer(lastValue);
}
}
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| auctions[tokenId].firstBidTime==0||block.timestamp<auctions[tokenId].firstBidTime+auctions[tokenId].duration,"Auction expired" | 359,004 | auctions[tokenId].firstBidTime==0||block.timestamp<auctions[tokenId].firstBidTime+auctions[tokenId].duration |
"Must send more than last bid by minBid Amount" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(!auctions[tokenId].paused, "Auction paused");
require(
msg.value >= auctions[tokenId].reservePrice,
"Must send reservePrice or more"
);
require(
auctions[tokenId].firstBidTime == 0 ||
block.timestamp <
auctions[tokenId].firstBidTime + auctions[tokenId].duration,
"Auction expired"
);
uint256 lastValue = auctions[tokenId].amount;
bool firstBid;
address payable lastBidder;
// allows for auctions with starting price of 0
if (lastValue != 0) {
require(msg.value > lastValue, "Must send more than last bid");
require(<FILL_ME>)
lastBidder = auctions[tokenId].bidder;
} else {
firstBid = true;
auctions[tokenId].firstBidTime = block.timestamp;
}
auctions[tokenId].amount = msg.value;
auctions[tokenId].bidder = msg.sender;
bool extended;
// at this point we know that the timestamp is less than start + duration
// we want to know by how much the timestamp is less than start + duration
// if the difference is less than the timeBuffer, update duration to time buffer
if (
(auctions[tokenId].firstBidTime.add(auctions[tokenId].duration))
.sub(block.timestamp) < timeBuffer
) {
// take the difference between now and starting point, add timeBuffer and set as duration
auctions[tokenId].duration = block.timestamp.sub(auctions[tokenId].firstBidTime).add(timeBuffer);
extended = true;
}
emit AuctionBid(
tokenId,
nftAddress,
msg.sender,
msg.value,
block.timestamp,
firstBid,
extended
);
if (!firstBid) {
// in case the bidder is a contract that doesn't allow receiving
if (!lastBidder.send(lastValue)) {
auctions[tokenId].admin.transfer(lastValue);
}
}
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| msg.value.sub(lastValue)>=minBid,"Must send more than last bid by minBid Amount" | 359,004 | msg.value.sub(lastValue)>=minBid |
"Auction hasn't begun" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(!auctions[tokenId].paused, "Auction paused");
require(<FILL_ME>)
require(
block.timestamp >=
auctions[tokenId].firstBidTime + auctions[tokenId].duration,
"Auction hasn't completed"
);
address winner = auctions[tokenId].bidder;
uint256 amount = auctions[tokenId].amount;
address creator = auctions[tokenId].creator;
uint256 adminSplit = auctions[tokenId].adminSplit;
address payable admin = auctions[tokenId].admin;
address payable proceedsRecipient = auctions[tokenId].proceedsRecipient;
emit AuctionEnded(tokenId, nftAddress, creator, winner, amount);
delete auctions[tokenId];
IERC721(nftAddress).transferFrom(address(this), winner, tokenId);
uint256 adminReceives = amount.mul(adminSplit).div(100);
uint256 proceedsAmount = amount.sub(adminReceives);
if (adminReceives > 0) {
admin.transfer(adminReceives);
}
proceedsRecipient.transfer(proceedsAmount);
}
function cancelAuction(uint256 tokenId) external nonReentrant {
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| uint256(auctions[tokenId].firstBidTime)!=0,"Auction hasn't begun" | 359,004 | uint256(auctions[tokenId].firstBidTime)!=0 |
"Can only be called by auction creator or owner" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(<FILL_ME>)
require(
uint256(auctions[tokenId].firstBidTime) == 0,
"Can't cancel an auction once it's begun"
);
address creator = auctions[tokenId].creator;
delete auctions[tokenId];
IERC721(nftAddress).transferFrom(address(this), creator, tokenId);
emit AuctionCanceled(tokenId, nftAddress, creator);
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| auctions[tokenId].creator==msg.sender||msg.sender==owner(),"Can only be called by auction creator or owner" | 359,004 | auctions[tokenId].creator==msg.sender||msg.sender==owner() |
"Can't cancel an auction once it's begun" | pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/**
██▀███ ▓█████ ██████ ▓█████ ██▀███ ██▒ █▓▓█████ ▄▄▄ █ ██ ▄████▄ ▄▄▄█████▓ ██▓ ▒█████ ███▄ █
▓██ ▒ ██▒▓█ ▀ ▒██ ▒ ▓█ ▀ ▓██ ▒ ██▒▓██░ █▒▓█ ▀ ▒████▄ ██ ▓██▒▒██▀ ▀█ ▓ ██▒ ▓▒▓██▒▒██▒ ██▒ ██ ▀█ █
▓██ ░▄█ ▒▒███ ░ ▓██▄ ▒███ ▓██ ░▄█ ▒ ▓██ █▒░▒███ ▒██ ▀█▄ ▓██ ▒██░▒▓█ ▄ ▒ ▓██░ ▒░▒██▒▒██░ ██▒▓██ ▀█ ██▒
▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒██▀▀█▄ ▒██ █░░▒▓█ ▄ ░██▄▄▄▄██ ▓▓█ ░██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ░██░▒██ ██░▓██▒ ▐▌██▒
░██▓ ▒██▒░▒████▒▒██████▒▒░▒████▒░██▓ ▒██▒ ▒▀█░ ░▒████▒ ▓█ ▓██▒▒▒█████▓ ▒ ▓███▀ ░ ▒██▒ ░ ░██░░ ████▓▒░▒██░ ▓██░
░ ▒▓ ░▒▓░░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒▓ ░▒▓░ ░ ▐░ ░░ ▒░ ░ ▒▒ ▓▒█░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒ ░░ ░▓ ░ ▒░▒░▒░ ░ ▒░ ▒ ▒
░▒ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ░░ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░ ▒ ░ ░ ▒ ▒░ ░ ░░ ░ ▒░
░░ ░ ░ ░ ░ ░ ░ ░░ ░ ░░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
▄▄▄▄ ▓██ ██▓ ▄▄▄▄ ██▓ ██▓ ██▓ ▓██ ██▓ ██▀███ ▓█████ ███▄ █ ███▄ █ ▓█████ ██ ▄█▀▄▄▄ ███▄ ▄███▓ ██▓███
▓█████▄▒██ ██▒ ▓█████▄ ▓██▒▓██▒ ▓██▒ ▒██ ██▒ ▓██ ▒ ██▒▓█ ▀ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ██▄█▒▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒
▒██▒ ▄██▒██ ██░ ▒██▒ ▄██▒██▒▒██░ ▒██░ ▒██ ██░ ▓██ ░▄█ ▒▒███ ▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓███▄░▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒
▒██░█▀ ░ ▐██▓░ ▒██░█▀ ░██░▒██░ ▒██░ ░ ▐██▓░ ▒██▀▀█▄ ▒▓█ ▄ ▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▓██ █▄░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒
░▓█ ▀█▓░ ██▒▓░ ░▓█ ▀█▓░██░░██████▒░██████▒ ░ ██▒▓░ ░██▓ ▒██▒░▒████▒▒██░ ▓██░▒██░ ▓██░░▒████▒▒██▒ █▄▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░
░▒▓███▀▒ ██▒▒▒ ░▒▓███▀▒░▓ ░ ▒░▓ ░░ ▒░▓ ░ ██▒▒▒ ░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▒ ▓▒▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░
▒░▒ ░▓██ ░▒░ ▒░▒ ░ ▒ ░░ ░ ▒ ░░ ░ ▒ ░▓██ ░▒░ ░▒ ░ ▒░ ░ ░ ░░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ▒░ ▒ ▒▒ ░░ ░ ░░▒ ░
░ ░▒ ▒ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░
░░ ░ ░ ░ ░
*/
contract ReserveAuction is Ownable, ReentrancyGuard {
using SafeMath for uint256;
bool public globalPaused;
uint256 public timeBuffer = 15 * 60; // extend 15 minutes after every bid made in last 15 minutes
uint256 public minBid = 1 * 10**17; // 0.1 eth
bytes4 constant interfaceId = 0x80ac58cd; // 721 interface id
address public nftAddress;
mapping(uint256 => Auction) public auctions;
uint256[] public tokenIds;
struct Auction {
bool exists;
bool paused;
uint256 amount;
uint256 tokenId;
uint256 duration;
uint256 firstBidTime;
uint256 reservePrice;
uint256 adminSplit; // percentage of 100
address creator;
address payable admin;
address payable proceedsRecipient;
address payable bidder;
}
modifier notPaused() {
}
event AuctionCreated(
uint256 tokenId,
address nftAddress,
uint256 duration,
uint256 reservePrice,
address creator
);
event AuctionBid(
uint256 tokenId,
address nftAddress,
address sender,
uint256 value,
uint256 timestamp,
bool firstBid,
bool extended
);
event AuctionEnded(
uint256 tokenId,
address nftAddress,
address creator,
address winner,
uint256 amount
);
event AuctionCanceled(
uint256 tokenId,
address nftAddress,
address creator
);
event UpdateAuction(
uint256 tokenId,
bool paused
);
constructor(address _nftAddress) public {
}
function updateNftAddress(address _nftAddress) public onlyOwner {
}
function updateMinBid(uint256 _minBid) public onlyOwner {
}
function updateTimeBuffer(uint256 _timeBuffer) public onlyOwner {
}
function updateAuction(uint256 tokenId, bool paused) public onlyOwner {
}
function createAuction(
bool paused,
uint256 tokenId,
uint256 duration,
uint256 reservePrice,
uint256 adminSplit, // percentage
address payable admin,
address payable proceedsRecipient
) external notPaused onlyOwner nonReentrant {
}
function createBid(uint256 tokenId) external payable notPaused nonReentrant {
}
function endAuction(uint256 tokenId) external notPaused nonReentrant {
}
function cancelAuction(uint256 tokenId) external nonReentrant {
require(auctions[tokenId].exists, "Auction doesn't exist");
require(
auctions[tokenId].creator == msg.sender || msg.sender == owner(),
"Can only be called by auction creator or owner"
);
require(<FILL_ME>)
address creator = auctions[tokenId].creator;
delete auctions[tokenId];
IERC721(nftAddress).transferFrom(address(this), creator, tokenId);
emit AuctionCanceled(tokenId, nftAddress, creator);
}
function updatePaused(bool _globalPaused) public onlyOwner {
}
}
| uint256(auctions[tokenId].firstBidTime)==0,"Can't cancel an auction once it's begun" | 359,004 | uint256(auctions[tokenId].firstBidTime)==0 |
"!signature" | pragma solidity 0.6.12;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract NerdBaseToken is Context, INerdBaseTokenLGE, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public constant DEV_FUND_LOCKED_MONTHS = 6;
uint256 public constant ONE_MONTH = 30 days;
uint256 public constant HARD_CAP_LIQUIDITY_EVENT = 800 ether;
uint256 public constant DEV_FUND_RESERVE_PERCENT = 9; //9%
uint256 public constant LP_LOCK_FOREVER_PERCENT = 40; //40%
uint256 public constant LP_INITIAL_LOCKED_PERIOD = 28 days;
uint256 public LGE_DURATION = 7 days;
address public override tokenUniswapPair;
uint256 public totalLPTokensMinted;
uint256 public totalETHContributed;
uint256 public LPperETHUnit;
mapping(address => uint256) public ethContributed;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event LiquidityAddition(address indexed dst, uint256 value);
event LPTokenClaimed(address dst, uint256 value);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public constant initialSupply = 21000e18;
uint256 public contractStartTimestamp;
uint256 public tokenActiveStartTimestamp;
address public override devFundAddress;
address public tentativeDevAddress;
uint256 public devFundTotal;
uint256 public releasedDevFund;
uint256 public lpReleaseStart;
address public lgeApprover;
mapping(address => bool) public alreadyPlayGameUsers;
function name() public view returns (string memory) {
}
function initialSetup(
address router,
address factory,
address _devFund,
uint256 _lgePeriod,
address _lgeApprover
) internal {
}
function isApprovedBySignature(
address _joiner,
bytes32 r,
bytes32 s,
uint8 v
) public view returns (bool) {
}
function isJoinedLGE(address _joiner) public view returns (bool) {
}
function registerLGE(
bytes32 r,
bytes32 s,
uint8 v
) public {
require(<FILL_ME>)
alreadyPlayGameUsers[msg.sender] = true;
}
function getAllocatedLP(address _user)
public
override
view
returns (uint256)
{
}
function getLpReleaseStart() public override view returns (uint256) {
}
function getTokenUniswapPair() public override view returns (address) {
}
function getTotalLPTokensMinted() public override view returns (uint256) {
}
function getReleasableLPTokensMinted()
public
override
view
returns (uint256)
{
}
function pendingReleasableDevFund() public view returns (uint256) {
}
function unlockDevFund() public {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public override view returns (uint256) {
}
function balanceOf(address _owner) public override view returns (uint256) {
}
IUniswapV2Router02 public uniswapRouterV2;
IUniswapV2Factory public uniswapFactory;
function getUniswapRouterV2() public override view returns (address) {
}
function getUniswapFactory() public override view returns (address) {
}
function createUniswapPairMainnet() public returns (address) {
}
string
public liquidityGenerationParticipationAgreement = "I'm not a resident of the United States \n I understand that this contract is provided with no warranty of any kind. \n I agree to not hold the contract creators, NERD team members or anyone associated with this event liable for any damage monetary and otherwise I might onccur. \n I understand that any smart contract interaction carries an inherent risk.";
function getSecondsLeftInLiquidityGenerationEvent()
public
view
returns (uint256)
{
}
function liquidityGenerationOngoing() public view returns (bool) {
}
function emergencyDrain24hAfterLiquidityGenerationEventIsDone()
public
onlyOwner
{
}
bool public LPGenerationCompleted;
function isLPGenerationCompleted() public override view returns (bool) {
}
function addLiquidityToUniswapNERDxWETHPair() public {
}
modifier checkPreconditionsLGE(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
) {
}
function addLiquidity(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement,
bytes32 r,
bytes32 s,
uint8 v
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function setDevFundReciever(address _devaddr) public {
}
function confirmDevAddress() public {
}
function getHardCap() public view returns (uint256) {
}
function addLiquidityWithoutSignature(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function addLiquidityInternal() private {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
}
function setShouldTransferChecker(address _transferCheckerAddress)
public
onlyOwner
{
}
address public override transferCheckerAddress;
function setFeeDistributor(address _feeDistributor) public onlyOwner {
}
address public override feeDistributor;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| isApprovedBySignature(msg.sender,r,s,v),"!signature" | 359,049 | isApprovedBySignature(msg.sender,r,s,v) |
"Liquidity generation grace period still ongoing" | pragma solidity 0.6.12;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract NerdBaseToken is Context, INerdBaseTokenLGE, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public constant DEV_FUND_LOCKED_MONTHS = 6;
uint256 public constant ONE_MONTH = 30 days;
uint256 public constant HARD_CAP_LIQUIDITY_EVENT = 800 ether;
uint256 public constant DEV_FUND_RESERVE_PERCENT = 9; //9%
uint256 public constant LP_LOCK_FOREVER_PERCENT = 40; //40%
uint256 public constant LP_INITIAL_LOCKED_PERIOD = 28 days;
uint256 public LGE_DURATION = 7 days;
address public override tokenUniswapPair;
uint256 public totalLPTokensMinted;
uint256 public totalETHContributed;
uint256 public LPperETHUnit;
mapping(address => uint256) public ethContributed;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event LiquidityAddition(address indexed dst, uint256 value);
event LPTokenClaimed(address dst, uint256 value);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public constant initialSupply = 21000e18;
uint256 public contractStartTimestamp;
uint256 public tokenActiveStartTimestamp;
address public override devFundAddress;
address public tentativeDevAddress;
uint256 public devFundTotal;
uint256 public releasedDevFund;
uint256 public lpReleaseStart;
address public lgeApprover;
mapping(address => bool) public alreadyPlayGameUsers;
function name() public view returns (string memory) {
}
function initialSetup(
address router,
address factory,
address _devFund,
uint256 _lgePeriod,
address _lgeApprover
) internal {
}
function isApprovedBySignature(
address _joiner,
bytes32 r,
bytes32 s,
uint8 v
) public view returns (bool) {
}
function isJoinedLGE(address _joiner) public view returns (bool) {
}
function registerLGE(
bytes32 r,
bytes32 s,
uint8 v
) public {
}
function getAllocatedLP(address _user)
public
override
view
returns (uint256)
{
}
function getLpReleaseStart() public override view returns (uint256) {
}
function getTokenUniswapPair() public override view returns (address) {
}
function getTotalLPTokensMinted() public override view returns (uint256) {
}
function getReleasableLPTokensMinted()
public
override
view
returns (uint256)
{
}
function pendingReleasableDevFund() public view returns (uint256) {
}
function unlockDevFund() public {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public override view returns (uint256) {
}
function balanceOf(address _owner) public override view returns (uint256) {
}
IUniswapV2Router02 public uniswapRouterV2;
IUniswapV2Factory public uniswapFactory;
function getUniswapRouterV2() public override view returns (address) {
}
function getUniswapFactory() public override view returns (address) {
}
function createUniswapPairMainnet() public returns (address) {
}
string
public liquidityGenerationParticipationAgreement = "I'm not a resident of the United States \n I understand that this contract is provided with no warranty of any kind. \n I agree to not hold the contract creators, NERD team members or anyone associated with this event liable for any damage monetary and otherwise I might onccur. \n I understand that any smart contract interaction carries an inherent risk.";
function getSecondsLeftInLiquidityGenerationEvent()
public
view
returns (uint256)
{
}
function liquidityGenerationOngoing() public view returns (bool) {
}
function emergencyDrain24hAfterLiquidityGenerationEventIsDone()
public
onlyOwner
{
require(<FILL_ME>)
(bool success, ) = msg.sender.call{value: address(this).balance}("");
require(success, "Transfer failed.");
_balances[msg.sender] = _balances[address(this)];
_balances[address(this)] = 0;
}
bool public LPGenerationCompleted;
function isLPGenerationCompleted() public override view returns (bool) {
}
function addLiquidityToUniswapNERDxWETHPair() public {
}
modifier checkPreconditionsLGE(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
) {
}
function addLiquidity(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement,
bytes32 r,
bytes32 s,
uint8 v
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function setDevFundReciever(address _devaddr) public {
}
function confirmDevAddress() public {
}
function getHardCap() public view returns (uint256) {
}
function addLiquidityWithoutSignature(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function addLiquidityInternal() private {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
}
function setShouldTransferChecker(address _transferCheckerAddress)
public
onlyOwner
{
}
address public override transferCheckerAddress;
function setFeeDistributor(address _feeDistributor) public onlyOwner {
}
address public override feeDistributor;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| contractStartTimestamp.add(8days)<block.timestamp,"Liquidity generation grace period still ongoing" | 359,049 | contractStartTimestamp.add(8days)<block.timestamp |
"You havent played the game" | pragma solidity 0.6.12;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract NerdBaseToken is Context, INerdBaseTokenLGE, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public constant DEV_FUND_LOCKED_MONTHS = 6;
uint256 public constant ONE_MONTH = 30 days;
uint256 public constant HARD_CAP_LIQUIDITY_EVENT = 800 ether;
uint256 public constant DEV_FUND_RESERVE_PERCENT = 9; //9%
uint256 public constant LP_LOCK_FOREVER_PERCENT = 40; //40%
uint256 public constant LP_INITIAL_LOCKED_PERIOD = 28 days;
uint256 public LGE_DURATION = 7 days;
address public override tokenUniswapPair;
uint256 public totalLPTokensMinted;
uint256 public totalETHContributed;
uint256 public LPperETHUnit;
mapping(address => uint256) public ethContributed;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event LiquidityAddition(address indexed dst, uint256 value);
event LPTokenClaimed(address dst, uint256 value);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public constant initialSupply = 21000e18;
uint256 public contractStartTimestamp;
uint256 public tokenActiveStartTimestamp;
address public override devFundAddress;
address public tentativeDevAddress;
uint256 public devFundTotal;
uint256 public releasedDevFund;
uint256 public lpReleaseStart;
address public lgeApprover;
mapping(address => bool) public alreadyPlayGameUsers;
function name() public view returns (string memory) {
}
function initialSetup(
address router,
address factory,
address _devFund,
uint256 _lgePeriod,
address _lgeApprover
) internal {
}
function isApprovedBySignature(
address _joiner,
bytes32 r,
bytes32 s,
uint8 v
) public view returns (bool) {
}
function isJoinedLGE(address _joiner) public view returns (bool) {
}
function registerLGE(
bytes32 r,
bytes32 s,
uint8 v
) public {
}
function getAllocatedLP(address _user)
public
override
view
returns (uint256)
{
}
function getLpReleaseStart() public override view returns (uint256) {
}
function getTokenUniswapPair() public override view returns (address) {
}
function getTotalLPTokensMinted() public override view returns (uint256) {
}
function getReleasableLPTokensMinted()
public
override
view
returns (uint256)
{
}
function pendingReleasableDevFund() public view returns (uint256) {
}
function unlockDevFund() public {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public override view returns (uint256) {
}
function balanceOf(address _owner) public override view returns (uint256) {
}
IUniswapV2Router02 public uniswapRouterV2;
IUniswapV2Factory public uniswapFactory;
function getUniswapRouterV2() public override view returns (address) {
}
function getUniswapFactory() public override view returns (address) {
}
function createUniswapPairMainnet() public returns (address) {
}
string
public liquidityGenerationParticipationAgreement = "I'm not a resident of the United States \n I understand that this contract is provided with no warranty of any kind. \n I agree to not hold the contract creators, NERD team members or anyone associated with this event liable for any damage monetary and otherwise I might onccur. \n I understand that any smart contract interaction carries an inherent risk.";
function getSecondsLeftInLiquidityGenerationEvent()
public
view
returns (uint256)
{
}
function liquidityGenerationOngoing() public view returns (bool) {
}
function emergencyDrain24hAfterLiquidityGenerationEventIsDone()
public
onlyOwner
{
}
bool public LPGenerationCompleted;
function isLPGenerationCompleted() public override view returns (bool) {
}
function addLiquidityToUniswapNERDxWETHPair() public {
}
modifier checkPreconditionsLGE(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
) {
}
function addLiquidity(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement,
bytes32 r,
bytes32 s,
uint8 v
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
require(<FILL_ME>)
addLiquidityInternal();
}
function setDevFundReciever(address _devaddr) public {
}
function confirmDevAddress() public {
}
function getHardCap() public view returns (uint256) {
}
function addLiquidityWithoutSignature(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function addLiquidityInternal() private {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
}
function setShouldTransferChecker(address _transferCheckerAddress)
public
onlyOwner
{
}
address public override transferCheckerAddress;
function setFeeDistributor(address _feeDistributor) public onlyOwner {
}
address public override feeDistributor;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| isJoinedLGE(msg.sender)||(isApprovedBySignature(msg.sender,r,s,v)),"You havent played the game" | 359,049 | isJoinedLGE(msg.sender)||(isApprovedBySignature(msg.sender,r,s,v)) |
"You havent played the game" | pragma solidity 0.6.12;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract NerdBaseToken is Context, INerdBaseTokenLGE, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public constant DEV_FUND_LOCKED_MONTHS = 6;
uint256 public constant ONE_MONTH = 30 days;
uint256 public constant HARD_CAP_LIQUIDITY_EVENT = 800 ether;
uint256 public constant DEV_FUND_RESERVE_PERCENT = 9; //9%
uint256 public constant LP_LOCK_FOREVER_PERCENT = 40; //40%
uint256 public constant LP_INITIAL_LOCKED_PERIOD = 28 days;
uint256 public LGE_DURATION = 7 days;
address public override tokenUniswapPair;
uint256 public totalLPTokensMinted;
uint256 public totalETHContributed;
uint256 public LPperETHUnit;
mapping(address => uint256) public ethContributed;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event LiquidityAddition(address indexed dst, uint256 value);
event LPTokenClaimed(address dst, uint256 value);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public constant initialSupply = 21000e18;
uint256 public contractStartTimestamp;
uint256 public tokenActiveStartTimestamp;
address public override devFundAddress;
address public tentativeDevAddress;
uint256 public devFundTotal;
uint256 public releasedDevFund;
uint256 public lpReleaseStart;
address public lgeApprover;
mapping(address => bool) public alreadyPlayGameUsers;
function name() public view returns (string memory) {
}
function initialSetup(
address router,
address factory,
address _devFund,
uint256 _lgePeriod,
address _lgeApprover
) internal {
}
function isApprovedBySignature(
address _joiner,
bytes32 r,
bytes32 s,
uint8 v
) public view returns (bool) {
}
function isJoinedLGE(address _joiner) public view returns (bool) {
}
function registerLGE(
bytes32 r,
bytes32 s,
uint8 v
) public {
}
function getAllocatedLP(address _user)
public
override
view
returns (uint256)
{
}
function getLpReleaseStart() public override view returns (uint256) {
}
function getTokenUniswapPair() public override view returns (address) {
}
function getTotalLPTokensMinted() public override view returns (uint256) {
}
function getReleasableLPTokensMinted()
public
override
view
returns (uint256)
{
}
function pendingReleasableDevFund() public view returns (uint256) {
}
function unlockDevFund() public {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public override view returns (uint256) {
}
function balanceOf(address _owner) public override view returns (uint256) {
}
IUniswapV2Router02 public uniswapRouterV2;
IUniswapV2Factory public uniswapFactory;
function getUniswapRouterV2() public override view returns (address) {
}
function getUniswapFactory() public override view returns (address) {
}
function createUniswapPairMainnet() public returns (address) {
}
string
public liquidityGenerationParticipationAgreement = "I'm not a resident of the United States \n I understand that this contract is provided with no warranty of any kind. \n I agree to not hold the contract creators, NERD team members or anyone associated with this event liable for any damage monetary and otherwise I might onccur. \n I understand that any smart contract interaction carries an inherent risk.";
function getSecondsLeftInLiquidityGenerationEvent()
public
view
returns (uint256)
{
}
function liquidityGenerationOngoing() public view returns (bool) {
}
function emergencyDrain24hAfterLiquidityGenerationEventIsDone()
public
onlyOwner
{
}
bool public LPGenerationCompleted;
function isLPGenerationCompleted() public override view returns (bool) {
}
function addLiquidityToUniswapNERDxWETHPair() public {
}
modifier checkPreconditionsLGE(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
) {
}
function addLiquidity(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement,
bytes32 r,
bytes32 s,
uint8 v
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function setDevFundReciever(address _devaddr) public {
}
function confirmDevAddress() public {
}
function getHardCap() public view returns (uint256) {
}
function addLiquidityWithoutSignature(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
require(<FILL_ME>)
addLiquidityInternal();
}
function addLiquidityInternal() private {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
}
function setShouldTransferChecker(address _transferCheckerAddress)
public
onlyOwner
{
}
address public override transferCheckerAddress;
function setFeeDistributor(address _feeDistributor) public onlyOwner {
}
address public override feeDistributor;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| isJoinedLGE(msg.sender),"You havent played the game" | 359,049 | isJoinedLGE(msg.sender) |
"Math broke, does gravity still work?" | pragma solidity 0.6.12;
// import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract NerdBaseToken is Context, INerdBaseTokenLGE, Ownable {
using SafeMath for uint256;
using Address for address;
uint256 public constant DEV_FUND_LOCKED_MONTHS = 6;
uint256 public constant ONE_MONTH = 30 days;
uint256 public constant HARD_CAP_LIQUIDITY_EVENT = 800 ether;
uint256 public constant DEV_FUND_RESERVE_PERCENT = 9; //9%
uint256 public constant LP_LOCK_FOREVER_PERCENT = 40; //40%
uint256 public constant LP_INITIAL_LOCKED_PERIOD = 28 days;
uint256 public LGE_DURATION = 7 days;
address public override tokenUniswapPair;
uint256 public totalLPTokensMinted;
uint256 public totalETHContributed;
uint256 public LPperETHUnit;
mapping(address => uint256) public ethContributed;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event LiquidityAddition(address indexed dst, uint256 value);
event LPTokenClaimed(address dst, uint256 value);
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public constant initialSupply = 21000e18;
uint256 public contractStartTimestamp;
uint256 public tokenActiveStartTimestamp;
address public override devFundAddress;
address public tentativeDevAddress;
uint256 public devFundTotal;
uint256 public releasedDevFund;
uint256 public lpReleaseStart;
address public lgeApprover;
mapping(address => bool) public alreadyPlayGameUsers;
function name() public view returns (string memory) {
}
function initialSetup(
address router,
address factory,
address _devFund,
uint256 _lgePeriod,
address _lgeApprover
) internal {
}
function isApprovedBySignature(
address _joiner,
bytes32 r,
bytes32 s,
uint8 v
) public view returns (bool) {
}
function isJoinedLGE(address _joiner) public view returns (bool) {
}
function registerLGE(
bytes32 r,
bytes32 s,
uint8 v
) public {
}
function getAllocatedLP(address _user)
public
override
view
returns (uint256)
{
}
function getLpReleaseStart() public override view returns (uint256) {
}
function getTokenUniswapPair() public override view returns (address) {
}
function getTotalLPTokensMinted() public override view returns (uint256) {
}
function getReleasableLPTokensMinted()
public
override
view
returns (uint256)
{
}
function pendingReleasableDevFund() public view returns (uint256) {
}
function unlockDevFund() public {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public override view returns (uint256) {
}
function balanceOf(address _owner) public override view returns (uint256) {
}
IUniswapV2Router02 public uniswapRouterV2;
IUniswapV2Factory public uniswapFactory;
function getUniswapRouterV2() public override view returns (address) {
}
function getUniswapFactory() public override view returns (address) {
}
function createUniswapPairMainnet() public returns (address) {
}
string
public liquidityGenerationParticipationAgreement = "I'm not a resident of the United States \n I understand that this contract is provided with no warranty of any kind. \n I agree to not hold the contract creators, NERD team members or anyone associated with this event liable for any damage monetary and otherwise I might onccur. \n I understand that any smart contract interaction carries an inherent risk.";
function getSecondsLeftInLiquidityGenerationEvent()
public
view
returns (uint256)
{
}
function liquidityGenerationOngoing() public view returns (bool) {
}
function emergencyDrain24hAfterLiquidityGenerationEventIsDone()
public
onlyOwner
{
}
bool public LPGenerationCompleted;
function isLPGenerationCompleted() public override view returns (bool) {
}
function addLiquidityToUniswapNERDxWETHPair() public {
}
modifier checkPreconditionsLGE(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
) {
}
function addLiquidity(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement,
bytes32 r,
bytes32 s,
uint8 v
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function setDevFundReciever(address _devaddr) public {
}
function confirmDevAddress() public {
}
function getHardCap() public view returns (uint256) {
}
function addLiquidityWithoutSignature(
bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
public
payable
checkPreconditionsLGE(
agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement
)
{
}
function addLiquidityInternal() private {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
}
function setShouldTransferChecker(address _transferCheckerAddress)
public
onlyOwner
{
}
address public override transferCheckerAddress;
function setFeeDistributor(address _feeDistributor) public onlyOwner {
}
address public override feeDistributor;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(
amount,
"ERC20: transfer amount exceeds balance"
);
(
uint256 transferToAmount,
uint256 transferToFeeDistributorAmount
) = IFeeApprover(transferCheckerAddress).calculateAmountsAfterFee(
sender,
recipient,
amount
);
console.log("Sender is :", sender, "Recipent is :", recipient);
console.log("amount is ", amount);
require(<FILL_ME>)
_balances[recipient] = _balances[recipient].add(transferToAmount);
emit Transfer(sender, recipient, transferToAmount);
//transferToFeeDistributorAmount is total rewards fees received for genesis pool (this contract) and farming pool
if (
transferToFeeDistributorAmount > 0 && feeDistributor != address(0)
) {
_balances[feeDistributor] = _balances[feeDistributor].add(
transferToFeeDistributorAmount
);
emit Transfer(
sender,
feeDistributor,
transferToFeeDistributorAmount
);
INerdVault(feeDistributor).updatePendingRewards();
}
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _setupDecimals(uint8 decimals_) internal {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| transferToAmount.add(transferToFeeDistributorAmount)==amount,"Math broke, does gravity still work?" | 359,049 | transferToAmount.add(transferToFeeDistributorAmount)==amount |
'Buy the previous stage' | /**
* RedLine project
*
* Website: https://redline.fund
* Email: [email protected]
*/
pragma solidity ^0.5.10;
contract Redline {
mapping (uint => uint) public stagePrice;
address public owner;
uint public currentUserID;
mapping (address => User) public users;
mapping (uint => address) public userAddresses;
uint REFERRALS_LIMIT = 3;
uint STAGE_DURATION = 365 days;
struct User {
uint id;
uint referrerID;
address[] referrals;
mapping (uint => uint) stageEndTime;
}
event RegisterUserEvent(address indexed user, address indexed referrer, uint time);
event BuyStageEvent(address indexed user, uint indexed stage, uint time);
event GetStageProfitEvent(address indexed user, address indexed referral, uint indexed stage, uint time);
event LostStageProfitEvent(address indexed user, address indexed referral, uint indexed stage, uint time);
modifier userNotRegistered() {
}
modifier userRegistered() {
}
modifier validReferrerID(uint _referrerID) {
}
modifier validStage(uint _stage) {
}
modifier validStageAmount(uint _stage) {
}
constructor() public {
}
function () external payable {
}
function registerUser(uint _referrerID) public payable userNotRegistered() validReferrerID(_referrerID) validStageAmount(1) {
}
function buyStage(uint _stage) public payable userRegistered() validStage(_stage) validStageAmount(_stage) {
for (uint s = _stage - 1; s > 0; s--) {
require(<FILL_ME>)
}
if (getUserStageEndTime(msg.sender, _stage) == 0) {
users[msg.sender].stageEndTime[_stage] = now + STAGE_DURATION;
} else {
users[msg.sender].stageEndTime[_stage] += STAGE_DURATION;
}
transferStagePayment(_stage, msg.sender);
emit BuyStageEvent(msg.sender, _stage, now);
}
function findReferrer(address _user) public view returns (address) {
}
function transferStagePayment(uint _stage, address _user) internal {
}
function getUserUpline(address _user, uint height) public view returns (address) {
}
function getUserReferrals(address _user) public view returns (address[] memory) {
}
function getUserStageEndTime(address _user, uint _stage) public view returns (uint) {
}
function createNewUser(uint _referrerID) private view returns (User memory) {
}
function bytesToAddress(bytes memory _addr) private pure returns (address addr) {
}
function addressToPayable(address _addr) private pure returns (address payable) {
}
}
| getUserStageEndTime(msg.sender,s)>=now,'Buy the previous stage' | 359,067 | getUserStageEndTime(msg.sender,s)>=now |
"Could not transfer tokens." | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @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 admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
}
function allowFarming(bool _status) public onlyOwner returns(bool){
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(<FILL_ME>)
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
}
function getNumberOfHolders() public view returns (uint) {
}
function farm(uint amountToFarm) public {
}
function unfarm(uint amountToWithdraw) public {
}
function claimRewards() public {
}
function getFundedTokens() public view returns (uint) {
}
}
| Token(VAPEAddress).transfer(account,unclaimedDivs),"Could not transfer tokens." | 359,085 | Token(VAPEAddress).transfer(account,unclaimedDivs) |
"Insufficient Token Allowance" | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @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 admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
}
function allowFarming(bool _status) public onlyOwner returns(bool){
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
function updateAccount(address account) private {
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
}
function getNumberOfHolders() public view returns (uint) {
}
function farm(uint amountToFarm) public {
require(farmingStatus == true, "Staking is not yet initialized");
require(amountToFarm > 0, "Cannot deposit 0 Tokens");
require(<FILL_ME>)
updateAccount(msg.sender);
uint fee = amountToFarm.mul(farmingFeeRate).div(1e4);
uint amountAfterFee = amountToFarm.sub(fee);
require(Token(LPTokenAddress).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
farmingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
}
function claimRewards() public {
}
function getFundedTokens() public view returns (uint) {
}
}
| Token(LPTokenAddress).transferFrom(msg.sender,address(this),amountToFarm),"Insufficient Token Allowance" | 359,085 | Token(LPTokenAddress).transferFrom(msg.sender,address(this),amountToFarm) |
"Could not transfer deposit fee." | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @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 admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
}
function allowFarming(bool _status) public onlyOwner returns(bool){
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
function updateAccount(address account) private {
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
}
function getNumberOfHolders() public view returns (uint) {
}
function farm(uint amountToFarm) public {
require(farmingStatus == true, "Staking is not yet initialized");
require(amountToFarm > 0, "Cannot deposit 0 Tokens");
require(Token(LPTokenAddress).transferFrom(msg.sender, address(this), amountToFarm), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToFarm.mul(farmingFeeRate).div(1e4);
uint amountAfterFee = amountToFarm.sub(fee);
require(<FILL_ME>)
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
farmingTime[msg.sender] = now;
}
}
function unfarm(uint amountToWithdraw) public {
}
function claimRewards() public {
}
function getFundedTokens() public view returns (uint) {
}
}
| Token(LPTokenAddress).transfer(admin,fee),"Could not transfer deposit fee." | 359,085 | Token(LPTokenAddress).transfer(admin,fee) |
"You have not staked for a while yet, kindly wait a bit more" | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @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 admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
}
function allowFarming(bool _status) public onlyOwner returns(bool){
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
function updateAccount(address account) private {
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
}
function getNumberOfHolders() public view returns (uint) {
}
function farm(uint amountToFarm) public {
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(<FILL_ME>)
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unfarmingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPTokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(LPTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimRewards() public {
}
function getFundedTokens() public view returns (uint) {
}
}
| now.sub(farmingTime[msg.sender])>PossibleUnfarmTime,"You have not staked for a while yet, kindly wait a bit more" | 359,085 | now.sub(farmingTime[msg.sender])>PossibleUnfarmTime |
"Could not transfer tokens." | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
//BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>"
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
*
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
*
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @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 admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VAPEPOOL2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
//token contract addresses
address public VAPEAddress;
address public LPTokenAddress;
// reward rate % per year
uint public rewardRate = 119880;
uint public rewardInterval = 365 days;
//farming fee in percentage
uint public farmingFeeRate = 0;
//unfarming fee in percentage
uint public unfarmingFeeRate = 0;
//unfarming possible Time
uint public PossibleUnfarmTime = 48 hours;
uint public totalClaimedRewards = 0;
uint private ToBeFarmedTokens;
bool public farmingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public farmingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
}
function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
}
function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
}
function allowFarming(bool _status) public onlyOwner returns(bool){
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
function updateAccount(address account) private {
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
}
function getNumberOfHolders() public view returns (uint) {
}
function farm(uint amountToFarm) public {
}
function unfarm(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(farmingTime[msg.sender]) > PossibleUnfarmTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unfarmingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPTokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(<FILL_ME>)
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimRewards() public {
}
function getFundedTokens() public view returns (uint) {
}
}
| Token(LPTokenAddress).transfer(msg.sender,amountAfterFee),"Could not transfer tokens." | 359,085 | Token(LPTokenAddress).transfer(msg.sender,amountAfterFee) |
"Beneficiary not assigned" | pragma solidity 0.5.17;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./Escrow.sol";
interface IBeneficiaryContract {
function __escrowSentTokens(uint256 amount) external;
}
/// @title PhasedEscrow
/// @notice A token holder contract allowing contract owner to set beneficiary of
/// tokens held by the contract and allowing the owner to withdraw the
/// tokens to that beneficiary in phases.
contract PhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryUpdated(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
IERC20 public token;
IBeneficiaryContract public beneficiary;
constructor(IERC20 _token) public {
}
/// @notice Sets the provided address as a beneficiary allowing it to
/// withdraw all tokens from escrow. This function can be called only
/// by escrow owner.
function setBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Withdraws the specified number of tokens from escrow to the
/// beneficiary. If the beneficiary is not set, or there are
/// insufficient tokens in escrow, the function fails.
function withdraw(uint256 amount) external onlyOwner {
require(<FILL_ME>)
uint256 balance = token.balanceOf(address(this));
require(amount <= balance, "Not enough tokens for withdrawal");
token.safeTransfer(address(beneficiary), amount);
emit TokensWithdrawn(address(beneficiary), amount);
beneficiary.__escrowSentTokens(amount);
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
}
/// @notice Withdraws all funds from a non-phased Escrow passed as
/// a parameter. For this function to succeed, this PhasedEscrow
/// has to be set as a beneficiary of the non-phased Escrow.
function withdrawFromEscrow(Escrow _escrow) public {
}
}
/// @title BatchedPhasedEscrow
/// @notice A token holder contract allowing contract owner to approve a set of
/// beneficiaries of tokens held by the contract, to appoint a separate
/// drawee role, and allowing that drawee to withdraw tokens to approved
/// beneficiaries in phases.
contract BatchedPhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryApproved(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
event DraweeRoleTransferred(address oldDrawee, address newDrawee);
IERC20 public token;
address public drawee;
mapping(address => bool) private approvedBeneficiaries;
modifier onlyDrawee() {
}
constructor(IERC20 _token) public {
}
/// @notice Approves the provided address as a beneficiary of tokens held by
/// the escrow. Can be called only by escrow owner.
function approveBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Returns `true` if the given address has been approved as a
/// beneficiary of the escrow, `false` otherwise.
function isBeneficiaryApproved(IBeneficiaryContract _beneficiary)
public
view
returns (bool)
{
}
/// @notice Transfers the role of drawee to another address. Can be called
/// only by the contract owner.
function setDrawee(address newDrawee) public onlyOwner {
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
}
/// @notice Withdraws tokens from escrow to selected beneficiaries,
/// transferring to each beneficiary the amount of tokens specified
/// as a parameter. Only beneficiaries previously approved by escrow
/// owner can receive funds.
function batchedWithdraw(
IBeneficiaryContract[] memory beneficiaries,
uint256[] memory amounts
) public onlyDrawee {
}
function withdraw(IBeneficiaryContract beneficiary, uint256 amount)
private
{
}
}
// Interface representing staking pool rewards contract such as CurveRewards
// contract deployed for Keep (0xAF379f0228ad0d46bB7B4f38f9dc9bCC1ad0360c) or
// LPRewards contract from keep-ecdsa repository deployed for Uniswap.
interface IStakingPoolRewards {
function notifyRewardAmount(uint256 amount) external;
}
/// @title StakingPoolRewardsEscrowBeneficiary
/// @notice A beneficiary contract that can receive a withdrawal phase from a
/// PhasedEscrow contract. Immediately stakes the received tokens on a
/// designated IStakingPoolRewards contract.
contract StakingPoolRewardsEscrowBeneficiary is Ownable, IBeneficiaryContract {
IERC20 public token;
IStakingPoolRewards public rewards;
constructor(IERC20 _token, IStakingPoolRewards _rewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @dev Interface of recipient contract for approveAndCall pattern.
interface IStakerRewards {
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes calldata _extraData
) external;
}
/// @title StakerRewardsBeneficiary
/// @notice An abstract beneficiary contract that can receive a withdrawal phase
/// from a PhasedEscrow contract. The received tokens are immediately
/// funded for a designated rewards escrow beneficiary contract.
contract StakerRewardsBeneficiary is Ownable {
IERC20 public token;
IStakerRewards public stakerRewards;
constructor(IERC20 _token, IStakerRewards _stakerRewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @title BeaconBackportRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconBackportRewardsEscrowBeneficiary contract.
contract BeaconBackportRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
/// @title BeaconRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconRewardsEscrowBeneficiary contract.
contract BeaconRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
| address(beneficiary)!=address(0),"Beneficiary not assigned" | 359,087 | address(beneficiary)!=address(0) |
"Unsupported token" | pragma solidity 0.5.17;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./Escrow.sol";
interface IBeneficiaryContract {
function __escrowSentTokens(uint256 amount) external;
}
/// @title PhasedEscrow
/// @notice A token holder contract allowing contract owner to set beneficiary of
/// tokens held by the contract and allowing the owner to withdraw the
/// tokens to that beneficiary in phases.
contract PhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryUpdated(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
IERC20 public token;
IBeneficiaryContract public beneficiary;
constructor(IERC20 _token) public {
}
/// @notice Sets the provided address as a beneficiary allowing it to
/// withdraw all tokens from escrow. This function can be called only
/// by escrow owner.
function setBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Withdraws the specified number of tokens from escrow to the
/// beneficiary. If the beneficiary is not set, or there are
/// insufficient tokens in escrow, the function fails.
function withdraw(uint256 amount) external onlyOwner {
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
require(<FILL_ME>)
token.safeTransferFrom(_from, address(this), _value);
}
/// @notice Withdraws all funds from a non-phased Escrow passed as
/// a parameter. For this function to succeed, this PhasedEscrow
/// has to be set as a beneficiary of the non-phased Escrow.
function withdrawFromEscrow(Escrow _escrow) public {
}
}
/// @title BatchedPhasedEscrow
/// @notice A token holder contract allowing contract owner to approve a set of
/// beneficiaries of tokens held by the contract, to appoint a separate
/// drawee role, and allowing that drawee to withdraw tokens to approved
/// beneficiaries in phases.
contract BatchedPhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryApproved(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
event DraweeRoleTransferred(address oldDrawee, address newDrawee);
IERC20 public token;
address public drawee;
mapping(address => bool) private approvedBeneficiaries;
modifier onlyDrawee() {
}
constructor(IERC20 _token) public {
}
/// @notice Approves the provided address as a beneficiary of tokens held by
/// the escrow. Can be called only by escrow owner.
function approveBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Returns `true` if the given address has been approved as a
/// beneficiary of the escrow, `false` otherwise.
function isBeneficiaryApproved(IBeneficiaryContract _beneficiary)
public
view
returns (bool)
{
}
/// @notice Transfers the role of drawee to another address. Can be called
/// only by the contract owner.
function setDrawee(address newDrawee) public onlyOwner {
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
}
/// @notice Withdraws tokens from escrow to selected beneficiaries,
/// transferring to each beneficiary the amount of tokens specified
/// as a parameter. Only beneficiaries previously approved by escrow
/// owner can receive funds.
function batchedWithdraw(
IBeneficiaryContract[] memory beneficiaries,
uint256[] memory amounts
) public onlyDrawee {
}
function withdraw(IBeneficiaryContract beneficiary, uint256 amount)
private
{
}
}
// Interface representing staking pool rewards contract such as CurveRewards
// contract deployed for Keep (0xAF379f0228ad0d46bB7B4f38f9dc9bCC1ad0360c) or
// LPRewards contract from keep-ecdsa repository deployed for Uniswap.
interface IStakingPoolRewards {
function notifyRewardAmount(uint256 amount) external;
}
/// @title StakingPoolRewardsEscrowBeneficiary
/// @notice A beneficiary contract that can receive a withdrawal phase from a
/// PhasedEscrow contract. Immediately stakes the received tokens on a
/// designated IStakingPoolRewards contract.
contract StakingPoolRewardsEscrowBeneficiary is Ownable, IBeneficiaryContract {
IERC20 public token;
IStakingPoolRewards public rewards;
constructor(IERC20 _token, IStakingPoolRewards _rewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @dev Interface of recipient contract for approveAndCall pattern.
interface IStakerRewards {
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes calldata _extraData
) external;
}
/// @title StakerRewardsBeneficiary
/// @notice An abstract beneficiary contract that can receive a withdrawal phase
/// from a PhasedEscrow contract. The received tokens are immediately
/// funded for a designated rewards escrow beneficiary contract.
contract StakerRewardsBeneficiary is Ownable {
IERC20 public token;
IStakerRewards public stakerRewards;
constructor(IERC20 _token, IStakerRewards _stakerRewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @title BeaconBackportRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconBackportRewardsEscrowBeneficiary contract.
contract BeaconBackportRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
/// @title BeaconRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconRewardsEscrowBeneficiary contract.
contract BeaconRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
| IERC20(_token)==token,"Unsupported token" | 359,087 | IERC20(_token)==token |
"Beneficiary was not approved" | pragma solidity 0.5.17;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./Escrow.sol";
interface IBeneficiaryContract {
function __escrowSentTokens(uint256 amount) external;
}
/// @title PhasedEscrow
/// @notice A token holder contract allowing contract owner to set beneficiary of
/// tokens held by the contract and allowing the owner to withdraw the
/// tokens to that beneficiary in phases.
contract PhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryUpdated(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
IERC20 public token;
IBeneficiaryContract public beneficiary;
constructor(IERC20 _token) public {
}
/// @notice Sets the provided address as a beneficiary allowing it to
/// withdraw all tokens from escrow. This function can be called only
/// by escrow owner.
function setBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Withdraws the specified number of tokens from escrow to the
/// beneficiary. If the beneficiary is not set, or there are
/// insufficient tokens in escrow, the function fails.
function withdraw(uint256 amount) external onlyOwner {
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
}
/// @notice Withdraws all funds from a non-phased Escrow passed as
/// a parameter. For this function to succeed, this PhasedEscrow
/// has to be set as a beneficiary of the non-phased Escrow.
function withdrawFromEscrow(Escrow _escrow) public {
}
}
/// @title BatchedPhasedEscrow
/// @notice A token holder contract allowing contract owner to approve a set of
/// beneficiaries of tokens held by the contract, to appoint a separate
/// drawee role, and allowing that drawee to withdraw tokens to approved
/// beneficiaries in phases.
contract BatchedPhasedEscrow is Ownable {
using SafeERC20 for IERC20;
event BeneficiaryApproved(address beneficiary);
event TokensWithdrawn(address beneficiary, uint256 amount);
event DraweeRoleTransferred(address oldDrawee, address newDrawee);
IERC20 public token;
address public drawee;
mapping(address => bool) private approvedBeneficiaries;
modifier onlyDrawee() {
}
constructor(IERC20 _token) public {
}
/// @notice Approves the provided address as a beneficiary of tokens held by
/// the escrow. Can be called only by escrow owner.
function approveBeneficiary(IBeneficiaryContract _beneficiary)
external
onlyOwner
{
}
/// @notice Returns `true` if the given address has been approved as a
/// beneficiary of the escrow, `false` otherwise.
function isBeneficiaryApproved(IBeneficiaryContract _beneficiary)
public
view
returns (bool)
{
}
/// @notice Transfers the role of drawee to another address. Can be called
/// only by the contract owner.
function setDrawee(address newDrawee) public onlyOwner {
}
/// @notice Funds the escrow by transferring all of the approved tokens
/// to the escrow.
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes memory
) public {
}
/// @notice Withdraws tokens from escrow to selected beneficiaries,
/// transferring to each beneficiary the amount of tokens specified
/// as a parameter. Only beneficiaries previously approved by escrow
/// owner can receive funds.
function batchedWithdraw(
IBeneficiaryContract[] memory beneficiaries,
uint256[] memory amounts
) public onlyDrawee {
require(
beneficiaries.length == amounts.length,
"Mismatched arrays length"
);
for (uint256 i = 0; i < beneficiaries.length; i++) {
IBeneficiaryContract beneficiary = beneficiaries[i];
require(<FILL_ME>)
withdraw(beneficiary, amounts[i]);
}
}
function withdraw(IBeneficiaryContract beneficiary, uint256 amount)
private
{
}
}
// Interface representing staking pool rewards contract such as CurveRewards
// contract deployed for Keep (0xAF379f0228ad0d46bB7B4f38f9dc9bCC1ad0360c) or
// LPRewards contract from keep-ecdsa repository deployed for Uniswap.
interface IStakingPoolRewards {
function notifyRewardAmount(uint256 amount) external;
}
/// @title StakingPoolRewardsEscrowBeneficiary
/// @notice A beneficiary contract that can receive a withdrawal phase from a
/// PhasedEscrow contract. Immediately stakes the received tokens on a
/// designated IStakingPoolRewards contract.
contract StakingPoolRewardsEscrowBeneficiary is Ownable, IBeneficiaryContract {
IERC20 public token;
IStakingPoolRewards public rewards;
constructor(IERC20 _token, IStakingPoolRewards _rewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @dev Interface of recipient contract for approveAndCall pattern.
interface IStakerRewards {
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes calldata _extraData
) external;
}
/// @title StakerRewardsBeneficiary
/// @notice An abstract beneficiary contract that can receive a withdrawal phase
/// from a PhasedEscrow contract. The received tokens are immediately
/// funded for a designated rewards escrow beneficiary contract.
contract StakerRewardsBeneficiary is Ownable {
IERC20 public token;
IStakerRewards public stakerRewards;
constructor(IERC20 _token, IStakerRewards _stakerRewards) public {
}
function __escrowSentTokens(uint256 amount) external onlyOwner {
}
}
/// @title BeaconBackportRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconBackportRewardsEscrowBeneficiary contract.
contract BeaconBackportRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
/// @title BeaconRewardsEscrowBeneficiary
/// @notice Transfer the received tokens to a designated
/// BeaconRewardsEscrowBeneficiary contract.
contract BeaconRewardsEscrowBeneficiary is StakerRewardsBeneficiary {
constructor(IERC20 _token, IStakerRewards _stakerRewards)
public
StakerRewardsBeneficiary(_token, _stakerRewards)
{}
}
| isBeneficiaryApproved(beneficiary),"Beneficiary was not approved" | 359,087 | isBeneficiaryApproved(beneficiary) |
'you cant withdraw that amount at this moment' | pragma solidity >=0.5.16 <0.7.0;
contract Latency {
struct LatencyPoint
{
uint256 time;
uint256 value;
}
LatencyPoint[] public _latencyArray;
address owner;
constructor ( ) public
{
}
modifier onlyOwner()
{
}
// the value which is incremeted in the struct after the waitingTime
function addValueCustomTime(uint256 _transferedValue, uint256 _waitingTime) public onlyOwner
{
}
function withdrawableAmount() public view returns(uint256 value)
{
}
function currentTime() public view returns(uint256 time) {
}
function removePoint(uint i) private
{
}
// you need to keep at least the last one such that you know how much you can withdraw
function removePastPoints() private
{
}
// you need to keep at least the last one such that you know how much you can withdraw
function removeZeroValues() private
{
}
function withdraw(uint256 _value) public onlyOwner
{
require(<FILL_ME>)
removePastPoints();
removeZeroValues();
for(uint i=0; i<_latencyArray.length; i++)
{
_latencyArray[i].value -= _value;
}
}
//if you transfer token from one address to the other you reduce the total amount
function reduceValue(uint256 _value) public onlyOwner
{
}
// returns the first point that is strictly larger than the amount
function withdrawSteps(uint256 _amount) public view returns (uint256 Steps)
{
}
function withdrawTupel(uint256 _index) public view returns (uint256 Time, uint256 Val)
{
}
function withdrawTime(uint256 _index) public view returns (uint256 Time)
{
}
function withdrawValue(uint256 _index) public view returns (uint256 Value){
}
}
| withdrawableAmount()>=_value,'you cant withdraw that amount at this moment' | 359,117 | withdrawableAmount()>=_value |
"Invalid Signature" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
require(<FILL_ME>)
require(_mintData._tokenId > 0 && _mintData._tokenId <= mintSupplyCount, "Invalid token id.");
require(mintEnabled, "Minting unavailable");
require(totalMinted < mintSupplyCount, "All tokens minted");
require(_mintData._worldData.biomes.length > 0, "No biomes");
require(_mintData._worldData.features.length > 0, "No features");
require(bytes(_mintData._tokenMetadataIPFSHash).length > 0, "No ipfs");
if (_msgSender() != owner()) {
require(
addressMintCount[_msgSender()] < maxMintPerAddress,
"You cannot mint more."
);
require(
totalMinted + (ownerMintReserveCount - ownerMintCount) < mintSupplyCount,
"Available tokens minted"
);
// make sure remaining mints are enough to cover remaining whitelist.
require(
(
block.timestamp > whitelistExpirationTimestamp ||
whitelist[_msgSender()] ||
(
totalMinted +
(ownerMintReserveCount - ownerMintCount) +
((whitelistAddressCount - whitelistMintCount) * 2)
< mintSupplyCount
)
),
"Only whitelist tokens available"
);
} else {
require(ownerMintCount < ownerMintReserveCount, "Owner mint limit");
}
_safeMint(_msgSender(), _mintData._tokenId);
tokenWorldData[_mintData._tokenId] = _mintData._worldData;
tokenMetadataIPFSHashes[_mintData._tokenId] = _mintData._tokenMetadataIPFSHash;
ipfsHashTokenIds[_mintData._tokenMetadataIPFSHash] = _mintData._tokenId;
tokenSeeds[_mintData._tokenId] = _mintData._seed;
addressMintCount[_msgSender()]++;
totalMinted++;
if (whitelist[_msgSender()]) {
whitelistMintCount++;
}
if (_msgSender() == owner()) {
ownerMintCount++;
}
return _mintData._tokenId;
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| verifyOwnerSignature(keccak256(abi.encode(_mintData)),_signature),"Invalid Signature" | 359,218 | verifyOwnerSignature(keccak256(abi.encode(_mintData)),_signature) |
"No ipfs" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
require(verifyOwnerSignature(keccak256(abi.encode(_mintData)), _signature), "Invalid Signature");
require(_mintData._tokenId > 0 && _mintData._tokenId <= mintSupplyCount, "Invalid token id.");
require(mintEnabled, "Minting unavailable");
require(totalMinted < mintSupplyCount, "All tokens minted");
require(_mintData._worldData.biomes.length > 0, "No biomes");
require(_mintData._worldData.features.length > 0, "No features");
require(<FILL_ME>)
if (_msgSender() != owner()) {
require(
addressMintCount[_msgSender()] < maxMintPerAddress,
"You cannot mint more."
);
require(
totalMinted + (ownerMintReserveCount - ownerMintCount) < mintSupplyCount,
"Available tokens minted"
);
// make sure remaining mints are enough to cover remaining whitelist.
require(
(
block.timestamp > whitelistExpirationTimestamp ||
whitelist[_msgSender()] ||
(
totalMinted +
(ownerMintReserveCount - ownerMintCount) +
((whitelistAddressCount - whitelistMintCount) * 2)
< mintSupplyCount
)
),
"Only whitelist tokens available"
);
} else {
require(ownerMintCount < ownerMintReserveCount, "Owner mint limit");
}
_safeMint(_msgSender(), _mintData._tokenId);
tokenWorldData[_mintData._tokenId] = _mintData._worldData;
tokenMetadataIPFSHashes[_mintData._tokenId] = _mintData._tokenMetadataIPFSHash;
ipfsHashTokenIds[_mintData._tokenMetadataIPFSHash] = _mintData._tokenId;
tokenSeeds[_mintData._tokenId] = _mintData._seed;
addressMintCount[_msgSender()]++;
totalMinted++;
if (whitelist[_msgSender()]) {
whitelistMintCount++;
}
if (_msgSender() == owner()) {
ownerMintCount++;
}
return _mintData._tokenId;
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| bytes(_mintData._tokenMetadataIPFSHash).length>0,"No ipfs" | 359,218 | bytes(_mintData._tokenMetadataIPFSHash).length>0 |
"You cannot mint more." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
require(verifyOwnerSignature(keccak256(abi.encode(_mintData)), _signature), "Invalid Signature");
require(_mintData._tokenId > 0 && _mintData._tokenId <= mintSupplyCount, "Invalid token id.");
require(mintEnabled, "Minting unavailable");
require(totalMinted < mintSupplyCount, "All tokens minted");
require(_mintData._worldData.biomes.length > 0, "No biomes");
require(_mintData._worldData.features.length > 0, "No features");
require(bytes(_mintData._tokenMetadataIPFSHash).length > 0, "No ipfs");
if (_msgSender() != owner()) {
require(<FILL_ME>)
require(
totalMinted + (ownerMintReserveCount - ownerMintCount) < mintSupplyCount,
"Available tokens minted"
);
// make sure remaining mints are enough to cover remaining whitelist.
require(
(
block.timestamp > whitelistExpirationTimestamp ||
whitelist[_msgSender()] ||
(
totalMinted +
(ownerMintReserveCount - ownerMintCount) +
((whitelistAddressCount - whitelistMintCount) * 2)
< mintSupplyCount
)
),
"Only whitelist tokens available"
);
} else {
require(ownerMintCount < ownerMintReserveCount, "Owner mint limit");
}
_safeMint(_msgSender(), _mintData._tokenId);
tokenWorldData[_mintData._tokenId] = _mintData._worldData;
tokenMetadataIPFSHashes[_mintData._tokenId] = _mintData._tokenMetadataIPFSHash;
ipfsHashTokenIds[_mintData._tokenMetadataIPFSHash] = _mintData._tokenId;
tokenSeeds[_mintData._tokenId] = _mintData._seed;
addressMintCount[_msgSender()]++;
totalMinted++;
if (whitelist[_msgSender()]) {
whitelistMintCount++;
}
if (_msgSender() == owner()) {
ownerMintCount++;
}
return _mintData._tokenId;
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| addressMintCount[_msgSender()]<maxMintPerAddress,"You cannot mint more." | 359,218 | addressMintCount[_msgSender()]<maxMintPerAddress |
"Available tokens minted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
require(verifyOwnerSignature(keccak256(abi.encode(_mintData)), _signature), "Invalid Signature");
require(_mintData._tokenId > 0 && _mintData._tokenId <= mintSupplyCount, "Invalid token id.");
require(mintEnabled, "Minting unavailable");
require(totalMinted < mintSupplyCount, "All tokens minted");
require(_mintData._worldData.biomes.length > 0, "No biomes");
require(_mintData._worldData.features.length > 0, "No features");
require(bytes(_mintData._tokenMetadataIPFSHash).length > 0, "No ipfs");
if (_msgSender() != owner()) {
require(
addressMintCount[_msgSender()] < maxMintPerAddress,
"You cannot mint more."
);
require(<FILL_ME>)
// make sure remaining mints are enough to cover remaining whitelist.
require(
(
block.timestamp > whitelistExpirationTimestamp ||
whitelist[_msgSender()] ||
(
totalMinted +
(ownerMintReserveCount - ownerMintCount) +
((whitelistAddressCount - whitelistMintCount) * 2)
< mintSupplyCount
)
),
"Only whitelist tokens available"
);
} else {
require(ownerMintCount < ownerMintReserveCount, "Owner mint limit");
}
_safeMint(_msgSender(), _mintData._tokenId);
tokenWorldData[_mintData._tokenId] = _mintData._worldData;
tokenMetadataIPFSHashes[_mintData._tokenId] = _mintData._tokenMetadataIPFSHash;
ipfsHashTokenIds[_mintData._tokenMetadataIPFSHash] = _mintData._tokenId;
tokenSeeds[_mintData._tokenId] = _mintData._seed;
addressMintCount[_msgSender()]++;
totalMinted++;
if (whitelist[_msgSender()]) {
whitelistMintCount++;
}
if (_msgSender() == owner()) {
ownerMintCount++;
}
return _mintData._tokenId;
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| totalMinted+(ownerMintReserveCount-ownerMintCount)<mintSupplyCount,"Available tokens minted" | 359,218 | totalMinted+(ownerMintReserveCount-ownerMintCount)<mintSupplyCount |
"Only whitelist tokens available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
require(verifyOwnerSignature(keccak256(abi.encode(_mintData)), _signature), "Invalid Signature");
require(_mintData._tokenId > 0 && _mintData._tokenId <= mintSupplyCount, "Invalid token id.");
require(mintEnabled, "Minting unavailable");
require(totalMinted < mintSupplyCount, "All tokens minted");
require(_mintData._worldData.biomes.length > 0, "No biomes");
require(_mintData._worldData.features.length > 0, "No features");
require(bytes(_mintData._tokenMetadataIPFSHash).length > 0, "No ipfs");
if (_msgSender() != owner()) {
require(
addressMintCount[_msgSender()] < maxMintPerAddress,
"You cannot mint more."
);
require(
totalMinted + (ownerMintReserveCount - ownerMintCount) < mintSupplyCount,
"Available tokens minted"
);
// make sure remaining mints are enough to cover remaining whitelist.
require(<FILL_ME>)
} else {
require(ownerMintCount < ownerMintReserveCount, "Owner mint limit");
}
_safeMint(_msgSender(), _mintData._tokenId);
tokenWorldData[_mintData._tokenId] = _mintData._worldData;
tokenMetadataIPFSHashes[_mintData._tokenId] = _mintData._tokenMetadataIPFSHash;
ipfsHashTokenIds[_mintData._tokenMetadataIPFSHash] = _mintData._tokenId;
tokenSeeds[_mintData._tokenId] = _mintData._seed;
addressMintCount[_msgSender()]++;
totalMinted++;
if (whitelist[_msgSender()]) {
whitelistMintCount++;
}
if (_msgSender() == owner()) {
ownerMintCount++;
}
return _mintData._tokenId;
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| (block.timestamp>whitelistExpirationTimestamp||whitelist[_msgSender()]||(totalMinted+(ownerMintReserveCount-ownerMintCount)+((whitelistAddressCount-whitelistMintCount)*2)<mintSupplyCount)),"Only whitelist tokens available" | 359,218 | (block.timestamp>whitelistExpirationTimestamp||whitelist[_msgSender()]||(totalMinted+(ownerMintReserveCount-ownerMintCount)+((whitelistAddressCount-whitelistMintCount)*2)<mintSupplyCount)) |
"Invalid Signature" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
require(<FILL_ME>)
require(!mintEnabled, "Whitelist is not available");
require(whitelistAddressCount < maxWhitelistCount, "Whitelist is full");
require(!whitelist[_msgSender()], "Your address is already whitelisted");
whitelistAddressCount++;
whitelist[_msgSender()] = true;
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| verifyOwnerSignature(keccak256(abi.encode(_msgSender())),_signature),"Invalid Signature" | 359,218 | verifyOwnerSignature(keccak256(abi.encode(_msgSender())),_signature) |
"Whitelist is not available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
require(verifyOwnerSignature(keccak256(abi.encode(_msgSender())), _signature), "Invalid Signature");
require(<FILL_ME>)
require(whitelistAddressCount < maxWhitelistCount, "Whitelist is full");
require(!whitelist[_msgSender()], "Your address is already whitelisted");
whitelistAddressCount++;
whitelist[_msgSender()] = true;
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| !mintEnabled,"Whitelist is not available" | 359,218 | !mintEnabled |
"Your address is already whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Compile with optimizer on, otherwise exceeds size limit.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract NFTWorlds is ERC721Enumerable, Ownable {
using SafeMath for uint256;
using ECDSA for bytes32;
/**
* @dev Mint Related
* */
string public ipfsGateway = "https://ipfs.nftworlds.com/ipfs/";
bool public mintEnabled = false;
uint public totalMinted = 0;
uint public mintSupplyCount;
uint private ownerMintReserveCount;
uint private ownerMintCount;
uint private maxMintPerAddress;
uint private whitelistExpirationTimestamp;
mapping(address => uint16) private addressMintCount;
uint public whitelistAddressCount = 0;
uint public whitelistMintCount = 0;
uint private maxWhitelistCount = 0;
mapping(address => bool) private whitelist;
/**
* @dev World Data
*/
string[] densityStrings = ["Very High", "High", "Medium", "Low", "Very Low"];
string[] biomeStrings = ["Forest","River","Swamp","Birch Forest","Savanna Plateau","Savanna","Beach","Desert","Plains","Desert Hills","Sunflower Glade","Gravel Strewn Mountains","Mountains","Wooded Mountains","Ocean","Deep Ocean","Swampy Hills","Evergreen Forest","Cursed Forest","Cold Ocean","Warm Ocean","Frozen Ocean","Stone Shore","Desert Lakes","Forest Of Flowers","Jungle","Badlands","Wooded Badlands Plateau","Evergreen Forest Mountains","Giant Evergreen Forest","Badlands Plateau","Dark Forest Hills","Snowy Tundra","Snowy Evergreen Forest","Frozen River","Snowy Beach","Snowy Mountains","Mushroom Shoreside Glades","Mushroom Glades","Frozen Fields","Bamboo Jungle","Destroyed Savanna","Eroded Badlands"];
string[] featureStrings = ["Ore Mine","Dark Trench","Ore Rich","Ancient Forest","Drought","Scarce Freshwater","Ironheart","Multi-Climate","Wild Cows","Snow","Mountains","Monsoons","Abundant Freshwater","Woodlands","Owls","Wild Horses","Monolith","Heavy Rains","Haunted","Salmon","Sunken City","Oil Fields","Dolphins","Sunken Ship","Town","Reefs","Deforestation","Deep Caverns","Aquatic Life Haven","Ancient Ocean","Sea Monsters","Buried Jems","Giant Squid","Cold Snaps","Icebergs","Witch's Hut","Heat Waves","Avalanches","Poisonous Bogs","Deep Water","Oasis","Jungle Ruins","Rains","Overgrowth","Wildflower Fields","Fishing Grounds","Fungus Patch","Vultures","Giant Spider Nests","Underground City","Calm Waters","Tropical Fish","Mushrooms","Large Lake","Pyramid","Rich Oil Veins","Cave Of Ancients","Island Volcano","Paydirt","Whales","Undersea Temple","City Beneath The Waves","Pirate's Grave","Wildlife Haven","Wild Bears","Rotting Earth","Blizzards","Cursed Wildlife","Lightning Strikes","Abundant Jewels","Dark Summoners","Never-Ending Winter","Bandit Camp","Vast Ocean","Shroom People","Holy River","Bird's Haven","Shapeshifters","Spawning Grounds","Fairies","Distorted Reality","Penguin Colonies","Heavenly Lights","Igloos","Arctic Pirates","Sunken Treasure","Witch Tales","Giant Ice Squid","Gold Veins","Polar Bears","Quicksand","Cats","Deadlands","Albino Llamas","Buried Treasure","Mermaids","Long Nights","Exile Camp","Octopus Colony","Chilled Caves","Dense Jungle","Spore Clouds","Will-O-Wisp's","Unending Clouds","Pandas","Hidden City Of Gold","Buried Idols","Thunder Storms","Abominable Snowmen","Floods","Centaurs","Walking Mushrooms","Scorched","Thunderstorms","Peaceful","Ancient Tunnel Network","Friendly Spirits","Giant Eagles","Catacombs","Temple Of Origin","World's Peak","Uninhabitable","Ancient Whales","Enchanted Earth","Kelp Overgrowth","Message In A Bottle","Ice Giants","Crypt Of Wisps","Underworld Passage","Eskimo Settlers","Dragons","Gold Rush","Fountain Of Aging","Haunted Manor","Holy","Kraken"];
struct WorldData {
uint24[5] geographyData; // landAreaKm2, waterAreaKm2, highestPointFromSeaLevelM, lowestPointFromSeaLevelM, annualRainfallMM,
uint16[9] resourceData; // lumberPercent, coalPercent, oilPercent, dirtSoilPercent, commonMetalsPercent, rareMetalsPercent, gemstonesPercent, freshWaterPercent, saltWaterPercent,
uint8[3] densities; // wildlifeDensity, aquaticLifeDensity, foliageDensity
uint8[] biomes;
uint8[] features;
}
mapping(uint => int32) private tokenSeeds;
mapping(uint => string) public tokenMetadataIPFSHashes;
mapping(string => uint) private ipfsHashTokenIds;
mapping(uint => WorldData) private tokenWorldData;
/**
* @dev Contract Methods
*/
constructor(
uint _mintSupplyCount,
uint _ownerMintReserveCount,
uint _whitelistExpirationTimestamp,
uint _maxWhitelistCount,
uint _maxMintPerAddress
) ERC721("NFT Worlds", "NFT Worlds") {
}
/************
* Metadata *
************/
function tokenURI(uint _tokenId) override public view returns (string memory) {
}
function emergencySetIPFSGateway(string memory _ipfsGateway) external onlyOwner {
}
function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) tokenExists(_tokenId) external {
}
function getSeed(uint _tokenId) tokenExists(_tokenId) public view returns (int32) {
}
function getGeography(uint _tokenId) tokenExists(_tokenId) public view returns (uint24[5] memory) {
}
function getResources(uint _tokenId) tokenExists(_tokenId) public view returns (uint16[9] memory) {
}
function getDensities(uint _tokenId) tokenExists(_tokenId) public view returns (string[3] memory) {
}
function getBiomes(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
function getFeatures(uint _tokenId) tokenExists(_tokenId) public view returns (string[] memory) {
}
modifier tokenExists(uint _tokenId) {
}
/********
* Mint *
********/
struct MintData {
uint _tokenId;
int32 _seed;
WorldData _worldData;
string _tokenMetadataIPFSHash;
}
function mintWorld(
MintData calldata _mintData,
bytes calldata _signature // prevent alteration of intended mint data
) external returns (uint) {
}
function setMintEnabled(bool _enabled) external onlyOwner {
}
/*************
* Whitelist *
*************/
function joinWhitelist(bytes calldata _signature) public {
require(verifyOwnerSignature(keccak256(abi.encode(_msgSender())), _signature), "Invalid Signature");
require(!mintEnabled, "Whitelist is not available");
require(whitelistAddressCount < maxWhitelistCount, "Whitelist is full");
require(<FILL_ME>)
whitelistAddressCount++;
whitelist[_msgSender()] = true;
}
/************
* Security *
************/
function verifyOwnerSignature(bytes32 hash, bytes memory signature) private view returns(bool) {
}
}
| !whitelist[_msgSender()],"Your address is already whitelisted" | 359,218 | !whitelist[_msgSender()] |
null | pragma solidity ^0.4.10;
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
//SkrillaToken interface containing functions used by the syndicate contract.
contract SkrillaTokenInterface {
function transfer(address _to, uint256 _value) public returns (bool);
function buyTokens() payable public;
function getCurrentPrice(address _buyer) public constant returns (uint256);
function tokenSaleBalanceOf(address _owner) public constant returns (uint256 balance);
function withdraw() public returns (bool);
}
contract TokenSyndicate {
SkrillaTokenInterface private tokenContract;
/*
* The address to call to purchase tokens.
*/
address public tokenContractAddress;
uint256 public tokenExchangeRate;
/**
* Timestamp after which a purchaser can get a refund of their investment. As long as the tokens have not been purchased.
*/
uint256 public refundStart;
/**
* The owner can set refundEnabled to allow purchasers to refund their funds before refundStart.
*/
bool public refundsEnabled;
bool public tokensPurchased;
/**
* Has the withdraw function been called on the token contract.
* This makes the syndicate's tokens available for distribution.
*/
bool public syndicateTokensWithdrawn;
/**
* The amount of wei collected by the syndicate.
*/
uint256 public totalPresale;
address public owner;
mapping(address => uint256) public presaleBalances;
event LogInvest(address indexed _to, uint256 presale);
event LogRefund(address indexed _to, uint256 presale);
event LogTokenPurchase(uint256 eth, uint256 tokens);
event LogWithdrawTokens(address indexed _to, uint256 tokens);
modifier onlyOwner() {
}
modifier onlyWhenTokensNotPurchased() {
}
modifier onlyWhenTokensPurchased() {
}
modifier onlyWhenSyndicateTokensWithdrawn() {
}
modifier whenRefundIsPermitted() {
}
modifier onlyWhenRefundsNotEnabled() {
require(<FILL_ME>)
_;
}
function TokenSyndicate(address _tokenContractAddress,
address _owner,
uint256 _refundStart) {
}
// Fallback function can be used to invest in syndicate
function() external payable {
}
/*
Invest in this contract in order to have tokens purchased on your behalf when the buyTokens() contract
is called without a `throw`.
*/
function invest() payable public onlyWhenTokensNotPurchased {
}
/*
Get the presaleBalance (ETH) for an address.
*/
function balanceOf(address _purchaser) external constant returns (uint256 presaleBalance) {
}
/**
* An 'escape hatch' function to allow purchasers to get a refund of their eth before refundStart.
*/
function enableRefunds() external onlyWhenTokensNotPurchased onlyOwner {
}
/*
Attempt to purchase the tokens from the token contract.
This must be done before the sale ends
*/
function buyTokens() external onlyWhenRefundsNotEnabled onlyWhenTokensNotPurchased onlyOwner {
}
/*
Call 'withdraw' on the skrilla contract as this contract. So that the tokens are available for distribution with the 'transfer' function.
This can only be called 14 days after sale close.
*/
function withdrawSyndicateTokens() external onlyWhenTokensPurchased onlyOwner {
}
/*
Transfer an accounts token entitlement to itself.
This can only be called if the tokens have been purchased by the contract and have been withdrawn by the contract.
*/
function withdrawTokens() external onlyWhenSyndicateTokensWithdrawn {
}
/*
Refund an accounts investment.
This is only possible if tokens have not been purchased.
*/
function refund() external whenRefundIsPermitted onlyWhenTokensNotPurchased {
}
}
| !refundsEnabled | 359,241 | !refundsEnabled |
"Source tokens are stuck in 0xv4 exchange" | pragma solidity 0.7.5;
contract ZeroxV4 is IExchange, TokenFetcher {
using Address for address;
using LibBytes for bytes;
address public weth;
struct ZeroxData {
LibOrderV4.Order order;
LibOrderV4.Signature signature;
}
constructor(address _weth) public {
}
/**
* @dev Fallback method to allow exchanges to transfer back ethers for a particular swap
*/
receive() external payable {
}
function swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
address _fromToken = address(fromToken);
if (address(fromToken) == Utils.ethAddress()) {
IWETH(weth).deposit{value: fromAmount}();
_fromToken = weth;
}
uint256 initialExchangeFromBalance = Utils.tokenBalance(
address(_fromToken),
address(this)
);
receivedAmount = _swap(
fromToken,
toToken,
fromAmount,
toAmount,
exchange,
payload
);
require(<FILL_ME>)
return receivedAmount;
}
function buy(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
}
function onChainSwap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount
)
external
override
payable
returns (uint256)
{
}
function _swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes memory payload) private returns (uint256) {
}
}
| Utils.tokenBalance(address(_fromToken),address(this))<=initialExchangeFromBalance,"Source tokens are stuck in 0xv4 exchange" | 359,317 | Utils.tokenBalance(address(_fromToken),address(this))<=initialExchangeFromBalance |
"Invalid from token!!" | pragma solidity 0.7.5;
contract ZeroxV4 is IExchange, TokenFetcher {
using Address for address;
using LibBytes for bytes;
address public weth;
struct ZeroxData {
LibOrderV4.Order order;
LibOrderV4.Signature signature;
}
constructor(address _weth) public {
}
/**
* @dev Fallback method to allow exchanges to transfer back ethers for a particular swap
*/
receive() external payable {
}
function swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
}
function buy(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
}
function onChainSwap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount
)
external
override
payable
returns (uint256)
{
}
function _swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes memory payload) private returns (uint256) {
ZeroxData memory data = abi.decode(payload, (ZeroxData));
address _fromToken = address(fromToken);
address _toToken = address(toToken);
if (address(fromToken) == Utils.ethAddress()) {
_fromToken = weth;
}
else if (address(toToken) == Utils.ethAddress()) {
_toToken = weth;
}
require(<FILL_ME>)
require(address(data.order.makerToken) == address(_toToken), "Invalid to token!!");
Utils.approve(exchange, address(_fromToken), fromAmount);
IZeroxV4(exchange).fillRfqOrder(
data.order,
data.signature,
uint128(fromAmount)
);
uint256 receivedAmount = Utils.tokenBalance(address(_toToken), address(this));
if (address(toToken) == Utils.ethAddress()) {
IWETH(weth).withdraw(receivedAmount);
}
Utils.transferTokens(address(toToken), msg.sender, receivedAmount);
return receivedAmount;
}
}
| address(data.order.takerToken)==address(_fromToken),"Invalid from token!!" | 359,317 | address(data.order.takerToken)==address(_fromToken) |
"Invalid to token!!" | pragma solidity 0.7.5;
contract ZeroxV4 is IExchange, TokenFetcher {
using Address for address;
using LibBytes for bytes;
address public weth;
struct ZeroxData {
LibOrderV4.Order order;
LibOrderV4.Signature signature;
}
constructor(address _weth) public {
}
/**
* @dev Fallback method to allow exchanges to transfer back ethers for a particular swap
*/
receive() external payable {
}
function swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
}
function buy(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes calldata payload
)
external
override
payable
returns (uint256 receivedAmount)
{
}
function onChainSwap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount
)
external
override
payable
returns (uint256)
{
}
function _swap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
address exchange,
bytes memory payload) private returns (uint256) {
ZeroxData memory data = abi.decode(payload, (ZeroxData));
address _fromToken = address(fromToken);
address _toToken = address(toToken);
if (address(fromToken) == Utils.ethAddress()) {
_fromToken = weth;
}
else if (address(toToken) == Utils.ethAddress()) {
_toToken = weth;
}
require(address(data.order.takerToken) == address(_fromToken), "Invalid from token!!");
require(<FILL_ME>)
Utils.approve(exchange, address(_fromToken), fromAmount);
IZeroxV4(exchange).fillRfqOrder(
data.order,
data.signature,
uint128(fromAmount)
);
uint256 receivedAmount = Utils.tokenBalance(address(_toToken), address(this));
if (address(toToken) == Utils.ethAddress()) {
IWETH(weth).withdraw(receivedAmount);
}
Utils.transferTokens(address(toToken), msg.sender, receivedAmount);
return receivedAmount;
}
}
| address(data.order.makerToken)==address(_toToken),"Invalid to token!!" | 359,317 | address(data.order.makerToken)==address(_toToken) |
'Caller is not owner of the token ID' | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./IDContract.sol";
/*
@*
@@@@@ /@@@@@@@@
@@ @@@@@@@ .@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@ @@@@@@@ @@@@@ @@@@@@@@@@@@@@@@@@& @@@ @@@@ @@@@@@* @@@, @@@@ @@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@ .@@@@ @@@@@ ,@@@@@@@@@@@@@@@ @@@@@@@@@,@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@ @@@@ @@@@@ (@@@@@( @@@@@@ @@@@@@@@ @@@% @@@@@ @@@ @@ @@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@ @@@@@@@ @#
@@@@@@@ @@@@@@@@@@@@@@@ @@@@@@ %@@@@@@ @@@@@@@@@@ @@@& @@@@@@@@ @@ .@@@@ @@@@@ @ @@@@@@ @@@@@ @@@@@
@@@@ @@@ @@@ @@@@ @@@@@@@@@@@@ @@@@@* @@@@@ /@@@@ @@@@( @@ @@@@ @ @@@@ ,@@@@ ,@ @@ @@@@@@@ @@@@@@@@@@@@@@@ @@@@ &@@@@@@@ #@@@.
@@@, @@@ @@ @@@( @@@@ @@@@@@@@@@@@@@@@@@. @@@@@@@ @@@@@@@ @. @@@@ @ @@@@@@ @@@@@@@@ @@ @@@@@@ @@@@@@ @@@@ @@@@@@@@@@@@@@@@@@ &@@@
@@@@ @@@@@@ @@@@ @@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@ @@ @@@@* @@@@@@ @@ .@@@@@, @@@@@ @@@@@@@@@@@ @@@& @@@@
@@@@@ @@@@@@@@@ @@@@ @@@@ @@@@@@ @@@@@ @@@@ /@@@@ @@@@@@@ ,@@ @@@@@ @@@@@@@ @@@@@@@ @@@@@@@ @@@@@
#@@@@ @@@@@@@@ @@@@ @@@ @@@@@ .#@@@@@@@@@ @@@@ @@@@@ %@@@@@ @@@ @@@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@@@@
@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@% @@@@, &@@@ @@@@@ @@@& @@@@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@ @@@@@( &@ @@@@@@@@@@@ @@@@@@@ @@@@@ @@@@@ @@@@ #@@@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@ ,@@@@ @@@@@@@@@ @@@@@ @@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@
@@@@@@ %@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@ (@@@@@ .@@@@@@@@ @@@@@@ @@@@@@
.@@@@ @@@@@@ @@@@@ @@@@@
*/
contract Afterlife is ERC721, ERC721Enumerable, ERC721Burnable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
IDContract private _impermanentContractInstance;
bool public mintingIsActive = false;
string public baseURI;
string public provenance;
constructor(string memory name, string memory symbol, address impermanentContractAddress) ERC721(name, symbol) {
}
function setImpermanentContractAddress(address impermanentContractAddress) public onlyOwner {
}
/*
* Pause minting if active, make active if paused.
*/
function flipMintingState() public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner {
}
/*
* Mint via burning an Impermanent Digital NFT
*/
function mintViaBurn(uint256 tokenId) public {
require(mintingIsActive, 'Minting is not live yet');
require(<FILL_ME>)
_impermanentContractInstance.burnForAfterlife(tokenId);
_tokenIdCounter.increment();
_safeMint(msg.sender, _tokenIdCounter.current());
}
/*
* Mint via burning multiple Impermanent Digital NFTs
*/
function mintViaBurnMultiple(uint256[] calldata tokenIds) public {
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
/*
* Set provenance once it's calculated.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| _impermanentContractInstance.ownerOf(tokenId)==msg.sender,'Caller is not owner of the token ID' | 359,318 | _impermanentContractInstance.ownerOf(tokenId)==msg.sender |
'Caller is not owner of the token ID' | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./IDContract.sol";
/*
@*
@@@@@ /@@@@@@@@
@@ @@@@@@@ .@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@ @@@@@@@ @@@@@ @@@@@@@@@@@@@@@@@@& @@@ @@@@ @@@@@@* @@@, @@@@ @@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@ .@@@@ @@@@@ ,@@@@@@@@@@@@@@@ @@@@@@@@@,@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@ @@@@ @@@@@ (@@@@@( @@@@@@ @@@@@@@@ @@@% @@@@@ @@@ @@ @@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@ @@@@@@@ @#
@@@@@@@ @@@@@@@@@@@@@@@ @@@@@@ %@@@@@@ @@@@@@@@@@ @@@& @@@@@@@@ @@ .@@@@ @@@@@ @ @@@@@@ @@@@@ @@@@@
@@@@ @@@ @@@ @@@@ @@@@@@@@@@@@ @@@@@* @@@@@ /@@@@ @@@@( @@ @@@@ @ @@@@ ,@@@@ ,@ @@ @@@@@@@ @@@@@@@@@@@@@@@ @@@@ &@@@@@@@ #@@@.
@@@, @@@ @@ @@@( @@@@ @@@@@@@@@@@@@@@@@@. @@@@@@@ @@@@@@@ @. @@@@ @ @@@@@@ @@@@@@@@ @@ @@@@@@ @@@@@@ @@@@ @@@@@@@@@@@@@@@@@@ &@@@
@@@@ @@@@@@ @@@@ @@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@ @@ @@@@* @@@@@@ @@ .@@@@@, @@@@@ @@@@@@@@@@@ @@@& @@@@
@@@@@ @@@@@@@@@ @@@@ @@@@ @@@@@@ @@@@@ @@@@ /@@@@ @@@@@@@ ,@@ @@@@@ @@@@@@@ @@@@@@@ @@@@@@@ @@@@@
#@@@@ @@@@@@@@ @@@@ @@@ @@@@@ .#@@@@@@@@@ @@@@ @@@@@ %@@@@@ @@@ @@@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@@@@
@@@@@@@@@@ @@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@% @@@@, &@@@ @@@@@ @@@& @@@@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@ @@@@@( &@ @@@@@@@@@@@ @@@@@@@ @@@@@ @@@@@ @@@@ #@@@@@@@@@@@@
@@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@ ,@@@@ @@@@@@@@@ @@@@@ @@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@ @@@@@@@
@@@@@@ %@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@ (@@@@@ .@@@@@@@@ @@@@@@ @@@@@@
.@@@@ @@@@@@ @@@@@ @@@@@
*/
contract Afterlife is ERC721, ERC721Enumerable, ERC721Burnable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
IDContract private _impermanentContractInstance;
bool public mintingIsActive = false;
string public baseURI;
string public provenance;
constructor(string memory name, string memory symbol, address impermanentContractAddress) ERC721(name, symbol) {
}
function setImpermanentContractAddress(address impermanentContractAddress) public onlyOwner {
}
/*
* Pause minting if active, make active if paused.
*/
function flipMintingState() public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner {
}
/*
* Mint via burning an Impermanent Digital NFT
*/
function mintViaBurn(uint256 tokenId) public {
}
/*
* Mint via burning multiple Impermanent Digital NFTs
*/
function mintViaBurnMultiple(uint256[] calldata tokenIds) public {
require(mintingIsActive, 'Minting is not live yet');
for (uint256 i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
}
for (uint256 i = 0; i < tokenIds.length; i++) {
_impermanentContractInstance.burnForAfterlife(tokenIds[i]);
_tokenIdCounter.increment();
_safeMint(msg.sender, _tokenIdCounter.current());
}
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
/*
* Set provenance once it's calculated.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| _impermanentContractInstance.ownerOf(tokenIds[i])==msg.sender,'Caller is not owner of the token ID' | 359,318 | _impermanentContractInstance.ownerOf(tokenIds[i])==msg.sender |
null | pragma solidity 0.4.18;
interface UniswapExchange {
function ethToTokenSwapInput(
uint256 min_tokens,
uint256 deadline
)
external
payable
returns (uint256 tokens_bought);
function tokenToEthSwapInput(
uint256 tokens_sold,
uint256 min_eth,
uint256 deadline
)
external
returns (uint256 eth_bought);
function getEthToTokenInputPrice(
uint256 eth_sold
)
external
view
returns (uint256 tokens_bought);
function getTokenToEthInputPrice(
uint256 tokens_sold
)
external
view
returns (uint256 eth_bought);
}
interface UniswapFactory {
function getExchange(address token) external view returns (address exchange);
}
/*
* A reserve that connects to Uniswap.
*
* This reserve makes use of an internal inventory for locally filling orders
* using the reserve's inventory when certain conditions are met.
* Conditions are:
* - After trading the inventory will remain within defined limits.
* - Uniswap prices do not display internal arbitrage.
* - Uniswap ask and bid prices meet minimum spread requirements.
*
* An additional premium may be added to the converted price for optional
* promotions.
*/
contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 {
// Parts per 10000
uint public constant DEFAULT_FEE_BPS = 25;
UniswapFactory public uniswapFactory;
address public kyberNetwork;
uint public feeBps = DEFAULT_FEE_BPS;
// Uniswap exchange contract for every listed token
// token -> exchange
mapping (address => address) public tokenExchange;
// Internal inventory balance limits
// token -> limit
mapping (address => uint) public internalInventoryMin;
mapping (address => uint) public internalInventoryMax;
// Minimum spread in BPS required for using internal inventory
// token -> limit
mapping (address => uint) public internalActivationMinSpreadBps;
// Premium BPS added to internal price (making it better).
// token -> limit
mapping (address => uint) public internalPricePremiumBps;
bool public tradeEnabled = true;
/**
Constructor
*/
function KyberUniswapReserve(
UniswapFactory _uniswapFactory,
address _admin,
address _kyberNetwork
)
public
{
}
function() public payable {
}
/**
Returns dest quantity / source quantity.
Last bit of the rate indicates whether to use internal inventory:
0 - use uniswap
1 - use internal inventory
*/
function getConversionRate(
ERC20 src,
ERC20 dest,
uint srcQty,
uint blockNumber
)
public
view
returns(uint)
{
}
function applyInternalInventoryHintToRate(
uint rate,
bool useInternalInventory
)
internal
pure
returns(uint)
{
}
event TradeExecute(
address indexed sender,
address src,
uint srcAmount,
address destToken,
uint destAmount,
address destAddress,
bool useInternalInventory
);
/**
conversionRate: expected conversion rate should be >= this value.
*/
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool)
{
require(tradeEnabled);
require(msg.sender == kyberNetwork);
require(isValidTokens(srcToken, destToken));
if (validate) {
require(conversionRate > 0);
if (srcToken == ETH_TOKEN_ADDRESS)
require(msg.value == srcAmount);
else
require(msg.value == 0);
}
// Making sure srcAmount has been transfered to the reserve.
// If srcToken is ETH the value has already been transfered by calling
// the function.
if (srcToken != ETH_TOKEN_ADDRESS)
require(srcToken.transferFrom(msg.sender, address(this), srcAmount));
uint expectedDestAmount = calcDestAmount(
srcToken, /* src */
destToken, /* dest */
srcAmount, /* srcAmount */
conversionRate /* rate */
);
bool useInternalInventory = conversionRate % 2 == 1;
uint destAmount;
UniswapExchange exchange;
if (srcToken == ETH_TOKEN_ADDRESS) {
if (!useInternalInventory) {
// Deduct fees (in ETH) before converting
uint quantity = deductFee(srcAmount);
exchange = UniswapExchange(tokenExchange[address(destToken)]);
destAmount = exchange.ethToTokenSwapInput.value(quantity)(
1, /* min_tokens: uniswap requires it to be > 0 */
2 ** 255 /* deadline */
);
require(destAmount >= expectedDestAmount);
}
// Transfer user-expected dest amount
require(<FILL_ME>)
} else {
if (!useInternalInventory) {
exchange = UniswapExchange(tokenExchange[address(srcToken)]);
destAmount = exchange.tokenToEthSwapInput(
srcAmount,
1, /* min_eth: uniswap requires it to be > 0 */
2 ** 255 /* deadline */
);
// Deduct fees (in ETH) after converting
destAmount = deductFee(destAmount);
require(destAmount >= expectedDestAmount);
}
// Transfer user-expected dest amount
destAddress.transfer(expectedDestAmount);
}
TradeExecute(
msg.sender, /* sender */
srcToken, /* src */
srcAmount, /* srcAmount */
destToken, /* destToken */
expectedDestAmount, /* destAmount */
destAddress, /* destAddress */
useInternalInventory /* useInternalInventory */
);
return true;
}
event FeeUpdated(
uint bps
);
function setFee(
uint bps
)
public
onlyAdmin
{
}
event InternalActivationConfigUpdated(
ERC20 token,
uint minSpreadBps,
uint premiumBps
);
function setInternalActivationConfig(
ERC20 token,
uint minSpreadBps,
uint premiumBps
)
public
onlyAdmin
{
}
event InternalInventoryLimitsUpdated(
ERC20 token,
uint minBalance,
uint maxBalance
);
function setInternalInventoryLimits(
ERC20 token,
uint minBalance,
uint maxBalance
)
public
onlyOperator
{
}
event TokenListed(
ERC20 token,
UniswapExchange exchange
);
function listToken(ERC20 token)
public
onlyAdmin
{
}
event TokenDelisted(ERC20 token);
function delistToken(ERC20 token)
public
onlyAdmin
{
}
function isValidTokens(
ERC20 src,
ERC20 dest
)
public
view
returns(bool)
{
}
event TradeEnabled(
bool enable
);
function enableTrade()
public
onlyAdmin
returns(bool)
{
}
function disableTrade()
public
onlyAlerter
returns(bool)
{
}
event KyberNetworkSet(
address kyberNetwork
);
function setKyberNetwork(
address _kyberNetwork
)
public
onlyAdmin
{
}
/*
* Uses amounts and rates to check if the reserve's internal inventory can
* be used directly.
*
* rateEthToToken and rateTokenToEth are in kyber rate format meaning
* rate as numerator and 1e18 as denominator.
*/
function shouldUseInternalInventory(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
uint destAmount,
uint rateSrcDest,
uint rateDestSrc
)
public
view
returns(bool)
{
}
/*
* Spread calculation is (ask - bid) / ((ask + bid) / 2).
* We multiply by 10000 to get result in BPS.
*
* Note: if askRate > bidRate result will be negative indicating
* internal arbitrage.
*/
function calculateSpreadBps(
uint _askRate,
uint _bidRate
)
public
pure
returns(int)
{
}
function deductFee(
uint amount
)
public
view
returns(uint)
{
}
function addPremium(
ERC20 token,
uint amount
)
public
view
returns(uint)
{
}
function calcUniswapConversion(
ERC20 src,
ERC20 dest,
uint srcQty
)
internal
view
returns(uint destQty, uint rate)
{
}
}
| destToken.transfer(destAddress,expectedDestAmount) | 359,358 | destToken.transfer(destAddress,expectedDestAmount) |
null | pragma solidity 0.4.18;
interface UniswapExchange {
function ethToTokenSwapInput(
uint256 min_tokens,
uint256 deadline
)
external
payable
returns (uint256 tokens_bought);
function tokenToEthSwapInput(
uint256 tokens_sold,
uint256 min_eth,
uint256 deadline
)
external
returns (uint256 eth_bought);
function getEthToTokenInputPrice(
uint256 eth_sold
)
external
view
returns (uint256 tokens_bought);
function getTokenToEthInputPrice(
uint256 tokens_sold
)
external
view
returns (uint256 eth_bought);
}
interface UniswapFactory {
function getExchange(address token) external view returns (address exchange);
}
/*
* A reserve that connects to Uniswap.
*
* This reserve makes use of an internal inventory for locally filling orders
* using the reserve's inventory when certain conditions are met.
* Conditions are:
* - After trading the inventory will remain within defined limits.
* - Uniswap prices do not display internal arbitrage.
* - Uniswap ask and bid prices meet minimum spread requirements.
*
* An additional premium may be added to the converted price for optional
* promotions.
*/
contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 {
// Parts per 10000
uint public constant DEFAULT_FEE_BPS = 25;
UniswapFactory public uniswapFactory;
address public kyberNetwork;
uint public feeBps = DEFAULT_FEE_BPS;
// Uniswap exchange contract for every listed token
// token -> exchange
mapping (address => address) public tokenExchange;
// Internal inventory balance limits
// token -> limit
mapping (address => uint) public internalInventoryMin;
mapping (address => uint) public internalInventoryMax;
// Minimum spread in BPS required for using internal inventory
// token -> limit
mapping (address => uint) public internalActivationMinSpreadBps;
// Premium BPS added to internal price (making it better).
// token -> limit
mapping (address => uint) public internalPricePremiumBps;
bool public tradeEnabled = true;
/**
Constructor
*/
function KyberUniswapReserve(
UniswapFactory _uniswapFactory,
address _admin,
address _kyberNetwork
)
public
{
}
function() public payable {
}
/**
Returns dest quantity / source quantity.
Last bit of the rate indicates whether to use internal inventory:
0 - use uniswap
1 - use internal inventory
*/
function getConversionRate(
ERC20 src,
ERC20 dest,
uint srcQty,
uint blockNumber
)
public
view
returns(uint)
{
}
function applyInternalInventoryHintToRate(
uint rate,
bool useInternalInventory
)
internal
pure
returns(uint)
{
}
event TradeExecute(
address indexed sender,
address src,
uint srcAmount,
address destToken,
uint destAmount,
address destAddress,
bool useInternalInventory
);
/**
conversionRate: expected conversion rate should be >= this value.
*/
function trade(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
address destAddress,
uint conversionRate,
bool validate
)
public
payable
returns(bool)
{
}
event FeeUpdated(
uint bps
);
function setFee(
uint bps
)
public
onlyAdmin
{
}
event InternalActivationConfigUpdated(
ERC20 token,
uint minSpreadBps,
uint premiumBps
);
function setInternalActivationConfig(
ERC20 token,
uint minSpreadBps,
uint premiumBps
)
public
onlyAdmin
{
require(<FILL_ME>)
require(minSpreadBps <= 1000); // min spread <= 10%
require(premiumBps <= 500); // premium <= 5%
internalActivationMinSpreadBps[address(token)] = minSpreadBps;
internalPricePremiumBps[address(token)] = premiumBps;
InternalActivationConfigUpdated(token, minSpreadBps, premiumBps);
}
event InternalInventoryLimitsUpdated(
ERC20 token,
uint minBalance,
uint maxBalance
);
function setInternalInventoryLimits(
ERC20 token,
uint minBalance,
uint maxBalance
)
public
onlyOperator
{
}
event TokenListed(
ERC20 token,
UniswapExchange exchange
);
function listToken(ERC20 token)
public
onlyAdmin
{
}
event TokenDelisted(ERC20 token);
function delistToken(ERC20 token)
public
onlyAdmin
{
}
function isValidTokens(
ERC20 src,
ERC20 dest
)
public
view
returns(bool)
{
}
event TradeEnabled(
bool enable
);
function enableTrade()
public
onlyAdmin
returns(bool)
{
}
function disableTrade()
public
onlyAlerter
returns(bool)
{
}
event KyberNetworkSet(
address kyberNetwork
);
function setKyberNetwork(
address _kyberNetwork
)
public
onlyAdmin
{
}
/*
* Uses amounts and rates to check if the reserve's internal inventory can
* be used directly.
*
* rateEthToToken and rateTokenToEth are in kyber rate format meaning
* rate as numerator and 1e18 as denominator.
*/
function shouldUseInternalInventory(
ERC20 srcToken,
uint srcAmount,
ERC20 destToken,
uint destAmount,
uint rateSrcDest,
uint rateDestSrc
)
public
view
returns(bool)
{
}
/*
* Spread calculation is (ask - bid) / ((ask + bid) / 2).
* We multiply by 10000 to get result in BPS.
*
* Note: if askRate > bidRate result will be negative indicating
* internal arbitrage.
*/
function calculateSpreadBps(
uint _askRate,
uint _bidRate
)
public
pure
returns(int)
{
}
function deductFee(
uint amount
)
public
view
returns(uint)
{
}
function addPremium(
ERC20 token,
uint amount
)
public
view
returns(uint)
{
}
function calcUniswapConversion(
ERC20 src,
ERC20 dest,
uint srcQty
)
internal
view
returns(uint destQty, uint rate)
{
}
}
| tokenExchange[address(token)]!=address(0) | 359,358 | tokenExchange[address(token)]!=address(0) |
"user cannot mint" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
contract FeudalzLandz is ERC721, EIP712, ERC721Burnable, AccessControl {
using Counters for Counters.Counter;
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
Counters.Counter private _tokenIdCounter;
address _signerAddress;
string _baseUri;
string _contractUri;
mapping (address => uint) public accountToMintedFreeTokens;
uint public maxSupply = 4444;
bool public isSalesActive = true;
uint public price;
constructor() ERC721("Feudalz Landz", "Landz") EIP712("LANDZ", "1.0.0") {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint quantity) external payable {
}
function mint(uint quantity, address receiver) external onlyRole(ADMIN_ROLE) {
}
function freeMint(uint quantity, uint maxFreeMints, bytes calldata signature) external {
require(<FILL_ME>)
require(isSalesActive, "sale is not active");
require(totalSupply() + quantity <= maxSupply, "quantity exceeds max supply");
require(quantity + accountToMintedFreeTokens[msg.sender] <= maxFreeMints, "quantity exceeds allowance");
for (uint i = 0; i < quantity; i++) {
safeMint(msg.sender);
}
accountToMintedFreeTokens[msg.sender] += quantity;
}
function safeMint(address to) internal {
}
function totalSupply() public view returns (uint) {
}
function contractURI() public view returns (string memory) {
}
function setBaseURI(string memory newBaseURI) external onlyRole(ADMIN_ROLE) {
}
function setContractURI(string memory newContractURI) external onlyRole(ADMIN_ROLE) {
}
function toggleSales() external onlyRole(ADMIN_ROLE) {
}
function setPrice(uint newPrice) external onlyRole(ADMIN_ROLE) {
}
function setMaxSupply(uint newMaxSupply) external onlyRole(ADMIN_ROLE) {
}
function withdrawAll() external onlyRole(ADMIN_ROLE) {
}
function _hash(address account, uint maxFreeMints) internal view returns (bytes32) {
}
function recoverAddress(address account, uint maxFreeMints, bytes calldata signature) public view returns(address) {
}
function setSignerAddress(address signerAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, AccessControl)
returns (bool)
{
}
}
| recoverAddress(msg.sender,maxFreeMints,signature)==_signerAddress,"user cannot mint" | 359,406 | recoverAddress(msg.sender,maxFreeMints,signature)==_signerAddress |
"quantity exceeds allowance" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
contract FeudalzLandz is ERC721, EIP712, ERC721Burnable, AccessControl {
using Counters for Counters.Counter;
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
Counters.Counter private _tokenIdCounter;
address _signerAddress;
string _baseUri;
string _contractUri;
mapping (address => uint) public accountToMintedFreeTokens;
uint public maxSupply = 4444;
bool public isSalesActive = true;
uint public price;
constructor() ERC721("Feudalz Landz", "Landz") EIP712("LANDZ", "1.0.0") {
}
function _baseURI() internal view override returns (string memory) {
}
function mint(uint quantity) external payable {
}
function mint(uint quantity, address receiver) external onlyRole(ADMIN_ROLE) {
}
function freeMint(uint quantity, uint maxFreeMints, bytes calldata signature) external {
require(recoverAddress(msg.sender, maxFreeMints, signature) == _signerAddress, "user cannot mint");
require(isSalesActive, "sale is not active");
require(totalSupply() + quantity <= maxSupply, "quantity exceeds max supply");
require(<FILL_ME>)
for (uint i = 0; i < quantity; i++) {
safeMint(msg.sender);
}
accountToMintedFreeTokens[msg.sender] += quantity;
}
function safeMint(address to) internal {
}
function totalSupply() public view returns (uint) {
}
function contractURI() public view returns (string memory) {
}
function setBaseURI(string memory newBaseURI) external onlyRole(ADMIN_ROLE) {
}
function setContractURI(string memory newContractURI) external onlyRole(ADMIN_ROLE) {
}
function toggleSales() external onlyRole(ADMIN_ROLE) {
}
function setPrice(uint newPrice) external onlyRole(ADMIN_ROLE) {
}
function setMaxSupply(uint newMaxSupply) external onlyRole(ADMIN_ROLE) {
}
function withdrawAll() external onlyRole(ADMIN_ROLE) {
}
function _hash(address account, uint maxFreeMints) internal view returns (bytes32) {
}
function recoverAddress(address account, uint maxFreeMints, bytes calldata signature) public view returns(address) {
}
function setSignerAddress(address signerAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, AccessControl)
returns (bool)
{
}
}
| quantity+accountToMintedFreeTokens[msg.sender]<=maxFreeMints,"quantity exceeds allowance" | 359,406 | quantity+accountToMintedFreeTokens[msg.sender]<=maxFreeMints |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./Royalties.sol";
/**
* @title LazySloths contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*
*/
// Twitter @FrankPoncelet
//
contract LazySloths is Ownable, ERC721Enumerable, Royalties {
using SafeMath for uint256;
uint256 public tokenPrice = 50000000000000000; //0.05 ETH
uint256 public MAX_SLOTHS;
uint public constant MAX_PURCHASE = 20;
uint public constant MAX_RESERVE = 30;
bool public saleIsActive;
address payable[] private addr = new address payable[](1);
uint256[] private royalties = new uint256[](1);
// Base URI for Meta data
string private _baseTokenURI = "ipfs://QmetbFFTF51b78BADpgB4px18Bct25yjstRrsDH4wj7J4w/";
string public SLOTHS_PROVENANCE = "";
address private constant DAO = 0x8ef4268e320bAEfBF2499cF9cEfe67177e5D8649;
event priceChange(address _by, uint256 price);
event PaymentReleased(address to, uint256 amount);
constructor() ERC721("The Lazy Sloths", "SLOTHS") {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view override (ERC721Enumerable,Royalties) returns (bool){
}
/**
* Set price
*/
function setPrice(uint256 price) public onlyOwner {
}
function withdraw() public onlyOwner {
uint256 artists = address(this).balance / 5;
require(<FILL_ME>)
require(payable(owner()).send(artists*3));
emit PaymentReleased(owner(), artists*3);
}
/**
* Set some Dorkis aside for giveaways.
*/
function reserveTokens() public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev Set the base token URI
*/
function setBaseTokenURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* Mints Sloths
*/
function mintSloths(uint numberOfTokens) public payable {
}
function preSale(address _to, uint256 numberOfTokens) external onlyOwner() {
}
/**
* Get all tokens for a specific wallet
*
*/
function getTokensForAddress(address fromAddress) external view returns (uint256 [] memory){
}
// contract can recieve Ether
fallback() external payable { }
receive() external payable { }
// Royalties implemetations
function getFeeRecipients(uint256 tokenId) external view override returns (address payable[] memory){
}
// fees.value is the royalties percentage, by default this value is 1000 on Rarible which is a 10% royalties fee.
function getFeeBps(uint256 tokenId) external view override returns (uint[] memory){
}
function getFees(uint256 tokenId) external view override returns (address payable[] memory, uint256[] memory){
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address, uint256){
}
}
| payable(DAO).send(artists*2) | 359,544 | payable(DAO).send(artists*2) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./Royalties.sol";
/**
* @title LazySloths contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*
*/
// Twitter @FrankPoncelet
//
contract LazySloths is Ownable, ERC721Enumerable, Royalties {
using SafeMath for uint256;
uint256 public tokenPrice = 50000000000000000; //0.05 ETH
uint256 public MAX_SLOTHS;
uint public constant MAX_PURCHASE = 20;
uint public constant MAX_RESERVE = 30;
bool public saleIsActive;
address payable[] private addr = new address payable[](1);
uint256[] private royalties = new uint256[](1);
// Base URI for Meta data
string private _baseTokenURI = "ipfs://QmetbFFTF51b78BADpgB4px18Bct25yjstRrsDH4wj7J4w/";
string public SLOTHS_PROVENANCE = "";
address private constant DAO = 0x8ef4268e320bAEfBF2499cF9cEfe67177e5D8649;
event priceChange(address _by, uint256 price);
event PaymentReleased(address to, uint256 amount);
constructor() ERC721("The Lazy Sloths", "SLOTHS") {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view override (ERC721Enumerable,Royalties) returns (bool){
}
/**
* Set price
*/
function setPrice(uint256 price) public onlyOwner {
}
function withdraw() public onlyOwner {
uint256 artists = address(this).balance / 5;
require(payable(DAO).send(artists*2));
require(<FILL_ME>)
emit PaymentReleased(owner(), artists*3);
}
/**
* Set some Dorkis aside for giveaways.
*/
function reserveTokens() public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev Set the base token URI
*/
function setBaseTokenURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* Mints Sloths
*/
function mintSloths(uint numberOfTokens) public payable {
}
function preSale(address _to, uint256 numberOfTokens) external onlyOwner() {
}
/**
* Get all tokens for a specific wallet
*
*/
function getTokensForAddress(address fromAddress) external view returns (uint256 [] memory){
}
// contract can recieve Ether
fallback() external payable { }
receive() external payable { }
// Royalties implemetations
function getFeeRecipients(uint256 tokenId) external view override returns (address payable[] memory){
}
// fees.value is the royalties percentage, by default this value is 1000 on Rarible which is a 10% royalties fee.
function getFeeBps(uint256 tokenId) external view override returns (uint[] memory){
}
function getFees(uint256 tokenId) external view override returns (address payable[] memory, uint256[] memory){
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address, uint256){
}
}
| payable(owner()).send(artists*3) | 359,544 | payable(owner()).send(artists*3) |
"Reserve would exceed max supply of Dorkis" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./Royalties.sol";
/**
* @title LazySloths contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*
*/
// Twitter @FrankPoncelet
//
contract LazySloths is Ownable, ERC721Enumerable, Royalties {
using SafeMath for uint256;
uint256 public tokenPrice = 50000000000000000; //0.05 ETH
uint256 public MAX_SLOTHS;
uint public constant MAX_PURCHASE = 20;
uint public constant MAX_RESERVE = 30;
bool public saleIsActive;
address payable[] private addr = new address payable[](1);
uint256[] private royalties = new uint256[](1);
// Base URI for Meta data
string private _baseTokenURI = "ipfs://QmetbFFTF51b78BADpgB4px18Bct25yjstRrsDH4wj7J4w/";
string public SLOTHS_PROVENANCE = "";
address private constant DAO = 0x8ef4268e320bAEfBF2499cF9cEfe67177e5D8649;
event priceChange(address _by, uint256 price);
event PaymentReleased(address to, uint256 amount);
constructor() ERC721("The Lazy Sloths", "SLOTHS") {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view override (ERC721Enumerable,Royalties) returns (bool){
}
/**
* Set price
*/
function setPrice(uint256 price) public onlyOwner {
}
function withdraw() public onlyOwner {
}
/**
* Set some Dorkis aside for giveaways.
*/
function reserveTokens() public onlyOwner {
require(<FILL_ME>)
uint supply = totalSupply();
for (uint i = 0; i < MAX_RESERVE; i++) {
_safeMint(msg.sender, supply + i);
}
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev Set the base token URI
*/
function setBaseTokenURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* Mints Sloths
*/
function mintSloths(uint numberOfTokens) public payable {
}
function preSale(address _to, uint256 numberOfTokens) external onlyOwner() {
}
/**
* Get all tokens for a specific wallet
*
*/
function getTokensForAddress(address fromAddress) external view returns (uint256 [] memory){
}
// contract can recieve Ether
fallback() external payable { }
receive() external payable { }
// Royalties implemetations
function getFeeRecipients(uint256 tokenId) external view override returns (address payable[] memory){
}
// fees.value is the royalties percentage, by default this value is 1000 on Rarible which is a 10% royalties fee.
function getFeeBps(uint256 tokenId) external view override returns (uint[] memory){
}
function getFees(uint256 tokenId) external view override returns (address payable[] memory, uint256[] memory){
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address, uint256){
}
}
| totalSupply().add(MAX_RESERVE)<=MAX_SLOTHS,"Reserve would exceed max supply of Dorkis" | 359,544 | totalSupply().add(MAX_RESERVE)<=MAX_SLOTHS |
"Purchase would exceed max supply of tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/utils/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.2.0/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "./Royalties.sol";
/**
* @title LazySloths contract
* @dev Extends ERC721 Non-Fungible Token Standard basic implementation
*
*/
// Twitter @FrankPoncelet
//
contract LazySloths is Ownable, ERC721Enumerable, Royalties {
using SafeMath for uint256;
uint256 public tokenPrice = 50000000000000000; //0.05 ETH
uint256 public MAX_SLOTHS;
uint public constant MAX_PURCHASE = 20;
uint public constant MAX_RESERVE = 30;
bool public saleIsActive;
address payable[] private addr = new address payable[](1);
uint256[] private royalties = new uint256[](1);
// Base URI for Meta data
string private _baseTokenURI = "ipfs://QmetbFFTF51b78BADpgB4px18Bct25yjstRrsDH4wj7J4w/";
string public SLOTHS_PROVENANCE = "";
address private constant DAO = 0x8ef4268e320bAEfBF2499cF9cEfe67177e5D8649;
event priceChange(address _by, uint256 price);
event PaymentReleased(address to, uint256 amount);
constructor() ERC721("The Lazy Sloths", "SLOTHS") {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view override (ERC721Enumerable,Royalties) returns (bool){
}
/**
* Set price
*/
function setPrice(uint256 price) public onlyOwner {
}
function withdraw() public onlyOwner {
}
/**
* Set some Dorkis aside for giveaways.
*/
function reserveTokens() public onlyOwner {
}
/*
* Set provenance once it's calculated
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev Set the base token URI
*/
function setBaseTokenURI(string memory baseURI) public onlyOwner {
}
/*
* Pause sale if active, make active if paused
*/
function flipSaleState() public onlyOwner {
}
/**
* Mints Sloths
*/
function mintSloths(uint numberOfTokens) public payable {
require(numberOfTokens > 0, "numberOfNfts cannot be 0");
require(saleIsActive, "Sale must be active to mint tokens");
require(numberOfTokens <= MAX_PURCHASE, "Can only mint 20 tokens at a time");
require(<FILL_ME>)
require(tokenPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply();
if (totalSupply() < MAX_SLOTHS) {
_safeMint(msg.sender, mintIndex);
}
}
}
function preSale(address _to, uint256 numberOfTokens) external onlyOwner() {
}
/**
* Get all tokens for a specific wallet
*
*/
function getTokensForAddress(address fromAddress) external view returns (uint256 [] memory){
}
// contract can recieve Ether
fallback() external payable { }
receive() external payable { }
// Royalties implemetations
function getFeeRecipients(uint256 tokenId) external view override returns (address payable[] memory){
}
// fees.value is the royalties percentage, by default this value is 1000 on Rarible which is a 10% royalties fee.
function getFeeBps(uint256 tokenId) external view override returns (uint[] memory){
}
function getFees(uint256 tokenId) external view override returns (address payable[] memory, uint256[] memory){
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address, uint256){
}
}
| totalSupply().add(numberOfTokens)<=MAX_SLOTHS,"Purchase would exceed max supply of tokens" | 359,544 | totalSupply().add(numberOfTokens)<=MAX_SLOTHS |
null | pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
pragma solidity ^0.4.15;
/**
* @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;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
}
}
pragma solidity ^0.4.15;
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused {
}
}
pragma solidity ^0.4.15;
contract FundRequestPrivateSeed is Pausable {
using SafeMath for uint;
// address where funds are collected
address public wallet;
// how many token units a buyer gets per wei
uint public rate;
// amount of raised money in wei
uint public weiRaised;
mapping(address => uint) public deposits;
mapping(address => uint) public balances;
address[] public investors;
uint public investorCount;
mapping(address => bool) public allowed;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function FundRequestPrivateSeed(uint _rate, address _wallet) {
}
// low level token purchase function
function buyTokens(address beneficiary) payable whenNotPaused {
require(<FILL_ME>)
require(validPurchase());
require(validPurchaseSize());
bool existing = deposits[beneficiary] > 0;
uint weiAmount = msg.value;
uint updatedWeiRaised = weiRaised.add(weiAmount);
// calculate token amount to be created
uint tokens = weiAmount.mul(rate);
weiRaised = updatedWeiRaised;
deposits[beneficiary] = deposits[beneficiary].add(msg.value);
balances[beneficiary] = balances[beneficiary].add(tokens);
if(!existing) {
investors.push(beneficiary);
investorCount++;
}
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
}
function validBeneficiary(address beneficiary) internal constant returns (bool) {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
}
// @return true if the amount is higher then 25ETH
function validPurchaseSize() internal constant returns (bool) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
function depositsOf(address _owner) constant returns (uint deposit) {
}
function allow(address beneficiary) onlyOwner {
}
function updateRate(uint _rate) onlyOwner whenPaused {
}
function updateWallet(address _wallet) onlyOwner whenPaused {
}
// fallback function can be used to buy tokens
function () payable {
}
}
| validBeneficiary(beneficiary) | 359,584 | validBeneficiary(beneficiary) |
null | pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
pragma solidity ^0.4.15;
/**
* @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;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
}
}
pragma solidity ^0.4.15;
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused {
}
}
pragma solidity ^0.4.15;
contract FundRequestPrivateSeed is Pausable {
using SafeMath for uint;
// address where funds are collected
address public wallet;
// how many token units a buyer gets per wei
uint public rate;
// amount of raised money in wei
uint public weiRaised;
mapping(address => uint) public deposits;
mapping(address => uint) public balances;
address[] public investors;
uint public investorCount;
mapping(address => bool) public allowed;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function FundRequestPrivateSeed(uint _rate, address _wallet) {
}
// low level token purchase function
function buyTokens(address beneficiary) payable whenNotPaused {
require(validBeneficiary(beneficiary));
require(validPurchase());
require(<FILL_ME>)
bool existing = deposits[beneficiary] > 0;
uint weiAmount = msg.value;
uint updatedWeiRaised = weiRaised.add(weiAmount);
// calculate token amount to be created
uint tokens = weiAmount.mul(rate);
weiRaised = updatedWeiRaised;
deposits[beneficiary] = deposits[beneficiary].add(msg.value);
balances[beneficiary] = balances[beneficiary].add(tokens);
if(!existing) {
investors.push(beneficiary);
investorCount++;
}
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
}
function validBeneficiary(address beneficiary) internal constant returns (bool) {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
}
// @return true if the amount is higher then 25ETH
function validPurchaseSize() internal constant returns (bool) {
}
function balanceOf(address _owner) constant returns (uint balance) {
}
function depositsOf(address _owner) constant returns (uint deposit) {
}
function allow(address beneficiary) onlyOwner {
}
function updateRate(uint _rate) onlyOwner whenPaused {
}
function updateWallet(address _wallet) onlyOwner whenPaused {
}
// fallback function can be used to buy tokens
function () payable {
}
}
| validPurchaseSize() | 359,584 | validPurchaseSize() |
"Purchase would exceed max supply of tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "manifoldxyz-creator-core-solidity/contracts/core/IERC721CreatorCore.sol";
import "manifoldxyz-creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol";
contract Spottie is Ownable, ERC165, ICreatorExtensionTokenURI {
using Strings for uint256;
using Strings for uint;
string public PROVENANCE = "";
uint256 public constant MAX_SUPPLY = 2000;
uint256 public constant TOKEN_PRICE = 0.03 ether;
uint256 public constant NUM_RESERVED_TOKENS = 150;
uint public constant MAX_PURCHASE = 10;
bool public saleIsActive = false;
string private _baseURIextended;
address private _creator;
uint private _numMinted;
mapping(uint256 => uint) _tokenEdition;
constructor(address creator) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
}
function tokenURI(address creator, uint256 tokenId) external view override returns (string memory) {
}
function totalSupply() external view returns (uint) {
}
function setBaseURI(string memory baseURI_) external onlyOwner() {
}
function withdraw() public onlyOwner {
}
function mintThroughCreator(address to) private {
}
function reserve() public onlyOwner {
}
function setProvenance(string memory provenance) public onlyOwner {
}
function setSaleState(bool newState) public onlyOwner {
}
function mint(uint numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint token");
require(numberOfTokens <= MAX_PURCHASE, "Exceeded max purchase amount");
require(<FILL_ME>)
require(TOKEN_PRICE * numberOfTokens <= msg.value, "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
if (_numMinted < MAX_SUPPLY) {
mintThroughCreator(msg.sender);
}
}
}
}
| _numMinted+numberOfTokens<=MAX_SUPPLY,"Purchase would exceed max supply of tokens" | 359,663 | _numMinted+numberOfTokens<=MAX_SUPPLY |
"Fees too high" | pragma solidity ^0.8.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01{
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract LuckyCorgi is ERC20Burnable, Ownable {
address public roadWallet;
address public pairAddress;
IUniswapV2Router02 public router;
address public baseToken;
address public ecoWallet;
address public routerAddress;
mapping(address => bool) public isExcluded;
uint256 public devMarketingFee = 5;
uint256 public ecoLotteryFee = 8;
bool public swapForMarketing = true;
bool public tradingEnabled = false;
mapping(address => bool) public _isWhitelisted;
mapping(address => uint256) public _isParticipated;
mapping(address => bool) public _isBlacklisted;
bool public _wlProtectionEnabled = true;
uint256 public _lockPercentage = 50;
uint256 public _maxTxAmount;
uint256 private _buyCooldown = 1 minutes;
mapping(address => uint256) public lastBuy;
bool public buyCooldownEnabled = true;
uint256 public pairBalanceThreshold = 5;
uint256 public maxSwapForFeesAmount = 0;
uint256 public minAmountToSwap = 200_000_000 ether;
constructor(
string memory name_,
string memory symbol_,
uint256 totalSupply,
address router_,
address baseToken_) ERC20(name_, symbol_) {
}
function setRoadFee(uint256 fee_) external onlyOwner {
devMarketingFee = fee_;
require(<FILL_ME>)
}
function setEcoFee(uint256 fee_) external onlyOwner {
}
function setRoadWallet(address addr) external onlyOwner {
}
function setEcoWallet(address addr) external onlyOwner {
}
function setPairBalanceThreshold(uint256 percentage) external onlyOwner {
}
function setMinAmountToSwap(uint256 minAmountToSwap_) external onlyOwner{
}
function blacklistAddress(address account, bool value) external onlyOwner {
}
function openTrading() external onlyOwner {
}
function multiAddToWhitelist(address [] memory whitelisted) external onlyOwner {
}
function multiRemoveFromWhitelist(address [] memory whitelisted) external onlyOwner {
}
function WLProtectionEnabled(bool status) external onlyOwner {
}
function WLPercentageLock(uint256 percentage) external onlyOwner {
}
function setMaxTxAmount(uint256 maxTx) external onlyOwner {
}
function setBuycooldownEnabled(bool status) external onlyOwner {
}
function setBuyCooldown(uint256 buyCooldown) external onlyOwner {
}
function setSwapForMarketing(bool enabled) external onlyOwner {
}
function setMaxTokensToSwapForFees(uint256 maxSwapAmount_) external onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal override {
}
function getAmountToSwap() public view returns (uint256){
}
function _swapForFees() internal {
}
function totalFees() public view returns (uint256){
}
function calculateFee(address sender, address recipient, uint256 amount) public view returns (uint256){
}
function swapForFees() external onlyOwner {
}
function multiExcludeFromFees(address [] memory addresses) external onlyOwner {
}
function _beforeTokenTransfer(address sender, address recipient, uint256 amount) override internal {
}
function multiIncludeInFees(address [] memory addresses) external onlyOwner {
}
receive() external payable {}
}
| totalFees()<20,"Fees too high" | 359,678 | totalFees()<20 |
"buy cooldown!" | pragma solidity ^0.8.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01{
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract LuckyCorgi is ERC20Burnable, Ownable {
address public roadWallet;
address public pairAddress;
IUniswapV2Router02 public router;
address public baseToken;
address public ecoWallet;
address public routerAddress;
mapping(address => bool) public isExcluded;
uint256 public devMarketingFee = 5;
uint256 public ecoLotteryFee = 8;
bool public swapForMarketing = true;
bool public tradingEnabled = false;
mapping(address => bool) public _isWhitelisted;
mapping(address => uint256) public _isParticipated;
mapping(address => bool) public _isBlacklisted;
bool public _wlProtectionEnabled = true;
uint256 public _lockPercentage = 50;
uint256 public _maxTxAmount;
uint256 private _buyCooldown = 1 minutes;
mapping(address => uint256) public lastBuy;
bool public buyCooldownEnabled = true;
uint256 public pairBalanceThreshold = 5;
uint256 public maxSwapForFeesAmount = 0;
uint256 public minAmountToSwap = 200_000_000 ether;
constructor(
string memory name_,
string memory symbol_,
uint256 totalSupply,
address router_,
address baseToken_) ERC20(name_, symbol_) {
}
function setRoadFee(uint256 fee_) external onlyOwner {
}
function setEcoFee(uint256 fee_) external onlyOwner {
}
function setRoadWallet(address addr) external onlyOwner {
}
function setEcoWallet(address addr) external onlyOwner {
}
function setPairBalanceThreshold(uint256 percentage) external onlyOwner {
}
function setMinAmountToSwap(uint256 minAmountToSwap_) external onlyOwner{
}
function blacklistAddress(address account, bool value) external onlyOwner {
}
function openTrading() external onlyOwner {
}
function multiAddToWhitelist(address [] memory whitelisted) external onlyOwner {
}
function multiRemoveFromWhitelist(address [] memory whitelisted) external onlyOwner {
}
function WLProtectionEnabled(bool status) external onlyOwner {
}
function WLPercentageLock(uint256 percentage) external onlyOwner {
}
function setMaxTxAmount(uint256 maxTx) external onlyOwner {
}
function setBuycooldownEnabled(bool status) external onlyOwner {
}
function setBuyCooldown(uint256 buyCooldown) external onlyOwner {
}
function setSwapForMarketing(bool enabled) external onlyOwner {
}
function setMaxTokensToSwapForFees(uint256 maxSwapAmount_) external onlyOwner {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal override {
}
function getAmountToSwap() public view returns (uint256){
}
function _swapForFees() internal {
}
function totalFees() public view returns (uint256){
}
function calculateFee(address sender, address recipient, uint256 amount) public view returns (uint256){
}
function swapForFees() external onlyOwner {
}
function multiExcludeFromFees(address [] memory addresses) external onlyOwner {
}
function _beforeTokenTransfer(address sender, address recipient, uint256 amount) override internal {
require(!_isBlacklisted[sender] && !_isBlacklisted[recipient], 'Blacklisted address');
if (tx.origin == owner() || sender == address(this) || recipient == address(this)) {
return;
}
if (buyCooldownEnabled && sender == pairAddress) {
require(<FILL_ME>)
lastBuy[tx.origin] = block.timestamp;
}
if (!tradingEnabled) {
require(_isWhitelisted[tx.origin] && (_isParticipated[tx.origin] == 0), "The address is not whitelisted");
_isParticipated[tx.origin] = amount;
}
if (_wlProtectionEnabled && _isWhitelisted[sender]) {
uint256 leftOverAfterSwap = balanceOf(sender) - (amount);
uint256 lockedAmount = _isParticipated[sender] * (_lockPercentage) / (100);
require(leftOverAfterSwap >= lockedAmount, "WL selling more than allowance");
}
}
function multiIncludeInFees(address [] memory addresses) external onlyOwner {
}
receive() external payable {}
}
| block.timestamp-lastBuy[tx.origin]>=_buyCooldown,"buy cooldown!" | 359,678 | block.timestamp-lastBuy[tx.origin]>=_buyCooldown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.