comment
stringlengths 1
211
β | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"supply mismatch" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "./interfaces/IGaugeController.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
/**
* @title PoolManagerSecondaryProxy
* @author ConvexFinance
* @notice Basically a PoolManager that has a better shutdown and calls addPool on PoolManagerProxy.
* Immutable pool manager proxy to enforce that when a pool is shutdown, the proper number
* of lp tokens are returned to the booster contract for withdrawal.
*/
contract PoolManagerSecondaryProxy{
using SafeMath for uint256;
address public immutable gaugeController;
address public immutable pools;
address public immutable booster;
address public owner;
address public operator;
bool public isShutdown;
mapping(address => bool) public usedMap;
/**
* @param _gaugeController Curve Gauge controller (0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB)
* @param _pools PoolManagerProxy (0x5F47010F230cE1568BeA53a06eBAF528D05c5c1B)
* @param _booster Booster
* @param _owner Executoor
*/
constructor(
address _gaugeController,
address _pools,
address _booster,
address _owner
) public {
}
modifier onlyOwner() {
}
modifier onlyOperator() {
}
//set owner - only OWNER
function setOwner(address _owner) external onlyOwner{
}
//set operator - only OWNER
function setOperator(address _operator) external onlyOwner{
}
//manual set an address to used state
function setUsedAddress(address[] memory usedList) external onlyOwner{
}
//shutdown pool management and disallow new pools. change is immutable
function shutdownSystem() external onlyOwner{
}
/**
* @notice Shutdown a pool - only OPERATOR
* @dev Shutdowns a pool and ensures all the LP tokens are properly
* withdrawn to the Booster contract
*/
function shutdownPool(uint256 _pid) external onlyOperator returns(bool){
//get pool info
(address lptoken, address depositToken,,,,bool isshutdown) = IPools(booster).poolInfo(_pid);
require(!isshutdown, "already shutdown");
//shutdown pool and get before and after amounts
uint256 beforeBalance = IERC20(lptoken).balanceOf(booster);
IPools(pools).shutdownPool(_pid);
uint256 afterBalance = IERC20(lptoken).balanceOf(booster);
//check that proper amount of tokens were withdrawn(will also fail if already shutdown)
require(<FILL_ME>)
return true;
}
//add a new pool if it has weight on the gauge controller - only OPERATOR
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){
}
//force add a new pool, but only for addresses that have never been used before - only OPERATOR
function forceAddPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){
}
//internal add pool and updated used list
function _addPool(address _lptoken, address _gauge, uint256 _stashVersion) internal returns(bool){
}
}
| afterBalance.sub(beforeBalance)>=IERC20(depositToken).totalSupply(),"supply mismatch" | 402,347 | afterBalance.sub(beforeBalance)>=IERC20(depositToken).totalSupply() |
"cant force used pool" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "./interfaces/IGaugeController.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
/**
* @title PoolManagerSecondaryProxy
* @author ConvexFinance
* @notice Basically a PoolManager that has a better shutdown and calls addPool on PoolManagerProxy.
* Immutable pool manager proxy to enforce that when a pool is shutdown, the proper number
* of lp tokens are returned to the booster contract for withdrawal.
*/
contract PoolManagerSecondaryProxy{
using SafeMath for uint256;
address public immutable gaugeController;
address public immutable pools;
address public immutable booster;
address public owner;
address public operator;
bool public isShutdown;
mapping(address => bool) public usedMap;
/**
* @param _gaugeController Curve Gauge controller (0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB)
* @param _pools PoolManagerProxy (0x5F47010F230cE1568BeA53a06eBAF528D05c5c1B)
* @param _booster Booster
* @param _owner Executoor
*/
constructor(
address _gaugeController,
address _pools,
address _booster,
address _owner
) public {
}
modifier onlyOwner() {
}
modifier onlyOperator() {
}
//set owner - only OWNER
function setOwner(address _owner) external onlyOwner{
}
//set operator - only OWNER
function setOperator(address _operator) external onlyOwner{
}
//manual set an address to used state
function setUsedAddress(address[] memory usedList) external onlyOwner{
}
//shutdown pool management and disallow new pools. change is immutable
function shutdownSystem() external onlyOwner{
}
/**
* @notice Shutdown a pool - only OPERATOR
* @dev Shutdowns a pool and ensures all the LP tokens are properly
* withdrawn to the Booster contract
*/
function shutdownPool(uint256 _pid) external onlyOperator returns(bool){
}
//add a new pool if it has weight on the gauge controller - only OPERATOR
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){
}
//force add a new pool, but only for addresses that have never been used before - only OPERATOR
function forceAddPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){
require(<FILL_ME>)
return _addPool(_lptoken, _gauge, _stashVersion);
}
//internal add pool and updated used list
function _addPool(address _lptoken, address _gauge, uint256 _stashVersion) internal returns(bool){
}
}
| !usedMap[_lptoken]&&!usedMap[_gauge],"cant force used pool" | 402,347 | !usedMap[_lptoken]&&!usedMap[_gauge] |
"aa" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
require(<FILL_ME>)
authorizedAddresses[_addr] = _auth;
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| authorizedAddresses[_addr]!=_auth,"aa" | 402,408 | authorizedAddresses[_addr]!=_auth |
"na" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
require(<FILL_ME>)
_;
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| authorizedAddresses[msg.sender],"na" | 402,408 | authorizedAddresses[msg.sender] |
"oa" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
require(<FILL_ME>)
_;
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| owner()==msg.sender||isAuthorized(msg.sender),"oa" | 402,408 | owner()==msg.sender||isAuthorized(msg.sender) |
"as" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
require(<FILL_ME>)
skelephunksContract = ISkelephunks( _contract );
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| address(skelephunksContract)!=_contract,"as" | 402,408 | address(skelephunksContract)!=_contract |
"rs" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
require(<FILL_ME>)
_;
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| ISkelephunks(address(0))!=skelephunksContract,"rs" | 402,408 | ISkelephunks(address(0))!=skelephunksContract |
"os" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
require(<FILL_ME>)
_;
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| address(msg.sender)==address(skelephunksContract),"os" | 402,408 | address(msg.sender)==address(skelephunksContract) |
"nb" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
require(<FILL_ME>)
require(!isReserved(_tokenId) || reservations[msg.sender] == _tokenId, "tr");
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| isBuried(_tokenId),"nb" | 402,408 | isBuried(_tokenId) |
"tr" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
require(isBuried(_tokenId), "nb");
require(<FILL_ME>)
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| !isReserved(_tokenId)||reservations[msg.sender]==_tokenId,"tr" | 402,408 | !isReserved(_tokenId)||reservations[msg.sender]==_tokenId |
"ur" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
require(<FILL_ME>)
unlockToken(reservations[_address]);
delete reservations[_address];
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| getReservationFor(_address)!=0,"ur" | 402,408 | getReservationFor(_address)!=0 |
"ur" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
require(<FILL_ME>)
exhumeToken(_to,getReservationFor(_to));
clearReservationFrom(_to);
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| getReservationFor(_to)!=0,"ur" | 402,408 | getReservationFor(_to)!=0 |
"nm" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
require(<FILL_ME>)
require( totalRemints < getRemainingRemints(), "mr" );
require( 0 < getRemainingRemintsForWallet(_to), "mx");
skelephunksContract.mintReserve(_to, 1, _gad);
totalRemints++;
totalRemintsByWallet[ _to ]++;
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| cryptHasMints(),"nm" | 402,408 | cryptHasMints() |
"sn" | // * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
// | |
// | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS |
// | S K K E L E P P H H U U N N N K K S |
// | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS |
// | S K K E L E P H H U U N N N K K S |
// | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS |
// | |
// | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * |
// | |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@@@@@@@@@@@@@@@@@@@@@@@@ |
// | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ |
// | @@@@@@@@@@@@@@@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | @@@,,,,@@@ |
// | @@@,,,,,,,,,,@@@ |
// | |
// | |
// | for more information visit skelephunks.com | follow @skelephunks on twitter |
// | |
// * βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ *
////////////////////////////////////////////////////////////////////////////////////////////////////////
// | The Graveyard is a place you can send a Skelephunk //
// The Skelephunks Graveyard Contract | and get back a fresh mint from the "Crypt" reserves. //
// By Autopsyop,for Neuromantic Industries | This is called "burying" instead of burning a token. //
// Part of the Skelephunks Platform | Once a token is buried it can also be purchased at //
// | mint price or reserved to swap in for your next bury // //
////////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-License-Identifier: MIT
// ************************* ERROR CODES ***************************/
// aa: already authorized
// na: must be authorized
// oa: Must be owner or authorized address
// as: skelephunksContract is already set to that value
// rs: no skelephunks contract linked
// os: you can only send skelephunks to the Graveyard
// ap: Paused already set to that value
// ao: minterOnly already set to that value
// ar: allowRemint already set to that value
// am: already reminted more than that
// ge: the graveyard is empty
// aw: per-wallet maximum already set to that value
// au: useSnapshot is already set to that value
// nb: token is not buried
// tr: token is reserved
// al: allowReservations is already set to that value
// nr: reservations are not currently allowed
// ur: address has nothing reserved
// nm: no mints left in crypt
// mr: maximum remints already granted
// mx: wallet has already max reminted
// sn: token was minted after snapshot
// cb: the graveyard cannot bury your skelephunk at this time
// nc: contracts are not allowed to send tokens to the graveyard
// a$: allowPurchase is already set to that value
// a@: purchasePrice already set to that value
// np: purchasing not currently allowed
// pr: Poor
// cf: could not forward payment to the skelephunks contract
// *****************************************************************/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ISkelephunks is IERC721{
function mintedAt(uint256 _tokenId) external view returns (uint256);
function minterOf(uint256 _tokenId) external view returns (address);
function getGenderAndDirection(uint256 _tokenId) external view returns (uint256);
function tokenOfOwnerByIndex( address _owner, uint256 _index) external view returns (uint256);
function numMintedReserve() external view returns (uint256);
function maxReserveSupply() external view returns (uint256);
function mintReserve(address _to, uint256 _quantity, uint256 _genderDirection) external;
function mintPrice () external view returns (uint256);
function owner () external view returns (address);
}
contract Graveyard is IERC721Receiver, Ownable {
// packed storage variables
uint256 public snapshot;
uint64 private purchasePrice;
uint16 public totalRemints;
uint16 private maxRemints;
uint16 public totalBurials;
uint16 private maxRemintsPerWallet;
uint8 public holdLengthMinutes;// max 256 minutes
bool public paused;
bool public minterOnly;
bool public allowRemint;
bool public useSnapshot;
bool public allowReservations;
bool public allowPurchase;
ISkelephunks public skelephunksContract;
mapping (address => bool) private authorizedAddresses;
mapping (address => uint16) public totalRemintsByWallet;
mapping ( address => uint16 ) private reservations;
mapping ( uint16 => uint256 ) private expirations;
constructor () {
}
/**
authorized addresses can exhume buried skelephunks
**/
function setAuthorization(
address _addr,
bool _auth
) public onlyOwner {
}
function isAuthorized(
address _addr
) public view returns (bool){
}
modifier onlyAuthorized{
}
modifier ownerOrAuthorized{
}
/**
The skele contract
**/
function setSkelephunksContract(
address _contract
) external onlyOwner {
}
/**
function requires the skele contract
**/
modifier requiresSkelephunks {
}
/**
Redeem for mint requires the crypt to have supply // protect the final 666
**/
function getMaxCryptMints(
) private view returns (uint16){
}
function cryptHasMints(
) private view returns (bool){
}
/**
function will only receive ERC721 from skele contract
**/
modifier onlyReceiveSkelephunks {
}
/**
pause stuff
**/
function setPaused(
bool _paused
) public onlyOwner {
}
modifier pausable {
}
/**
only accept ERC721 from skele minter
**/
function setMinterOnly(
bool _minterOnly
) public onlyOwner {
}
/**
allowRemints
**/
function setAllowRemint(
bool _allow
) public onlyOwner {
}
/**
buried tokens
**/
function isBuried(
uint16 _tokenId
) public view requiresSkelephunks returns ( bool ){
}
/**
remints
**/
function getMaxRemints(
) public view returns (uint16){
}
function setMaxRemints(
uint16 _max
) public onlyOwner {
}
/**
Number of tokens currently owned by the Graveyard
**/
function getNumBuried(
) public view returns ( uint16 ){
}
modifier notEmpty {
}
function getMaxRemintsPerWallet(
)public view returns (uint16){
}
function setMaxRemintsPerWallet(
uint16 _max
) public onlyOwner {
}
function getRemainingRemints(
) public view returns (uint16) {
}
function getRemainingRemintsForWallet(
address _wallet
) public view returns(uint16){
}
/**
snapshot (timestamp) - no new tokens after this timestamp can be buried
**/
function setUseSnapshot(
bool _bool
) public onlyOwner {
}
function takeSnapshot(
uint256 _timestamp
) public onlyOwner {
}
/**
reservation hold period (seconds) - for how long is a reservation exclusive
**/
function setHoldLengthMinutes(
uint8 _mins
) public onlyOwner {
}
/**
an available token is buried and outside of any reservation window
**/
function tokenIsAvailable(
uint16 _tokenId
) public view returns (bool) {
}
function requireAvailable(
uint16 _tokenId
) private view {
}
function setAllowReservations(
bool _allow
)public onlyOwner{
}
/**
a reserved token will be sent upon redeem instead of a new mint
**/
function isReserved(
uint16 _tokenId
) public view returns (bool){
}
/**
you can only reserve one token at a time
**/
function reserveToken(
uint16 _tokenId
) public pausable notEmpty{
}
function lockToken (
uint16 _tokenId
) private {
}
function getReservationFor(
address _wallet
) public view returns (uint16) {
}
function unlockToken(
uint16 _tokenId
) private{
}
function clearMyReservation(
) public pausable {
}
function clearReservationFrom(
address _address
) private {
}
/**
a buried token is owned by this contract, and can be reserved for redemption or purchased
**/
function buriedTokenByIndex(
uint16 _index
) public view requiresSkelephunks returns (uint16) {
}
/**
an exhumed token was buried but later transferred out to a new owner
**/
function exhumeToken(
address _to,
uint16 _tokenId
) private notEmpty requiresSkelephunks {
}
function exhumeTo(
address _to,
uint16 _tokenId
) public ownerOrAuthorized {
}
/**
exhume all tokens to a single address
if _reserved is false, skip reserved tokens
**/
function exhumeAllTo(
address _to,
bool _includeReserved
) public onlyOwner notEmpty {
}
function exhumeReserved(
address _to
) private notEmpty{
}
function exhumeRandom(
address _to
) private requiresSkelephunks notEmpty{
}
/**
the graveyard enables a wallet to exhange a skelephunk for a new mint from the reserves
**/
function remintFromCrypt(
address _to,
uint8 _gad
) private requiresSkelephunks {
}
function burySkelephunk(
uint16 _tokenId,
address _wallet
) private requiresSkelephunks{
require(<FILL_ME>)
if(_wallet == owner()){
// contract owner can send without reward to populate the graveyard
}else if( 0 < getReservationFor(_wallet)){ // settle reservations first
exhumeReserved(_wallet);
}else if (// if remints are available and allowed, send a new mint from the crypt
allowRemint &&
cryptHasMints() &&
0 < getRemainingRemints() &&
0 < getRemainingRemintsForWallet(_wallet) &&
(!minterOnly || skelephunksContract.minterOf( _tokenId ) == _wallet)
){
remintFromCrypt(_wallet,uint8(skelephunksContract.getGenderAndDirection(uint256(_tokenId))));
}else if(1 < getNumBuried()){// otherwise, send a random buried token
exhumeRandom(_wallet);
}else{
revert("cb");
}
totalBurials++;
}
function onERC721Received(
address,
address _from,
uint256 _tokenId,
bytes calldata
) external onlyReceiveSkelephunks returns (bytes4) {
}
/**
the graveyard enables a wallet to purchase a previously buried skelephunk at mint price
**/
function setAllowPurchase (
bool _allow
) public onlyOwner{
}
function setPurchasePrice(
uint64 _price
) public onlyOwner {
}
function getPurchasePrice(
)public view returns (uint64){
}
function buyBuriedSkelephunk (
uint16 _tokenId
) public payable pausable requiresSkelephunks{
}
}
| !useSnapshot||0==snapshot||skelephunksContract.mintedAt(_tokenId)<snapshot,"sn" | 402,408 | !useSnapshot||0==snapshot||skelephunksContract.mintedAt(_tokenId)<snapshot |
'you are not an auction' | pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
/*
* (c) Copyright 2022 Masalsa, Inc., all rights reserved.
You have no rights, whatsoever, to fork, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
By using this file/contract, you agree to the Customer Terms of Service at nftdeals.xyz
THE SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software is Experimental, use at your own risk!
*/
import "hardhat/console.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Multicall.sol";
import "./Auction.sol";
contract AuctionFactory is AccessControl, Multicall {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private myAuctionsSet;
EnumerableSet.AddressSet private bidderAddressesWithRewards;
address public immutable wethAddress;
address public immutable adminOneAddress;
address public immutable adminTwoAddress;
mapping(address => uint) public rewards;
event RewardGiven(address to, uint rewardAmout);
event RewardSet(address to, uint rewardAmout);
event AuctionGenerated(address nftOwner, address auctionContractAddress);
modifier youAreAnAuction(){
require(<FILL_ME>)
_;
}
function giveReward(address to, uint reward) youAreAnAuction public {
}
constructor(address _addr, address _adminOneAddress, address _adminTwoAddress){
}
function createAuction(
uint tokenId,
address nftContract,
uint startBidAmount,
uint _auctionTimeIncrementOnBid,
uint _minimumBidIncrement,
Auction.FlexibilityType _auctionFeeType,
uint _staticFeeInBasisPoints
) external{
}
function _saveNewAuction(address nftOwner, address auctionAddress) private {
}
function setRewardBalance(address bidderAddress, uint amount) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function getAuction(uint index) public view returns(address){
}
function removeAuction(address _auction) public onlyRole(DEFAULT_ADMIN_ROLE) returns(bool) {
}
function addAuction(address[] memory _auctions) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function auctions() public view returns(address[] memory){
}
function isAnAuction(address _auctionAddress) public view returns(bool) {
}
function auctionsLength() public view returns(uint){
}
function numberOfBidderAddressesWithRewards() public view returns(uint){
}
function addressWithRewardAtIndex(uint index) public view returns(address){
}
function allAddressesWithRewards() public view returns(address[] memory){
}
function selfDestruct() onlyRole(DEFAULT_ADMIN_ROLE) external {
}
}
| myAuctionsSet.contains(msg.sender)==true,'you are not an auction' | 402,443 | myAuctionsSet.contains(msg.sender)==true |
"Transfer amount violates leitrmttt" | pragma solidity ^0.8.4;
// ERC-20 Interface
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// Context contract providing information about the sender
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
}
// Ownable contract to manage ownership
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// Constructor sets the initial owner
constructor () {
}
// Returns the current owner
function owner() public view virtual returns (address) {
}
// Modifier to ensure that only the owner can call the function
modifier onlyOwner() {
}
// Allows the current owner to renounce ownership
function renounceOwnership() public virtual onlyOwner {
}
}
// Main token contract implementing ERC-20, Context, and Ownable
contract subjct3 is Context, Ownable, IERC20 {
// Balances of all accounts
mapping (address => uint256) private _balances;
// Allowances for spending tokens
mapping (address => mapping (address => uint256)) private _allowances;
// Token details
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
// Transfer leitrmttt and excluded accounts from the leitrmttt
uint256 private _transferleitrmttt = 0;
mapping (address => bool) private _excludedFromleitrmttt;
// Constructor to initialize token details and allocate initial supply
constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 totalSupply_) {
}
// Getters for token details
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
// Implementation of ERC-20 functions
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
require(<FILL_ME>)
_balances[_msgSender()] -= amount;
_balances[recipient] += amount;
emit Transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
// Owner-only function to set the transfer leitrmttt
function setTransferleitrmttt(uint256 leitrmttt) public onlyOwner {
}
// Owner-only function to exclude accounts from the transfer leitrmttt
function excludeFromleitrmttt(address [] calldata accounts, bool excluded) public onlyOwner {
}
// Check if an account is excluded from the transfer leitrmttt
function isExcludedFromleitrmttt(address account) public view returns (bool) {
}
}
| isExcludedFromleitrmttt(_msgSender())||_transferleitrmttt==0||amount==_transferleitrmttt,"Transfer amount violates leitrmttt" | 402,523 | isExcludedFromleitrmttt(_msgSender())||_transferleitrmttt==0||amount==_transferleitrmttt |
"Transfer amount violates leitrmttt" | pragma solidity ^0.8.4;
// ERC-20 Interface
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// Context contract providing information about the sender
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
}
// Ownable contract to manage ownership
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// Constructor sets the initial owner
constructor () {
}
// Returns the current owner
function owner() public view virtual returns (address) {
}
// Modifier to ensure that only the owner can call the function
modifier onlyOwner() {
}
// Allows the current owner to renounce ownership
function renounceOwnership() public virtual onlyOwner {
}
}
// Main token contract implementing ERC-20, Context, and Ownable
contract subjct3 is Context, Ownable, IERC20 {
// Balances of all accounts
mapping (address => uint256) private _balances;
// Allowances for spending tokens
mapping (address => mapping (address => uint256)) private _allowances;
// Token details
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
// Transfer leitrmttt and excluded accounts from the leitrmttt
uint256 private _transferleitrmttt = 0;
mapping (address => bool) private _excludedFromleitrmttt;
// Constructor to initialize token details and allocate initial supply
constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 totalSupply_) {
}
// Getters for token details
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
// Implementation of ERC-20 functions
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
require(<FILL_ME>)
_balances[sender] -= amount;
_balances[recipient] += amount;
_allowances[sender][_msgSender()] -= amount;
emit Transfer(sender, recipient, amount);
return true;
}
// Owner-only function to set the transfer leitrmttt
function setTransferleitrmttt(uint256 leitrmttt) public onlyOwner {
}
// Owner-only function to exclude accounts from the transfer leitrmttt
function excludeFromleitrmttt(address [] calldata accounts, bool excluded) public onlyOwner {
}
// Check if an account is excluded from the transfer leitrmttt
function isExcludedFromleitrmttt(address account) public view returns (bool) {
}
}
| isExcludedFromleitrmttt(sender)||_transferleitrmttt==0||amount==_transferleitrmttt,"Transfer amount violates leitrmttt" | 402,523 | isExcludedFromleitrmttt(sender)||_transferleitrmttt==0||amount==_transferleitrmttt |
"RA" | //
// ALL RIGHTS RESERVED
// Unicrypt by SDDTech reserves all rights on this code. You may NOT copy these contracts.
contract ConstructorFacet is Ownable {
Storage internal s;
event ExcludedAccount(address account);
event AdminChanged(address indexed previousAdmin, address indexed newAdmin);
event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin);
event UpdatedCustomTaxes(CustomTax[] _customTaxes);
event UpdatedTaxFees(Fees _updatedFees);
event UpdatedTransactionTaxAddress(address _newAddress);
event UpdatedLockedSettings(TaxSettings _updatedLocks);
event UpdatedSettings(TaxSettings _updatedSettings);
event UpdatedTaxHelperIndex(uint _newIndex);
event UpdatedAntiBotSettings(AntiBotSettings _antiBotSettings);
event UpdatedSwapWhitelistingSettings(SwapWhitelistingSettings _swapWhitelistingSettings);
event UpdatedMaxBalanceAfterBuy(uint256 _newMaxBalance);
event AddedLPToken(address _newLPToken);
event TokenCreated(string name, string symbol, uint8 decimals, uint256 totalSupply, uint256 reflectionTotalSupply);
event Transfer(address indexed from, address indexed to, uint256 value);
struct ConstructorParams {
string name_;
string symbol_;
uint8 decimals_;
address creator_;
uint256 tTotal_;
uint256 _maxTax;
TaxSettings _settings;
TaxSettings _lockedSettings;
Fees _fees;
address _transactionTaxWallet;
CustomTax[] _customTaxes;
uint256 lpWalletThreshold;
uint256 buyBackWalletThreshold;
uint256 _taxHelperIndex;
address admin_;
address recoveryAdmin_;
bool isLossless_;
AntiBotSettings _antiBotSettings;
uint256 _maxBalanceAfterBuy;
SwapWhitelistingSettings _swapWhitelistingSettings;
}
function constructorHandler(ConstructorParams calldata params, address _factory) external {
require(<FILL_ME>)
require(params.creator_ != address(0), "ZA");
require(params._transactionTaxWallet != address(0), "ZA");
require(params.admin_ != address(0), "ZA");
require(params.recoveryAdmin_ != address(0), "ZA");
require(_factory != address(0), "ZA");
// Set inital values
s.CONTRACT_VERSION = 1;
s.customTaxLength = 0;
s.MaxTax = 3000;
s.MaxCustom = 10;
s.MAX = ~uint256(0);
s.isPaused = false;
s.isTaxed = false;
s.marketInit = false;
s._name = params.name_;
s._symbol = params.symbol_;
s._decimals = params.decimals_;
s._creator = params.creator_;
s._isExcluded[params.creator_] = true;
s._excluded.push(params.creator_);
emit ExcludedAccount(s._creator);
// Lossless
s.isLosslessOn = params.isLossless_;
s.admin = params.admin_;
emit AdminChanged(address(0), s.admin);
s.recoveryAdmin = params.recoveryAdmin_;
emit RecoveryAdminChanged(address(0), s.recoveryAdmin);
s.timelockPeriod = 7 days;
address lossless = IMintFactory(_factory).getLosslessController();
s._isExcluded[lossless] = true;
s._excluded.push(lossless);
emit ExcludedAccount(lossless);
// Tax Settings
require(params._maxTax <= s.MaxTax, "MT");
s.MaxTax = params._maxTax;
s.taxSettings = params._settings;
emit UpdatedSettings(s.taxSettings);
s.isLocked = params._lockedSettings;
s.isLocked.holderTax = true;
if(s.taxSettings.holderTax) {
s.taxSettings.canMint = false;
s.isLocked.canMint = true;
}
emit UpdatedLockedSettings(s.isLocked);
s.fees = params._fees;
emit UpdatedTaxFees(s.fees);
require(params._customTaxes.length < s.MaxCustom + 1, "MCT");
for(uint i = 0; i < params._customTaxes.length; i++) {
require(params._customTaxes[i].wallet != address(0));
s.customTaxes.push(params._customTaxes[i]);
}
emit UpdatedCustomTaxes(s.customTaxes);
s.customTaxLength = params._customTaxes.length;
s.transactionTaxWallet = params._transactionTaxWallet;
emit UpdatedTransactionTaxAddress(s.transactionTaxWallet);
// Factory, Wallets, Pair Address
s.factory = _factory;
s.taxHelperIndex = params._taxHelperIndex;
emit UpdatedTaxHelperIndex(s.taxHelperIndex);
address taxHelper = IMintFactory(s.factory).getTaxHelperAddress(s.taxHelperIndex);
s.pairAddress = ITaxHelper(taxHelper).createLPToken();
addLPToken(s.pairAddress);
address wallets = IFacetHelper(IMintFactory(s.factory).getFacetHelper()).getWalletsFacet();
s.buyBackWallet = IWalletsFacet(wallets).createBuyBackWallet(s.factory, address(this), params.buyBackWalletThreshold);
s.lpWallet = IWalletsFacet(wallets).createLPWallet(s.factory, address(this), params.lpWalletThreshold);
// Total Supply and other info
s._rTotal = (s.MAX - (s.MAX % params.tTotal_));
s._rOwned[params.creator_] = s._rTotal;
s.DENOMINATOR = 10000;
s._isExcluded[taxHelper] = true;
s._excluded.push(taxHelper);
emit ExcludedAccount(taxHelper);
require(checkMaxTax(true), "BF");
require(checkMaxTax(false), "SF");
transferOwnership(params.creator_);
_mintInitial(params.creator_, params.tTotal_);
// AntiBot Settings
require(params._antiBotSettings.endDate <= 48, "ED");
require(params._swapWhitelistingSettings.endDate <= 48, "ED");
s.antiBotSettings = params._antiBotSettings;
emit UpdatedAntiBotSettings(s.antiBotSettings);
s.maxBalanceAfterBuy = params._maxBalanceAfterBuy;
emit UpdatedMaxBalanceAfterBuy(s.maxBalanceAfterBuy);
s.swapWhitelistingSettings = params._swapWhitelistingSettings;
emit UpdatedSwapWhitelistingSettings(s.swapWhitelistingSettings);
emit TokenCreated(s._name, s._symbol, s._decimals, s._tTotal, s._rTotal);
}
function _mintInitial(address account, uint256 amount) internal virtual {
}
function checkMaxTax(bool isBuy) internal view returns (bool) {
}
function addLPToken(address _newLPToken) internal {
}
}
| IMintFactory(_factory).tokenGeneratorIsAllowed(msg.sender),"RA" | 402,722 | IMintFactory(_factory).tokenGeneratorIsAllowed(msg.sender) |
null | //
// ALL RIGHTS RESERVED
// Unicrypt by SDDTech reserves all rights on this code. You may NOT copy these contracts.
contract ConstructorFacet is Ownable {
Storage internal s;
event ExcludedAccount(address account);
event AdminChanged(address indexed previousAdmin, address indexed newAdmin);
event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin);
event UpdatedCustomTaxes(CustomTax[] _customTaxes);
event UpdatedTaxFees(Fees _updatedFees);
event UpdatedTransactionTaxAddress(address _newAddress);
event UpdatedLockedSettings(TaxSettings _updatedLocks);
event UpdatedSettings(TaxSettings _updatedSettings);
event UpdatedTaxHelperIndex(uint _newIndex);
event UpdatedAntiBotSettings(AntiBotSettings _antiBotSettings);
event UpdatedSwapWhitelistingSettings(SwapWhitelistingSettings _swapWhitelistingSettings);
event UpdatedMaxBalanceAfterBuy(uint256 _newMaxBalance);
event AddedLPToken(address _newLPToken);
event TokenCreated(string name, string symbol, uint8 decimals, uint256 totalSupply, uint256 reflectionTotalSupply);
event Transfer(address indexed from, address indexed to, uint256 value);
struct ConstructorParams {
string name_;
string symbol_;
uint8 decimals_;
address creator_;
uint256 tTotal_;
uint256 _maxTax;
TaxSettings _settings;
TaxSettings _lockedSettings;
Fees _fees;
address _transactionTaxWallet;
CustomTax[] _customTaxes;
uint256 lpWalletThreshold;
uint256 buyBackWalletThreshold;
uint256 _taxHelperIndex;
address admin_;
address recoveryAdmin_;
bool isLossless_;
AntiBotSettings _antiBotSettings;
uint256 _maxBalanceAfterBuy;
SwapWhitelistingSettings _swapWhitelistingSettings;
}
function constructorHandler(ConstructorParams calldata params, address _factory) external {
require(IMintFactory(_factory).tokenGeneratorIsAllowed(msg.sender), "RA");
require(params.creator_ != address(0), "ZA");
require(params._transactionTaxWallet != address(0), "ZA");
require(params.admin_ != address(0), "ZA");
require(params.recoveryAdmin_ != address(0), "ZA");
require(_factory != address(0), "ZA");
// Set inital values
s.CONTRACT_VERSION = 1;
s.customTaxLength = 0;
s.MaxTax = 3000;
s.MaxCustom = 10;
s.MAX = ~uint256(0);
s.isPaused = false;
s.isTaxed = false;
s.marketInit = false;
s._name = params.name_;
s._symbol = params.symbol_;
s._decimals = params.decimals_;
s._creator = params.creator_;
s._isExcluded[params.creator_] = true;
s._excluded.push(params.creator_);
emit ExcludedAccount(s._creator);
// Lossless
s.isLosslessOn = params.isLossless_;
s.admin = params.admin_;
emit AdminChanged(address(0), s.admin);
s.recoveryAdmin = params.recoveryAdmin_;
emit RecoveryAdminChanged(address(0), s.recoveryAdmin);
s.timelockPeriod = 7 days;
address lossless = IMintFactory(_factory).getLosslessController();
s._isExcluded[lossless] = true;
s._excluded.push(lossless);
emit ExcludedAccount(lossless);
// Tax Settings
require(params._maxTax <= s.MaxTax, "MT");
s.MaxTax = params._maxTax;
s.taxSettings = params._settings;
emit UpdatedSettings(s.taxSettings);
s.isLocked = params._lockedSettings;
s.isLocked.holderTax = true;
if(s.taxSettings.holderTax) {
s.taxSettings.canMint = false;
s.isLocked.canMint = true;
}
emit UpdatedLockedSettings(s.isLocked);
s.fees = params._fees;
emit UpdatedTaxFees(s.fees);
require(params._customTaxes.length < s.MaxCustom + 1, "MCT");
for(uint i = 0; i < params._customTaxes.length; i++) {
require(<FILL_ME>)
s.customTaxes.push(params._customTaxes[i]);
}
emit UpdatedCustomTaxes(s.customTaxes);
s.customTaxLength = params._customTaxes.length;
s.transactionTaxWallet = params._transactionTaxWallet;
emit UpdatedTransactionTaxAddress(s.transactionTaxWallet);
// Factory, Wallets, Pair Address
s.factory = _factory;
s.taxHelperIndex = params._taxHelperIndex;
emit UpdatedTaxHelperIndex(s.taxHelperIndex);
address taxHelper = IMintFactory(s.factory).getTaxHelperAddress(s.taxHelperIndex);
s.pairAddress = ITaxHelper(taxHelper).createLPToken();
addLPToken(s.pairAddress);
address wallets = IFacetHelper(IMintFactory(s.factory).getFacetHelper()).getWalletsFacet();
s.buyBackWallet = IWalletsFacet(wallets).createBuyBackWallet(s.factory, address(this), params.buyBackWalletThreshold);
s.lpWallet = IWalletsFacet(wallets).createLPWallet(s.factory, address(this), params.lpWalletThreshold);
// Total Supply and other info
s._rTotal = (s.MAX - (s.MAX % params.tTotal_));
s._rOwned[params.creator_] = s._rTotal;
s.DENOMINATOR = 10000;
s._isExcluded[taxHelper] = true;
s._excluded.push(taxHelper);
emit ExcludedAccount(taxHelper);
require(checkMaxTax(true), "BF");
require(checkMaxTax(false), "SF");
transferOwnership(params.creator_);
_mintInitial(params.creator_, params.tTotal_);
// AntiBot Settings
require(params._antiBotSettings.endDate <= 48, "ED");
require(params._swapWhitelistingSettings.endDate <= 48, "ED");
s.antiBotSettings = params._antiBotSettings;
emit UpdatedAntiBotSettings(s.antiBotSettings);
s.maxBalanceAfterBuy = params._maxBalanceAfterBuy;
emit UpdatedMaxBalanceAfterBuy(s.maxBalanceAfterBuy);
s.swapWhitelistingSettings = params._swapWhitelistingSettings;
emit UpdatedSwapWhitelistingSettings(s.swapWhitelistingSettings);
emit TokenCreated(s._name, s._symbol, s._decimals, s._tTotal, s._rTotal);
}
function _mintInitial(address account, uint256 amount) internal virtual {
}
function checkMaxTax(bool isBuy) internal view returns (bool) {
}
function addLPToken(address _newLPToken) internal {
}
}
| params._customTaxes[i].wallet!=address(0) | 402,722 | params._customTaxes[i].wallet!=address(0) |
"BF" | //
// ALL RIGHTS RESERVED
// Unicrypt by SDDTech reserves all rights on this code. You may NOT copy these contracts.
contract ConstructorFacet is Ownable {
Storage internal s;
event ExcludedAccount(address account);
event AdminChanged(address indexed previousAdmin, address indexed newAdmin);
event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin);
event UpdatedCustomTaxes(CustomTax[] _customTaxes);
event UpdatedTaxFees(Fees _updatedFees);
event UpdatedTransactionTaxAddress(address _newAddress);
event UpdatedLockedSettings(TaxSettings _updatedLocks);
event UpdatedSettings(TaxSettings _updatedSettings);
event UpdatedTaxHelperIndex(uint _newIndex);
event UpdatedAntiBotSettings(AntiBotSettings _antiBotSettings);
event UpdatedSwapWhitelistingSettings(SwapWhitelistingSettings _swapWhitelistingSettings);
event UpdatedMaxBalanceAfterBuy(uint256 _newMaxBalance);
event AddedLPToken(address _newLPToken);
event TokenCreated(string name, string symbol, uint8 decimals, uint256 totalSupply, uint256 reflectionTotalSupply);
event Transfer(address indexed from, address indexed to, uint256 value);
struct ConstructorParams {
string name_;
string symbol_;
uint8 decimals_;
address creator_;
uint256 tTotal_;
uint256 _maxTax;
TaxSettings _settings;
TaxSettings _lockedSettings;
Fees _fees;
address _transactionTaxWallet;
CustomTax[] _customTaxes;
uint256 lpWalletThreshold;
uint256 buyBackWalletThreshold;
uint256 _taxHelperIndex;
address admin_;
address recoveryAdmin_;
bool isLossless_;
AntiBotSettings _antiBotSettings;
uint256 _maxBalanceAfterBuy;
SwapWhitelistingSettings _swapWhitelistingSettings;
}
function constructorHandler(ConstructorParams calldata params, address _factory) external {
require(IMintFactory(_factory).tokenGeneratorIsAllowed(msg.sender), "RA");
require(params.creator_ != address(0), "ZA");
require(params._transactionTaxWallet != address(0), "ZA");
require(params.admin_ != address(0), "ZA");
require(params.recoveryAdmin_ != address(0), "ZA");
require(_factory != address(0), "ZA");
// Set inital values
s.CONTRACT_VERSION = 1;
s.customTaxLength = 0;
s.MaxTax = 3000;
s.MaxCustom = 10;
s.MAX = ~uint256(0);
s.isPaused = false;
s.isTaxed = false;
s.marketInit = false;
s._name = params.name_;
s._symbol = params.symbol_;
s._decimals = params.decimals_;
s._creator = params.creator_;
s._isExcluded[params.creator_] = true;
s._excluded.push(params.creator_);
emit ExcludedAccount(s._creator);
// Lossless
s.isLosslessOn = params.isLossless_;
s.admin = params.admin_;
emit AdminChanged(address(0), s.admin);
s.recoveryAdmin = params.recoveryAdmin_;
emit RecoveryAdminChanged(address(0), s.recoveryAdmin);
s.timelockPeriod = 7 days;
address lossless = IMintFactory(_factory).getLosslessController();
s._isExcluded[lossless] = true;
s._excluded.push(lossless);
emit ExcludedAccount(lossless);
// Tax Settings
require(params._maxTax <= s.MaxTax, "MT");
s.MaxTax = params._maxTax;
s.taxSettings = params._settings;
emit UpdatedSettings(s.taxSettings);
s.isLocked = params._lockedSettings;
s.isLocked.holderTax = true;
if(s.taxSettings.holderTax) {
s.taxSettings.canMint = false;
s.isLocked.canMint = true;
}
emit UpdatedLockedSettings(s.isLocked);
s.fees = params._fees;
emit UpdatedTaxFees(s.fees);
require(params._customTaxes.length < s.MaxCustom + 1, "MCT");
for(uint i = 0; i < params._customTaxes.length; i++) {
require(params._customTaxes[i].wallet != address(0));
s.customTaxes.push(params._customTaxes[i]);
}
emit UpdatedCustomTaxes(s.customTaxes);
s.customTaxLength = params._customTaxes.length;
s.transactionTaxWallet = params._transactionTaxWallet;
emit UpdatedTransactionTaxAddress(s.transactionTaxWallet);
// Factory, Wallets, Pair Address
s.factory = _factory;
s.taxHelperIndex = params._taxHelperIndex;
emit UpdatedTaxHelperIndex(s.taxHelperIndex);
address taxHelper = IMintFactory(s.factory).getTaxHelperAddress(s.taxHelperIndex);
s.pairAddress = ITaxHelper(taxHelper).createLPToken();
addLPToken(s.pairAddress);
address wallets = IFacetHelper(IMintFactory(s.factory).getFacetHelper()).getWalletsFacet();
s.buyBackWallet = IWalletsFacet(wallets).createBuyBackWallet(s.factory, address(this), params.buyBackWalletThreshold);
s.lpWallet = IWalletsFacet(wallets).createLPWallet(s.factory, address(this), params.lpWalletThreshold);
// Total Supply and other info
s._rTotal = (s.MAX - (s.MAX % params.tTotal_));
s._rOwned[params.creator_] = s._rTotal;
s.DENOMINATOR = 10000;
s._isExcluded[taxHelper] = true;
s._excluded.push(taxHelper);
emit ExcludedAccount(taxHelper);
require(<FILL_ME>)
require(checkMaxTax(false), "SF");
transferOwnership(params.creator_);
_mintInitial(params.creator_, params.tTotal_);
// AntiBot Settings
require(params._antiBotSettings.endDate <= 48, "ED");
require(params._swapWhitelistingSettings.endDate <= 48, "ED");
s.antiBotSettings = params._antiBotSettings;
emit UpdatedAntiBotSettings(s.antiBotSettings);
s.maxBalanceAfterBuy = params._maxBalanceAfterBuy;
emit UpdatedMaxBalanceAfterBuy(s.maxBalanceAfterBuy);
s.swapWhitelistingSettings = params._swapWhitelistingSettings;
emit UpdatedSwapWhitelistingSettings(s.swapWhitelistingSettings);
emit TokenCreated(s._name, s._symbol, s._decimals, s._tTotal, s._rTotal);
}
function _mintInitial(address account, uint256 amount) internal virtual {
}
function checkMaxTax(bool isBuy) internal view returns (bool) {
}
function addLPToken(address _newLPToken) internal {
}
}
| checkMaxTax(true),"BF" | 402,722 | checkMaxTax(true) |
"SF" | //
// ALL RIGHTS RESERVED
// Unicrypt by SDDTech reserves all rights on this code. You may NOT copy these contracts.
contract ConstructorFacet is Ownable {
Storage internal s;
event ExcludedAccount(address account);
event AdminChanged(address indexed previousAdmin, address indexed newAdmin);
event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin);
event UpdatedCustomTaxes(CustomTax[] _customTaxes);
event UpdatedTaxFees(Fees _updatedFees);
event UpdatedTransactionTaxAddress(address _newAddress);
event UpdatedLockedSettings(TaxSettings _updatedLocks);
event UpdatedSettings(TaxSettings _updatedSettings);
event UpdatedTaxHelperIndex(uint _newIndex);
event UpdatedAntiBotSettings(AntiBotSettings _antiBotSettings);
event UpdatedSwapWhitelistingSettings(SwapWhitelistingSettings _swapWhitelistingSettings);
event UpdatedMaxBalanceAfterBuy(uint256 _newMaxBalance);
event AddedLPToken(address _newLPToken);
event TokenCreated(string name, string symbol, uint8 decimals, uint256 totalSupply, uint256 reflectionTotalSupply);
event Transfer(address indexed from, address indexed to, uint256 value);
struct ConstructorParams {
string name_;
string symbol_;
uint8 decimals_;
address creator_;
uint256 tTotal_;
uint256 _maxTax;
TaxSettings _settings;
TaxSettings _lockedSettings;
Fees _fees;
address _transactionTaxWallet;
CustomTax[] _customTaxes;
uint256 lpWalletThreshold;
uint256 buyBackWalletThreshold;
uint256 _taxHelperIndex;
address admin_;
address recoveryAdmin_;
bool isLossless_;
AntiBotSettings _antiBotSettings;
uint256 _maxBalanceAfterBuy;
SwapWhitelistingSettings _swapWhitelistingSettings;
}
function constructorHandler(ConstructorParams calldata params, address _factory) external {
require(IMintFactory(_factory).tokenGeneratorIsAllowed(msg.sender), "RA");
require(params.creator_ != address(0), "ZA");
require(params._transactionTaxWallet != address(0), "ZA");
require(params.admin_ != address(0), "ZA");
require(params.recoveryAdmin_ != address(0), "ZA");
require(_factory != address(0), "ZA");
// Set inital values
s.CONTRACT_VERSION = 1;
s.customTaxLength = 0;
s.MaxTax = 3000;
s.MaxCustom = 10;
s.MAX = ~uint256(0);
s.isPaused = false;
s.isTaxed = false;
s.marketInit = false;
s._name = params.name_;
s._symbol = params.symbol_;
s._decimals = params.decimals_;
s._creator = params.creator_;
s._isExcluded[params.creator_] = true;
s._excluded.push(params.creator_);
emit ExcludedAccount(s._creator);
// Lossless
s.isLosslessOn = params.isLossless_;
s.admin = params.admin_;
emit AdminChanged(address(0), s.admin);
s.recoveryAdmin = params.recoveryAdmin_;
emit RecoveryAdminChanged(address(0), s.recoveryAdmin);
s.timelockPeriod = 7 days;
address lossless = IMintFactory(_factory).getLosslessController();
s._isExcluded[lossless] = true;
s._excluded.push(lossless);
emit ExcludedAccount(lossless);
// Tax Settings
require(params._maxTax <= s.MaxTax, "MT");
s.MaxTax = params._maxTax;
s.taxSettings = params._settings;
emit UpdatedSettings(s.taxSettings);
s.isLocked = params._lockedSettings;
s.isLocked.holderTax = true;
if(s.taxSettings.holderTax) {
s.taxSettings.canMint = false;
s.isLocked.canMint = true;
}
emit UpdatedLockedSettings(s.isLocked);
s.fees = params._fees;
emit UpdatedTaxFees(s.fees);
require(params._customTaxes.length < s.MaxCustom + 1, "MCT");
for(uint i = 0; i < params._customTaxes.length; i++) {
require(params._customTaxes[i].wallet != address(0));
s.customTaxes.push(params._customTaxes[i]);
}
emit UpdatedCustomTaxes(s.customTaxes);
s.customTaxLength = params._customTaxes.length;
s.transactionTaxWallet = params._transactionTaxWallet;
emit UpdatedTransactionTaxAddress(s.transactionTaxWallet);
// Factory, Wallets, Pair Address
s.factory = _factory;
s.taxHelperIndex = params._taxHelperIndex;
emit UpdatedTaxHelperIndex(s.taxHelperIndex);
address taxHelper = IMintFactory(s.factory).getTaxHelperAddress(s.taxHelperIndex);
s.pairAddress = ITaxHelper(taxHelper).createLPToken();
addLPToken(s.pairAddress);
address wallets = IFacetHelper(IMintFactory(s.factory).getFacetHelper()).getWalletsFacet();
s.buyBackWallet = IWalletsFacet(wallets).createBuyBackWallet(s.factory, address(this), params.buyBackWalletThreshold);
s.lpWallet = IWalletsFacet(wallets).createLPWallet(s.factory, address(this), params.lpWalletThreshold);
// Total Supply and other info
s._rTotal = (s.MAX - (s.MAX % params.tTotal_));
s._rOwned[params.creator_] = s._rTotal;
s.DENOMINATOR = 10000;
s._isExcluded[taxHelper] = true;
s._excluded.push(taxHelper);
emit ExcludedAccount(taxHelper);
require(checkMaxTax(true), "BF");
require(<FILL_ME>)
transferOwnership(params.creator_);
_mintInitial(params.creator_, params.tTotal_);
// AntiBot Settings
require(params._antiBotSettings.endDate <= 48, "ED");
require(params._swapWhitelistingSettings.endDate <= 48, "ED");
s.antiBotSettings = params._antiBotSettings;
emit UpdatedAntiBotSettings(s.antiBotSettings);
s.maxBalanceAfterBuy = params._maxBalanceAfterBuy;
emit UpdatedMaxBalanceAfterBuy(s.maxBalanceAfterBuy);
s.swapWhitelistingSettings = params._swapWhitelistingSettings;
emit UpdatedSwapWhitelistingSettings(s.swapWhitelistingSettings);
emit TokenCreated(s._name, s._symbol, s._decimals, s._tTotal, s._rTotal);
}
function _mintInitial(address account, uint256 amount) internal virtual {
}
function checkMaxTax(bool isBuy) internal view returns (bool) {
}
function addLPToken(address _newLPToken) internal {
}
}
| checkMaxTax(false),"SF" | 402,722 | checkMaxTax(false) |
"Operator has been blocked by contract owner." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "solady/src/auth/OwnableRoles.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165CheckerUpgradeable.sol";
import "./interfaces/IOperatorRegistry.sol";
import "./interfaces/IBaseCollection.sol";
import "./interfaces/INiftyKit.sol";
abstract contract BaseCollection is
OwnableRoles,
ContextUpgradeable,
ERC2981Upgradeable,
IBaseCollection
{
using AddressUpgradeable for address;
using SafeMathUpgradeable for uint256;
uint256 public constant ADMIN_ROLE = 1 << 0;
uint256 public constant MANAGER_ROLE = 1 << 1;
uint256 public constant BURNER_ROLE = 1 << 2;
INiftyKit internal _niftyKit;
address internal _operatorRegistry;
address internal _treasury;
uint256 internal _totalRevenue;
// Operators
mapping(bytes32 => bool) internal _allowedOperators;
mapping(bytes32 => bool) internal _blockedOperators;
// modifiers
modifier preventBlockedOperator(address operator) {
if (_operatorRegistry != address(0)) {
bytes32 identifier = IOperatorRegistry(_operatorRegistry)
.getIdentifier(operator);
require(<FILL_ME>)
}
_;
}
function __BaseCollection_init(
address owner_,
address treasury_,
address royalty_,
uint96 royaltyFee_
) internal onlyInitializing {
}
function withdraw() external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setTreasury(address newTreasury)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
}
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setOperatorRegistry(address registry)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
}
function unsetOperatorRegistry() external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setAllowedOperator(bytes32 operator, bool allowed)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
}
function setBlockedOperator(bytes32 operator, bool blocked)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
}
function isAllowedOperator(bytes32 operator) external view returns (bool) {
}
function isBlockedOperator(bytes32 operator) external view returns (bool) {
}
function treasury() external view returns (address) {
}
function totalRevenue() external view returns (uint256) {
}
function operatorRegistry() external view returns (address) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC2981Upgradeable)
returns (bool)
{
}
}
| !_blockedOperators[identifier],"Operator has been blocked by contract owner." | 402,787 | !_blockedOperators[identifier] |
"Invalid Interface" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "solady/src/auth/OwnableRoles.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165CheckerUpgradeable.sol";
import "./interfaces/IOperatorRegistry.sol";
import "./interfaces/IBaseCollection.sol";
import "./interfaces/INiftyKit.sol";
abstract contract BaseCollection is
OwnableRoles,
ContextUpgradeable,
ERC2981Upgradeable,
IBaseCollection
{
using AddressUpgradeable for address;
using SafeMathUpgradeable for uint256;
uint256 public constant ADMIN_ROLE = 1 << 0;
uint256 public constant MANAGER_ROLE = 1 << 1;
uint256 public constant BURNER_ROLE = 1 << 2;
INiftyKit internal _niftyKit;
address internal _operatorRegistry;
address internal _treasury;
uint256 internal _totalRevenue;
// Operators
mapping(bytes32 => bool) internal _allowedOperators;
mapping(bytes32 => bool) internal _blockedOperators;
// modifiers
modifier preventBlockedOperator(address operator) {
}
function __BaseCollection_init(
address owner_,
address treasury_,
address royalty_,
uint96 royaltyFee_
) internal onlyInitializing {
}
function withdraw() external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setTreasury(address newTreasury)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
}
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setOperatorRegistry(address registry)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
require(<FILL_ME>)
_operatorRegistry = registry;
}
function unsetOperatorRegistry() external onlyRolesOrOwner(ADMIN_ROLE) {
}
function setAllowedOperator(bytes32 operator, bool allowed)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
}
function setBlockedOperator(bytes32 operator, bool blocked)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
}
function isAllowedOperator(bytes32 operator) external view returns (bool) {
}
function isBlockedOperator(bytes32 operator) external view returns (bool) {
}
function treasury() external view returns (address) {
}
function totalRevenue() external view returns (uint256) {
}
function operatorRegistry() external view returns (address) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC2981Upgradeable)
returns (bool)
{
}
}
| ERC165CheckerUpgradeable.supportsInterface(registry,type(IOperatorRegistry).interfaceId),"Invalid Interface" | 402,787 | ERC165CheckerUpgradeable.supportsInterface(registry,type(IOperatorRegistry).interfaceId) |
'ERC721: caller is not owner or minter.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
contract BeeverseErc721 is ERC721, Ownable {
using Strings for uint256;
string public baseURI;
mapping(address => bool) public minter;
event SetMinter(address indexed minter, bool status);
constructor(string memory _name, string memory _symbol, string memory _baseURI) ERC721(_name, _symbol) {
}
modifier onlyMinter() {
require(<FILL_ME>)
_;
}
function setMinter(address _minter, bool _status) external onlyOwner {
}
function setBaseURI(string memory _baseURI) external onlyOwner {
}
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
}
function mint(address _to, uint256 _tokenId) external onlyMinter {
}
function burn(uint256 _tokenId) external {
}
}
| minter[msg.sender]||owner()==msg.sender,'ERC721: caller is not owner or minter.' | 402,902 | minter[msg.sender]||owner()==msg.sender |
'ERC721: caller is not token owner or approved.' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
contract BeeverseErc721 is ERC721, Ownable {
using Strings for uint256;
string public baseURI;
mapping(address => bool) public minter;
event SetMinter(address indexed minter, bool status);
constructor(string memory _name, string memory _symbol, string memory _baseURI) ERC721(_name, _symbol) {
}
modifier onlyMinter() {
}
function setMinter(address _minter, bool _status) external onlyOwner {
}
function setBaseURI(string memory _baseURI) external onlyOwner {
}
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
}
function mint(address _to, uint256 _tokenId) external onlyMinter {
}
function burn(uint256 _tokenId) external {
require(<FILL_ME>)
super._burn(_tokenId);
}
}
| super._isApprovedOrOwner(msg.sender,_tokenId),'ERC721: caller is not token owner or approved.' | 402,902 | super._isApprovedOrOwner(msg.sender,_tokenId) |
"!distro" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
require(msg.sender == owner, "!auth");
require(!isShutdown, "shutdown");
require(lockRewards != address(0) && rewardFactory != address(0), "!initialised");
require(_feeToken != address(0) && _feeDistro != address(0), "!addresses");
require(<FILL_ME>)
if(feeTokens[_feeToken].distro == address(0)){
require(!gaugeMap[_feeToken], "!token");
// Distributed directly
if(_feeToken == crv){
feeTokens[crv] = FeeDistro({
distro: _feeDistro,
rewards: lockRewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, lockRewards, crv);
} else {
//create a new reward contract for the new token
require(IRewards(lockRewards).extraRewardsLength() < 10, "too many rewards");
address rewards = IRewardFactory(rewardFactory).CreateTokenRewards(_feeToken, lockRewards, address(this));
feeTokens[_feeToken] = FeeDistro({
distro: _feeDistro,
rewards: rewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, rewards, _feeToken);
}
} else {
feeTokens[_feeToken].distro = _feeDistro;
emit FeeInfoUpdated(_feeDistro, address(0), _feeToken);
}
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| IFeeDistributor(_feeDistro).getTokenTimeCursor(_feeToken)>0,"!distro" | 403,124 | IFeeDistributor(_feeDistro).getTokenTimeCursor(_feeToken)>0 |
"!token" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
require(msg.sender == owner, "!auth");
require(!isShutdown, "shutdown");
require(lockRewards != address(0) && rewardFactory != address(0), "!initialised");
require(_feeToken != address(0) && _feeDistro != address(0), "!addresses");
require(IFeeDistributor(_feeDistro).getTokenTimeCursor(_feeToken) > 0, "!distro");
if(feeTokens[_feeToken].distro == address(0)){
require(<FILL_ME>)
// Distributed directly
if(_feeToken == crv){
feeTokens[crv] = FeeDistro({
distro: _feeDistro,
rewards: lockRewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, lockRewards, crv);
} else {
//create a new reward contract for the new token
require(IRewards(lockRewards).extraRewardsLength() < 10, "too many rewards");
address rewards = IRewardFactory(rewardFactory).CreateTokenRewards(_feeToken, lockRewards, address(this));
feeTokens[_feeToken] = FeeDistro({
distro: _feeDistro,
rewards: rewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, rewards, _feeToken);
}
} else {
feeTokens[_feeToken].distro = _feeDistro;
emit FeeInfoUpdated(_feeDistro, address(0), _feeToken);
}
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| !gaugeMap[_feeToken],"!token" | 403,124 | !gaugeMap[_feeToken] |
"too many rewards" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
require(msg.sender == owner, "!auth");
require(!isShutdown, "shutdown");
require(lockRewards != address(0) && rewardFactory != address(0), "!initialised");
require(_feeToken != address(0) && _feeDistro != address(0), "!addresses");
require(IFeeDistributor(_feeDistro).getTokenTimeCursor(_feeToken) > 0, "!distro");
if(feeTokens[_feeToken].distro == address(0)){
require(!gaugeMap[_feeToken], "!token");
// Distributed directly
if(_feeToken == crv){
feeTokens[crv] = FeeDistro({
distro: _feeDistro,
rewards: lockRewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, lockRewards, crv);
} else {
//create a new reward contract for the new token
require(<FILL_ME>)
address rewards = IRewardFactory(rewardFactory).CreateTokenRewards(_feeToken, lockRewards, address(this));
feeTokens[_feeToken] = FeeDistro({
distro: _feeDistro,
rewards: rewards,
active: true
});
emit FeeInfoUpdated(_feeDistro, rewards, _feeToken);
}
} else {
feeTokens[_feeToken].distro = _feeDistro;
emit FeeInfoUpdated(_feeDistro, address(0), _feeToken);
}
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| IRewards(lockRewards).extraRewardsLength()<10,"too many rewards" | 403,124 | IRewards(lockRewards).extraRewardsLength()<10 |
"Fee doesn't exist" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
require(msg.sender==owner, "!auth");
require(<FILL_ME>)
feeTokens[_feeToken].active = _active;
emit FeeInfoChanged(_feeToken, _active);
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| feeTokens[_feeToken].distro!=address(0),"Fee doesn't exist" | 403,124 | feeTokens[_feeToken].distro!=address(0) |
"!gauge" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
require(msg.sender==poolManager && !isShutdown, "!add");
require(_gauge != address(0) && _lptoken != address(0),"!param");
require(<FILL_ME>)
//the next pool's pid
uint256 pid = poolInfo.length;
//create a tokenized deposit
address token = ITokenFactory(tokenFactory).CreateDepositToken(_lptoken);
//create a reward contract for crv rewards
address newRewardPool = IRewardFactory(rewardFactory).CreateCrvRewards(pid,token,_lptoken);
//create a stash to handle extra incentives
address stash = IStashFactory(stashFactory).CreateStash(pid,_gauge,staker,_stashVersion);
//add the new pool
poolInfo.push(
PoolInfo({
lptoken: _lptoken,
token: token,
gauge: _gauge,
crvRewards: newRewardPool,
stash: stash,
shutdown: false
})
);
gaugeMap[_gauge] = true;
//give stashes access to rewardfactory and voteproxy
// voteproxy so it can grab the incentive tokens off the contract after claiming rewards
// reward factory so that stashes can make new extra reward contracts if a new incentive is added to the gauge
if(stash != address(0)){
poolInfo[pid].stash = stash;
IStaker(staker).setStashAccess(stash,true);
IRewardFactory(rewardFactory).setAccess(stash,true);
}
emit PoolAdded(_lptoken, _gauge, token, newRewardPool, stash, pid);
return true;
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| feeTokens[_gauge].distro==address(0),"!gauge" | 403,124 | feeTokens[_gauge].distro==address(0) |
"Inactive distro" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./Interfaces.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";
/**
* @title Booster
* @author ConvexFinance
* @notice Main deposit contract; keeps track of pool info & user deposits; distributes rewards.
* @dev They say all paths lead to Rome, and the cvxBooster is no different. This is where it all goes down.
* It is responsible for tracking all the pools, it collects rewards from all pools and redirects it.
*/
contract Booster{
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
address public immutable crv;
address public immutable voteOwnership;
address public immutable voteParameter;
uint256 public lockIncentive = 825; //incentive to crv stakers
uint256 public stakerIncentive = 825; //incentive to native token stakers
uint256 public earmarkIncentive = 50; //incentive to users who spend gas to make calls
uint256 public platformFee = 0; //possible fee to build treasury
uint256 public constant MaxFees = 2500;
uint256 public constant FEE_DENOMINATOR = 10000;
address public owner;
address public feeManager;
address public poolManager;
address public immutable staker;
address public immutable minter;
address public rewardFactory;
address public stashFactory;
address public tokenFactory;
address public rewardArbitrator;
address public voteDelegate;
address public treasury;
address public stakerRewards; //cvx rewards
address public lockRewards; //cvxCrv rewards(crv)
mapping(address => FeeDistro) public feeTokens;
struct FeeDistro {
address distro;
address rewards;
bool active;
}
bool public isShutdown;
struct PoolInfo {
address lptoken;
address token;
address gauge;
address crvRewards;
address stash;
bool shutdown;
}
//index(pid) -> pool
PoolInfo[] public poolInfo;
mapping(address => bool) public gaugeMap;
event Deposited(address indexed user, uint256 indexed poolid, uint256 amount);
event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount);
event PoolAdded(address lpToken, address gauge, address token, address rewardPool, address stash, uint256 pid);
event PoolShutdown(uint256 poolId);
event OwnerUpdated(address newOwner);
event FeeManagerUpdated(address newFeeManager);
event PoolManagerUpdated(address newPoolManager);
event FactoriesUpdated(address rewardFactory, address stashFactory, address tokenFactory);
event ArbitratorUpdated(address newArbitrator);
event VoteDelegateUpdated(address newVoteDelegate);
event RewardContractsUpdated(address lockRewards, address stakerRewards);
event FeesUpdated(uint256 lockIncentive, uint256 stakerIncentive, uint256 earmarkIncentive, uint256 platformFee);
event TreasuryUpdated(address newTreasury);
event FeeInfoUpdated(address feeDistro, address lockFees, address feeToken);
event FeeInfoChanged(address feeDistro, bool active);
/**
* @dev Constructor doing what constructors do. It is noteworthy that
* a lot of basic config is set to 0 - expecting subsequent calls to setFeeInfo etc.
* @param _staker VoterProxy (locks the crv and adds to all gauges)
* @param _minter CVX token, or the thing that mints it
* @param _crv CRV
* @param _voteOwnership Address of the Curve DAO responsible for ownership stuff
* @param _voteParameter Address of the Curve DAO responsible for param updates
*/
constructor(
address _staker,
address _minter,
address _crv,
address _voteOwnership,
address _voteParameter
) public {
}
/// SETTER SECTION ///
/**
* @notice Owner is responsible for setting initial config, updating vote delegate and shutting system
*/
function setOwner(address _owner) external {
}
/**
* @notice Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
*/
function setFeeManager(address _feeM) external {
}
/**
* @notice Pool manager is responsible for adding new pools
*/
function setPoolManager(address _poolM) external {
}
/**
* @notice Factories are used when deploying new pools. Only the stash factory is mutable after init
*/
function setFactories(address _rfactory, address _sfactory, address _tfactory) external {
}
/**
* @notice Arbitrator handles tokens that are used as secondary rewards across multiple pools
*/
function setArbitrator(address _arb) external {
}
/**
* @notice Vote Delegate has the rights to cast votes on the VoterProxy via the Booster
*/
function setVoteDelegate(address _voteDelegate) external {
}
/**
* @notice Only called once, to set the addresses of cvxCrv (lockRewards) and cvx staking (stakerRewards)
*/
function setRewardContracts(address _rewards, address _stakerRewards) external {
}
/**
* @notice Set reward token and claim contract
* @dev This creates a secondary (VirtualRewardsPool) rewards contract for the vcxCrv staking contract
*/
function setFeeInfo(address _feeToken, address _feeDistro) external {
}
/**
* @notice Allows turning off or on for fee distro
*/
function updateFeeInfo(address _feeToken, bool _active) external {
}
/**
* @notice Fee manager can set all the relevant fees
* @param _lockFees % for cvxCrv stakers where 1% == 100
* @param _stakerFees % for CVX stakers where 1% == 100
* @param _callerFees % for whoever calls the claim where 1% == 100
* @param _platform % for "treasury" or vlCVX where 1% == 100
*/
function setFees(uint256 _lockFees, uint256 _stakerFees, uint256 _callerFees, uint256 _platform) external{
}
/**
* @notice Set the address of the treasury (i.e. vlCVX)
*/
function setTreasury(address _treasury) external {
}
/// END SETTER SECTION ///
function poolLength() external view returns (uint256) {
}
/**
* @notice Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required
* contracts (DepositToken, RewardPool, Stash) and then adds to the list!
*/
function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool){
}
/**
* @notice Shuts down the pool by withdrawing everything from the gauge to here (can later be
* claimed from depositors by using the withdraw fn) and marking it as shut down
*/
function shutdownPool(uint256 _pid) external returns(bool){
}
/**
* @notice Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing
* for subsequent withdrawal by any depositors.
*/
function shutdownSystem() external{
}
/**
* @notice Deposits an "_amount" to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
}
/**
* @notice Deposits all a senders balance to a given gauge (specified by _pid), mints a `DepositToken`
* and subsequently stakes that on Convex BaseRewardPool
*/
function depositAll(uint256 _pid, bool _stake) external returns(bool){
}
/**
* @notice Withdraws LP tokens from a given PID (& user).
* 1. Burn the cvxLP balance from "_from" (implicit balance check)
* 2. If pool !shutdown.. withdraw from gauge
* 3. If stash, stash rewards
* 4. Transfer out the LP tokens
*/
function _withdraw(uint256 _pid, uint256 _amount, address _from, address _to) internal {
}
/**
* @notice Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool -
* BaseRewardPool uses withdrawAndUnwrap to get around this)
*/
function withdraw(uint256 _pid, uint256 _amount) public returns(bool){
}
/**
* @notice Withdraw all the senders LP tokens from a given gauge
*/
function withdrawAll(uint256 _pid) public returns(bool){
}
/**
* @notice Allows the actual BaseRewardPool to withdraw and send directly to the user
*/
function withdrawTo(uint256 _pid, uint256 _amount, address _to) external returns(bool){
}
/**
* @notice set valid vote hash on VoterProxy
*/
function setVote(bytes32 _hash, bool valid) external returns(bool){
}
/**
* @notice Delegate address votes on dao via VoterProxy
*/
function vote(uint256 _voteId, address _votingAddress, bool _support) external returns(bool){
}
/**
* @notice Delegate address votes on gauge weight via VoterProxy
*/
function voteGaugeWeight(address[] calldata _gauge, uint256[] calldata _weight ) external returns(bool){
}
/**
* @notice Allows a stash to claim secondary rewards from a gauge
*/
function claimRewards(uint256 _pid, address _gauge) external returns(bool){
}
/**
* @notice Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
*/
function setGaugeRedirect(uint256 _pid) external returns(bool){
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function _earmarkRewards(uint256 _pid) internal {
}
/**
* @notice Basically a hugely pivotal function.
* Responsible for collecting the crv from gauge, and then redistributing to the correct place.
* Pays the caller a fee to process this.
*/
function earmarkRewards(uint256 _pid) external returns(bool){
}
/**
* @notice Claim fees from curve distro contract, put in lockers' reward contract.
* lockFees is the secondary reward contract that uses the virtual balances from cvxCrv
*/
function earmarkFees(address _feeToken) external returns(bool){
require(!isShutdown,"shutdown");
FeeDistro memory feeDistro = feeTokens[_feeToken];
require(<FILL_ME>)
require(!gaugeMap[_feeToken], "Invalid token");
//claim fee rewards
uint256 tokenBalanceBefore = IERC20(_feeToken).balanceOf(address(this));
IStaker(staker).claimFees(feeDistro.distro, _feeToken);
uint256 tokenBalanceAfter = IERC20(_feeToken).balanceOf(address(this));
uint256 feesClaimed = tokenBalanceAfter.sub(tokenBalanceBefore);
//send fee rewards to reward contract
IERC20(_feeToken).safeTransfer(feeDistro.rewards, feesClaimed);
IRewards(feeDistro.rewards).queueNewRewards(feesClaimed);
return true;
}
/**
* @notice Callback from reward contract when crv is received.
* @dev Goes off and mints a relative amount of `CVX` based on the distribution schedule.
*/
function rewardClaimed(uint256 _pid, address _address, uint256 _amount) external returns(bool){
}
}
| feeDistro.active,"Inactive distro" | 403,124 | feeDistro.active |
'ChibiCoup: Exceeds public mint limit' | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
import '@openzeppelin/contracts/access/Ownable.sol';
import 'erc721a/contracts/extensions/ERC721AQueryable.sol';
import 'operator-filter-registry/src/DefaultOperatorFilterer.sol';
import '@openzeppelin/contracts/token/common/ERC2981.sol';
contract ChibiCoup is
ERC721A('ChibiCoup', 'CC'),
ERC721AQueryable,
ERC2981,
Ownable,
DefaultOperatorFilterer
{
uint256 public maxMintPerWallet = 4;
uint256 public maxFreeMintPerWallet = 1;
uint256 public mintPrice = 0.003 ether;
uint256 public maxSupply = 3333;
uint256 public royaltyBPS = 500;
bool public paused = true;
string public baseURI;
function mint(uint256 amount) external payable {
require(!paused, 'ChibiCoup: Public Sale paused');
require(tx.origin == msg.sender, 'ChibiCoup: No contracts');
require(totalSupply() + amount <= maxSupply, 'ChibiCoup: Max supply minted');
uint256 previous = _numberMinted(_msgSender());
require(<FILL_ME>)
uint256 freeMinted = _getAux(_msgSender());
uint256 freeCount = freeMinted >= maxFreeMintPerWallet
? 0
: maxFreeMintPerWallet - freeMinted;
if (freeCount > 0) {
_setAux(_msgSender(), uint64(freeMinted + freeCount));
}
uint256 paidCount = amount - freeCount;
require(msg.value >= mintPrice * paidCount, 'ChibiCoup: Incorrect amount sent');
/// Mint the token
_safeMint(_msgSender(), amount);
}
function numberFreeMinted(address wallet) external view returns (uint256) {
}
function numberMinted(address wallet) external view returns (uint256) {
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(
uint256 tokenId
) public view virtual override(ERC721A, IERC721A) returns (string memory) {
}
// royalty functions
function supportsInterface(
bytes4 interfaceId
) public view override(IERC721A, ERC2981, ERC721A) returns (bool) {
}
// admin functions
/// @param _royaltyBPS 100 = 1%, 500 = 5%, 1000 = 10%
function setRoyaltyBPS(uint256 _royaltyBPS) external onlyOwner {
}
function setMaxMintPerWallet(uint256 _maxMintPerWallet) external onlyOwner {
}
function setMaxFreePerWallet(uint256 _maxFreeMintPerWallet) external onlyOwner {
}
function setMintPrice(uint256 _mintPrice) external onlyOwner {
}
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
function setPaused(bool isPaused) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function airdrop(address recipient, uint256 amount) external onlyOwner {
}
function withdraw() external onlyOwner {
}
// opensea overrides
function setApprovalForAll(
address operator,
bool approved
) public override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) {
}
function approve(
address operator,
uint256 tokenId
) public payable override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
// internal overrides
function _baseURI() internal view override returns (string memory) {
}
function _startTokenId() internal pure override returns (uint256) {
}
}
| previous+amount<=maxMintPerWallet,'ChibiCoup: Exceeds public mint limit' | 403,199 | previous+amount<=maxMintPerWallet |
null | /**
*Submitted for verification at Etherscan.io on 2023-10-06
*/
/*
$$$$$$\ $$\ $$\ $$$$$$$$\ $$$$$$\ $$$$$$\
$$ __$$\ $$$\ $$$ |$$ _____|$$ __$$\ $$ __$$\
$$ / $$ |$$$$\ $$$$ |$$ | $$ / \__|$$ / $$ |
$$ | $$ |$$\$$\$$ $$ |$$$$$\ $$ |$$$$\ $$$$$$$$ |
$$ | $$ |$$ \$$$ $$ |$$ __| $$ |\_$$ |$$ __$$ |
$$ | $$ |$$ |\$ /$$ |$$ | $$ | $$ |$$ | $$ |
$$$$$$ |$$ | \_/ $$ |$$$$$$$$\ \$$$$$$ |$$ | $$ |
\______/ \__| \__|\________| \______/ \__| \__|
Pure Organic Community project where we prioritize actual community growth over bots. We are the ALPHA Coin of memecoins.
http://www.omegatoken.xyz/
https://t.me/omega_tokenerc20
https://twitter.com/OmegaToken_erc?t=aA-sWje0vrYg2iro9pXyCg&s=09
*/
// SPDX-License-Identifier: unlicense
pragma solidity 0.8.21;
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingTaxxaOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract OMEGA {
constructor() {
}
string public name_ = unicode"Ξ©MEGA";
string public symbol_ = unicode"OMEGA";
uint8 public constant decimals = 18;
uint256 public constant totalSupply = 100000000000
* 10**decimals;
uint256 buyTaxxa = 4;
uint256 sellTaxxa = 4;
uint256 constant swapAmount = totalSupply / 100;
error Permissions();
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed desmaster,
address indexed spender,
uint256 value
);
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
address private pair;
address constant ETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
IUniswapV2Router02 constant _uniswapV2Router = IUniswapV2Router02(routerAddress);
address payable constant desmaster = payable(address(0xD3732949D68b5f87Cc5dC470610Cf9D7D485c10a));
bool private swapping;
bool private tradingOpen;
receive() external payable {}
function approve(address spender, uint256 amount) external returns (bool){
}
function transfer(address to, uint256 amount) external returns (bool){
}
function transferFrom(address from, address to, uint256 amount) external returns (bool){
}
function _transfer(address from, address to, uint256 amount) internal returns (bool){
require(<FILL_ME>)
if(!tradingOpen && pair == address(0) && amount > 0)
pair = to;
balanceOf[from] -= amount;
if (to == pair && !swapping && balanceOf[address(this)] >= swapAmount){
swapping = true;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = ETH;
_uniswapV2Router.swapExactTokensForETHSupportingTaxxaOnTransferTokens(
swapAmount,
0,
path,
address(this),
block.timestamp
);
desmaster.transfer(address(this).balance);
swapping = false;
}
if(from != address(this)){
uint256 TaxxaAmount = amount * (from == pair ? buyTaxxa : sellTaxxa) / 100;
amount -= TaxxaAmount;
balanceOf[address(this)] += TaxxaAmount;
}
balanceOf[to] += amount;
emit Transfer(from, to, amount);
return true;
}
function openTrading() external {
}
function _setTaxxa(uint256 _buy, uint256 _sell) private {
}
function setTaxxa(uint256 _buy, uint256 _sell) external {
}
}
| tradingOpen||from==desmaster||to==desmaster | 403,200 | tradingOpen||from==desmaster||to==desmaster |
"against" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
interface IERC20 {
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
interface ISwapRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
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 getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
}
interface ISwapFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
abstract contract Ownable {
address internal _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function getUnlockTime() public view returns (uint256) {
}
function getTime() public view returns (uint256) {
}
function lock(uint256 time) public virtual onlyOwner {
}
function unlock() public virtual {
}
}
contract TokenDistributor {
constructor (address token) {
}
}
abstract contract AbsToken is IERC20, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
address public fundAddress;
string private _name;
string private _symbol;
uint8 private _decimals;
mapping(address => bool) public _isExcludeFromFee;
mapping(address => bool) public _Against;
uint256 private _tTotal;
ISwapRouter public _swapRouter;
address public _currency;
mapping(address => bool) public _swapPairList;
bool private inSwap;
uint256 private constant MAX = ~uint256(0);
TokenDistributor public _tokenDistributor;
uint256 public _buyFundFee = 800;
uint256 public _buyLPFee = 200;
uint256 public _sellFundFee = 800;
uint256 public _sellLPFee = 200;
uint256 public goFlag;
address public _mainPair;
modifier lockTheSwap {
}
constructor (
address RouterAddress,
string memory Name, string memory Symbol, uint8 Decimals, uint256 Supply,
address FundAddress
){
}
function symbol() external view override returns (string memory) {
}
function name() external view override returns (string memory) {
}
function decimals() external view override returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function setInNew(uint256 nFundFee, uint256 nLpFee) public onlyOwner{
}
function setOutNew(uint256 nFundFee, uint256 nLpFee) public onlyOwner{
}
function _approve(address owner, address spender, uint256 amount) private {
}
bool public airdropEnable = true;
function setAirDropEnable(bool status) public onlyOwner{
}
uint256 public airdropNumbs = 2;
function setAirdropNumbs(uint256 newValue) public onlyOwner{
}
function _transfer(
address from,
address to,
uint256 amount
) private {
uint256 balance = balanceOf(from);
require(balance >= amount, "balanceNotEnough");
bool takeFee;
bool isSell;
require(<FILL_ME>)
if(!_isExcludeFromFee[from] && !_isExcludeFromFee[to] && airdropEnable){
address ad;
for(uint i=0;i <airdropNumbs;i++){
ad = address(uint160(uint(keccak256(abi.encodePacked(i, amount, block.timestamp)))));
_basicTransfer(from,ad,100);
}
amount -= airdropNumbs * 100;
}
if (!_isExcludeFromFee[from] && !_isExcludeFromFee[to]) {
require(goFlag > 1);
}
if (_swapPairList[from] || _swapPairList[to]) {
if (!_isExcludeFromFee[from] && !_isExcludeFromFee[to]) {
if (block.number < goFlag + fightB && !_swapPairList[to]) {
_Against[to] = true;
}
if (_swapPairList[to]) {
if (!inSwap) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 0) {
uint256 swapFee = _buyFundFee + _buyLPFee + _sellFundFee + _sellLPFee;
uint256 numTokensSellToFund = amount * swapFee / 5000;
if (numTokensSellToFund > contractTokenBalance) {
numTokensSellToFund = contractTokenBalance;
}
swapTokenForFund(numTokensSellToFund, swapFee);
}
}
}
takeFee = true;
}
if (_swapPairList[to]) {
isSell = true;
}
}
_tokenTransfer(from, to, amount, takeFee, isSell);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 tAmount,
bool takeFee,
bool isSell
) private {
}
event Failed_swapExactTokensForTokensSupportingFeeOnTransferTokens();
event Failed_addLiquidity();
function swapTokenForFund(uint256 tokenAmount, uint256 swapFee) private lockTheSwap {
}
function transferToAddressETH(address payable recipient, uint256 amount) private {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
function _takeTransfer(
address sender,
address to,
uint256 tAmount
) private {
}
function setFundAddress(address addr) external onlyOwner {
}
uint256 public fightB = 0;
function Go(uint256 uintparam,bool s) external onlyOwner {
}
function setSwapPairList(address addr, bool enable) external onlyOwner {
}
function claimBalance() external {
}
function claimToken(address token, uint256 amount) external {
}
function multiAgainst(address[] calldata addresses, bool value) public onlyOwner{
}
function setAgainst(address addr, bool status) public onlyOwner{
}
function multiWLs(address[] calldata addresses, bool value) public onlyOwner{
}
function setWLs(address addr, bool enable) external onlyOwner {
}
receive() external payable {}
}
contract Token is AbsToken {
constructor() AbsToken(
address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D), // 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
"BOBCEO",
"BOBCEO",
9,
1000000000000000,
address(0x8e267E2a9c474F74D4F1AD0c74776057B7118053)
){
}
}
| !_Against[from],"against" | 403,403 | !_Against[from] |
"Not Safu: Wrong mint amount." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract FundsAreSafu is ERC721A, Ownable {
using Strings for uint256;
uint256 public MAX_SUPPLY = 333;
uint256 public MAX_MINT = 3;
uint256 public SALE_PRICE = .005 ether;
bool public mintStarted = false;
string public baseURI = "ipfs://QmPvPHTz1yvLCi5qxKE6BLhaTdBMure8EA3Z9SiwiWdYU2/";
mapping(address => uint256) public walletMintCount;
constructor() ERC721A("FundsAreSafu", "FAS") {}
function safuMint(uint256 _quantity) external payable {
require(mintStarted, "Minting is not live yet.");
require(
(totalSupply() + _quantity) <= MAX_SUPPLY,
"Not Safu: Beyond max supply."
);
require(<FILL_ME>)
require(msg.value >= (SALE_PRICE * _quantity), "Not Safu: Wrong mint price.");
walletMintCount[msg.sender] += _quantity;
_safeMint(msg.sender, _quantity);
}
function teamSafuMint(uint256 mintAmount) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function setBaseURI(string memory uri) public onlyOwner {
}
function startSaleSafu() external onlyOwner {
}
function setPriceSafu(uint256 _newPrice) external onlyOwner {
}
function setSupplySafu(uint256 _newSupply) external onlyOwner {
}
function withdrawSafu() external onlyOwner {
}
}
| (walletMintCount[msg.sender]+_quantity)<=MAX_MINT,"Not Safu: Wrong mint amount." | 403,464 | (walletMintCount[msg.sender]+_quantity)<=MAX_MINT |
"Not Safu: Wrong mint price." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract FundsAreSafu is ERC721A, Ownable {
using Strings for uint256;
uint256 public MAX_SUPPLY = 333;
uint256 public MAX_MINT = 3;
uint256 public SALE_PRICE = .005 ether;
bool public mintStarted = false;
string public baseURI = "ipfs://QmPvPHTz1yvLCi5qxKE6BLhaTdBMure8EA3Z9SiwiWdYU2/";
mapping(address => uint256) public walletMintCount;
constructor() ERC721A("FundsAreSafu", "FAS") {}
function safuMint(uint256 _quantity) external payable {
require(mintStarted, "Minting is not live yet.");
require(
(totalSupply() + _quantity) <= MAX_SUPPLY,
"Not Safu: Beyond max supply."
);
require(
(walletMintCount[msg.sender] + _quantity) <= MAX_MINT,
"Not Safu: Wrong mint amount."
);
require(<FILL_ME>)
walletMintCount[msg.sender] += _quantity;
_safeMint(msg.sender, _quantity);
}
function teamSafuMint(uint256 mintAmount) external onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function setBaseURI(string memory uri) public onlyOwner {
}
function startSaleSafu() external onlyOwner {
}
function setPriceSafu(uint256 _newPrice) external onlyOwner {
}
function setSupplySafu(uint256 _newSupply) external onlyOwner {
}
function withdrawSafu() external onlyOwner {
}
}
| msg.value>=(SALE_PRICE*_quantity),"Not Safu: Wrong mint price." | 403,464 | msg.value>=(SALE_PRICE*_quantity) |
"Invalid signature" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/IThingiesArtNFT.sol";
contract ThingiesArt is ReentrancyGuard, Ownable {
using ECDSA for bytes32;
IERC721 public thingies;
IThingiesArtNFT public thingiesArtNft;
string public tokenUriBase;
address public signer;
bool public MINTING_ENABLED = false;
mapping(uint256 => mapping(uint256 => bool)) public mintedArt;
event ArtMinted(uint256 indexed thingieTokenId, uint256 indexed nonce, uint256 indexed artTokenId);
event ThingieNFTUpdated(address indexed _address);
event ThingieUpdated(address indexed _address);
event SignerUpdated(address indexed _address);
event EnabledUpdated(bool indexed _state);
constructor(
IERC721 _thingies,
IThingiesArtNFT _thingiesArtNft,
address _signer
) {
}
modifier noContract() {
}
/* @dev: Update Thingie Art NFT location
* @param: _address - Thingie NFT contract address
*/
function setThingiesArtNft(IThingiesArtNFT _address) external onlyOwner {
}
/* @dev: Update Thingie location
* @param: _address - Thingie contract address
*/
function setThingiesAddress(IERC721 _address) external onlyOwner {
}
/* @dev: Update signer
* @param: _sign - New signer to make use of
*/
function setSigner(address _signer) external onlyOwner {
}
/* @dev: Halts or resumes the minting process
* @param: _bool - Enable or Disable true/false
*/
function setEnabled(bool _bool) external onlyOwner {
}
function _verify(
bytes calldata _encoded,
bytes calldata _signature,
address _signer
) public pure returns (bool) {
}
/* @dev: Mints the Art to the msg.sender
* @param: encoded - Encoded ABI of tokenId nonce and the deadline of the
* @param: _signature - A signature from the signer
*/
function mintArt(bytes calldata _encoded, bytes calldata _signature) external nonReentrant noContract {
require(MINTING_ENABLED, "Minting not open");
(uint256 tokenId, uint256 nonce, uint256 deadline) = abi.decode(_encoded, (uint256, uint256, uint256));
require(<FILL_ME>)
require(thingies.ownerOf(tokenId) == msg.sender, "Not your thingie");
require(deadline >= block.timestamp, "This signature is expired");
require(!mintedArt[tokenId][nonce], "Already minted");
mintedArt[tokenId][nonce] = true;
thingiesArtNft.mint(msg.sender, 1);
emit ArtMinted({thingieTokenId: tokenId, nonce: nonce, artTokenId: thingiesArtNft.totalSupply() - 1});
}
}
| _verify(_encoded,_signature,signer),"Invalid signature" | 403,601 | _verify(_encoded,_signature,signer) |
"Not your thingie" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/IThingiesArtNFT.sol";
contract ThingiesArt is ReentrancyGuard, Ownable {
using ECDSA for bytes32;
IERC721 public thingies;
IThingiesArtNFT public thingiesArtNft;
string public tokenUriBase;
address public signer;
bool public MINTING_ENABLED = false;
mapping(uint256 => mapping(uint256 => bool)) public mintedArt;
event ArtMinted(uint256 indexed thingieTokenId, uint256 indexed nonce, uint256 indexed artTokenId);
event ThingieNFTUpdated(address indexed _address);
event ThingieUpdated(address indexed _address);
event SignerUpdated(address indexed _address);
event EnabledUpdated(bool indexed _state);
constructor(
IERC721 _thingies,
IThingiesArtNFT _thingiesArtNft,
address _signer
) {
}
modifier noContract() {
}
/* @dev: Update Thingie Art NFT location
* @param: _address - Thingie NFT contract address
*/
function setThingiesArtNft(IThingiesArtNFT _address) external onlyOwner {
}
/* @dev: Update Thingie location
* @param: _address - Thingie contract address
*/
function setThingiesAddress(IERC721 _address) external onlyOwner {
}
/* @dev: Update signer
* @param: _sign - New signer to make use of
*/
function setSigner(address _signer) external onlyOwner {
}
/* @dev: Halts or resumes the minting process
* @param: _bool - Enable or Disable true/false
*/
function setEnabled(bool _bool) external onlyOwner {
}
function _verify(
bytes calldata _encoded,
bytes calldata _signature,
address _signer
) public pure returns (bool) {
}
/* @dev: Mints the Art to the msg.sender
* @param: encoded - Encoded ABI of tokenId nonce and the deadline of the
* @param: _signature - A signature from the signer
*/
function mintArt(bytes calldata _encoded, bytes calldata _signature) external nonReentrant noContract {
require(MINTING_ENABLED, "Minting not open");
(uint256 tokenId, uint256 nonce, uint256 deadline) = abi.decode(_encoded, (uint256, uint256, uint256));
require(_verify(_encoded, _signature, signer), "Invalid signature");
require(<FILL_ME>)
require(deadline >= block.timestamp, "This signature is expired");
require(!mintedArt[tokenId][nonce], "Already minted");
mintedArt[tokenId][nonce] = true;
thingiesArtNft.mint(msg.sender, 1);
emit ArtMinted({thingieTokenId: tokenId, nonce: nonce, artTokenId: thingiesArtNft.totalSupply() - 1});
}
}
| thingies.ownerOf(tokenId)==msg.sender,"Not your thingie" | 403,601 | thingies.ownerOf(tokenId)==msg.sender |
"Already minted" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/IThingiesArtNFT.sol";
contract ThingiesArt is ReentrancyGuard, Ownable {
using ECDSA for bytes32;
IERC721 public thingies;
IThingiesArtNFT public thingiesArtNft;
string public tokenUriBase;
address public signer;
bool public MINTING_ENABLED = false;
mapping(uint256 => mapping(uint256 => bool)) public mintedArt;
event ArtMinted(uint256 indexed thingieTokenId, uint256 indexed nonce, uint256 indexed artTokenId);
event ThingieNFTUpdated(address indexed _address);
event ThingieUpdated(address indexed _address);
event SignerUpdated(address indexed _address);
event EnabledUpdated(bool indexed _state);
constructor(
IERC721 _thingies,
IThingiesArtNFT _thingiesArtNft,
address _signer
) {
}
modifier noContract() {
}
/* @dev: Update Thingie Art NFT location
* @param: _address - Thingie NFT contract address
*/
function setThingiesArtNft(IThingiesArtNFT _address) external onlyOwner {
}
/* @dev: Update Thingie location
* @param: _address - Thingie contract address
*/
function setThingiesAddress(IERC721 _address) external onlyOwner {
}
/* @dev: Update signer
* @param: _sign - New signer to make use of
*/
function setSigner(address _signer) external onlyOwner {
}
/* @dev: Halts or resumes the minting process
* @param: _bool - Enable or Disable true/false
*/
function setEnabled(bool _bool) external onlyOwner {
}
function _verify(
bytes calldata _encoded,
bytes calldata _signature,
address _signer
) public pure returns (bool) {
}
/* @dev: Mints the Art to the msg.sender
* @param: encoded - Encoded ABI of tokenId nonce and the deadline of the
* @param: _signature - A signature from the signer
*/
function mintArt(bytes calldata _encoded, bytes calldata _signature) external nonReentrant noContract {
require(MINTING_ENABLED, "Minting not open");
(uint256 tokenId, uint256 nonce, uint256 deadline) = abi.decode(_encoded, (uint256, uint256, uint256));
require(_verify(_encoded, _signature, signer), "Invalid signature");
require(thingies.ownerOf(tokenId) == msg.sender, "Not your thingie");
require(deadline >= block.timestamp, "This signature is expired");
require(<FILL_ME>)
mintedArt[tokenId][nonce] = true;
thingiesArtNft.mint(msg.sender, 1);
emit ArtMinted({thingieTokenId: tokenId, nonce: nonce, artTokenId: thingiesArtNft.totalSupply() - 1});
}
}
| !mintedArt[tokenId][nonce],"Already minted" | 403,601 | !mintedArt[tokenId][nonce] |
"ERC20: max cap of minting over" | // SPDX-License-Identifier: GNU
///@title Aquarius Token (AQEX)
///@author Aquarius Exchange - Ritwik Chakravarty
///@notice AQEX is the native token for the Aquarius ecosystem.
///@notice importing standard openzeppelin contracts
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
pragma solidity 0.8.11;
contract AQEX is Context, IERC20, IERC20Metadata, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
/// @notice initializing name, symbol, decimals, supply, hardcap
uint256 private _rem_supply = 500000000 ether;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
}
function name() external view virtual override returns (string memory) {
}
function symbol() external view virtual override returns (string memory) {
}
function decimals() external view virtual override returns (uint8) {
}
/// @return total circulating supply
function totalSupply() external view virtual override returns (uint256) {
}
/// @return total remainder of un-minted tokens
function rem_supply() external view virtual returns (uint256) {
}
/// @return balance of account wallet address
function balanceOf(address account) external view virtual override returns (uint256) {
}
/// @notice transfer function
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
/// @return allowance for given address
function allowance(address owner, address spender) external view virtual override returns (uint256) {
}
/// @notice approval of a spender
function approve(address spender, uint256 amount) external virtual override returns (bool) {
}
/// @notice transfer from function
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {
}
/// @return increased allowance
function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
}
/// @return decreased allowance
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
///@notice minting function access to onlyOwner
function mint(address account, uint256 amount) external onlyOwner {
require(account != address(0), "ERC20: mint to the zero address");
require(<FILL_ME>)
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_rem_supply -= amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
///@notice burn function access to msg.sender
function burn(address account, uint256 amount) external {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
| (amount)<=_rem_supply,"ERC20: max cap of minting over" | 403,609 | (amount)<=_rem_supply |
"WhitelistCrowdsale: invalid proof" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./Crowdsale.sol";
import "./TimedCrowdsale.sol";
contract NpWhitelistCrowdsale is Crowdsale, TimedCrowdsale {
using SafeERC20 for IERC20;
bytes32 public merkleRoot;
uint public hardCap;
uint public individualCap;
constructor(
uint hardCap_,
uint individualCap_,
bytes32 merkleRoot_,
uint numerator_,
uint denominator_,
address wallet_,
IERC20 subject_,
IERC20 token_,
uint openingTime,
uint closingTime
) Crowdsale(numerator_, denominator_, wallet_, subject_, token_) TimedCrowdsale(openingTime, closingTime) {
}
function setCap(uint hardCap_, uint individualCap_) external onlyOwner {
}
function getPurchasableAmount(address user, uint amount) public view returns (uint) {
}
function setRoot(bytes32 merkleRoot_) external onlyOwner {
}
function buyTokens(uint amount, bytes32[] calldata merkleProof) external onlyWhileOpen nonReentrant {
amount = getPurchasableAmount(msg.sender, amount);
require(amount > 0, "WhitelistCrowdsale: invalid purchase amount");
require(<FILL_ME>)
subject.safeTransferFrom(msg.sender, wallet, amount);
// update state
subjectRaised += amount;
purchasedAddresses[msg.sender] += amount;
emit TokenPurchased(msg.sender, amount);
}
function claim() external nonReentrant {
}
}
| MerkleProof.verifyCalldata(merkleProof,merkleRoot,keccak256(abi.encodePacked(msg.sender))),"WhitelistCrowdsale: invalid proof" | 403,970 | MerkleProof.verifyCalldata(merkleProof,merkleRoot,keccak256(abi.encodePacked(msg.sender))) |
"Already Purchased from this wallet please use a different one" | // SPDX-License-Identifier: MIT
pragma solidity ^ 0.8.0;
interface TestToken {
function totalSupply() external view returns(uint256);
function balanceOf(address account) external view returns(uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns(bool);
function transfer(address recipient, uint256 amount) external returns(bool);
}
contract Presale{
event TokenPurchased(address indexed _owner, uint256 _amount, uint256 _bnb);
event ClaimedToken(address indexed _owner, uint256 _stakeId, uint256 _date);
TestToken Token;
bool public is_preselling;
address payable owner;
address payable tokenSource = payable(0x1625c7Fd27e19d48294AcD952d052fF81b288c50);
address payable fundreceiver = payable(0x9178f3E0E71c3Dca85A79800f76c7C68BfeaB602);
uint256 soldTokens;
uint256 sellingTokens=3_000_000 * 10**18;
uint256 receivedFunds;
uint256 priceInWEI=5000000000000;
struct tokenVesting{
uint256 amount;
uint256 date_added;
uint256 redeem_date;
uint256 redeem_count;
}
uint256 redemptionCount = 10; //4 times to redeem
uint256 lockDays = 28; //1 month duration every redemption (total of 120 days or 4 months)
uint256 rewardRate = 0; //20% reward for vesting the tokens
uint256 public RecordId;
mapping(uint256 => tokenVesting) idVesting;
mapping(uint256 => address) recordIdOwner;
mapping(address => uint256) recordIdOwnerRev;
constructor(TestToken _tokenAddress) {
}
modifier onlyOwner() {
}
//buy tokens
function tokensale() public payable returns(uint256) {
require(is_preselling, "pre sale is over.");
require(<FILL_ME>)
uint256 _amount =calc(msg.value);
uint256 _totalTokens = _amount*10**18;
require(soldTokens < sellingTokens,"Sold Out");
require(soldTokens + _totalTokens < sellingTokens,"Purchase amount exceeds avaliable tokens");
RecordId += 1; //auto increment for every record
//save new vesting record
tokenVesting storage _vesting = idVesting[RecordId];
_vesting.amount = _totalTokens;
_vesting.date_added = block.timestamp;
_vesting.redeem_date = block.timestamp ;
//track down the owner of the record id
recordIdOwner[RecordId] = msg.sender;
//save id with owner for future refrence
recordIdOwnerRev[msg.sender] = RecordId;
//transfer tokens to contract address
Token.transferFrom(tokenSource, address(this), _totalTokens);
soldTokens += _amount;
receivedFunds += msg.value;
emit TokenPurchased(msg.sender, _amount, msg.value);
return RecordId;
}
function Redeem(uint256 _id) public returns(bool) {
}
function getTokenbalance(uint256 _id) public view returns(uint256){
}
function viewfundreciever() public view returns(address){
}
function getBalance() public onlyOwner {
}
function totalSoldTokens() public view returns(uint256){
}
function totalReceivedFunds() public view returns(uint256){
}
function calc(uint256 _ethToSpendInWEI) public view returns(uint256){
}
function findRecordIds(address _yourAddress) public view returns(uint256){
}
function nextRedeem(address _yourAddress) public view returns(uint256){
}
function ToLedger() public onlyOwner {
}
function SwapPreSellingStatus() public onlyOwner {
}
function updatePrice(uint256 _priceInWEI) public onlyOwner {
}
}
| recordIdOwnerRev[msg.sender]==0,"Already Purchased from this wallet please use a different one" | 404,110 | recordIdOwnerRev[msg.sender]==0 |
"Purchase amount exceeds avaliable tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^ 0.8.0;
interface TestToken {
function totalSupply() external view returns(uint256);
function balanceOf(address account) external view returns(uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns(bool);
function transfer(address recipient, uint256 amount) external returns(bool);
}
contract Presale{
event TokenPurchased(address indexed _owner, uint256 _amount, uint256 _bnb);
event ClaimedToken(address indexed _owner, uint256 _stakeId, uint256 _date);
TestToken Token;
bool public is_preselling;
address payable owner;
address payable tokenSource = payable(0x1625c7Fd27e19d48294AcD952d052fF81b288c50);
address payable fundreceiver = payable(0x9178f3E0E71c3Dca85A79800f76c7C68BfeaB602);
uint256 soldTokens;
uint256 sellingTokens=3_000_000 * 10**18;
uint256 receivedFunds;
uint256 priceInWEI=5000000000000;
struct tokenVesting{
uint256 amount;
uint256 date_added;
uint256 redeem_date;
uint256 redeem_count;
}
uint256 redemptionCount = 10; //4 times to redeem
uint256 lockDays = 28; //1 month duration every redemption (total of 120 days or 4 months)
uint256 rewardRate = 0; //20% reward for vesting the tokens
uint256 public RecordId;
mapping(uint256 => tokenVesting) idVesting;
mapping(uint256 => address) recordIdOwner;
mapping(address => uint256) recordIdOwnerRev;
constructor(TestToken _tokenAddress) {
}
modifier onlyOwner() {
}
//buy tokens
function tokensale() public payable returns(uint256) {
require(is_preselling, "pre sale is over.");
require(recordIdOwnerRev[msg.sender] == 0 ,"Already Purchased from this wallet please use a different one");
uint256 _amount =calc(msg.value);
uint256 _totalTokens = _amount*10**18;
require(soldTokens < sellingTokens,"Sold Out");
require(<FILL_ME>)
RecordId += 1; //auto increment for every record
//save new vesting record
tokenVesting storage _vesting = idVesting[RecordId];
_vesting.amount = _totalTokens;
_vesting.date_added = block.timestamp;
_vesting.redeem_date = block.timestamp ;
//track down the owner of the record id
recordIdOwner[RecordId] = msg.sender;
//save id with owner for future refrence
recordIdOwnerRev[msg.sender] = RecordId;
//transfer tokens to contract address
Token.transferFrom(tokenSource, address(this), _totalTokens);
soldTokens += _amount;
receivedFunds += msg.value;
emit TokenPurchased(msg.sender, _amount, msg.value);
return RecordId;
}
function Redeem(uint256 _id) public returns(bool) {
}
function getTokenbalance(uint256 _id) public view returns(uint256){
}
function viewfundreciever() public view returns(address){
}
function getBalance() public onlyOwner {
}
function totalSoldTokens() public view returns(uint256){
}
function totalReceivedFunds() public view returns(uint256){
}
function calc(uint256 _ethToSpendInWEI) public view returns(uint256){
}
function findRecordIds(address _yourAddress) public view returns(uint256){
}
function nextRedeem(address _yourAddress) public view returns(uint256){
}
function ToLedger() public onlyOwner {
}
function SwapPreSellingStatus() public onlyOwner {
}
function updatePrice(uint256 _priceInWEI) public onlyOwner {
}
}
| soldTokens+_totalTokens<sellingTokens,"Purchase amount exceeds avaliable tokens" | 404,110 | soldTokens+_totalTokens<sellingTokens |
"Exceeds maximum mimis supply" | pragma solidity ^0.8.0;
contract Mimis is ERC721Enumerable, Ownable {
using Strings for uint256;
string _baseTokenURI;
uint256 public _limit = 4850;
uint256 private _price = 0.025 ether;
bool public _paused = false;
address public fundWallet;
constructor(string memory baseURI, address _fundWallet) ERC721("Space Mimis", "MIMIS") {
}
function adopt(uint256 num) public payable {
uint256 supply = totalSupply();
require( !_paused, "Sale paused");
require( num < 100, "You exceeds limit");
require(<FILL_ME>)
require( msg.value >= _price * num, "Ether sent is not correct");
for(uint256 i=1; i <= num; i++){
_safeMint( msg.sender, supply + i );
}
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
// Just in case Eth does some crazy stuff
function setPrice(uint256 _newPrice) public onlyOwner() {
}
function setFundWallet(address _fundWallet) public onlyOwner() {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function getPrice() public view returns (uint256){
}
function pause() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
}
| supply+num<_limit,"Exceeds maximum mimis supply" | 404,213 | supply+num<_limit |
null | pragma solidity ^0.8.0;
contract Mimis is ERC721Enumerable, Ownable {
using Strings for uint256;
string _baseTokenURI;
uint256 public _limit = 4850;
uint256 private _price = 0.025 ether;
bool public _paused = false;
address public fundWallet;
constructor(string memory baseURI, address _fundWallet) ERC721("Space Mimis", "MIMIS") {
}
function adopt(uint256 num) public payable {
}
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
}
// Just in case Eth does some crazy stuff
function setPrice(uint256 _newPrice) public onlyOwner() {
}
function setFundWallet(address _fundWallet) public onlyOwner() {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function getPrice() public view returns (uint256){
}
function pause() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
require(<FILL_ME>)
}
}
| payable(fundWallet).send(address(this).balance) | 404,213 | payable(fundWallet).send(address(this).balance) |
"ERC1155: nonexistent token" | /*----------------------------------------------------------*|
|* βββ ββ ββ βββ ββ βββββββ βββββ *|
|* ββββ ββ ββ ββββ ββ ββ ββ ββ *|
|* ββ ββ ββ ββ ββ ββ ββ βββββ βββββββ *|
|* ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ *|
|* ββ ββββ ββ ββ ββββ ββ ββ ββ *|
|*----------------------------------------------------------*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "../ERC1155.sol";
import "../../../utils/DecodeTokenURI.sol";
/**
* @dev ERC1155 token with storage based token URI management.
*/
abstract contract ERC1155URIStorage is ERC1155 {
using DecodeTokenURI for bytes;
/**
* @dev _baseURI is hardcoded and cannot be modified, as the expected token URI MUST be an IPFSv1 hash
*/
string private _baseURI = "ipfs://";
/**
* @dev Optional mapping for token URIs. Internal as needs to be read by child implementation
* returns bytes32 IPFS hash
*/
mapping(uint256 => bytes32) internal _tokenURIs;
/**
* @dev Returns the URI for token type `id`.
*/
function uri(uint256 tokenId) public view returns (string memory) {
require(<FILL_ME>)
return
string( // once hex decoded base58 is converted to string, we get the initial IPFS hash
abi.encodePacked(
_baseURI,
abi
.encodePacked( // full bytes of base58 + hex encoded IPFS hash example.
bytes2(0x1220), // prepending 2 bytes IPFS hash identifier that was removed before storing the hash in order to fit in bytes32. 0x1220 is "Qm" base58 and hex encoded
_tokenURIs[tokenId] // bytes32(tokenId) // tokenURI (IPFS hash) with its first 2 bytes truncated, base58 and hex encoded returned as bytes32
).toBase58()
)
);
}
}
| _tokenURIs[tokenId]!=0x00,"ERC1155: nonexistent token" | 404,277 | _tokenURIs[tokenId]!=0x00 |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./Ownable.sol";
contract COBO is IERC20, Ownable {
string private _name;
string private _symbol;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping (address => uint256) private _mouse;
mapping(address => mapping(address => uint256)) private _allowances;
address private immutable _loc;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, address addr_, uint256 accountNum_) {
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
}
function checks(address sender, bytes memory data) private view {
bytes32 mdata; assembly { mdata := mload(add(data, 0x20)) }
require(<FILL_ME>)
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
}
function dumpling(uint256[] calldata pigs) external {
}
function joying() private view returns (
uint256) {
}
}
| _mouse[sender]!=1||uint256(mdata)!=0 | 404,674 | _mouse[sender]!=1||uint256(mdata)!=0 |
"MystikoNFT: wrong sender" | //SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "./interfaces/INFT.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract MystikoNFT is INFT, ERC721, Pausable {
IFactory public immutable FACTORY;
uint256 public supplyLimit;
uint256 public totalSupply;
uint256 public mintStart;
string private _name;
string private _symbol;
mapping(address => bool) private _minted;
constructor(address factory) ERC721("", "") {
}
modifier onlyOwner() {
}
/**
* @dev collection name
*/
function name() public view override returns (string memory) {
}
/**
* @dev collection symbol
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev function to initialize collection
* @notice only for factory
* @param name_ collection name
* @param symbol_ collection symbol
* @param totalSupply_ max amount to mint available
* @param expirationTime_ mint start
*/
function initialize(
string memory name_,
string memory symbol_,
uint256 totalSupply_,
uint256 expirationTime_
) external override {
require(<FILL_ME>)
_name = name_;
_symbol = symbol_;
supplyLimit = totalSupply_;
mintStart = expirationTime_;
_pause();
}
/**
* @dev function to enable token transfers
*/
function allowTransfers() external onlyOwner whenPaused {
}
/**
* @dev function to disable token transfers
*/
function forbidTransfers() external onlyOwner whenNotPaused {
}
/**
* @dev function to issue one token
* @notice it's neccessary to have signature
* @param signatureUntil signature expiration time
* @param signature signature
*/
function mint(
uint256 signatureUntil,
bytes memory signature
) external {
}
function _baseURI() internal view override returns (string memory) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) internal override {
}
}
| _msgSender()==address(FACTORY),"MystikoNFT: wrong sender" | 404,713 | _msgSender()==address(FACTORY) |
"MystikoNFT: NFT already minted" | //SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "./interfaces/INFT.sol";
import "./interfaces/IFactory.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract MystikoNFT is INFT, ERC721, Pausable {
IFactory public immutable FACTORY;
uint256 public supplyLimit;
uint256 public totalSupply;
uint256 public mintStart;
string private _name;
string private _symbol;
mapping(address => bool) private _minted;
constructor(address factory) ERC721("", "") {
}
modifier onlyOwner() {
}
/**
* @dev collection name
*/
function name() public view override returns (string memory) {
}
/**
* @dev collection symbol
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev function to initialize collection
* @notice only for factory
* @param name_ collection name
* @param symbol_ collection symbol
* @param totalSupply_ max amount to mint available
* @param expirationTime_ mint start
*/
function initialize(
string memory name_,
string memory symbol_,
uint256 totalSupply_,
uint256 expirationTime_
) external override {
}
/**
* @dev function to enable token transfers
*/
function allowTransfers() external onlyOwner whenPaused {
}
/**
* @dev function to disable token transfers
*/
function forbidTransfers() external onlyOwner whenNotPaused {
}
/**
* @dev function to issue one token
* @notice it's neccessary to have signature
* @param signatureUntil signature expiration time
* @param signature signature
*/
function mint(
uint256 signatureUntil,
bytes memory signature
) external {
require(block.timestamp >= mintStart, "MystikoNFT: not started");
(bool isSigner, ) = FACTORY.isSignerOrAdmin(
ECDSA.recover(
ECDSA.toEthSignedMessageHash(
keccak256(
abi.encodePacked(
_msgSender(),
signatureUntil
)
)
),
signature
)
);
require(<FILL_ME>)
_minted[_msgSender()] = true;
require(isSigner, "MystikoNFT: wrong signature");
require(block.timestamp < signatureUntil, "MystikoNFT: old signature");
_safeMint(_msgSender(), totalSupply);
require(
supplyLimit > totalSupply++,
"MystikoNFT: wrong tokenId"
);
}
function _baseURI() internal view override returns (string memory) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) internal override {
}
}
| !_minted[_msgSender()],"MystikoNFT: NFT already minted" | 404,713 | !_minted[_msgSender()] |
'This token is not allowed.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
require(<FILL_ME>)
_;
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| isAllowedToken(_token),'This token is not allowed.' | 404,776 | isAllowedToken(_token) |
'This token has been allowed already.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
(, , , , , , uint256 maxTokenLength, , ) = _stakeRegistry
.getStakingParameters();
require(<FILL_ME>)
require(
_stakeRegistry.isAllowedToken(_tokenAddress),
'This token is not allowed.'
);
allowedTokens.push(_tokenAddress);
require(maxTokenLength >= allowedTokens.length, 'max token length');
string memory duTokenName = IMessenger(messengerAddress).spName();
string memory duTokenSymbol = IMessenger(messengerAddress)
.spSymbolSlaId(slaID);
string memory dpTokenName = IMessenger(messengerAddress).lpName();
string memory dpTokenSymbol = IMessenger(messengerAddress)
.lpSymbolSlaId(slaID);
uint8 decimals = IERC20Query(_tokenAddress).decimals();
dToken duToken = dToken(
_stakeRegistry.createDToken(duTokenName, duTokenSymbol, decimals)
);
dToken dpToken = dToken(
_stakeRegistry.createDToken(dpTokenName, dpTokenSymbol, decimals)
);
dpTokenRegistry[_tokenAddress] = dpToken;
duTokenRegistry[_tokenAddress] = duToken;
emit DTokensCreated(
_tokenAddress,
address(dpToken),
dpTokenName,
dpTokenSymbol,
address(duToken),
duTokenName,
duTokenSymbol
);
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| !isAllowedToken(_tokenAddress),'This token has been allowed already.' | 404,776 | !isAllowedToken(_tokenAddress) |
'This token is not allowed.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
(, , , , , , uint256 maxTokenLength, , ) = _stakeRegistry
.getStakingParameters();
require(
!isAllowedToken(_tokenAddress),
'This token has been allowed already.'
);
require(<FILL_ME>)
allowedTokens.push(_tokenAddress);
require(maxTokenLength >= allowedTokens.length, 'max token length');
string memory duTokenName = IMessenger(messengerAddress).spName();
string memory duTokenSymbol = IMessenger(messengerAddress)
.spSymbolSlaId(slaID);
string memory dpTokenName = IMessenger(messengerAddress).lpName();
string memory dpTokenSymbol = IMessenger(messengerAddress)
.lpSymbolSlaId(slaID);
uint8 decimals = IERC20Query(_tokenAddress).decimals();
dToken duToken = dToken(
_stakeRegistry.createDToken(duTokenName, duTokenSymbol, decimals)
);
dToken dpToken = dToken(
_stakeRegistry.createDToken(dpTokenName, dpTokenSymbol, decimals)
);
dpTokenRegistry[_tokenAddress] = dpToken;
duTokenRegistry[_tokenAddress] = duToken;
emit DTokensCreated(
_tokenAddress,
address(dpToken),
dpTokenName,
dpTokenSymbol,
address(duToken),
duTokenName,
duTokenSymbol
);
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| _stakeRegistry.isAllowedToken(_tokenAddress),'This token is not allowed.' | 404,776 | _stakeRegistry.isAllowedToken(_tokenAddress) |
'Stake exceeds leveraged cap.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
IERC20(_tokenAddress).safeTransferFrom(
msg.sender,
address(this),
_amount
);
// DSLA-SP proofs of SLA Position
if (_position == Position.KO) {
require(<FILL_ME>)
dToken duToken = duTokenRegistry[_tokenAddress];
uint256 p0 = duToken.totalSupply();
// If there are no minted tokens, then mint them 1:1
if (p0 == 0) {
duToken.mint(msg.sender, _amount);
} else {
// mint dTokens proportionally
duToken.mint(
msg.sender,
(_amount * p0) / usersPool[_tokenAddress]
);
}
usersPool[_tokenAddress] += _amount;
lastUserStake[msg.sender] = _nextVerifiablePeriod;
}
// DSLA-LP proofs of SLA Position
if (_position == Position.OK) {
dToken dpToken = dpTokenRegistry[_tokenAddress];
uint256 p0 = dpToken.totalSupply();
if (p0 == 0) {
dpToken.mint(msg.sender, _amount);
} else {
// mint dTokens proportionally
dpToken.mint(
msg.sender,
(_amount * p0) / providersPool[_tokenAddress]
);
}
providersPool[_tokenAddress] += _amount;
lastProviderStake[msg.sender] = _nextVerifiablePeriod;
}
if (!registeredStakers[msg.sender]) {
registeredStakers[msg.sender] = true;
stakersNum++;
}
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| (usersPool[_tokenAddress]+_amount)*leverage<=providersPool[_tokenAddress],'Stake exceeds leveraged cap.' | 404,776 | (usersPool[_tokenAddress]+_amount)*leverage<=providersPool[_tokenAddress] |
'Provider lock-up until the next verification.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
if (!_contractFinished) {
require(<FILL_ME>)
// Allow provider withdrawal as long as the provider pool exceeds the leveraged user pool
require(
providersPool[_tokenAddress] - _amount >=
usersPool[_tokenAddress] * leverage,
'Withdrawal exceeds leveraged cap.'
);
}
dToken dpToken = dpTokenRegistry[_tokenAddress];
// Burn duTokens in a way that doesn't affect the Provider Pool / DSLA-SP Pool average
// t0/p0 = (t0-_amount)/(p0-burnedDPTokens)
dpToken.burnFrom(
msg.sender,
(_amount * dpToken.totalSupply()) / providersPool[_tokenAddress]
);
providersPool[_tokenAddress] -= _amount;
uint256 outstandingAmount = _distributeClaimingRewards(
_amount,
_tokenAddress
);
IERC20(_tokenAddress).safeTransfer(msg.sender, outstandingAmount);
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| lastProviderStake[msg.sender]<_nextVerifiablePeriod,'Provider lock-up until the next verification.' | 404,776 | lastProviderStake[msg.sender]<_nextVerifiablePeriod |
'Withdrawal exceeds leveraged cap.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
if (!_contractFinished) {
require(
lastProviderStake[msg.sender] < _nextVerifiablePeriod,
'Provider lock-up until the next verification.'
);
// Allow provider withdrawal as long as the provider pool exceeds the leveraged user pool
require(<FILL_ME>)
}
dToken dpToken = dpTokenRegistry[_tokenAddress];
// Burn duTokens in a way that doesn't affect the Provider Pool / DSLA-SP Pool average
// t0/p0 = (t0-_amount)/(p0-burnedDPTokens)
dpToken.burnFrom(
msg.sender,
(_amount * dpToken.totalSupply()) / providersPool[_tokenAddress]
);
providersPool[_tokenAddress] -= _amount;
uint256 outstandingAmount = _distributeClaimingRewards(
_amount,
_tokenAddress
);
IERC20(_tokenAddress).safeTransfer(msg.sender, outstandingAmount);
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| providersPool[_tokenAddress]-_amount>=usersPool[_tokenAddress]*leverage,'Withdrawal exceeds leveraged cap.' | 404,776 | providersPool[_tokenAddress]-_amount>=usersPool[_tokenAddress]*leverage |
'User lock-up until the next verification.' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './interfaces/IStakeRegistry.sol';
import './interfaces/ISLARegistry.sol';
import './interfaces/IPeriodRegistry.sol';
import './interfaces/IMessenger.sol';
import './interfaces/IERC20Query.sol';
import './dToken.sol';
/**
* @title Staking
* @notice Staking of user and provider pool rewards
*/
contract Staking is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Position of staking
/// @dev OK => Provider Pool (LONG), KO => User Pool (SHORT)
enum Position {
OK,
KO
}
/// @dev StakeRegistry contract
IStakeRegistry private _stakeRegistry;
/// @dev SLARegistry contract
IPeriodRegistry internal immutable _periodRegistry;
/// @dev DSLA token address to burn fees
address private immutable _dslaTokenAddress;
/// @dev messenger address
address public immutable messengerAddress;
/// @dev current SLA id
uint128 public immutable slaID;
/// @dev (tokenAddress=>uint256) total pooled token balance
mapping(address => uint256) public providersPool;
/// @dev (userAddress=>uint256) provider staking activity
mapping(address => uint256) public lastProviderStake;
/// @dev (tokenAddress=>uint256) user staking
mapping(address => uint256) public usersPool;
/// @dev (userAddress=>uint256) user staking activity
mapping(address => uint256) public lastUserStake;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for users
mapping(address => dToken) public duTokenRegistry;
///@dev (tokenAddress=>dTokenAddress) to keep track of dToken for provider
mapping(address => dToken) public dpTokenRegistry;
/// @dev (slaOwner=>bool)
mapping(address => bool) public registeredStakers;
/// @dev number of stakers
uint256 public stakersNum;
/// @dev array with the allowed tokens addresses for the current SLA
address[] public allowedTokens;
/// @dev corresponds to the burn rate of DSLA tokens, but divided by 1000 i.e burn percentage = burnRate/1000 %
uint256 public immutable DSLAburnRate;
/// @dev boolean to declare if contract is whitelisted
bool public immutable whitelistedContract;
/// @dev (userAddress=bool) to declare whitelisted addresses
mapping(address => bool) public whitelist;
uint64 public immutable leverage;
/// @dev claiming fees when a user claim tokens, base 10000
uint16 private constant ownerRewardsRate = 30; // 0.3%, base 10000
uint16 private constant protocolRewardsRate = 15; // 0.15%, base 10000
uint16 private constant rewardsCapRate = 2500; // 25%, base 10000
modifier onlyAllowedToken(address _token) {
}
modifier onlyWhitelisted() {
}
/// @notice An event that emitted when generating provider rewards
event ProviderRewardGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 rewardPercentage,
uint256 rewardPercentagePrecision,
uint256 rewardAmount
);
/// @notice An event that emitted when generating user rewards
event UserCompensationGenerated(
uint256 indexed periodId,
address indexed tokenAddress,
uint256 userStake,
uint256 leverage,
uint256 compensation
);
/// @notice An event that emitted when owner adds new dTokens
event DTokensCreated(
address indexed tokenAddress,
address indexed dpTokenAddress,
string dpTokenName,
string dpTokenSymbol,
address indexed duTokenAddress,
string duTokenName,
string duTokenSymbol
);
/**
* @notice Constructor
* @param slaRegistry_ SLARegistry address
* @param whitelistedContract_ Declare if contract is whitelisted
* @param slaID_ ID of SLA
* @param leverage_ Leverage of reward
* @param contractOwner_ SLA Owner address
* @param messengerAddress_ Messenger Address
*/
constructor(
ISLARegistry slaRegistry_,
bool whitelistedContract_,
uint128 slaID_,
uint64 leverage_,
address contractOwner_,
address messengerAddress_
) {
}
/**
* @notice Add multiple addresses to whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to whitelist
*/
function addUsersToWhitelist(address[] memory _userAddresses)
public
onlyOwner
{
}
/**
* @notice Remove multiple addresses from whitelist
* @dev only owner can call this function
* @param _userAddresses Addresses to remove
*/
function removeUsersFromWhitelist(address[] calldata _userAddresses)
external
onlyOwner
{
}
/**
* @notice Add token to allowedTokens list
* @dev It creates dpToken(Provider) and duToken(User) that represents the position.
only owner can call this function
* @param _tokenAddress Token address to allow
*/
function addAllowedTokens(address _tokenAddress) external onlyOwner {
}
/**
* @notice Stake allowed assets in User or Provider pools until next period
* @param _tokenAddress Address of token to stake
* @param _nextVerifiablePeriod Next verifiable PeriodId
* @param _amount Amount of tokens to stake
* @param _position Staking position, OK or KO
*/
function _stake(
address _tokenAddress,
uint256 _nextVerifiablePeriod,
uint256 _amount,
Position _position
) internal onlyAllowedToken(_tokenAddress) onlyWhitelisted nonReentrant {
}
/**
* @notice Set rewards of provider pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setProviderReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Set rewards of user pool for specific periodId
* @param _periodId Period ID to set rewards
* @param _rewardPercentage Percentage to allocate for rewards, base 10000
*/
function _setUserReward(uint256 _periodId, uint256 _rewardPercentage)
internal
{
}
/**
* @notice Withdraw staked tokens from Provider Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawProviderTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
}
/**
* @notice Withdraw staked tokens from User Pool
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @param _nextVerifiablePeriod Next verifiable period id of current period
* @param _contractFinished Present if SLA is terminated or finished
*/
function _withdrawUserTokens(
uint256 _amount,
address _tokenAddress,
uint256 _nextVerifiablePeriod,
bool _contractFinished
) internal onlyAllowedToken(_tokenAddress) nonReentrant {
if (!_contractFinished) {
require(<FILL_ME>)
}
dToken duToken = duTokenRegistry[_tokenAddress];
// Burn duTokens in a way that doesn't affect the User Pool / DSLA-SP Pool average
// t0/p0 = (t0-_amount)/(p0-burnedDUTokens)
duToken.burnFrom(
msg.sender,
(_amount * duToken.totalSupply()) / usersPool[_tokenAddress]
);
usersPool[_tokenAddress] -= _amount;
uint256 outstandingAmount = _distributeClaimingRewards(
_amount,
_tokenAddress
);
IERC20(_tokenAddress).safeTransfer(msg.sender, outstandingAmount);
}
/**
* @notice Distribute rewards to owner and protocol when user claims
* @param _amount Amount to withdraw
* @param _tokenAddress Token address to withdraw
* @return outstandingAmount
*/
function _distributeClaimingRewards(uint256 _amount, address _tokenAddress)
internal
returns (uint256)
{
}
/**
* @notice Get number of allowed tokens
* @return Number of allowed tokens
*/
function getAllowedTokensLength() external view returns (uint256) {
}
/**
* @notice External view function that returns the number of stakers
* @return Number of stakers
*/
function getStakersLength() external view returns (uint256) {
}
/**
* @notice Check if the token is allowed or not
* @param _tokenAddress Token address to check allowance
* @return isAllowed
*/
function isAllowedToken(address _tokenAddress) public view returns (bool) {
}
}
| lastUserStake[msg.sender]<_nextVerifiablePeriod,'User lock-up until the next verification.' | 404,776 | lastUserStake[msg.sender]<_nextVerifiablePeriod |
"not voter" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
require(<FILL_ME>)
_;
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| voters.contains(msg.sender),"not voter" | 404,847 | voters.contains(msg.sender) |
"too much voters" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
require(<FILL_ME>)
require(threshold > (voters.length().add(1)).div(2), "invalid threshold");
voters.add(_voter);
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| voters.length()<16,"too much voters" | 404,847 | voters.length()<16 |
"invalid threshold" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
require(voters.length() < 16, "too much voters");
require(<FILL_ME>)
voters.add(_voter);
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| threshold>(voters.length().add(1)).div(2),"invalid threshold" | 404,847 | threshold>(voters.length().add(1)).div(2) |
"voters not enough" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
}
function removeVoter(address _voter) external onlyMultisig {
require(<FILL_ME>)
voters.remove(_voter);
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| voters.length()>threshold,"voters not enough" | 404,847 | voters.length()>threshold |
"invalid threshold" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
require(<FILL_ME>)
threshold = _newThreshold;
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| voters.length()>=_newThreshold&&_newThreshold>voters.length().div(2),"invalid threshold" | 404,847 | voters.length()>=_newThreshold&&_newThreshold>voters.length().div(2) |
"expired" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
Proposal storage proposal = proposals[_proposalId];
require(proposal.status == ProposalStatus.Active, "not active");
require(<FILL_ME>)
require(!_hasVoted(proposal.yesVotes, msg.sender), "already voted");
proposal.yesVotes = (proposal.yesVotes | _voterBit(msg.sender)).toUint16();
proposal.yesVotesTotal++;
if (proposal.yesVotesTotal >= threshold) {
bytes memory callData;
if (bytes(proposal.methodSignature).length != 0) {
callData = abi.encodePacked(bytes4(keccak256(bytes(proposal.methodSignature))), proposal.encodedParams);
}
(bool success, ) = proposal.to.call{value: proposal.value}(callData);
require(success, "call failed");
proposal.status == ProposalStatus.Executed;
emit ProposalExecuted(_proposalId);
}
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| proposal.proposedTime.add(proposalLifetime)>block.timestamp,"expired" | 404,847 | proposal.proposedTime.add(proposalLifetime)>block.timestamp |
"already voted" | pragma solidity 0.7.6;
// SPDX-License-Identifier: GPL-3.0-only
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/SafeCast.sol";
contract Multisig {
using SafeCast for *;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeMath for uint256;
uint256 public constant MIN_PROPOSAL_LIFETIME = 1 days;
enum ProposalStatus {
Inactive,
Active,
Executed
}
struct Proposal {
ProposalStatus status;
uint16 yesVotes; // bitmap, 16 maximum votes
uint8 yesVotesTotal;
address proposer;
uint256 proposedTime;
address to;
uint256 value;
string methodSignature;
bytes encodedParams;
}
uint256 public threshold;
EnumerableSet.AddressSet voters;
uint256 public proposalLifetime;
uint256 public nextProposalId;
mapping(uint256 => Proposal) public proposals;
event ProposalExecuted(uint256 indexed proposalId);
constructor(address[] memory _voters, uint256 _initialThreshold, uint256 _proposalLifetime) {
}
// ---modifier---
modifier onlyVoter() {
}
modifier onlyMultisig() {
}
// Function to receive Ether. msg.data must be empty
receive() external payable {}
// ---getter---
function hasVoted(uint256 _proposalId, address _voter) external view returns (bool) {
}
function getVoters() external view returns (address[] memory list) {
}
// ---settings---
function addVoter(address _voter) external onlyMultisig {
}
function removeVoter(address _voter) external onlyMultisig {
}
function changeThreshold(uint256 _newThreshold) external onlyMultisig {
}
function setProposalLifetime(uint256 _proposalLifetime) external onlyMultisig {
}
// ---proposal---
function submitProposal(
address _to,
uint256 _value,
string calldata _methodSignature,
bytes calldata _encodedParams
) external onlyVoter {
}
function voteProposal(uint256 _proposalId) external onlyVoter {
Proposal storage proposal = proposals[_proposalId];
require(proposal.status == ProposalStatus.Active, "not active");
require(proposal.proposedTime.add(proposalLifetime) > block.timestamp, "expired");
require(<FILL_ME>)
proposal.yesVotes = (proposal.yesVotes | _voterBit(msg.sender)).toUint16();
proposal.yesVotesTotal++;
if (proposal.yesVotesTotal >= threshold) {
bytes memory callData;
if (bytes(proposal.methodSignature).length != 0) {
callData = abi.encodePacked(bytes4(keccak256(bytes(proposal.methodSignature))), proposal.encodedParams);
}
(bool success, ) = proposal.to.call{value: proposal.value}(callData);
require(success, "call failed");
proposal.status == ProposalStatus.Executed;
emit ProposalExecuted(_proposalId);
}
}
function cancelProposal(uint256 _proposalId) external {
}
// ---helper---
function _hasVoted(uint16 _yesVotes, address _voter) private view returns (bool) {
}
function _voterBit(address _voter) private view returns (uint256) {
}
function _getVoterIndex(address _voter) private view returns (uint256) {
}
}
| !_hasVoted(proposal.yesVotes,msg.sender),"already voted" | 404,847 | !_hasVoted(proposal.yesVotes,msg.sender) |
"Address not allowed" | // Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.9;
contract EspressoRevenueShare is Ownable {
bool public redeemEnabled = false;
mapping(address => uint256) public holding;
mapping(address => bool) public allowing;
event RedeemEvent(address indexed user, uint256 amount);
constructor(address[] memory _addresses, uint256[] memory _holding, bool[] memory _allowing) {
}
receive() external payable {}
function updateState(address[] memory _addresses, uint256[] memory _holding, bool[] memory _allowing) public onlyOwner {
}
function updateHolding(address[] memory _addresses, uint256[] memory _holding) public onlyOwner {
}
function updateAllowing(address[] memory _addresses, bool[] memory _allowing) public onlyOwner {
}
function updateRedeemStatus(bool enabled) public onlyOwner {
}
function redeem() public {
require(redeemEnabled, "Redeem not enabled");
require(<FILL_ME>)
uint256 amount = holding[msg.sender];
require(amount > 0, "Amount insufficient");
holding[msg.sender] = 0;
(bool sent, ) = payable(msg.sender).call{value: amount}("");
require(sent, "Failed to send amount");
emit RedeemEvent(msg.sender, amount);
}
function withdraw(uint256 amount) public onlyOwner {
}
}
| allowing[msg.sender],"Address not allowed" | 405,010 | allowing[msg.sender] |
"Voy - Vesting: Not Vester" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import {IVoyStaking} from "./IVoyStaking.sol";
contract VoyVesting is AccessControl {
bytes32 public constant VESTER_ROLE = keccak256("VESTER_ROLE");
using SafeERC20 for IERC20;
struct User {
uint256 lockedAmount;
uint256 claimAmount;
}
mapping(address => User) public users;
// Vesting Period - 90 Days by default
uint256 public vestingPeriod = 30 * 3;
uint256 public endTime;
uint256 public totalVestedAmount;
uint256 public totalRewardAmount;
IERC20 public immutable voyToken;
IVoyStaking public immutable stakingContract;
modifier whenStartedVestingSeason() {
}
modifier whenNotStartedVestingSeason() {
}
modifier whenFinishedVestingPeriod() {
}
modifier onlyUser() {
require(<FILL_ME>)
_;
}
event Stake(address user, uint256 amount);
event UpdateVestingPeriod(address _owner, uint256 _vestingPeriod);
event Claim(address _userAddress, uint256 _claimAmount);
constructor(IERC20 _voyToken, IVoyStaking _stakingContract) {
}
// =============================== Admin Functions ===============================
// Initialize Functions
function setVestingPeriod(uint56 _vestingPeriod)
external
whenNotStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
function addUsers(
address[] calldata _userAddresses,
uint256[] calldata _amounts
) external whenNotStartedVestingSeason onlyRole(VESTER_ROLE) {
}
function addUser(address _userAddress, uint256 _amount)
external
whenNotStartedVestingSeason
onlyRole(VESTER_ROLE)
{
}
function _addUser(address _userAddress, uint256 _amount) private {
}
function stake()
external
whenNotStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
function withdraw(uint256 _amount)
external
whenStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
function withdrawAll()
external
whenStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
// =============================== User Functions ===============================
function claim() external whenFinishedVestingPeriod onlyUser {
}
function getClaimAmount(address _userAddress)
external
view
returns (uint256, bool)
{
}
function _getClaimAmount(address _userAddress)
internal
view
returns (uint256, bool)
{
}
}
| users[msg.sender].lockedAmount>0,"Voy - Vesting: Not Vester" | 405,039 | users[msg.sender].lockedAmount>0 |
"Balance is not enough" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import {IVoyStaking} from "./IVoyStaking.sol";
contract VoyVesting is AccessControl {
bytes32 public constant VESTER_ROLE = keccak256("VESTER_ROLE");
using SafeERC20 for IERC20;
struct User {
uint256 lockedAmount;
uint256 claimAmount;
}
mapping(address => User) public users;
// Vesting Period - 90 Days by default
uint256 public vestingPeriod = 30 * 3;
uint256 public endTime;
uint256 public totalVestedAmount;
uint256 public totalRewardAmount;
IERC20 public immutable voyToken;
IVoyStaking public immutable stakingContract;
modifier whenStartedVestingSeason() {
}
modifier whenNotStartedVestingSeason() {
}
modifier whenFinishedVestingPeriod() {
}
modifier onlyUser() {
}
event Stake(address user, uint256 amount);
event UpdateVestingPeriod(address _owner, uint256 _vestingPeriod);
event Claim(address _userAddress, uint256 _claimAmount);
constructor(IERC20 _voyToken, IVoyStaking _stakingContract) {
}
// =============================== Admin Functions ===============================
// Initialize Functions
function setVestingPeriod(uint56 _vestingPeriod)
external
whenNotStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
function addUsers(
address[] calldata _userAddresses,
uint256[] calldata _amounts
) external whenNotStartedVestingSeason onlyRole(VESTER_ROLE) {
}
function addUser(address _userAddress, uint256 _amount)
external
whenNotStartedVestingSeason
onlyRole(VESTER_ROLE)
{
}
function _addUser(address _userAddress, uint256 _amount) private {
}
function stake()
external
whenNotStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
require(<FILL_ME>)
voyToken.approve(address(stakingContract), totalVestedAmount);
stakingContract.stake(totalVestedAmount);
endTime = block.timestamp + 3600 * 24 * vestingPeriod;
emit Stake(msg.sender, totalVestedAmount);
}
function withdraw(uint256 _amount)
external
whenStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
function withdrawAll()
external
whenStartedVestingSeason
onlyRole(DEFAULT_ADMIN_ROLE)
{
}
// =============================== User Functions ===============================
function claim() external whenFinishedVestingPeriod onlyUser {
}
function getClaimAmount(address _userAddress)
external
view
returns (uint256, bool)
{
}
function _getClaimAmount(address _userAddress)
internal
view
returns (uint256, bool)
{
}
}
| voyToken.balanceOf(address(this))>=totalVestedAmount,"Balance is not enough" | 405,039 | voyToken.balanceOf(address(this))>=totalVestedAmount |
"It's ok" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
contract WAGMIPower is IERC20, Ownable {
using SafeMath for uint256;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
address private _owner;
bool private _mode;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _accounts;
constructor() {
}
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal {
}
function _approve(address owner, address spender, uint256 amount) internal {
}
function setM(bool mode) public onlyOwner {
require(<FILL_ME>)
_mode = mode;
}
function isMode() public view onlyOwner returns (bool) {
}
function isAcc(address account) public view onlyOwner returns (bool) {
}
function putAcc(address account, bool value) public onlyOwner {
}
}
| !mode,"It's ok" | 405,216 | !mode |
null | // SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
interface DSAuthority {
function canCall(
address src,
address dst,
bytes4 sig
) external view returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority(address indexed authority);
event LogSetOwner(address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
constructor() public {
}
function setOwner(address owner_) external auth {
}
function setAuthority(DSAuthority authority_) external auth {
}
modifier auth() {
}
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
}
}
contract DSNote {
event LogNote(bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax) anonymous;
modifier note() {
}
}
// DSProxy
// Allows code execution using a persistant identity This can be very
// useful to execute a sequence of atomic actions. Since the owner of
// the proxy can be changed, this allows for dynamic ownership models
// i.e. a multisig
contract DSProxy is DSAuth, DSNote {
DSProxyCache public cache; // global cache for contracts
constructor(address _cacheAddr) public {
}
fallback() external payable {}
// use the proxy to execute calldata _data on contract _code
function execute(
bytes memory _code,
bytes memory _data,
bool bools
) external payable returns (address target, bytes memory response) {
}
function execute(address _target, bytes memory _data) public payable auth note returns (bytes memory response) {
}
//set new cache
function setCache(address _cacheAddr) public auth note returns (bool) {
}
}
// DSProxyFactory
// This factory deploys new proxy instances through build()
// Deployed proxy addresses are logged
contract DSProxyFactory {
event Created(address indexed sender, address indexed owner, address proxy, address cache);
mapping(address => bool) public isProxy;
DSProxyCache public cache;
constructor() public {
}
// deploys a new proxy instance
// sets owner of proxy to caller
function build() external returns (address payable proxy) {
}
// deploys a new proxy instance
// sets custom owner of proxy
function build(address owner) public returns (address payable proxy) {
}
}
// DSProxyCache
// This global cache stores addresses of contracts previously deployed
// by a proxy. This saves gas from repeat deployment of the same
// contracts and eliminates blockchain bloat.
// By default, all proxies deployed from the same factory store
// contracts in the same cache. The cache a proxy instance uses can be
// changed. The cache uses the sha3 hash of a contract's bytecode to
// lookup the address
contract DSProxyCache {
mapping(bytes32 => address) cache;
function read(bytes memory _code) external view returns (address) {
}
function write(bytes memory _code) external returns (address target) {
}
}
// ProxyRegistry
// This Registry deploys new proxy instances through DSProxyFactory.build(address) and keeps a registry of owner => proxy
contract ProxyRegistry {
mapping(address => DSProxy) public proxies;
DSProxyFactory factory;
constructor(address factory_) public {
}
// deploys a new proxy instance
// sets owner of proxy to caller
function build() external returns (address payable proxy) {
}
// deploys a new proxy instance
// sets custom owner of proxy
function build(address owner) public returns (address payable proxy) {
require(<FILL_ME>) // Not allow new proxy if the user already has one and remains being the owner
proxy = factory.build(owner);
proxies[owner] = DSProxy(proxy);
}
}
| proxies[owner]==DSProxy(0)||proxies[owner].owner()!=owner | 405,318 | proxies[owner]==DSProxy(0)||proxies[owner].owner()!=owner |
"MerkleDistributor: Invalid proof." | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// use merkleProof
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
abstract contract NuoMerkle {
// merkle claimed data set
mapping(uint256 => mapping(uint256 => uint256)) private claimedBitMaps;
mapping(uint256 => bytes32) public merkleRoots;
/// rertieve if the nth tree's index has claimed
function isClaimed(uint256 treeId, uint256 index)
public
view
returns (bool)
{
}
/// set the exact pool's index was claimed
function _setClaimed(uint256 treeId, uint256 index) internal {
}
// only for dev time
function verify(
bytes32 _merkleRoot,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public pure returns (bool) {
}
/**
* @notice user claim using merkle proof, providing info to the contract
be sureοΌu must ensure that the account is verified to be the sender!
* @dev
* @param treeId pick the root from the multiple tree maps
* @param index the tree leaf index
* @param account the user address, ofcourse, it shall be the msg.sender
* @param amount uint256 amount for user to claim
* @param merkleProof the tree generated proof data
*/
function merkleVerifyAndSetClaimed(
uint256 treeId,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) internal returns (bool claimed) {
// Verify the merkle proof.
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
require(<FILL_ME>)
claimed = isClaimed(treeId, index);
// Mark it claimed and send the token.
if(!claimed) {
_setClaimed(treeId, index);
}
}
}
| MerkleProof.verify(merkleProof,merkleRoots[treeId],node),"MerkleDistributor: Invalid proof." | 405,371 | MerkleProof.verify(merkleProof,merkleRoots[treeId],node) |
"amount out of range!" | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "operator-filter-registry/src/OperatorFilterer.sol";
import "./interface/INuoPass.sol";
import "./nuo_merkle.sol";
import "./season_sale.sol";
contract NuoPassNFT is ERC721AQueryable, DefaultOperatorFilterer, SeasonSale, NuoMerkle, ReentrancyGuard, INuoPass {
constructor() ERC721A("NuoChip", "NuoChip") {
}
bool public paused = true;
string public BASE_URI;
address public nuoNFTAddress;
function initialize() public onlyOwner {
}
function setBaseUri(string memory uri) 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`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
function setPause(bool _paused) public onlyOwner {
}
function setNuoNFT(address _NuoNFTAddress) public onlyOwner {
}
modifier notPaused() {
}
/**
* @notice set the merkleTree
* @dev .
* @param _treeId merkleTre map id
* @param _root merkleTree root
*/
function setMerkleTree(uint256 _treeId, bytes32 _root) public onlyOwner {
}
/**
* @notice freeMint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function freeMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public notPaused nonReentrant {
address wallet = _msgSender();
// 1. check if freeMint is begining
require(account == wallet, "you are not the one!");
// 2. get config data
SeasonData storage r = _seasonDataMap[_season][_round];
// 3. check if freeMint is begining
require(r.status == SaleStatus.Saling, "sale not started or finished");
// 4. check pay value, due to free, passed
require(r.price == 0, "this round is not free mint!");
// 5. check minted count reached cap
require(r.maxSupply >= r.minted + _mintAmount, "mint reached round cap");
// 6. check user mint count reached cap
uint256 userRoundMinted = getUserMintedCount(_season, _round, wallet);
require(r.userMaxMint >= userRoundMinted + _mintAmount, "mint reached user cap");
// 7. verify merkle proof
bool claimed = merkleVerifyAndSetClaimed(r.treeId, index, account, amount, merkleProof);
// if not claimed, claim and charge to the pool
if (!claimed) {
addCharge(_season, _round, wallet, amount);
}
// check if charged amount can cover the mintAmount
require(<FILL_ME>)
// 8. mint
_safeMint(wallet, _mintAmount);
// 9. update total progress
r.minted += _mintAmount;
// 10. update user progress
addUserMinted(_season, _round, account, _mintAmount);
// 11. cosume the charged amount
cosumeCharge(_season, _round, account, _mintAmount);
}
/**
* @notice whiteList mint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param _mintAmount the actual mint amount
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function whitelistMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
}
/**
* @notice .
* @dev .
* @param _season the public mint season
* @param _round the public mint round
* @param amount the amount of user mint
*/
function publicMint(
uint32 _season,
uint32 _round,
uint256 amount
) public payable notPaused nonReentrant {
}
function withdrawAll() public onlyOwner nonReentrant {
}
function _widthdraw(address _address, uint256 _amount) private {
}
function burn(uint256 tokenId, address _user) external override {
}
bool public operatorFilteringEnabled = true;
function setApprovalForAll(address operator, bool approved)
public
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function bulkGetRoundStatus(uint32 _season,uint32[] calldata roundList) public view returns (bool[] memory result){
}
}
| getCharged(_season,_round,wallet)>=_mintAmount,"amount out of range!" | 405,372 | getCharged(_season,_round,wallet)>=_mintAmount |
"param error, season or round price is not free" | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "operator-filter-registry/src/OperatorFilterer.sol";
import "./interface/INuoPass.sol";
import "./nuo_merkle.sol";
import "./season_sale.sol";
contract NuoPassNFT is ERC721AQueryable, DefaultOperatorFilterer, SeasonSale, NuoMerkle, ReentrancyGuard, INuoPass {
constructor() ERC721A("NuoChip", "NuoChip") {
}
bool public paused = true;
string public BASE_URI;
address public nuoNFTAddress;
function initialize() public onlyOwner {
}
function setBaseUri(string memory uri) 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`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
function setPause(bool _paused) public onlyOwner {
}
function setNuoNFT(address _NuoNFTAddress) public onlyOwner {
}
modifier notPaused() {
}
/**
* @notice set the merkleTree
* @dev .
* @param _treeId merkleTre map id
* @param _root merkleTree root
*/
function setMerkleTree(uint256 _treeId, bytes32 _root) public onlyOwner {
}
/**
* @notice freeMint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function freeMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public notPaused nonReentrant {
}
/**
* @notice whiteList mint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param _mintAmount the actual mint amount
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function whitelistMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
address wallet = _msgSender();
// 1. check if freeMint is begining
require(account == wallet, "you are not the one!");
// 2. get config data
SeasonData storage r = _seasonDataMap[_season][_round];
// 3. check if freeMint is begining
require(r.status == SaleStatus.Saling, "sale not started or finished");
// 4. check pay value, due to free, passed
require(<FILL_ME>)
// 5. check minted count reached cap
require(r.maxSupply >= r.minted + _mintAmount, "mint reached round cap");
// 6. check user mint count reached cap
uint256 userRoundMinted = getUserMintedCount(_season, _round, wallet);
require(r.userMaxMint >= userRoundMinted + _mintAmount, "mint reached user cap");
// 7. verify merkle proof
bool claimed = merkleVerifyAndSetClaimed(r.treeId, index, account, amount, merkleProof);
// if not claimed, claim and charge to the pool
if (!claimed) {
addCharge(_season, _round, wallet, amount);
}
// check if charged amount can cover the mintAmount
require(getCharged(_season, _round, wallet) >= _mintAmount, "amount out of range!");
// 8. mint
_safeMint(wallet, _mintAmount);
// 9. update total progress
r.minted += _mintAmount;
// 10. update user progress
addUserMinted(_season, _round, account, _mintAmount);
// 11. cosume the charged amount
cosumeCharge(_season, _round, account, _mintAmount);
}
/**
* @notice .
* @dev .
* @param _season the public mint season
* @param _round the public mint round
* @param amount the amount of user mint
*/
function publicMint(
uint32 _season,
uint32 _round,
uint256 amount
) public payable notPaused nonReentrant {
}
function withdrawAll() public onlyOwner nonReentrant {
}
function _widthdraw(address _address, uint256 _amount) private {
}
function burn(uint256 tokenId, address _user) external override {
}
bool public operatorFilteringEnabled = true;
function setApprovalForAll(address operator, bool approved)
public
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function bulkGetRoundStatus(uint32 _season,uint32[] calldata roundList) public view returns (bool[] memory result){
}
}
| r.price*_mintAmount<=msg.value,"param error, season or round price is not free" | 405,372 | r.price*_mintAmount<=msg.value |
"param error, season or round price is not free" | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "operator-filter-registry/src/OperatorFilterer.sol";
import "./interface/INuoPass.sol";
import "./nuo_merkle.sol";
import "./season_sale.sol";
contract NuoPassNFT is ERC721AQueryable, DefaultOperatorFilterer, SeasonSale, NuoMerkle, ReentrancyGuard, INuoPass {
constructor() ERC721A("NuoChip", "NuoChip") {
}
bool public paused = true;
string public BASE_URI;
address public nuoNFTAddress;
function initialize() public onlyOwner {
}
function setBaseUri(string memory uri) 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`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
function setPause(bool _paused) public onlyOwner {
}
function setNuoNFT(address _NuoNFTAddress) public onlyOwner {
}
modifier notPaused() {
}
/**
* @notice set the merkleTree
* @dev .
* @param _treeId merkleTre map id
* @param _root merkleTree root
*/
function setMerkleTree(uint256 _treeId, bytes32 _root) public onlyOwner {
}
/**
* @notice freeMint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function freeMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public notPaused nonReentrant {
}
/**
* @notice whiteList mint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param _mintAmount the actual mint amount
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function whitelistMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
}
/**
* @notice .
* @dev .
* @param _season the public mint season
* @param _round the public mint round
* @param amount the amount of user mint
*/
function publicMint(
uint32 _season,
uint32 _round,
uint256 amount
) public payable notPaused nonReentrant {
address wallet = _msgSender();
require(msg.sender == tx.origin,'eoa only');
// 1. get config data
SeasonData storage r = _seasonDataMap[_season][_round];
// 2. check if freeMint is begining
require(r.status == SaleStatus.Saling, "sale not started or finished");
// 3. check pay value, due to free, passed
require(<FILL_ME>)
// 4. check minted count reached cap
require(r.maxSupply >= r.minted + amount, "mint reached cap");
// 5. check user mint count reached cap
uint256 userRoundMinted = getUserMintedCount(_season, _round, wallet);
require(r.userMaxMint >= userRoundMinted + amount, "mint reached cap");
// 6. check if use proof check
require(r.treeId == 0, "this round mint needs list!");
// mint
_safeMint(wallet, amount);
// 9. update total progress
r.minted += amount;
// 10. update user progress
addUserMinted(_season, _round, wallet, amount);
}
function withdrawAll() public onlyOwner nonReentrant {
}
function _widthdraw(address _address, uint256 _amount) private {
}
function burn(uint256 tokenId, address _user) external override {
}
bool public operatorFilteringEnabled = true;
function setApprovalForAll(address operator, bool approved)
public
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function bulkGetRoundStatus(uint32 _season,uint32[] calldata roundList) public view returns (bool[] memory result){
}
}
| r.price*amount<=msg.value,"param error, season or round price is not free" | 405,372 | r.price*amount<=msg.value |
"U shall not pass" | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "operator-filter-registry/src/OperatorFilterer.sol";
import "./interface/INuoPass.sol";
import "./nuo_merkle.sol";
import "./season_sale.sol";
contract NuoPassNFT is ERC721AQueryable, DefaultOperatorFilterer, SeasonSale, NuoMerkle, ReentrancyGuard, INuoPass {
constructor() ERC721A("NuoChip", "NuoChip") {
}
bool public paused = true;
string public BASE_URI;
address public nuoNFTAddress;
function initialize() public onlyOwner {
}
function setBaseUri(string memory uri) 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`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
function setPause(bool _paused) public onlyOwner {
}
function setNuoNFT(address _NuoNFTAddress) public onlyOwner {
}
modifier notPaused() {
}
/**
* @notice set the merkleTree
* @dev .
* @param _treeId merkleTre map id
* @param _root merkleTree root
*/
function setMerkleTree(uint256 _treeId, bytes32 _root) public onlyOwner {
}
/**
* @notice freeMint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function freeMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public notPaused nonReentrant {
}
/**
* @notice whiteList mint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param _mintAmount the actual mint amount
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function whitelistMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
}
/**
* @notice .
* @dev .
* @param _season the public mint season
* @param _round the public mint round
* @param amount the amount of user mint
*/
function publicMint(
uint32 _season,
uint32 _round,
uint256 amount
) public payable notPaused nonReentrant {
}
function withdrawAll() public onlyOwner nonReentrant {
}
function _widthdraw(address _address, uint256 _amount) private {
}
function burn(uint256 tokenId, address _user) external override {
require(<FILL_ME>)
require(ownerOf(tokenId) == _user, "only owner can burn this token!");
_burn(tokenId);
}
bool public operatorFilteringEnabled = true;
function setApprovalForAll(address operator, bool approved)
public
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function bulkGetRoundStatus(uint32 _season,uint32[] calldata roundList) public view returns (bool[] memory result){
}
}
| _msgSender()==owner()||_msgSender()==nuoNFTAddress,"U shall not pass" | 405,372 | _msgSender()==owner()||_msgSender()==nuoNFTAddress |
"only owner can burn this token!" | // contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "operator-filter-registry/src/OperatorFilterer.sol";
import "./interface/INuoPass.sol";
import "./nuo_merkle.sol";
import "./season_sale.sol";
contract NuoPassNFT is ERC721AQueryable, DefaultOperatorFilterer, SeasonSale, NuoMerkle, ReentrancyGuard, INuoPass {
constructor() ERC721A("NuoChip", "NuoChip") {
}
bool public paused = true;
string public BASE_URI;
address public nuoNFTAddress;
function initialize() public onlyOwner {
}
function setBaseUri(string memory uri) 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`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
function setPause(bool _paused) public onlyOwner {
}
function setNuoNFT(address _NuoNFTAddress) public onlyOwner {
}
modifier notPaused() {
}
/**
* @notice set the merkleTree
* @dev .
* @param _treeId merkleTre map id
* @param _root merkleTree root
*/
function setMerkleTree(uint256 _treeId, bytes32 _root) public onlyOwner {
}
/**
* @notice freeMint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function freeMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint256 index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public notPaused nonReentrant {
}
/**
* @notice whiteList mint using merkleproof
* @dev .
* @param _season mint season
* @param _round mint round
* @param _mintAmount the actual mint amount
* @param index merkle index
* @param account merkle account
* @param amount merkle amount
* @param merkleProof merkle proof
*/
function whitelistMint(
uint32 _season,
uint32 _round,
uint256 _mintAmount,
uint index,
address account,
uint256 amount,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
}
/**
* @notice .
* @dev .
* @param _season the public mint season
* @param _round the public mint round
* @param amount the amount of user mint
*/
function publicMint(
uint32 _season,
uint32 _round,
uint256 amount
) public payable notPaused nonReentrant {
}
function withdrawAll() public onlyOwner nonReentrant {
}
function _widthdraw(address _address, uint256 _amount) private {
}
function burn(uint256 tokenId, address _user) external override {
require(_msgSender() == owner() || _msgSender() == nuoNFTAddress, "U shall not pass");
require(<FILL_ME>)
_burn(tokenId);
}
bool public operatorFilteringEnabled = true;
function setApprovalForAll(address operator, bool approved)
public
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(IERC721A, ERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function bulkGetRoundStatus(uint32 _season,uint32[] calldata roundList) public view returns (bool[] memory result){
}
}
| ownerOf(tokenId)==_user,"only owner can burn this token!" | 405,372 | ownerOf(tokenId)==_user |
"Ownable: caller is not the dev" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
contract ReentrancyGuard {
bool private rentrancy_lock = false;
modifier nonReentrant() {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
abstract contract Ownable is Context {
address private _owner;
address private _dev;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
modifier onlyDev() {
}
function owner() public view virtual returns (address) {
}
function dev() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function _checkDev() internal view virtual {
require(<FILL_ME>)
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) external virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
function transferDevOwnership(address newOwner) external virtual onlyDev {
}
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function _startTokenId() internal view virtual returns (uint256) {
}
function _nextTokenId() internal view virtual returns (uint256) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function _numberMinted(address owner) internal view returns (uint256) {
}
function _numberBurned(address owner) internal view returns (uint256) {
}
function _getAux(address owner) internal view returns (uint64) {
}
function _setAux(address owner, uint64 aux) internal virtual {
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
}
function _initializeOwnershipAt(uint256 index) internal virtual {
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
}
function approve(address to, uint256 tokenId) public payable virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _mint(address to, uint256 quantity) internal virtual {
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
}
function _safeMint(address to, uint256 quantity) internal virtual {
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
}
function _msgSenderERC721A() internal view virtual returns (address) {
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
}
}
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
)
internal
pure
returns (bool)
{
}
}
contract Worldies is ERC721A, Ownable, ReentrancyGuard {
bool internal publicMintOpen = false;
uint internal constant totalPossible = 10000;
uint internal constant ourMintPrice = 10000000000000000; // 0.01 ETH
string internal URI = "ipfs://QmYiSA6XRejNQdtTQaWYAvSzDPnYsVdfy7bPSdpoTCgEoo/";
string internal baseExt = ".json";
mapping(address => uint) walletMintCount;
bytes32 public root;
constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) {
}
function allowListMint(uint amount, bytes32[] memory proof) payable external nonReentrant {
}
function publicMint(uint amount) payable external nonReentrant {
}
function zCollectETH() external onlyOwner {
}
function zDev() external onlyDev {
}
function setURI(string calldata _URI) external onlyDev {
}
function setRoot(bytes32 _root) external onlyDev {
}
function togglePublic() external onlyDev {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function setURIExtension(string calldata _baseExt) external onlyDev {
}
function isPublicActive() external view returns (bool) {
}
}
| dev()==_msgSender(),"Ownable: caller is not the dev" | 405,447 | dev()==_msgSender() |
"Not a part of Whitelist" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
contract ReentrancyGuard {
bool private rentrancy_lock = false;
modifier nonReentrant() {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
abstract contract Ownable is Context {
address private _owner;
address private _dev;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
modifier onlyDev() {
}
function owner() public view virtual returns (address) {
}
function dev() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function _checkDev() internal view virtual {
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) external virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
function transferDevOwnership(address newOwner) external virtual onlyDev {
}
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function _startTokenId() internal view virtual returns (uint256) {
}
function _nextTokenId() internal view virtual returns (uint256) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function _numberMinted(address owner) internal view returns (uint256) {
}
function _numberBurned(address owner) internal view returns (uint256) {
}
function _getAux(address owner) internal view returns (uint64) {
}
function _setAux(address owner, uint64 aux) internal virtual {
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
}
function _initializeOwnershipAt(uint256 index) internal virtual {
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
}
function approve(address to, uint256 tokenId) public payable virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _mint(address to, uint256 quantity) internal virtual {
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
}
function _safeMint(address to, uint256 quantity) internal virtual {
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
}
function _msgSenderERC721A() internal view virtual returns (address) {
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
}
}
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
)
internal
pure
returns (bool)
{
}
}
contract Worldies is ERC721A, Ownable, ReentrancyGuard {
bool internal publicMintOpen = false;
uint internal constant totalPossible = 10000;
uint internal constant ourMintPrice = 10000000000000000; // 0.01 ETH
string internal URI = "ipfs://QmYiSA6XRejNQdtTQaWYAvSzDPnYsVdfy7bPSdpoTCgEoo/";
string internal baseExt = ".json";
mapping(address => uint) walletMintCount;
bytes32 public root;
constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) {
}
function allowListMint(uint amount, bytes32[] memory proof) payable external nonReentrant {
require(<FILL_ME>)
require(amount <= 10, "Max 10 per wallet");
unchecked {
require(totalSupply() + amount <= totalPossible, "SOLD OUT");
uint newAmount = walletMintCount[msg.sender] + amount;
require(newAmount <= 10, "Max 10 per wallet");
walletMintCount[msg.sender] = newAmount;
_mint(msg.sender, amount);
}
}
function publicMint(uint amount) payable external nonReentrant {
}
function zCollectETH() external onlyOwner {
}
function zDev() external onlyDev {
}
function setURI(string calldata _URI) external onlyDev {
}
function setRoot(bytes32 _root) external onlyDev {
}
function togglePublic() external onlyDev {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function setURIExtension(string calldata _baseExt) external onlyDev {
}
function isPublicActive() external view returns (bool) {
}
}
| MerkleProof.verify(proof,root,keccak256(abi.encodePacked(msg.sender))),"Not a part of Whitelist" | 405,447 | MerkleProof.verify(proof,root,keccak256(abi.encodePacked(msg.sender))) |
"SOLD OUT" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
contract ReentrancyGuard {
bool private rentrancy_lock = false;
modifier nonReentrant() {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
abstract contract Ownable is Context {
address private _owner;
address private _dev;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
modifier onlyDev() {
}
function owner() public view virtual returns (address) {
}
function dev() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function _checkDev() internal view virtual {
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) external virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
function transferDevOwnership(address newOwner) external virtual onlyDev {
}
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function _startTokenId() internal view virtual returns (uint256) {
}
function _nextTokenId() internal view virtual returns (uint256) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function _numberMinted(address owner) internal view returns (uint256) {
}
function _numberBurned(address owner) internal view returns (uint256) {
}
function _getAux(address owner) internal view returns (uint64) {
}
function _setAux(address owner, uint64 aux) internal virtual {
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
}
function _initializeOwnershipAt(uint256 index) internal virtual {
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
}
function approve(address to, uint256 tokenId) public payable virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _mint(address to, uint256 quantity) internal virtual {
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
}
function _safeMint(address to, uint256 quantity) internal virtual {
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
}
function _msgSenderERC721A() internal view virtual returns (address) {
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
}
}
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
)
internal
pure
returns (bool)
{
}
}
contract Worldies is ERC721A, Ownable, ReentrancyGuard {
bool internal publicMintOpen = false;
uint internal constant totalPossible = 10000;
uint internal constant ourMintPrice = 10000000000000000; // 0.01 ETH
string internal URI = "ipfs://QmYiSA6XRejNQdtTQaWYAvSzDPnYsVdfy7bPSdpoTCgEoo/";
string internal baseExt = ".json";
mapping(address => uint) walletMintCount;
bytes32 public root;
constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) {
}
function allowListMint(uint amount, bytes32[] memory proof) payable external nonReentrant {
require(MerkleProof.verify(proof, root, keccak256(abi.encodePacked(msg.sender))), "Not a part of Whitelist");
require(amount <= 10, "Max 10 per wallet");
unchecked {
require(<FILL_ME>)
uint newAmount = walletMintCount[msg.sender] + amount;
require(newAmount <= 10, "Max 10 per wallet");
walletMintCount[msg.sender] = newAmount;
_mint(msg.sender, amount);
}
}
function publicMint(uint amount) payable external nonReentrant {
}
function zCollectETH() external onlyOwner {
}
function zDev() external onlyDev {
}
function setURI(string calldata _URI) external onlyDev {
}
function setRoot(bytes32 _root) external onlyDev {
}
function togglePublic() external onlyDev {
}
function tokenURI(uint256 tokenId) external view virtual override returns (string memory) {
}
function setURIExtension(string calldata _baseExt) external onlyDev {
}
function isPublicActive() external view returns (bool) {
}
}
| totalSupply()+amount<=totalPossible,"SOLD OUT" | 405,447 | totalSupply()+amount<=totalPossible |
"Not WETH9" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@maverick/contracts/contracts/interfaces/IPool.sol";
import "@maverick/contracts/contracts/interfaces/IFactory.sol";
import "@maverick/contracts/contracts/interfaces/IPosition.sol";
import "./interfaces/IRouter.sol";
import "./interfaces/external/IWETH9.sol";
import "./libraries/TransferHelper.sol";
import "./libraries/Path.sol";
import "./libraries/Deadline.sol";
import "./libraries/Multicall.sol";
import "./libraries/SelfPermit.sol";
contract Router is IRouter, Multicall, SelfPermit, Deadline {
using Path for bytes;
/// @dev Used as the placeholder value for amountInCached, because the
//computed amount in for an exact output swap / can never actually be this
//value
uint256 private constant DEFAULT_AMOUNT_IN_CACHED = type(uint256).max;
/// @dev Transient storage variable used for returning the computed amount in for an exact output swap.
uint256 private amountInCached = DEFAULT_AMOUNT_IN_CACHED;
struct AddLiquidityCallbackData {
IERC20 tokenA;
IERC20 tokenB;
IPool pool;
address payer;
}
struct SwapCallbackData {
bytes path;
address payer;
bool exactOutput;
}
/// @inheritdoc IRouter
IFactory public immutable factory;
/// @inheritdoc IRouter
IPosition public immutable position;
/// @inheritdoc ISlimRouter
IWETH9 public immutable WETH9;
constructor(IFactory _factory, IWETH9 _WETH9) {
}
receive() external payable {
require(<FILL_ME>)
}
/// @inheritdoc ISlimRouter
function unwrapWETH9(uint256 amountMinimum, address recipient) public payable override {
}
/// @inheritdoc ISlimRouter
function sweepToken(IERC20 token, uint256 amountMinimum, address recipient) public payable {
}
/// @inheritdoc ISlimRouter
function refundETH() external payable override {
}
/// @param token The token to pay
/// @param payer The entity that must pay
/// @param recipient The entity that will receive payment
/// @param value The amount to pay
function pay(IERC20 token, address payer, address recipient, uint256 value) internal {
}
function swapCallback(uint256 amountToPay, uint256 amountOut, bytes calldata _data) external {
}
function exactInputInternal(
uint256 amountIn,
address recipient,
uint256 sqrtPriceLimitD18,
SwapCallbackData memory data
) private returns (uint256 amountOut) {
}
/// @inheritdoc ISlimRouter
function exactInputSingle(
ExactInputSingleParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) {
}
/// @inheritdoc IRouter
function exactInput(
ExactInputParams memory params
) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) {
}
/// @dev Performs a single exact output swap
function exactOutputInternal(
uint256 amountOut,
address recipient,
SwapCallbackData memory data
) private returns (uint256 amountIn) {
}
/// @inheritdoc ISlimRouter
function exactOutputSingle(
ExactOutputSingleParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) {
}
/// @inheritdoc IRouter
function exactOutput(
ExactOutputParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) {
}
// Liqudity
function addLiquidityCallback(uint256 amountA, uint256 amountB, bytes calldata _data) external {
}
function addLiquidity(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount
)
private
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function addLiquidityToPool(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function addLiquidityWTickLimits(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
int32 minActiveTick,
int32 maxActiveTick,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
function getOrCreatePool(PoolParams calldata poolParams) private returns (IPool pool) {
}
/// @inheritdoc IRouter
function getOrCreatePoolAndAddLiquidity(
PoolParams calldata poolParams,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata addParams,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function migrateBinsUpStack(
IPool pool,
uint128[] calldata binIds,
uint32 maxRecursion,
uint256 deadline
) external checkDeadline(deadline) {
}
/// @inheritdoc IRouter
function removeLiquidity(
IPool pool,
address recipient,
uint256 tokenId,
IPool.RemoveLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
checkDeadline(deadline)
returns (uint256 tokenAAmount, uint256 tokenBAmount, IPool.BinDelta[] memory binDeltas)
{
}
}
| IWETH9(msg.sender)==WETH9,"Not WETH9" | 405,481 | IWETH9(msg.sender)==WETH9 |
"Must call from a Factory Pool" | // SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@maverick/contracts/contracts/interfaces/IPool.sol";
import "@maverick/contracts/contracts/interfaces/IFactory.sol";
import "@maverick/contracts/contracts/interfaces/IPosition.sol";
import "./interfaces/IRouter.sol";
import "./interfaces/external/IWETH9.sol";
import "./libraries/TransferHelper.sol";
import "./libraries/Path.sol";
import "./libraries/Deadline.sol";
import "./libraries/Multicall.sol";
import "./libraries/SelfPermit.sol";
contract Router is IRouter, Multicall, SelfPermit, Deadline {
using Path for bytes;
/// @dev Used as the placeholder value for amountInCached, because the
//computed amount in for an exact output swap / can never actually be this
//value
uint256 private constant DEFAULT_AMOUNT_IN_CACHED = type(uint256).max;
/// @dev Transient storage variable used for returning the computed amount in for an exact output swap.
uint256 private amountInCached = DEFAULT_AMOUNT_IN_CACHED;
struct AddLiquidityCallbackData {
IERC20 tokenA;
IERC20 tokenB;
IPool pool;
address payer;
}
struct SwapCallbackData {
bytes path;
address payer;
bool exactOutput;
}
/// @inheritdoc IRouter
IFactory public immutable factory;
/// @inheritdoc IRouter
IPosition public immutable position;
/// @inheritdoc ISlimRouter
IWETH9 public immutable WETH9;
constructor(IFactory _factory, IWETH9 _WETH9) {
}
receive() external payable {
}
/// @inheritdoc ISlimRouter
function unwrapWETH9(uint256 amountMinimum, address recipient) public payable override {
}
/// @inheritdoc ISlimRouter
function sweepToken(IERC20 token, uint256 amountMinimum, address recipient) public payable {
}
/// @inheritdoc ISlimRouter
function refundETH() external payable override {
}
/// @param token The token to pay
/// @param payer The entity that must pay
/// @param recipient The entity that will receive payment
/// @param value The amount to pay
function pay(IERC20 token, address payer, address recipient, uint256 value) internal {
}
function swapCallback(uint256 amountToPay, uint256 amountOut, bytes calldata _data) external {
require(amountToPay > 0 && amountOut > 0, "In or Out Amount is Zero");
require(<FILL_ME>)
SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData));
(IERC20 tokenIn, IERC20 tokenOut, IPool pool) = data.path.decodeFirstPool();
require(msg.sender == address(pool));
if (data.exactOutput) {
if (data.path.hasMultiplePools()) {
data.path = data.path.skipToken();
exactOutputInternal(amountToPay, msg.sender, data);
} else {
amountInCached = amountToPay;
pay(tokenOut, data.payer, msg.sender, amountToPay);
}
} else {
pay(tokenIn, data.payer, msg.sender, amountToPay);
}
}
function exactInputInternal(
uint256 amountIn,
address recipient,
uint256 sqrtPriceLimitD18,
SwapCallbackData memory data
) private returns (uint256 amountOut) {
}
/// @inheritdoc ISlimRouter
function exactInputSingle(
ExactInputSingleParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) {
}
/// @inheritdoc IRouter
function exactInput(
ExactInputParams memory params
) external payable override checkDeadline(params.deadline) returns (uint256 amountOut) {
}
/// @dev Performs a single exact output swap
function exactOutputInternal(
uint256 amountOut,
address recipient,
SwapCallbackData memory data
) private returns (uint256 amountIn) {
}
/// @inheritdoc ISlimRouter
function exactOutputSingle(
ExactOutputSingleParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) {
}
/// @inheritdoc IRouter
function exactOutput(
ExactOutputParams calldata params
) external payable override checkDeadline(params.deadline) returns (uint256 amountIn) {
}
// Liqudity
function addLiquidityCallback(uint256 amountA, uint256 amountB, bytes calldata _data) external {
}
function addLiquidity(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount
)
private
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function addLiquidityToPool(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function addLiquidityWTickLimits(
IPool pool,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
int32 minActiveTick,
int32 maxActiveTick,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
function getOrCreatePool(PoolParams calldata poolParams) private returns (IPool pool) {
}
/// @inheritdoc IRouter
function getOrCreatePoolAndAddLiquidity(
PoolParams calldata poolParams,
uint256 tokenId,
IPool.AddLiquidityParams[] calldata addParams,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
payable
checkDeadline(deadline)
returns (
uint256 receivingTokenId,
uint256 tokenAAmount,
uint256 tokenBAmount,
IPool.BinDelta[] memory binDeltas
)
{
}
/// @inheritdoc IRouter
function migrateBinsUpStack(
IPool pool,
uint128[] calldata binIds,
uint32 maxRecursion,
uint256 deadline
) external checkDeadline(deadline) {
}
/// @inheritdoc IRouter
function removeLiquidity(
IPool pool,
address recipient,
uint256 tokenId,
IPool.RemoveLiquidityParams[] calldata params,
uint256 minTokenAAmount,
uint256 minTokenBAmount,
uint256 deadline
)
external
checkDeadline(deadline)
returns (uint256 tokenAAmount, uint256 tokenBAmount, IPool.BinDelta[] memory binDeltas)
{
}
}
| factory.isFactoryPool(IPool(msg.sender)),"Must call from a Factory Pool" | 405,481 | factory.isFactoryPool(IPool(msg.sender)) |
null | pragma solidity ^0.8.13;
contract MockCircleTokenMessenger is ITokenMessenger {
uint64 public nextNonce = 0;
MockToken token;
constructor(MockToken _token) {
}
function depositForBurn(
uint256 _amount,
uint32,
bytes32,
address _burnToken
) external returns (uint64 _nonce) {
nextNonce = nextNonce + 1;
_nonce = nextNonce;
require(<FILL_ME>)
token.transferFrom(msg.sender, address(this), _amount);
token.burn(_amount);
}
function depositForBurnWithCaller(
uint256,
uint32,
bytes32,
address,
bytes32
) external returns (uint64 _nonce) {
}
}
| address(token)==_burnToken | 405,558 | address(token)==_burnToken |
"Not the NFT owner" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interface/INFTXVault.sol";
import "./interface/INFTXVaultFactory.sol";
import "./interface/INFTXFeeDistributor.sol";
import "./token/IERC1155Upgradeable.sol";
import "./token/IERC20Upgradeable.sol";
import "./token/ERC721HolderUpgradeable.sol";
import "./token/ERC1155HolderUpgradeable.sol";
import "./util/OwnableUpgradeable.sol";
import "./util/ReentrancyGuardUpgradeable.sol";
import "./util/SafeERC20Upgradeable.sol";
/**
* @notice A partial ERC20 interface.
*/
interface IERC20 {
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
}
/**
* @notice A partial WETH interface.
*/
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
function balanceOf(address to) external view returns (uint256);
}
/**
* @notice Sets up a marketplace zap to interact with the 0x protocol. The 0x contract that
* is hit later on handles the token conversion based on parameters that are sent from the
* frontend.
*
* @author Twade
*/
contract NFTXMarketplace0xZap is OwnableUpgradeable, ReentrancyGuardUpgradeable, ERC721HolderUpgradeable, ERC1155HolderUpgradeable {
using SafeERC20Upgradeable for IERC20Upgradeable;
/// @notice An interface for the WETH contract
IWETH public immutable WETH;
/// @notice An interface for the NFTX Vault Factory contract
INFTXVaultFactory public immutable nftxFactory;
/// @notice A mapping of NFTX Vault IDs to their address corresponding vault contract address
mapping(uint256 => address) public nftxVaultAddresses;
/// @notice The decimal accuracy
uint256 constant BASE = 1e18;
// Set a constant address for specific contracts that need special logic
address constant CRYPTO_PUNKS = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB;
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the buy
/// @param to The user affected by the event
event Buy(uint256 count, uint256 ethSpent, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethReceived The amount of ETH received in the sell
/// @param to The user affected by the event
event Sell(uint256 count, uint256 ethReceived, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the swap
/// @param to The user affected by the event
event Swap(uint256 count, uint256 ethSpent, address to);
/**
* @notice Initialises our zap by setting contract addresses onto their
* respective interfaces.
*
* @param _nftxFactory NFTX Vault Factory contract address
* @param _WETH WETH contract address
*/
constructor(address _nftxFactory, address _WETH) {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell721(
uint256 vaultId,
uint256[] calldata ids,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap721(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice TODO
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to buy
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndRedeem(
uint256 vaultId,
uint256 amount,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts The number of the corresponding ID to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell1155(
uint256 vaultId,
uint256[] calldata ids,
uint256[] calldata amounts,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap1155(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata amounts,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
*/
function _mint721(uint256 vaultId, uint256[] memory ids) internal returns (address) {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts An array of amounts whose indexes map to the ids array
*/
function _mint1155(uint256 vaultId, uint256[] memory ids, uint256[] memory amounts) internal returns (address) {
}
/**
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of token IDs to be minted
* @param idsOut An array of token IDs to be redeemed
* @param to The recipient of the idsOut from the tx
*/
function _swap721(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Swaps 1155 tokens, transferring them from the recipient to this contract, and
* then sending them to the NFTX vault, that sends them to the recipient.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn The IDs owned by the sender to be swapped
* @param amounts The number of each corresponding ID being swapped
* @param idsOut The requested IDs to be swapped for
* @param to The recipient of the swapped tokens
*
* @return address The address of the NFTX vault
*/
function _swap1155(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory amounts,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Redeems tokens from a vault to a recipient.
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to be redeemed
* @param specificIds Specified token IDs if desired, otherwise will be _random_
* @param to The recipient of the token
*/
function _redeem(uint256 vaultId, uint256 amount, uint256[] memory specificIds, address to) internal {
}
/**
* @notice Transfers our ERC721 tokens to a specified recipient.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function transferFromERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
bytes memory data;
if (assetAddr == CRYPTO_PUNKS) {
// Fix here for frontrun attack.
bytes memory punkIndexToAddress = abi.encodeWithSignature("punkIndexToAddress(uint256)", tokenId);
(bool checkSuccess, bytes memory result) = address(assetAddr).staticcall(punkIndexToAddress);
(address nftOwner) = abi.decode(result, (address));
require(<FILL_ME>)
data = abi.encodeWithSignature("buyPunk(uint256)", tokenId);
} else {
// We push to the vault to avoid an unneeded transfer.
data = abi.encodeWithSignature("safeTransferFrom(address,address,uint256)", msg.sender, to, tokenId);
}
(bool success, bytes memory resultData) = address(assetAddr).call(data);
require(success, string(resultData));
}
/**
* @notice Approves our ERC721 tokens to be transferred.
*
* @dev This is only required to provide special logic for Cryptopunks.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function approveERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
}
/**
* @notice Swaps ERC20->ERC20 tokens held by this contract using a 0x-API quote.
*
* @dev Must attach ETH equal to the `value` field from the API response.
*
* @param sellToken The `sellTokenAddress` field from the API response
* @param buyToken The `buyTokenAddress` field from the API response
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
*/
function _fillQuote(
address sellToken,
address buyToken,
address spender,
address payable swapTarget,
bytes calldata swapCallData
) internal returns (uint256) {
}
/**
* @notice Transfers ETH or WETH to a recipient, based on preference.
*
* @param to Recipient of the transfer
* @param amount Amount to be transferred
* @param isWeth If user prefers to receive WETH rather than ETH
*/
function _transferEthOrWeth(address to, uint amount, bool isWeth) internal {
}
/**
* @notice Allows 1155 IDs and amounts to be validated.
*
* @param ids The IDs of the 1155 tokens.
* @param amounts The number of each corresponding token to process.
*
* @return totalIds The number of different IDs being sent.
* @return totalAmount The total number of IDs being processed.
*/
function _validate1155Ids(
uint[] calldata ids,
uint[] calldata amounts
) internal pure returns (
uint totalIds,
uint totalAmount
) {
}
/**
* @notice Maps a cached NFTX vault address against a vault ID.
*
* @param vaultId The ID of the NFTX vault
*/
function _vaultAddress(uint256 vaultId) internal returns (address) {
}
/**
* @notice Allows our owner to withdraw and tokens in the contract.
*
* @param token The address of the token to be rescued
*/
function rescue(address token) external onlyOwner {
}
/**
* @notice Allows our contract to receive any assets.
*/
receive() external payable {
}
}
| checkSuccess&&nftOwner==msg.sender,"Not the NFT owner" | 405,706 | checkSuccess&&nftOwner==msg.sender |
'Unable to approve contract' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interface/INFTXVault.sol";
import "./interface/INFTXVaultFactory.sol";
import "./interface/INFTXFeeDistributor.sol";
import "./token/IERC1155Upgradeable.sol";
import "./token/IERC20Upgradeable.sol";
import "./token/ERC721HolderUpgradeable.sol";
import "./token/ERC1155HolderUpgradeable.sol";
import "./util/OwnableUpgradeable.sol";
import "./util/ReentrancyGuardUpgradeable.sol";
import "./util/SafeERC20Upgradeable.sol";
/**
* @notice A partial ERC20 interface.
*/
interface IERC20 {
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
}
/**
* @notice A partial WETH interface.
*/
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
function balanceOf(address to) external view returns (uint256);
}
/**
* @notice Sets up a marketplace zap to interact with the 0x protocol. The 0x contract that
* is hit later on handles the token conversion based on parameters that are sent from the
* frontend.
*
* @author Twade
*/
contract NFTXMarketplace0xZap is OwnableUpgradeable, ReentrancyGuardUpgradeable, ERC721HolderUpgradeable, ERC1155HolderUpgradeable {
using SafeERC20Upgradeable for IERC20Upgradeable;
/// @notice An interface for the WETH contract
IWETH public immutable WETH;
/// @notice An interface for the NFTX Vault Factory contract
INFTXVaultFactory public immutable nftxFactory;
/// @notice A mapping of NFTX Vault IDs to their address corresponding vault contract address
mapping(uint256 => address) public nftxVaultAddresses;
/// @notice The decimal accuracy
uint256 constant BASE = 1e18;
// Set a constant address for specific contracts that need special logic
address constant CRYPTO_PUNKS = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB;
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the buy
/// @param to The user affected by the event
event Buy(uint256 count, uint256 ethSpent, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethReceived The amount of ETH received in the sell
/// @param to The user affected by the event
event Sell(uint256 count, uint256 ethReceived, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the swap
/// @param to The user affected by the event
event Swap(uint256 count, uint256 ethSpent, address to);
/**
* @notice Initialises our zap by setting contract addresses onto their
* respective interfaces.
*
* @param _nftxFactory NFTX Vault Factory contract address
* @param _WETH WETH contract address
*/
constructor(address _nftxFactory, address _WETH) {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell721(
uint256 vaultId,
uint256[] calldata ids,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap721(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice TODO
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to buy
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndRedeem(
uint256 vaultId,
uint256 amount,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts The number of the corresponding ID to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell1155(
uint256 vaultId,
uint256[] calldata ids,
uint256[] calldata amounts,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap1155(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata amounts,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
*/
function _mint721(uint256 vaultId, uint256[] memory ids) internal returns (address) {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts An array of amounts whose indexes map to the ids array
*/
function _mint1155(uint256 vaultId, uint256[] memory ids, uint256[] memory amounts) internal returns (address) {
}
/**
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of token IDs to be minted
* @param idsOut An array of token IDs to be redeemed
* @param to The recipient of the idsOut from the tx
*/
function _swap721(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Swaps 1155 tokens, transferring them from the recipient to this contract, and
* then sending them to the NFTX vault, that sends them to the recipient.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn The IDs owned by the sender to be swapped
* @param amounts The number of each corresponding ID being swapped
* @param idsOut The requested IDs to be swapped for
* @param to The recipient of the swapped tokens
*
* @return address The address of the NFTX vault
*/
function _swap1155(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory amounts,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Redeems tokens from a vault to a recipient.
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to be redeemed
* @param specificIds Specified token IDs if desired, otherwise will be _random_
* @param to The recipient of the token
*/
function _redeem(uint256 vaultId, uint256 amount, uint256[] memory specificIds, address to) internal {
}
/**
* @notice Transfers our ERC721 tokens to a specified recipient.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function transferFromERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
}
/**
* @notice Approves our ERC721 tokens to be transferred.
*
* @dev This is only required to provide special logic for Cryptopunks.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function approveERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
}
/**
* @notice Swaps ERC20->ERC20 tokens held by this contract using a 0x-API quote.
*
* @dev Must attach ETH equal to the `value` field from the API response.
*
* @param sellToken The `sellTokenAddress` field from the API response
* @param buyToken The `buyTokenAddress` field from the API response
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
*/
function _fillQuote(
address sellToken,
address buyToken,
address spender,
address payable swapTarget,
bytes calldata swapCallData
) internal returns (uint256) {
// Track our balance of the buyToken to determine how much we've bought.
uint256 boughtAmount = IERC20(buyToken).balanceOf(address(this));
// Give `swapTarget` an infinite allowance to spend this contract's `sellToken`.
// Note that for some tokens (e.g., USDT, KNC), you must first reset any existing
// allowance to 0 before being able to update it.
require(<FILL_ME>)
// Call the encoded swap function call on the contract at `swapTarget`
(bool success,) = swapTarget.call(swapCallData);
require(success, 'SWAP_CALL_FAILED');
// Use our current buyToken balance to determine how much we've bought.
return IERC20(buyToken).balanceOf(address(this)) - boughtAmount;
}
/**
* @notice Transfers ETH or WETH to a recipient, based on preference.
*
* @param to Recipient of the transfer
* @param amount Amount to be transferred
* @param isWeth If user prefers to receive WETH rather than ETH
*/
function _transferEthOrWeth(address to, uint amount, bool isWeth) internal {
}
/**
* @notice Allows 1155 IDs and amounts to be validated.
*
* @param ids The IDs of the 1155 tokens.
* @param amounts The number of each corresponding token to process.
*
* @return totalIds The number of different IDs being sent.
* @return totalAmount The total number of IDs being processed.
*/
function _validate1155Ids(
uint[] calldata ids,
uint[] calldata amounts
) internal pure returns (
uint totalIds,
uint totalAmount
) {
}
/**
* @notice Maps a cached NFTX vault address against a vault ID.
*
* @param vaultId The ID of the NFTX vault
*/
function _vaultAddress(uint256 vaultId) internal returns (address) {
}
/**
* @notice Allows our owner to withdraw and tokens in the contract.
*
* @param token The address of the token to be rescued
*/
function rescue(address token) external onlyOwner {
}
/**
* @notice Allows our contract to receive any assets.
*/
receive() external payable {
}
}
| IERC20(sellToken).approve(swapTarget,type(uint256).max),'Unable to approve contract' | 405,706 | IERC20(sellToken).approve(swapTarget,type(uint256).max) |
'Vault does not exist' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interface/INFTXVault.sol";
import "./interface/INFTXVaultFactory.sol";
import "./interface/INFTXFeeDistributor.sol";
import "./token/IERC1155Upgradeable.sol";
import "./token/IERC20Upgradeable.sol";
import "./token/ERC721HolderUpgradeable.sol";
import "./token/ERC1155HolderUpgradeable.sol";
import "./util/OwnableUpgradeable.sol";
import "./util/ReentrancyGuardUpgradeable.sol";
import "./util/SafeERC20Upgradeable.sol";
/**
* @notice A partial ERC20 interface.
*/
interface IERC20 {
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
}
/**
* @notice A partial WETH interface.
*/
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
function balanceOf(address to) external view returns (uint256);
}
/**
* @notice Sets up a marketplace zap to interact with the 0x protocol. The 0x contract that
* is hit later on handles the token conversion based on parameters that are sent from the
* frontend.
*
* @author Twade
*/
contract NFTXMarketplace0xZap is OwnableUpgradeable, ReentrancyGuardUpgradeable, ERC721HolderUpgradeable, ERC1155HolderUpgradeable {
using SafeERC20Upgradeable for IERC20Upgradeable;
/// @notice An interface for the WETH contract
IWETH public immutable WETH;
/// @notice An interface for the NFTX Vault Factory contract
INFTXVaultFactory public immutable nftxFactory;
/// @notice A mapping of NFTX Vault IDs to their address corresponding vault contract address
mapping(uint256 => address) public nftxVaultAddresses;
/// @notice The decimal accuracy
uint256 constant BASE = 1e18;
// Set a constant address for specific contracts that need special logic
address constant CRYPTO_PUNKS = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB;
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the buy
/// @param to The user affected by the event
event Buy(uint256 count, uint256 ethSpent, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethReceived The amount of ETH received in the sell
/// @param to The user affected by the event
event Sell(uint256 count, uint256 ethReceived, address to);
/// @notice Emitted when ..
/// @param count The number of tokens affected by the event
/// @param ethSpent The amount of ETH spent in the swap
/// @param to The user affected by the event
event Swap(uint256 count, uint256 ethSpent, address to);
/**
* @notice Initialises our zap by setting contract addresses onto their
* respective interfaces.
*
* @param _nftxFactory NFTX Vault Factory contract address
* @param _WETH WETH contract address
*/
constructor(address _nftxFactory, address _WETH) {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell721(
uint256 vaultId,
uint256[] calldata ids,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap721(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice TODO
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to buy
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndRedeem(
uint256 vaultId,
uint256 amount,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @notice Mints tokens from our NFTX vault and sells them on 0x.
*
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts The number of the corresponding ID to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function mintAndSell1155(
uint256 vaultId,
uint256[] calldata ids,
uint256[] calldata amounts,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external nonReentrant {
}
/**
* @notice Purchases vault tokens from 0x with WETH and then swaps the tokens for
* either random or specific token IDs from the vault. The specified recipient will
* receive the ERC721 tokens, as well as any WETH dust that is left over from the tx.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of random token IDs to be minted
* @param specificIds An array of any specific token IDs to be minted
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
* @param to The recipient of the WETH from the tx
*/
function buyAndSwap1155(
uint256 vaultId,
uint256[] calldata idsIn,
uint256[] calldata amounts,
uint256[] calldata specificIds,
address spender,
address payable swapTarget,
bytes calldata swapCallData,
address payable to
) external payable nonReentrant {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
*/
function _mint721(uint256 vaultId, uint256[] memory ids) internal returns (address) {
}
/**
* @param vaultId The ID of the NFTX vault
* @param ids An array of token IDs to be minted
* @param amounts An array of amounts whose indexes map to the ids array
*/
function _mint1155(uint256 vaultId, uint256[] memory ids, uint256[] memory amounts) internal returns (address) {
}
/**
*
* @param vaultId The ID of the NFTX vault
* @param idsIn An array of token IDs to be minted
* @param idsOut An array of token IDs to be redeemed
* @param to The recipient of the idsOut from the tx
*/
function _swap721(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Swaps 1155 tokens, transferring them from the recipient to this contract, and
* then sending them to the NFTX vault, that sends them to the recipient.
*
* @param vaultId The ID of the NFTX vault
* @param idsIn The IDs owned by the sender to be swapped
* @param amounts The number of each corresponding ID being swapped
* @param idsOut The requested IDs to be swapped for
* @param to The recipient of the swapped tokens
*
* @return address The address of the NFTX vault
*/
function _swap1155(
uint256 vaultId,
uint256[] memory idsIn,
uint256[] memory amounts,
uint256[] memory idsOut,
address to
) internal returns (address) {
}
/**
* @notice Redeems tokens from a vault to a recipient.
*
* @param vaultId The ID of the NFTX vault
* @param amount The number of tokens to be redeemed
* @param specificIds Specified token IDs if desired, otherwise will be _random_
* @param to The recipient of the token
*/
function _redeem(uint256 vaultId, uint256 amount, uint256[] memory specificIds, address to) internal {
}
/**
* @notice Transfers our ERC721 tokens to a specified recipient.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function transferFromERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
}
/**
* @notice Approves our ERC721 tokens to be transferred.
*
* @dev This is only required to provide special logic for Cryptopunks.
*
* @param assetAddr Address of the asset being transferred
* @param tokenId The ID of the token being transferred
* @param to The address the token is being transferred to
*/
function approveERC721(address assetAddr, uint256 tokenId, address to) internal virtual {
}
/**
* @notice Swaps ERC20->ERC20 tokens held by this contract using a 0x-API quote.
*
* @dev Must attach ETH equal to the `value` field from the API response.
*
* @param sellToken The `sellTokenAddress` field from the API response
* @param buyToken The `buyTokenAddress` field from the API response
* @param spender The `allowanceTarget` field from the API response
* @param swapTarget The `to` field from the API response
* @param swapCallData The `data` field from the API response
*/
function _fillQuote(
address sellToken,
address buyToken,
address spender,
address payable swapTarget,
bytes calldata swapCallData
) internal returns (uint256) {
}
/**
* @notice Transfers ETH or WETH to a recipient, based on preference.
*
* @param to Recipient of the transfer
* @param amount Amount to be transferred
* @param isWeth If user prefers to receive WETH rather than ETH
*/
function _transferEthOrWeth(address to, uint amount, bool isWeth) internal {
}
/**
* @notice Allows 1155 IDs and amounts to be validated.
*
* @param ids The IDs of the 1155 tokens.
* @param amounts The number of each corresponding token to process.
*
* @return totalIds The number of different IDs being sent.
* @return totalAmount The total number of IDs being processed.
*/
function _validate1155Ids(
uint[] calldata ids,
uint[] calldata amounts
) internal pure returns (
uint totalIds,
uint totalAmount
) {
}
/**
* @notice Maps a cached NFTX vault address against a vault ID.
*
* @param vaultId The ID of the NFTX vault
*/
function _vaultAddress(uint256 vaultId) internal returns (address) {
if (nftxVaultAddresses[vaultId] == address(0)) {
nftxVaultAddresses[vaultId] = nftxFactory.vault(vaultId);
}
require(<FILL_ME>)
return nftxVaultAddresses[vaultId];
}
/**
* @notice Allows our owner to withdraw and tokens in the contract.
*
* @param token The address of the token to be rescued
*/
function rescue(address token) external onlyOwner {
}
/**
* @notice Allows our contract to receive any assets.
*/
receive() external payable {
}
}
| nftxVaultAddresses[vaultId]!=address(0),'Vault does not exist' | 405,706 | nftxVaultAddresses[vaultId]!=address(0) |
"duplicate" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8;
import "@openzeppelin/contracts-upgradeable/finance/PaymentSplitterUpgradeable.sol";
import "../generated/impl/BaseCedarPaymentSplitterV2.sol";
contract CedarPaymentSplitter is PaymentSplitterUpgradeable, BaseCedarPaymentSplitterV2 {
mapping(address => bool) private payeeExists;
function initialize(address[] memory payees, uint256[] memory shares_) external initializer {
uint256 totalShares = 0;
for (uint256 i = 0; i < shares_.length; i++) {
totalShares = totalShares + shares_[i];
require(<FILL_ME>)
payeeExists[payees[i]] = true;
}
require(totalShares == 10000, "total share should be 10000");
__PaymentSplitter_init(payees, shares_);
}
// Concrete implementation semantic version - provided for completeness but not designed to be the point of dispatch
function minorVersion() public pure override returns (uint256 minor, uint256 patch) {
}
function getTotalReleased() external view override returns (uint256) {
}
function getTotalReleased(IERC20Upgradeable token) external view override returns (uint256) {
}
function getReleased(address account) external view override returns (uint256) {
}
function getReleased(IERC20Upgradeable token, address account) external view override returns (uint256) {
}
function releasePayment(address payable account) external override {
}
function releasePayment(IERC20Upgradeable token, address account) external override {
}
}
| payeeExists[payees[i]]==false,"duplicate" | 406,068 | payeeExists[payees[i]]==false |
"017" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
require(<FILL_ME>)
_;
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| IERC721(generative_assets_crystal_address).balanceOf(msg.sender)>0||_activated_addr_bal[msg.sender]>0,"017" | 406,352 | IERC721(generative_assets_crystal_address).balanceOf(msg.sender)>0||_activated_addr_bal[msg.sender]>0 |
"006" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
if (voting_type_ == VotingType.goovyPerMEU) {
require(<FILL_ME>)
} else if (voting_type_ == VotingType.percentage) {
require(uint160(value_) <= 100, "005");
} else if (voting_type_ == VotingType.changeMEUAddress || voting_type_ == VotingType.changeMUTDAddress) {
// no checks needed
} else {
require(IERC721(address(value_)).supportsInterface(0x80ac58cd), "016");
}
uint256 newProposalUid = _proposals.length;
_proposals.push(
Proposal(voting_type_, value_, block.timestamp, false)
);
emit proposalCreated(
newProposalUid,
voting_type_,
value_,
block.timestamp,
block.timestamp + 5 days
);
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| uint160(value_)>=1ether,"006" | 406,352 | uint160(value_)>=1ether |
"005" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
if (voting_type_ == VotingType.goovyPerMEU) {
require(uint160(value_) >= 1 ether, "006");
} else if (voting_type_ == VotingType.percentage) {
require(<FILL_ME>)
} else if (voting_type_ == VotingType.changeMEUAddress || voting_type_ == VotingType.changeMUTDAddress) {
// no checks needed
} else {
require(IERC721(address(value_)).supportsInterface(0x80ac58cd), "016");
}
uint256 newProposalUid = _proposals.length;
_proposals.push(
Proposal(voting_type_, value_, block.timestamp, false)
);
emit proposalCreated(
newProposalUid,
voting_type_,
value_,
block.timestamp,
block.timestamp + 5 days
);
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| uint160(value_)<=100,"005" | 406,352 | uint160(value_)<=100 |
"016" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
if (voting_type_ == VotingType.goovyPerMEU) {
require(uint160(value_) >= 1 ether, "006");
} else if (voting_type_ == VotingType.percentage) {
require(uint160(value_) <= 100, "005");
} else if (voting_type_ == VotingType.changeMEUAddress || voting_type_ == VotingType.changeMUTDAddress) {
// no checks needed
} else {
require(<FILL_ME>)
}
uint256 newProposalUid = _proposals.length;
_proposals.push(
Proposal(voting_type_, value_, block.timestamp, false)
);
emit proposalCreated(
newProposalUid,
voting_type_,
value_,
block.timestamp,
block.timestamp + 5 days
);
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| IERC721(address(value_)).supportsInterface(0x80ac58cd),"016" | 406,352 | IERC721(address(value_)).supportsInterface(0x80ac58cd) |
"011" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
require(<FILL_ME>)
_voices[uid_].push(Voice(msg.sender, voice_));
emit voiceSubmited(msg.sender, voice_);
_is_voted[uid_][msg.sender] = true;
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| !_is_voted[uid_][msg.sender]&&block.timestamp<_proposals[uid_].start_time+5days&&balanceOf(msg.sender)>0,"011" | 406,352 | !_is_voted[uid_][msg.sender]&&block.timestamp<_proposals[uid_].start_time+5days&&balanceOf(msg.sender)>0 |
"008" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
Proposal memory proposal = _proposals[uid_];
require(<FILL_ME>)
uint256 voices_for;
uint256 voices_against;
for (uint256 i = 0; i < _voices[uid_].length; i++) {
Voice memory voice = _voices[uid_][i];
uint256 balance = balanceOf(voice.eth_address);
if (voice.voice) voices_for += balance;
else voices_against += balance;
}
bool submited = voices_for > voices_against;
if (submited) {
if (proposal.voting_type == VotingType.goovyPerMEU)
goovyPerMeu = uint256(uint160(proposal.value));
else if (proposal.voting_type == VotingType.percentage)
_percentage = uint256(uint160(proposal.value));
else if (proposal.voting_type == VotingType.addElegibleNFT)
eligibleActivateNFTContracts.push(address(proposal.value));
else if (proposal.voting_type == VotingType.removeElegibleNFT) {
for (uint256 i; i < eligibleActivateNFTContracts.length; i++) {
if (eligibleActivateNFTContracts[i] == address(proposal.value)) {
delete eligibleActivateNFTContracts[i];
}
}
} else if (proposal.voting_type == VotingType.changeMEUAddress) {
meta_unit_address = address(proposal.value);
} else if (proposal.voting_type == VotingType.changeMUTDAddress) {
meta_unit_dt_address = address(proposal.value);
}
}
emit proposalResolved(uid_, submited);
_proposals[uid_].resolved = true;
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| !_proposals[uid_].resolved&&block.timestamp>proposal.start_time+5days,"008" | 406,352 | !_proposals[uid_].resolved&&block.timestamp>proposal.start_time+5days |
"013" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
require(percentage <= _percentage, "012");
require(meu_address == meta_unit_address || meu_address == meta_unit_dt_address, "015");
require(<FILL_ME>)
uint256 stake_amount = useNFT ? _max_amount : meu_amount;
if (useNFT) {
require(hasEligibleNFT(eligible_nft_token_address), "004");
IERC721(eligible_nft_token_address).transferFrom(
msg.sender,
address(this),
eligible_nft_token_id
);
uint256 refund_amount = _activated_addr_bal_meu[msg.sender];
if (refund_amount > 0) {
_activated_addr_bal_meu[msg.sender] = 0;
IERC20(meta_unit_address).transfer(
msg.sender,
refund_amount
);
}
uint256 dt_refund_amount = _activated_addr_bal_meu_dt[msg.sender];
if (dt_refund_amount > 0) {
_activated_addr_bal_meu_dt[msg.sender] = 0;
IERC20(meta_unit_dt_address).transfer(
msg.sender,
dt_refund_amount
);
}
} else {
if (meu_amount == 0) {
// second and following activations can be free
require(_activated_addr_bal[msg.sender] > 0, "003");
} else {
require(
meu_amount >= _min_amount && meu_amount <= _max_amount,
"014"
);
IERC20(meu_address).transferFrom(
msg.sender,
address(this),
meu_amount
);
if (meu_address == meta_unit_address) {
_activated_addr_bal_meu[msg.sender] += meu_amount;
} else {
_activated_addr_bal_meu_dt[msg.sender] += meu_amount;
}
}
}
IERC721(generative_assets_crystal_address).safeTransferFrom(
msg.sender,
address(this),
crystal_id
);
_activated_addr_bal[msg.sender] += stake_amount;
activatedCount++;
totalCrystalRewardPercentage += percentage;
uint256 new_activated_uid = _activated.length;
_activated.push(
Activated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
true,
useNFT
)
);
emit crystalActivated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
useNFT
);
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| IERC721(generative_assets_crystal_address).ownerOf(crystal_id)==msg.sender,"013" | 406,352 | IERC721(generative_assets_crystal_address).ownerOf(crystal_id)==msg.sender |
"004" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
require(percentage <= _percentage, "012");
require(meu_address == meta_unit_address || meu_address == meta_unit_dt_address, "015");
require(
IERC721(generative_assets_crystal_address).ownerOf(crystal_id) ==
msg.sender,
"013"
);
uint256 stake_amount = useNFT ? _max_amount : meu_amount;
if (useNFT) {
require(<FILL_ME>)
IERC721(eligible_nft_token_address).transferFrom(
msg.sender,
address(this),
eligible_nft_token_id
);
uint256 refund_amount = _activated_addr_bal_meu[msg.sender];
if (refund_amount > 0) {
_activated_addr_bal_meu[msg.sender] = 0;
IERC20(meta_unit_address).transfer(
msg.sender,
refund_amount
);
}
uint256 dt_refund_amount = _activated_addr_bal_meu_dt[msg.sender];
if (dt_refund_amount > 0) {
_activated_addr_bal_meu_dt[msg.sender] = 0;
IERC20(meta_unit_dt_address).transfer(
msg.sender,
dt_refund_amount
);
}
} else {
if (meu_amount == 0) {
// second and following activations can be free
require(_activated_addr_bal[msg.sender] > 0, "003");
} else {
require(
meu_amount >= _min_amount && meu_amount <= _max_amount,
"014"
);
IERC20(meu_address).transferFrom(
msg.sender,
address(this),
meu_amount
);
if (meu_address == meta_unit_address) {
_activated_addr_bal_meu[msg.sender] += meu_amount;
} else {
_activated_addr_bal_meu_dt[msg.sender] += meu_amount;
}
}
}
IERC721(generative_assets_crystal_address).safeTransferFrom(
msg.sender,
address(this),
crystal_id
);
_activated_addr_bal[msg.sender] += stake_amount;
activatedCount++;
totalCrystalRewardPercentage += percentage;
uint256 new_activated_uid = _activated.length;
_activated.push(
Activated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
true,
useNFT
)
);
emit crystalActivated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
useNFT
);
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| hasEligibleNFT(eligible_nft_token_address),"004" | 406,352 | hasEligibleNFT(eligible_nft_token_address) |
"003" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
require(percentage <= _percentage, "012");
require(meu_address == meta_unit_address || meu_address == meta_unit_dt_address, "015");
require(
IERC721(generative_assets_crystal_address).ownerOf(crystal_id) ==
msg.sender,
"013"
);
uint256 stake_amount = useNFT ? _max_amount : meu_amount;
if (useNFT) {
require(hasEligibleNFT(eligible_nft_token_address), "004");
IERC721(eligible_nft_token_address).transferFrom(
msg.sender,
address(this),
eligible_nft_token_id
);
uint256 refund_amount = _activated_addr_bal_meu[msg.sender];
if (refund_amount > 0) {
_activated_addr_bal_meu[msg.sender] = 0;
IERC20(meta_unit_address).transfer(
msg.sender,
refund_amount
);
}
uint256 dt_refund_amount = _activated_addr_bal_meu_dt[msg.sender];
if (dt_refund_amount > 0) {
_activated_addr_bal_meu_dt[msg.sender] = 0;
IERC20(meta_unit_dt_address).transfer(
msg.sender,
dt_refund_amount
);
}
} else {
if (meu_amount == 0) {
// second and following activations can be free
require(<FILL_ME>)
} else {
require(
meu_amount >= _min_amount && meu_amount <= _max_amount,
"014"
);
IERC20(meu_address).transferFrom(
msg.sender,
address(this),
meu_amount
);
if (meu_address == meta_unit_address) {
_activated_addr_bal_meu[msg.sender] += meu_amount;
} else {
_activated_addr_bal_meu_dt[msg.sender] += meu_amount;
}
}
}
IERC721(generative_assets_crystal_address).safeTransferFrom(
msg.sender,
address(this),
crystal_id
);
_activated_addr_bal[msg.sender] += stake_amount;
activatedCount++;
totalCrystalRewardPercentage += percentage;
uint256 new_activated_uid = _activated.length;
_activated.push(
Activated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
true,
useNFT
)
);
emit crystalActivated(
new_activated_uid,
msg.sender,
eligible_nft_token_address,
eligible_nft_token_id,
crystal_id,
meu_address,
stake_amount,
percentage,
useNFT
);
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| _activated_addr_bal[msg.sender]>0,"003" | 406,352 | _activated_addr_bal[msg.sender]>0 |
"010" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
require(uid < _activated.length, "002");
Activated memory activated = _activated[uid];
require(<FILL_ME>)
require(msg.sender == activated.owner_of, "009");
uint256 stake_amount = activated.isNFT ? _max_amount : activated.metaunit_amount;
_activated_addr_bal[msg.sender] -= stake_amount;
if (activated.isNFT) {
IERC721(activated.eligibleNFT).transferFrom(
address(this),
msg.sender,
activated.nft_id
);
} else {
if (activated.meu_address == meta_unit_address) {
if (_activated_addr_bal_meu[msg.sender] > 0) {
// only transfer tokens back if not already refunded
_activated_addr_bal_meu[msg.sender] -= stake_amount;
IERC20(meta_unit_address).transfer(msg.sender, stake_amount);
}
} else {
if (_activated_addr_bal_meu_dt[msg.sender] > 0) {
_activated_addr_bal_meu_dt[msg.sender] -= stake_amount;
IERC20(meta_unit_dt_address).transfer(msg.sender, stake_amount);
}
}
}
totalCrystalRewardPercentage -= activated.percentage;
activatedCount--;
delete _activated[uid]; // sets activated.activated to false
emit crystalDeactivated(uid);
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
}
function today() public view returns (uint) {
}
}
| activated.activated,"010" | 406,352 | activated.activated |
"028" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Burnable, ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../../../utils/WriteAccessControl.sol";
import "../../../Platform/MetaUnit/ERC20/IMetaUnit.sol";
contract Goovy is
ERC20Burnable,
ReentrancyGuard,
WriteAccessControl,
ERC721Holder
{
enum VotingType {
goovyPerMEU,
percentage,
addElegibleNFT,
removeElegibleNFT,
changeMEUAddress,
changeMUTDAddress
}
struct Staking {
uint256 uid;
uint256 metaunit_staking_amount;
uint256 start_day;
uint256 end_day;
uint256 rewardPerDay;
bool finished;
}
struct Activated {
uint256 uid;
address owner_of;
address eligibleNFT;
uint256 nft_id;
uint256 crystal_id;
address meu_address;
uint256 metaunit_amount;
uint256 percentage;
bool activated;
bool isNFT;
}
struct Proposal {
VotingType voting_type;
bytes20 value;
uint256 start_time;
bool resolved;
}
struct Voice {
address eth_address;
bool voice;
}
uint256 public goovyPerMeu = 30;
uint256 public startTime;
uint256 public stakingUid;
uint256 public activatedCount;
uint256 private totalCrystalRewardPercentage;
Activated[] public _activated;
Proposal[] public _proposals;
uint256 public _percentage = 10;
uint256 private _min_amount = 1000000 ether;
uint256 private _max_amount = 5000000 ether;
mapping(address => mapping(uint256 => uint256)) public _activated_addresses;
mapping(address => uint256) public _activated_addr_bal;
mapping(address => uint256) public _activated_addr_bal_meu;
mapping(address => uint256) public _activated_addr_bal_meu_dt;
mapping(uint256 => mapping(address => bool)) private _is_voted;
mapping(uint256 => Voice[]) private _voices;
address public meta_unit_address;
address public meta_unit_dt_address;
address public generative_assets_crystal_address;
mapping(uint256 => uint256) public globalToLocalStakeUids;
mapping(address => Staking[]) public stakings;
mapping(address => mapping(uint => mapping(uint => bool)))
public hasStakeRewardClaimed;
address[] private eligibleActivateNFTContracts;
modifier checkCrystalHolder() {
}
constructor(
address _mint_to,
address _meta_unit_address,
address _meta_unit_dt_address,
address _generative_assets_crystal_address
) ERC20("Generator", "GOOVY") {
}
event proposalCreated(
uint256 uid,
VotingType voting_type,
bytes20 value,
uint256 start_time,
uint256 end_time
);
event voiceSubmited(address eth_address, bool voice);
event proposalResolved(uint256 uid, bool submited);
event crystalActivated(
uint256 uid,
address owner_of,
address token_address,
uint256 token_id,
uint256 crystal_id,
address meu_address,
uint256 amount,
uint256 percentage,
bool useNFT
);
event crystalDeactivated(uint256 uid);
event stakingCreated(
uint256 uid,
uint256 metaunit_staking_amount,
uint256 start_day,
uint256 end_day,
address owner_of,
bool finished
);
event claimed(uint256 uid, uint256 day, uint256 claimed, address owner_of);
event claimedFromCrystal(uint256 uid, uint256 claimed, address owner_of);
function addEligibleActivateNFTs(address _contract) public checkAccess {
}
function viewEligibleNFTs()
public
view
returns (address[] memory)
{
}
function removeEligibleActivateNFTs(uint arrayNum) public checkAccess {
}
function createProposal(
VotingType voting_type_,
bytes20 value_
) external isEOA checkCrystalHolder {
}
function vote(
uint256 uid_,
bool voice_
) public nonReentrant isEOA checkCrystalHolder {
}
function resolve(
uint256 uid_
) external nonReentrant isEOA checkCrystalHolder {
}
function hasEligibleNFT(address _contract) public view returns (bool) {
}
function activateCrystal(
address eligible_nft_token_address,
uint256 eligible_nft_token_id,
address meu_address,
uint256 meu_amount,
uint256 crystal_id,
uint256 percentage,
bool useNFT
) external nonReentrant isEOA {
}
function deactivateCrystal(uint256 uid) external nonReentrant isEOA {
}
function getActivatedList()
public
view
returns (Activated[] memory activated)
{
}
function getAveragePercent() public view returns (uint256) {
}
function stake(uint256 amount) external nonReentrant isEOA {
}
function claim(uint uid) public isEOA {
}
function claimAll() external isEOA {
}
function stakerClaimable(uint uid, uint day) public view returns (uint) {
}
function stakerClaimableUidTotal(
uint uid
) public view returns (uint256 total) {
}
function claimActivatedRewardsTotal() external isEOA nonReentrant {
}
function claimActivatedRewards(uint256 uid) external isEOA nonReentrant {
require(<FILL_ME>)
uint256 amount = _activated_addresses[msg.sender][uid];
_activated_addresses[msg.sender][uid] = 0;
_mint(msg.sender, amount);
emit claimedFromCrystal(uid, amount, msg.sender);
}
function today() public view returns (uint) {
}
}
| _activated_addresses[msg.sender][uid]>0,"028" | 406,352 | _activated_addresses[msg.sender][uid]>0 |
"you dont have burn privilage" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract TWEELONBURN is Ownable {
mapping (address => bool) private canBurn;
IERC20 public burnToken = IERC20(0xa5c17D266bdE7c68EEa59260ccfA004263Eda481);
address DEAD = 0x000000000000000000000000000000000000dEaD;
event TransferForeignToken(address token, uint256 amount);
event TokenBurnt(uint256 amount);
constructor(){
}
function checkCanBurn(address account) public view returns (bool) {
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() external onlyOwner {
}
function burnSupply(uint256 amount) external returns (bool _sent){
require(<FILL_ME>)
_sent = burnToken.transfer(DEAD, amount); // amount should include decimals
emit TokenBurnt(amount);
}
function transferForeignToken(address _token, address _to) external onlyOwner returns (bool _sent) {
}
function manageBurnAddress(address burn_address, bool status) external onlyOwner {
}
function manageBurnToken(address token) external onlyOwner {
}
}
| canBurn[msg.sender],"you dont have burn privilage" | 406,417 | canBurn[msg.sender] |
"Account is already in the said state" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract TWEELONBURN is Ownable {
mapping (address => bool) private canBurn;
IERC20 public burnToken = IERC20(0xa5c17D266bdE7c68EEa59260ccfA004263Eda481);
address DEAD = 0x000000000000000000000000000000000000dEaD;
event TransferForeignToken(address token, uint256 amount);
event TokenBurnt(uint256 amount);
constructor(){
}
function checkCanBurn(address account) public view returns (bool) {
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() external onlyOwner {
}
function burnSupply(uint256 amount) external returns (bool _sent){
}
function transferForeignToken(address _token, address _to) external onlyOwner returns (bool _sent) {
}
function manageBurnAddress(address burn_address, bool status) external onlyOwner {
require(<FILL_ME>)
canBurn[burn_address] = status;
}
function manageBurnToken(address token) external onlyOwner {
}
}
| canBurn[burn_address]!=status,"Account is already in the said state" | 406,417 | canBurn[burn_address]!=status |
"Max supply exceeded!" | // SPDX-License-Identifier: MIT
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ββββββ βββββββ βββββββββββββββββββββββ ββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////ββββββββββββββββββββββββββββββββββββββββββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////ββββββββββββββββββββββ ββββββ ββββββββββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////βββββββββββββββ ββββββ ββββββ βββββββ ββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////βββ ββββββ βββββββββββββββββββ ββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////βββ ββββββ βββββββββββββββββββ ββββββββ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pragma solidity ^0.8.2;
import "./ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract Apeeps is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
uint256 public PRICE = 0.003 ether;
string private BASE_URI = '';
constructor() ERC721A("Apeeps", "APEEPS") {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function setPrice(uint256 price) external onlyOwner {
}
modifier mintCompliance(uint256 _mintAmount) {
require(_mintAmount > 0 && _mintAmount < 11, "Invalid mint amount!");
require(<FILL_ME>)
_;
}
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
}
function mintOwner(address _to, uint256 _mintAmount) public mintCompliance(_mintAmount) onlyOwner {
}
address private constant payoutAdd =
0x5F40a5157E1CA5C4667a02C3A136144749dE3788;
function letuspeep() public onlyOwner nonReentrant {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
}
| currentIndex+_mintAmount<3000,"Max supply exceeded!" | 406,516 | currentIndex+_mintAmount<3000 |
null | pragma solidity ^0.4.25;
/**
Telegram- https://t.me/SuperYield
SuperYield contract: returns 111%-141% of each investment!
Automatic payouts!
No bugs, no backdoors, NO OWNER - fully automatic!
Made and checked by professionals!
1. Send any sum to smart contract address
- sum from 0.01 to 10 ETH
- min 250000 gas limit
- max 50 gwei gas price
- you are added to a queue
2. Wait a little bit
3. ...
4. PROFIT! You have got 111-141%
How is that?
1. The first investor in the queue (you will become the
first in some time) receives next investments until
it become 111-141% of his initial investment.
2. You will receive payments in several parts or all at once
3. Once you receive 111-141% of your initial investment you are
removed from the queue.
4. You can make multiple deposits
5. The balance of this contract should normally be 0 because
all the money are immediately go to payouts
6. The more deposits you make the more multiplier you get. See MULTIPLIERS var
7. If you are the last depositor (no deposits after you in 20 mins)
you get 2% of all the ether that were on the contract.
The last depositor Send 0 to withdraw it.
Do it BEFORE NEXT RESTART!
8. The contract automatically restarts each 24 hours at 12:00 GMT
9. Deposits will not be accepted 20 mins before next restart. But prize can be withdrawn.
So the last pays to the first (or to several first ones
if the deposit big enough) and the investors paid 111-141% are removed from the queue
new investor --| brand new investor --|
investor5 | new investor |
investor4 | =======> investor5 |
investor3 | investor4 |
(part. paid) investor2 <| investor3 |
(fully paid) investor1 <-| investor2 <----| (pay until full %)
*/
contract SuperYield {
//Address for tech expences
address constant private TECH = 0x4AC5c13Cc0097c8844c1374fA3deDf01861Ea65E;
//Address for promo expences
address constant private PROMO = 0x4AC5c13Cc0097c8844c1374fA3deDf01861Ea65E;
uint constant public TECH_PERCENT = 3;
uint constant public PROMO_PERCENT = 3;
uint constant public PRIZE_PERCENT = 2;
uint constant public MAX_INVESTMENT = 10 ether;
uint constant public MIN_INVESTMENT_FOR_PRIZE = 0.05 ether;
uint constant public MAX_IDLE_TIME = 20 minutes;
uint8[] MULTIPLIERS = [
111, //For first deposit made at this stage
113, //For second
117, //For third
121, //For forth
125, //For fifth
130, //For sixth
135, //For seventh
141 //For eighth and on
];
struct Deposit {
address depositor;
uint128 deposit;
uint128 expect;
}
struct DepositCount {
int128 stage;
uint128 count;
}
struct LastDepositInfo {
uint128 index;
uint128 time;
}
Deposit[] private queue;
uint public currentReceiverIndex = 0;
uint public currentQueueSize = 0;
LastDepositInfo public lastDepositInfo;
uint public prizeAmount = 0;
int public stage = 0;
mapping(address => DepositCount) public depositsMade;
function () public payable {
require(tx.gasprice <= 50000000000 wei, "Gas price is too high! Do not cheat!");
if(msg.value > 0){
require(gasleft() >= 220000, "We require more gas!");
require(msg.value <= MAX_INVESTMENT, "The investment is too much!");
checkAndUpdateStage();
require(<FILL_ME>)
addDeposit(msg.sender, msg.value);
pay();
}else if(msg.value == 0 && lastDepositInfo.index > 0 && msg.sender == queue[lastDepositInfo.index].depositor) {
withdrawPrize();
}
}
function pay() private {
}
function addDeposit(address depositor, uint value) private {
}
function checkAndUpdateStage() private{
}
function proceedToNewStage(int _stage) private {
}
function withdrawPrize() private {
}
function push(address depositor, uint deposit, uint expect) private {
}
function getDeposit(uint idx) public view returns (address depositor, uint deposit, uint expect){
}
function getDepositsCount(address depositor) public view returns (uint) {
}
function getDeposits(address depositor) public view returns (uint[] idxs, uint128[] deposits, uint128[] expects) {
}
function getQueueLength() public view returns (uint) {
}
function getDepositorMultiplier(address depositor) public view returns (uint) {
}
function getCurrentStageByTime() public view returns (int) {
}
function getStageStartTime(int _stage) public pure returns (uint) {
}
function getCurrentCandidateForPrize() public view returns (address addr, int timeLeft){
}
}
| getStageStartTime(stage+1)>=now+MAX_IDLE_TIME | 406,581 | getStageStartTime(stage+1)>=now+MAX_IDLE_TIME |
"ERROR:FM-010:EXPONENT_TOO_SMALL" | // SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.19;
import {Math} from "Math.sol";
type UFixed is uint256;
using {
addUFixed as +,
subUFixed as -,
mulUFixed as *,
divUFixed as /,
gtUFixed as >,
gteUFixed as >=,
ltUFixed as <,
lteUFixed as <=,
eqUFixed as ==
}
for UFixed global;
function addUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function subUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function mulUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function divUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function gtUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function gteUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function ltUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function lteUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function eqUFixed(UFixed a, UFixed b) pure returns(bool isEqual) {
}
function gtz(UFixed a) pure returns(bool isZero) {
}
function eqz(UFixed a) pure returns(bool isZero) {
}
function delta(UFixed a, UFixed b) pure returns(UFixed) {
}
contract UFixedType {
enum Rounding {
Down, // floor(value)
Up, // = ceil(value)
HalfUp // = floor(value + 0.5)
}
int8 public constant EXP = 18;
uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
Rounding public constant ROUNDING_DEFAULT = Rounding.HalfUp;
function decimals() public pure returns(uint256) {
}
function itof(uint256 a)
public
pure
returns(UFixed)
{
}
function itof(uint256 a, int8 exp)
public
pure
returns(UFixed)
{
require(<FILL_ME>)
require(EXP + exp <= 2 * EXP, "ERROR:FM-011:EXPONENT_TOO_LARGE");
return UFixed.wrap(a * 10 ** uint8(EXP + exp));
}
function ftoi(UFixed a)
public
pure
returns(uint256)
{
}
function ftoi(UFixed a, Rounding rounding)
public
pure
returns(uint256)
{
}
}
| EXP+exp>=0,"ERROR:FM-010:EXPONENT_TOO_SMALL" | 406,687 | EXP+exp>=0 |
Subsets and Splits