comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
}
}
/**
* @title QWoodDAOToken
* @dev Token which use as share in QWoodDAO.
*/
contract QWoodDAOToken is ERC20, Ownable {
using SafeMath for uint256;
string public constant name = "QWoodDAO";
string public constant symbol = "QOD";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 9000000 * (10 ** uint256(decimals));
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
address public dao;
uint public periodOne;
uint public periodTwo;
uint public periodThree;
event NewDAOContract(address indexed previousDAOContract, address indexed newDAOContract);
/**
* @dev Constructor.
*/
function QWoodDAOToken(
uint _periodOne,
uint _periodTwo,
uint _periodThree
) public {
}
// PUBLIC
// ERC20
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
// ERC20 Additional
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
// ERC827
/**
* @dev Addition to ERC20 token methods. It allows to
* @dev approve the transfer of value and execute a call with the sent data.
*
* @dev Beware that changing an allowance with this method brings the risk that
* @dev someone may use both the old and the new allowance by unfortunate
* @dev transaction ordering. One possible solution to mitigate this race condition
* @dev is to first reduce the spender's allowance to 0 and set the desired value
* @dev afterwards:
* @dev https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* @param _spender The address that will spend the funds.
* @param _value The amount of tokens to be spent.
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
payable
returns (bool)
{
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens to a specified
* @dev address and execute a call with the sent data on the same transaction
*
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
payable
returns (bool)
{
require(_to != address(this));
transfer(_to, _value);
// solium-disable-next-line security/no-call-value
require(<FILL_ME>)
return true;
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens from one address to
* @dev another and make a contract call on the same transaction
*
* @param _from The address which you want to send tokens from
* @param _to The address which you want to transfer to
* @param _value The amout of tokens to be transferred
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public payable returns (bool)
{
}
/**
* @dev Addition to StandardToken methods. Increase the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To increment
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function increaseApprovalAndCall(
address _spender,
uint _addedValue,
bytes _data
)
public
payable
returns (bool)
{
}
/**
* @dev Addition to StandardToken methods. Decrease the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To decrement
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function decreaseApprovalAndCall(
address _spender,
uint _subtractedValue,
bytes _data
)
public
payable
returns (bool)
{
}
// Additional
function pureBalanceOf(address _owner) public view returns (uint256 balance) {
}
/**
* @dev Set new DAO contract address.
* @param newDao The address of DAO contract.
*/
function setDAOContract(address newDao) public onlyOwner {
}
// INTERNAL
function _balanceOf(address _owner) internal view returns (uint256) {
}
function _getPeriodFor(uint ts) internal view returns (uint) {
}
function _weekFor(uint ts) internal view returns (uint) {
}
}
| _to.call.value(msg.value)(_data) | 344,458 | _to.call.value(msg.value)(_data) |
null | /* Token lock contract for YF Gamma Staking tokens
*/
pragma solidity 0.6.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
/*
* Lock YF Gamma Tokens and create lock contract
*/
contract YFGMTokenLock {
// Safemath Liberary
using SafeMath for uint256;
// Unlock token duration
uint256 public unlockTwoDate;
uint256 public unlockOneDate;
// Grouping token owner
uint256 public YFGMLockOne;
uint256 public YFGMLockTwo;
address public owner;
ERC20 public YFGMToken;
//
constructor(address _wallet) public {
}
// Lock 10000 YFGM for 21 days
function LockOneTokens (address _from, uint _amount) public {
require(_from == owner);
require(<FILL_ME>)
YFGMLockOne = _amount;
unlockOneDate = now;
YFGMToken.transferFrom(owner, address(this), _amount);
}
// Lock 1000 YFGM for 21 days
function LockTwoTokens (address _from, uint256 _amount) public {
}
function withdrawOneTokens(address _to, uint256 _amount) public {
}
function withdrawTwoTokens(address _to, uint256 _amount) public {
}
function balanceOf() public view returns (uint256) {
}
}
| YFGMToken.balanceOf(_from)>=_amount | 344,511 | YFGMToken.balanceOf(_from)>=_amount |
null | /* Token lock contract for YF Gamma Staking tokens
*/
pragma solidity 0.6.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
/*
* Lock YF Gamma Tokens and create lock contract
*/
contract YFGMTokenLock {
// Safemath Liberary
using SafeMath for uint256;
// Unlock token duration
uint256 public unlockTwoDate;
uint256 public unlockOneDate;
// Grouping token owner
uint256 public YFGMLockOne;
uint256 public YFGMLockTwo;
address public owner;
ERC20 public YFGMToken;
//
constructor(address _wallet) public {
}
// Lock 10000 YFGM for 21 days
function LockOneTokens (address _from, uint _amount) public {
}
// Lock 1000 YFGM for 21 days
function LockTwoTokens (address _from, uint256 _amount) public {
}
function withdrawOneTokens(address _to, uint256 _amount) public {
require(_to == owner);
require(_amount <= YFGMLockOne);
require(<FILL_ME>)
YFGMLockOne = YFGMLockOne.sub(_amount);
YFGMToken.transfer(_to, _amount);
}
function withdrawTwoTokens(address _to, uint256 _amount) public {
}
function balanceOf() public view returns (uint256) {
}
}
| now.sub(unlockOneDate)>=21days | 344,511 | now.sub(unlockOneDate)>=21days |
null | /* Token lock contract for YF Gamma Staking tokens
*/
pragma solidity 0.6.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
/*
* Lock YF Gamma Tokens and create lock contract
*/
contract YFGMTokenLock {
// Safemath Liberary
using SafeMath for uint256;
// Unlock token duration
uint256 public unlockTwoDate;
uint256 public unlockOneDate;
// Grouping token owner
uint256 public YFGMLockOne;
uint256 public YFGMLockTwo;
address public owner;
ERC20 public YFGMToken;
//
constructor(address _wallet) public {
}
// Lock 10000 YFGM for 21 days
function LockOneTokens (address _from, uint _amount) public {
}
// Lock 1000 YFGM for 21 days
function LockTwoTokens (address _from, uint256 _amount) public {
}
function withdrawOneTokens(address _to, uint256 _amount) public {
}
function withdrawTwoTokens(address _to, uint256 _amount) public {
require(_to == owner);
require(_amount <= YFGMLockTwo);
require(<FILL_ME>)
YFGMLockTwo = YFGMLockTwo.sub(_amount);
YFGMToken.transfer(_to, _amount);
}
function balanceOf() public view returns (uint256) {
}
}
| now.sub(unlockTwoDate)>=21days | 344,511 | now.sub(unlockTwoDate)>=21days |
"Invalid PassId" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./ILand.sol";
import "./IOre.sol";
import "./IMintPass.sol";
contract MintPassMinter is Ownable, ReentrancyGuard {
// MintPass token contract interface
IMintPass public mintPass;
// Land token contract interface
ILand public land;
// Ore token contract interface
IOre public ore;
// Stores the currently set pass prices
mapping (uint256 => uint256) private _passPrices;
// Keeps track of the timestamp of the latest claiming period
uint256 private _lastClaimTimestamp;
// Keeps track of the total free pass claimed by landowners
uint256 public totalFreePassClaimed;
// Keeps track of the total purchased mint passes
mapping (uint256 => uint256) public totalPurchasedByPassId;
// Keeps track of total claimed free passes for land owners
mapping (uint256 => uint256) public lastClaimTimestampByLandId;
// The passId used to indicate the free passes claimable by landowners
uint256 private _freePassId;
constructor(
address _ore,
address _land,
address _mintPass
) {
}
function freePassId() external view returns (uint256) {
}
function passPrice(uint256 _passId) external view returns (uint256) {
require(<FILL_ME>)
return _passPrices[_passId];
}
// Enable new claiming by updating the ending timestamp to 24 hours after enabled
function setLastClaimTimestamp(uint256 _timestamp) external onlyOwner {
}
function lastClaimTimestamp() external view returns (uint256) {
}
// Update the token price
function setPassPrice(uint256 _passId, uint256 _price) external onlyOwner {
}
// Set the passId used as landowner's free passes
function setFreePassId(uint256 _passId) external onlyOwner {
}
// Generate passes to be used for marketing purposes
function generatePassForMarketing(uint256 _passId, uint256 _count) external onlyOwner {
}
// Fetch the total count of unclaimed free passes for the specified landowner account
function unclaimedFreePass(address _account) external view returns (uint256) {
}
// Handles free passes claiming for the landowners
function claimFreePass() external nonReentrant {
}
// Handles pass purchases using ORE
function buyPass(uint256 _passId, uint256 _count) external nonReentrant {
}
}
| mintPass.passExists(_passId),"Invalid PassId" | 344,592 | mintPass.passExists(_passId) |
"Price Not Set" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./ILand.sol";
import "./IOre.sol";
import "./IMintPass.sol";
contract MintPassMinter is Ownable, ReentrancyGuard {
// MintPass token contract interface
IMintPass public mintPass;
// Land token contract interface
ILand public land;
// Ore token contract interface
IOre public ore;
// Stores the currently set pass prices
mapping (uint256 => uint256) private _passPrices;
// Keeps track of the timestamp of the latest claiming period
uint256 private _lastClaimTimestamp;
// Keeps track of the total free pass claimed by landowners
uint256 public totalFreePassClaimed;
// Keeps track of the total purchased mint passes
mapping (uint256 => uint256) public totalPurchasedByPassId;
// Keeps track of total claimed free passes for land owners
mapping (uint256 => uint256) public lastClaimTimestampByLandId;
// The passId used to indicate the free passes claimable by landowners
uint256 private _freePassId;
constructor(
address _ore,
address _land,
address _mintPass
) {
}
function freePassId() external view returns (uint256) {
}
function passPrice(uint256 _passId) external view returns (uint256) {
}
// Enable new claiming by updating the ending timestamp to 24 hours after enabled
function setLastClaimTimestamp(uint256 _timestamp) external onlyOwner {
}
function lastClaimTimestamp() external view returns (uint256) {
}
// Update the token price
function setPassPrice(uint256 _passId, uint256 _price) external onlyOwner {
}
// Set the passId used as landowner's free passes
function setFreePassId(uint256 _passId) external onlyOwner {
}
// Generate passes to be used for marketing purposes
function generatePassForMarketing(uint256 _passId, uint256 _count) external onlyOwner {
}
// Fetch the total count of unclaimed free passes for the specified landowner account
function unclaimedFreePass(address _account) external view returns (uint256) {
}
// Handles free passes claiming for the landowners
function claimFreePass() external nonReentrant {
}
// Handles pass purchases using ORE
function buyPass(uint256 _passId, uint256 _count) external nonReentrant {
// Check if sufficient funds are sent
require(mintPass.passExists(_passId), "Invalid PassId");
require(<FILL_ME>)
uint256 totalPrice = _count * _passPrices[_passId];
require(ore.balanceOf(msg.sender) >= totalPrice, "Insufficient Ore");
totalPurchasedByPassId[_passId] += _count;
// Burn the ORE and proceed to mint the passes
ore.burn(msg.sender, totalPrice);
mintPass.mintToken(msg.sender, _passId, _count);
}
}
| _passPrices[_passId]>0,"Price Not Set" | 344,592 | _passPrices[_passId]>0 |
"Insufficient Ore" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./ILand.sol";
import "./IOre.sol";
import "./IMintPass.sol";
contract MintPassMinter is Ownable, ReentrancyGuard {
// MintPass token contract interface
IMintPass public mintPass;
// Land token contract interface
ILand public land;
// Ore token contract interface
IOre public ore;
// Stores the currently set pass prices
mapping (uint256 => uint256) private _passPrices;
// Keeps track of the timestamp of the latest claiming period
uint256 private _lastClaimTimestamp;
// Keeps track of the total free pass claimed by landowners
uint256 public totalFreePassClaimed;
// Keeps track of the total purchased mint passes
mapping (uint256 => uint256) public totalPurchasedByPassId;
// Keeps track of total claimed free passes for land owners
mapping (uint256 => uint256) public lastClaimTimestampByLandId;
// The passId used to indicate the free passes claimable by landowners
uint256 private _freePassId;
constructor(
address _ore,
address _land,
address _mintPass
) {
}
function freePassId() external view returns (uint256) {
}
function passPrice(uint256 _passId) external view returns (uint256) {
}
// Enable new claiming by updating the ending timestamp to 24 hours after enabled
function setLastClaimTimestamp(uint256 _timestamp) external onlyOwner {
}
function lastClaimTimestamp() external view returns (uint256) {
}
// Update the token price
function setPassPrice(uint256 _passId, uint256 _price) external onlyOwner {
}
// Set the passId used as landowner's free passes
function setFreePassId(uint256 _passId) external onlyOwner {
}
// Generate passes to be used for marketing purposes
function generatePassForMarketing(uint256 _passId, uint256 _count) external onlyOwner {
}
// Fetch the total count of unclaimed free passes for the specified landowner account
function unclaimedFreePass(address _account) external view returns (uint256) {
}
// Handles free passes claiming for the landowners
function claimFreePass() external nonReentrant {
}
// Handles pass purchases using ORE
function buyPass(uint256 _passId, uint256 _count) external nonReentrant {
// Check if sufficient funds are sent
require(mintPass.passExists(_passId), "Invalid PassId");
require(_passPrices[_passId] > 0, "Price Not Set");
uint256 totalPrice = _count * _passPrices[_passId];
require(<FILL_ME>)
totalPurchasedByPassId[_passId] += _count;
// Burn the ORE and proceed to mint the passes
ore.burn(msg.sender, totalPrice);
mintPass.mintToken(msg.sender, _passId, _count);
}
}
| ore.balanceOf(msg.sender)>=totalPrice,"Insufficient Ore" | 344,592 | ore.balanceOf(msg.sender)>=totalPrice |
"sold out" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract ShamDAO is ERC721Enumerable, Ownable {
using Strings for uint256;
event MintToken(address indexed sender, uint256 startWith, uint256 times);
//supply counters
uint256 public totalTokens;
uint256 public totalCount = 6969;
uint256 public maxBatch = 100;
uint256 public price = 50000000000000000;
//string
string public baseURI;
//bool
bool private started = true;
//constructor args
constructor(string memory baseURI_) ERC721("ShamDAO", "SHAM") {
}
//basic functions.
function _baseURI() internal view virtual override returns (string memory){
}
function setBaseURI(string memory _newURI) public onlyOwner {
}
function setStart(bool _start) public onlyOwner {
}
function tokensOfOwner(address owner)
public
view
returns (uint256[] memory)
{
}
function mint(uint256 _times) payable public {
require(started, "Not Shams enough yet.");
require(_times >0 && _times <= maxBatch, "Too many Shams!");
require(<FILL_ME>)
require(msg.value == _times * price, "Value error, please check price.");
payable(owner()).transfer(msg.value);
emit MintToken(_msgSender(), totalTokens+1, _times);
for(uint256 i=0; i< _times; i++){
_mint(_msgSender(), 1 + totalTokens++);
}
}
}
| totalTokens+_times<=totalCount,"sold out" | 344,624 | totalTokens+_times<=totalCount |
'Error: You have already been excluded from reward!' | pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
import './base.sol';
interface Argu {
function isExcludedFromFee(address addr) external view returns (bool);
function isExcludedFromReward(address addr) external view returns (bool);
function canInvokeMe(address addr) external view returns (bool);
function getRewardCycleBlock() external view returns (uint256);
function getNextAvailableClaimDate(address addr) external view returns(uint256);
function setNextAvailableClaimDate(address addr, uint256 timestamp) external;
}
interface CarbonCoin {
function uniswapV2Pair() external view returns (address);
function migrateRewardToken(address _newadress, uint256 rewardTokenAmount) external;
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
contract ClaimRewards is Ownable,ReentrancyGuard {
using SafeMath for uint256;
using Address for address;
CarbonCoin private cbc;
Argu private argu;
address private _usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
address private polyBridge = 0x250e76987d838a75310c34bf422ea9f1AC4Cc906;
address public uniswapV2Pair;
uint256 private _claimTotal;
IERC20 usdt = IERC20(_usdt);
event ClaimUSDTSuccessfully(
address recipient,
uint256 ethReceived,
uint256 nextAvailableClaimDate
);
constructor () public {
}
function setArgus(Argu _argu,CarbonCoin _cbc) public onlyOwner{
}
function setPolyBridge(address _polyBridge) public onlyOwner{
}
function getPolyBridge() public view returns (address){
}
function getTotalRewardToken() public view returns (uint256){
}
//----------------------------
function getTotalClaimedRewards() public view returns (uint256) {
}
function getRewardCycleBlock() public view returns(uint256){
}
function getNextAvailableClaimDate(address addr) public view returns(uint256){
}
function getExcludeFromReward(address addr) public view returns(bool){
}
receive() external payable {}
//----------------------------
function ClaimReward() isHuman nonReentrant public {
require(<FILL_ME>)
require(argu.getNextAvailableClaimDate(msg.sender) <= block.timestamp, 'Error: next available not reached');
require(cbc.balanceOf(msg.sender) >= 0, 'Error: You must own Tokens to claim reward!');
uint256 usdtAmount = checkReward();
cbc.migrateRewardToken(msg.sender,usdtAmount);
argu.setNextAvailableClaimDate(msg.sender,argu.getRewardCycleBlock());
_claimTotal = _claimTotal.add(usdtAmount);
emit ClaimUSDTSuccessfully(msg.sender, usdtAmount, argu.getNextAvailableClaimDate(msg.sender));
}
function checkReward() public view returns (uint256) {
}
function _CalculateReward(uint256 currentBalance,uint256 currentUsdtPool,uint256 cTotalSupply) private pure returns (uint256) {
}
function checkRewardForExactAddr(address addr)public view returns(uint256){
}
}
| !argu.isExcludedFromReward(msg.sender),'Error: You have already been excluded from reward!' | 344,636 | !argu.isExcludedFromReward(msg.sender) |
'Error: next available not reached' | pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
import './base.sol';
interface Argu {
function isExcludedFromFee(address addr) external view returns (bool);
function isExcludedFromReward(address addr) external view returns (bool);
function canInvokeMe(address addr) external view returns (bool);
function getRewardCycleBlock() external view returns (uint256);
function getNextAvailableClaimDate(address addr) external view returns(uint256);
function setNextAvailableClaimDate(address addr, uint256 timestamp) external;
}
interface CarbonCoin {
function uniswapV2Pair() external view returns (address);
function migrateRewardToken(address _newadress, uint256 rewardTokenAmount) external;
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
contract ClaimRewards is Ownable,ReentrancyGuard {
using SafeMath for uint256;
using Address for address;
CarbonCoin private cbc;
Argu private argu;
address private _usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
address private polyBridge = 0x250e76987d838a75310c34bf422ea9f1AC4Cc906;
address public uniswapV2Pair;
uint256 private _claimTotal;
IERC20 usdt = IERC20(_usdt);
event ClaimUSDTSuccessfully(
address recipient,
uint256 ethReceived,
uint256 nextAvailableClaimDate
);
constructor () public {
}
function setArgus(Argu _argu,CarbonCoin _cbc) public onlyOwner{
}
function setPolyBridge(address _polyBridge) public onlyOwner{
}
function getPolyBridge() public view returns (address){
}
function getTotalRewardToken() public view returns (uint256){
}
//----------------------------
function getTotalClaimedRewards() public view returns (uint256) {
}
function getRewardCycleBlock() public view returns(uint256){
}
function getNextAvailableClaimDate(address addr) public view returns(uint256){
}
function getExcludeFromReward(address addr) public view returns(bool){
}
receive() external payable {}
//----------------------------
function ClaimReward() isHuman nonReentrant public {
require(!argu.isExcludedFromReward(msg.sender), 'Error: You have already been excluded from reward!');
require(<FILL_ME>)
require(cbc.balanceOf(msg.sender) >= 0, 'Error: You must own Tokens to claim reward!');
uint256 usdtAmount = checkReward();
cbc.migrateRewardToken(msg.sender,usdtAmount);
argu.setNextAvailableClaimDate(msg.sender,argu.getRewardCycleBlock());
_claimTotal = _claimTotal.add(usdtAmount);
emit ClaimUSDTSuccessfully(msg.sender, usdtAmount, argu.getNextAvailableClaimDate(msg.sender));
}
function checkReward() public view returns (uint256) {
}
function _CalculateReward(uint256 currentBalance,uint256 currentUsdtPool,uint256 cTotalSupply) private pure returns (uint256) {
}
function checkRewardForExactAddr(address addr)public view returns(uint256){
}
}
| argu.getNextAvailableClaimDate(msg.sender)<=block.timestamp,'Error: next available not reached' | 344,636 | argu.getNextAvailableClaimDate(msg.sender)<=block.timestamp |
'Error: You must own Tokens to claim reward!' | pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
import './base.sol';
interface Argu {
function isExcludedFromFee(address addr) external view returns (bool);
function isExcludedFromReward(address addr) external view returns (bool);
function canInvokeMe(address addr) external view returns (bool);
function getRewardCycleBlock() external view returns (uint256);
function getNextAvailableClaimDate(address addr) external view returns(uint256);
function setNextAvailableClaimDate(address addr, uint256 timestamp) external;
}
interface CarbonCoin {
function uniswapV2Pair() external view returns (address);
function migrateRewardToken(address _newadress, uint256 rewardTokenAmount) external;
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
contract ClaimRewards is Ownable,ReentrancyGuard {
using SafeMath for uint256;
using Address for address;
CarbonCoin private cbc;
Argu private argu;
address private _usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
address private polyBridge = 0x250e76987d838a75310c34bf422ea9f1AC4Cc906;
address public uniswapV2Pair;
uint256 private _claimTotal;
IERC20 usdt = IERC20(_usdt);
event ClaimUSDTSuccessfully(
address recipient,
uint256 ethReceived,
uint256 nextAvailableClaimDate
);
constructor () public {
}
function setArgus(Argu _argu,CarbonCoin _cbc) public onlyOwner{
}
function setPolyBridge(address _polyBridge) public onlyOwner{
}
function getPolyBridge() public view returns (address){
}
function getTotalRewardToken() public view returns (uint256){
}
//----------------------------
function getTotalClaimedRewards() public view returns (uint256) {
}
function getRewardCycleBlock() public view returns(uint256){
}
function getNextAvailableClaimDate(address addr) public view returns(uint256){
}
function getExcludeFromReward(address addr) public view returns(bool){
}
receive() external payable {}
//----------------------------
function ClaimReward() isHuman nonReentrant public {
require(!argu.isExcludedFromReward(msg.sender), 'Error: You have already been excluded from reward!');
require(argu.getNextAvailableClaimDate(msg.sender) <= block.timestamp, 'Error: next available not reached');
require(<FILL_ME>)
uint256 usdtAmount = checkReward();
cbc.migrateRewardToken(msg.sender,usdtAmount);
argu.setNextAvailableClaimDate(msg.sender,argu.getRewardCycleBlock());
_claimTotal = _claimTotal.add(usdtAmount);
emit ClaimUSDTSuccessfully(msg.sender, usdtAmount, argu.getNextAvailableClaimDate(msg.sender));
}
function checkReward() public view returns (uint256) {
}
function _CalculateReward(uint256 currentBalance,uint256 currentUsdtPool,uint256 cTotalSupply) private pure returns (uint256) {
}
function checkRewardForExactAddr(address addr)public view returns(uint256){
}
}
| cbc.balanceOf(msg.sender)>=0,'Error: You must own Tokens to claim reward!' | 344,636 | cbc.balanceOf(msg.sender)>=0 |
"You can't invoke me!" | pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
import './base.sol';
interface Argu {
function isExcludedFromFee(address addr) external view returns (bool);
function isExcludedFromReward(address addr) external view returns (bool);
function canInvokeMe(address addr) external view returns (bool);
function getRewardCycleBlock() external view returns (uint256);
function getNextAvailableClaimDate(address addr) external view returns(uint256);
function setNextAvailableClaimDate(address addr, uint256 timestamp) external;
}
interface CarbonCoin {
function uniswapV2Pair() external view returns (address);
function migrateRewardToken(address _newadress, uint256 rewardTokenAmount) external;
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
}
contract ClaimRewards is Ownable,ReentrancyGuard {
using SafeMath for uint256;
using Address for address;
CarbonCoin private cbc;
Argu private argu;
address private _usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
address private polyBridge = 0x250e76987d838a75310c34bf422ea9f1AC4Cc906;
address public uniswapV2Pair;
uint256 private _claimTotal;
IERC20 usdt = IERC20(_usdt);
event ClaimUSDTSuccessfully(
address recipient,
uint256 ethReceived,
uint256 nextAvailableClaimDate
);
constructor () public {
}
function setArgus(Argu _argu,CarbonCoin _cbc) public onlyOwner{
}
function setPolyBridge(address _polyBridge) public onlyOwner{
}
function getPolyBridge() public view returns (address){
}
function getTotalRewardToken() public view returns (uint256){
}
//----------------------------
function getTotalClaimedRewards() public view returns (uint256) {
}
function getRewardCycleBlock() public view returns(uint256){
}
function getNextAvailableClaimDate(address addr) public view returns(uint256){
}
function getExcludeFromReward(address addr) public view returns(bool){
}
receive() external payable {}
//----------------------------
function ClaimReward() isHuman nonReentrant public {
}
function checkReward() public view returns (uint256) {
}
function _CalculateReward(uint256 currentBalance,uint256 currentUsdtPool,uint256 cTotalSupply) private pure returns (uint256) {
}
function checkRewardForExactAddr(address addr)public view returns(uint256){
require(<FILL_ME>)
if (argu.isExcludedFromReward(addr)){
return 0;
}
uint256 cTotalSupply = cbc.totalSupply()
.sub(cbc.balanceOf(address(0)))
.sub(cbc.balanceOf(0x000000000000000000000000000000000000dEaD))
.sub(cbc.balanceOf(address(polyBridge)))
.sub(cbc.balanceOf(address(uniswapV2Pair)));
return _CalculateReward(
cbc.balanceOf(address(addr)),
usdt.balanceOf(address(cbc)),
cTotalSupply
);
}
}
| argu.canInvokeMe(msg.sender),"You can't invoke me!" | 344,636 | argu.canInvokeMe(msg.sender) |
"Product not available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./CryptoFoxesShopWithdraw.sol";
import "./CryptoFoxesShopProducts.sol";
contract CryptoFoxesShop is Ownable, CryptoFoxesShopProducts, CryptoFoxesShopWithdraw, ReentrancyGuard{
mapping(string => uint256) public purchasedProduct;
mapping(string => mapping(address => uint256)) public purchasedProductWallet;
uint256 public purchaseId;
event Purchase(address indexed _owner, string indexed _slug, uint256 _quantity, uint256 _id);
constructor(address _cryptoFoxesSteak) CryptoFoxesShopWithdraw(_cryptoFoxesSteak) {}
//////////////////////////////////////////////////
// TESTER //
//////////////////////////////////////////////////
function checkPurchase(string memory _slug, uint256 _quantity, address _wallet) private{
require(<FILL_ME>)
if(products[_slug].start > 0 && products[_slug].end > 0){
require(products[_slug].start <= block.timestamp && block.timestamp <= products[_slug].end, "Product not available");
}
if (products[_slug].quantityMax > 0) {
require(purchasedProduct[_slug] + _quantity <= products[_slug].quantityMax, "Product sold out");
purchasedProduct[_slug] += _quantity;
}
if(products[_slug].maxPerWallet > 0){
require(purchasedProductWallet[_slug][_wallet] + _quantity <= products[_slug].maxPerWallet, "Max per wallet limit");
purchasedProductWallet[_slug][_wallet] += _quantity;
}
}
function _compareStrings(string memory a, string memory b) private pure returns (bool) {
}
//////////////////////////////////////////////////
// PURCHASE //
//////////////////////////////////////////////////
function purchase(string memory _slug, uint256 _quantity) public nonReentrant {
}
function purchaseCart(string[] memory _slugs, uint256[] memory _quantities) public nonReentrant {
}
function _purchase(address _wallet, string memory _slug, uint256 _quantity) private {
}
function _purchaseCart(address _wallet, string[] memory _slugs, uint256[] memory _quantities) private {
}
//////////////////////////////////////////////////
// PURCHASE BY CONTRACT //
//////////////////////////////////////////////////
function purchaseByContract(address _wallet, string memory _slug, uint256 _quantity) public isFoxContract {
}
function purchaseCartByContract(address _wallet, string[] memory _slugs, uint256[] memory _quantities) public isFoxContract {
}
//////////////////////////////////////////////////
// PRODUCT GETTER //
//////////////////////////////////////////////////
function getProductPrice(string memory _slug, uint256 _quantity) public view returns(uint256){
}
function getProductStock(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchased(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchasedWallet(string memory _slug, address _wallet) public view returns(uint256){
}
}
| products[_slug].enable&&_quantity>0,"Product not available" | 344,744 | products[_slug].enable&&_quantity>0 |
"Product not available" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./CryptoFoxesShopWithdraw.sol";
import "./CryptoFoxesShopProducts.sol";
contract CryptoFoxesShop is Ownable, CryptoFoxesShopProducts, CryptoFoxesShopWithdraw, ReentrancyGuard{
mapping(string => uint256) public purchasedProduct;
mapping(string => mapping(address => uint256)) public purchasedProductWallet;
uint256 public purchaseId;
event Purchase(address indexed _owner, string indexed _slug, uint256 _quantity, uint256 _id);
constructor(address _cryptoFoxesSteak) CryptoFoxesShopWithdraw(_cryptoFoxesSteak) {}
//////////////////////////////////////////////////
// TESTER //
//////////////////////////////////////////////////
function checkPurchase(string memory _slug, uint256 _quantity, address _wallet) private{
require(products[_slug].enable && _quantity > 0,"Product not available");
if(products[_slug].start > 0 && products[_slug].end > 0){
require(<FILL_ME>)
}
if (products[_slug].quantityMax > 0) {
require(purchasedProduct[_slug] + _quantity <= products[_slug].quantityMax, "Product sold out");
purchasedProduct[_slug] += _quantity;
}
if(products[_slug].maxPerWallet > 0){
require(purchasedProductWallet[_slug][_wallet] + _quantity <= products[_slug].maxPerWallet, "Max per wallet limit");
purchasedProductWallet[_slug][_wallet] += _quantity;
}
}
function _compareStrings(string memory a, string memory b) private pure returns (bool) {
}
//////////////////////////////////////////////////
// PURCHASE //
//////////////////////////////////////////////////
function purchase(string memory _slug, uint256 _quantity) public nonReentrant {
}
function purchaseCart(string[] memory _slugs, uint256[] memory _quantities) public nonReentrant {
}
function _purchase(address _wallet, string memory _slug, uint256 _quantity) private {
}
function _purchaseCart(address _wallet, string[] memory _slugs, uint256[] memory _quantities) private {
}
//////////////////////////////////////////////////
// PURCHASE BY CONTRACT //
//////////////////////////////////////////////////
function purchaseByContract(address _wallet, string memory _slug, uint256 _quantity) public isFoxContract {
}
function purchaseCartByContract(address _wallet, string[] memory _slugs, uint256[] memory _quantities) public isFoxContract {
}
//////////////////////////////////////////////////
// PRODUCT GETTER //
//////////////////////////////////////////////////
function getProductPrice(string memory _slug, uint256 _quantity) public view returns(uint256){
}
function getProductStock(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchased(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchasedWallet(string memory _slug, address _wallet) public view returns(uint256){
}
}
| products[_slug].start<=block.timestamp&&block.timestamp<=products[_slug].end,"Product not available" | 344,744 | products[_slug].start<=block.timestamp&&block.timestamp<=products[_slug].end |
"Product sold out" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./CryptoFoxesShopWithdraw.sol";
import "./CryptoFoxesShopProducts.sol";
contract CryptoFoxesShop is Ownable, CryptoFoxesShopProducts, CryptoFoxesShopWithdraw, ReentrancyGuard{
mapping(string => uint256) public purchasedProduct;
mapping(string => mapping(address => uint256)) public purchasedProductWallet;
uint256 public purchaseId;
event Purchase(address indexed _owner, string indexed _slug, uint256 _quantity, uint256 _id);
constructor(address _cryptoFoxesSteak) CryptoFoxesShopWithdraw(_cryptoFoxesSteak) {}
//////////////////////////////////////////////////
// TESTER //
//////////////////////////////////////////////////
function checkPurchase(string memory _slug, uint256 _quantity, address _wallet) private{
require(products[_slug].enable && _quantity > 0,"Product not available");
if(products[_slug].start > 0 && products[_slug].end > 0){
require(products[_slug].start <= block.timestamp && block.timestamp <= products[_slug].end, "Product not available");
}
if (products[_slug].quantityMax > 0) {
require(<FILL_ME>)
purchasedProduct[_slug] += _quantity;
}
if(products[_slug].maxPerWallet > 0){
require(purchasedProductWallet[_slug][_wallet] + _quantity <= products[_slug].maxPerWallet, "Max per wallet limit");
purchasedProductWallet[_slug][_wallet] += _quantity;
}
}
function _compareStrings(string memory a, string memory b) private pure returns (bool) {
}
//////////////////////////////////////////////////
// PURCHASE //
//////////////////////////////////////////////////
function purchase(string memory _slug, uint256 _quantity) public nonReentrant {
}
function purchaseCart(string[] memory _slugs, uint256[] memory _quantities) public nonReentrant {
}
function _purchase(address _wallet, string memory _slug, uint256 _quantity) private {
}
function _purchaseCart(address _wallet, string[] memory _slugs, uint256[] memory _quantities) private {
}
//////////////////////////////////////////////////
// PURCHASE BY CONTRACT //
//////////////////////////////////////////////////
function purchaseByContract(address _wallet, string memory _slug, uint256 _quantity) public isFoxContract {
}
function purchaseCartByContract(address _wallet, string[] memory _slugs, uint256[] memory _quantities) public isFoxContract {
}
//////////////////////////////////////////////////
// PRODUCT GETTER //
//////////////////////////////////////////////////
function getProductPrice(string memory _slug, uint256 _quantity) public view returns(uint256){
}
function getProductStock(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchased(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchasedWallet(string memory _slug, address _wallet) public view returns(uint256){
}
}
| purchasedProduct[_slug]+_quantity<=products[_slug].quantityMax,"Product sold out" | 344,744 | purchasedProduct[_slug]+_quantity<=products[_slug].quantityMax |
"Max per wallet limit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./CryptoFoxesShopWithdraw.sol";
import "./CryptoFoxesShopProducts.sol";
contract CryptoFoxesShop is Ownable, CryptoFoxesShopProducts, CryptoFoxesShopWithdraw, ReentrancyGuard{
mapping(string => uint256) public purchasedProduct;
mapping(string => mapping(address => uint256)) public purchasedProductWallet;
uint256 public purchaseId;
event Purchase(address indexed _owner, string indexed _slug, uint256 _quantity, uint256 _id);
constructor(address _cryptoFoxesSteak) CryptoFoxesShopWithdraw(_cryptoFoxesSteak) {}
//////////////////////////////////////////////////
// TESTER //
//////////////////////////////////////////////////
function checkPurchase(string memory _slug, uint256 _quantity, address _wallet) private{
require(products[_slug].enable && _quantity > 0,"Product not available");
if(products[_slug].start > 0 && products[_slug].end > 0){
require(products[_slug].start <= block.timestamp && block.timestamp <= products[_slug].end, "Product not available");
}
if (products[_slug].quantityMax > 0) {
require(purchasedProduct[_slug] + _quantity <= products[_slug].quantityMax, "Product sold out");
purchasedProduct[_slug] += _quantity;
}
if(products[_slug].maxPerWallet > 0){
require(<FILL_ME>)
purchasedProductWallet[_slug][_wallet] += _quantity;
}
}
function _compareStrings(string memory a, string memory b) private pure returns (bool) {
}
//////////////////////////////////////////////////
// PURCHASE //
//////////////////////////////////////////////////
function purchase(string memory _slug, uint256 _quantity) public nonReentrant {
}
function purchaseCart(string[] memory _slugs, uint256[] memory _quantities) public nonReentrant {
}
function _purchase(address _wallet, string memory _slug, uint256 _quantity) private {
}
function _purchaseCart(address _wallet, string[] memory _slugs, uint256[] memory _quantities) private {
}
//////////////////////////////////////////////////
// PURCHASE BY CONTRACT //
//////////////////////////////////////////////////
function purchaseByContract(address _wallet, string memory _slug, uint256 _quantity) public isFoxContract {
}
function purchaseCartByContract(address _wallet, string[] memory _slugs, uint256[] memory _quantities) public isFoxContract {
}
//////////////////////////////////////////////////
// PRODUCT GETTER //
//////////////////////////////////////////////////
function getProductPrice(string memory _slug, uint256 _quantity) public view returns(uint256){
}
function getProductStock(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchased(string memory _slug) public view returns(uint256){
}
function getTotalProductPurchasedWallet(string memory _slug, address _wallet) public view returns(uint256){
}
}
| purchasedProductWallet[_slug][_wallet]+_quantity<=products[_slug].maxPerWallet,"Max per wallet limit" | 344,744 | purchasedProductWallet[_slug][_wallet]+_quantity<=products[_slug].maxPerWallet |
"Apostle does not exist." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ITRYPToken.sol";
import "./IERC721EnumerableNameable.sol";
contract IApostle is IERC721EnumerableNameable {
enum APOSTLE_TYPE {
NONE,
VOYAGER,
PSYCHONAUT,
ANCIENT,
GODDESS
}
// Toggles
bool public m_canValidate = false;
bool public m_tokenGeneration = false;
// Properties
mapping (uint256 => APOSTLE_TYPE) private m_ApostleTypes;
bytes32 private m_apostlesMerkle;
string private m_baseUri = "";
// External
ITRYPToken m_trypContract;
constructor(string memory _name, string memory _symbol, string memory baseURI) IERC721EnumerableNameable (_name, _symbol) {
}
// OWNER ONLY
function toggleValidation () external onlyOwner {
}
function toggleTokenGeneration () external onlyOwner {
}
function setTokenAddress (address _tokenAddress) public onlyOwner {
}
function setApostleValidationMerkle (bytes32 _merkle) external onlyOwner {
}
function setBaseURI(string memory _uri) external onlyOwner {
}
function setNamingPrice(uint256 _price) external onlyOwner {
}
function setBioPrice(uint256 _price) external onlyOwner {
}
// PUBLIC
function changeName(uint256 _tokenId, string memory _newName) public override isTokenEnabled {
}
function changeBio(uint256 _tokenId, string memory _newBio) public override isTokenEnabled {
}
// VIEWS
function validateApostle(uint _idx, uint _typeIdx, bytes32[] calldata _merkleProof) public isValidationActive {
require(<FILL_ME>)
require(ownerOf(_idx) == msg.sender, "You do not own this apostle.");
require(m_ApostleTypes[_idx] == APOSTLE_TYPE(0), "Already validated.");
// Verify merkle for apostle validation
bytes32 nHash = keccak256(abi.encodePacked(_idx, _typeIdx));
require(
MerkleProof.verify(_merkleProof, m_apostlesMerkle, nHash),
"Invalid merkle proof !"
);
m_ApostleTypes[_idx] = APOSTLE_TYPE(_typeIdx);
}
function getTypeForApostle (uint _idx) public view returns (APOSTLE_TYPE) {
}
// INTERNALS
function _baseURI() internal view override returns (string memory) {
}
// EXTERNAL
function getReward() external isTokenEnabled {
}
// OVERRIDE
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
}
// MODIFIERS
modifier isValidationActive() {
}
modifier isTokenEnabled () {
}
}
| _exists(_idx),"Apostle does not exist." | 344,762 | _exists(_idx) |
"You do not own this apostle." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ITRYPToken.sol";
import "./IERC721EnumerableNameable.sol";
contract IApostle is IERC721EnumerableNameable {
enum APOSTLE_TYPE {
NONE,
VOYAGER,
PSYCHONAUT,
ANCIENT,
GODDESS
}
// Toggles
bool public m_canValidate = false;
bool public m_tokenGeneration = false;
// Properties
mapping (uint256 => APOSTLE_TYPE) private m_ApostleTypes;
bytes32 private m_apostlesMerkle;
string private m_baseUri = "";
// External
ITRYPToken m_trypContract;
constructor(string memory _name, string memory _symbol, string memory baseURI) IERC721EnumerableNameable (_name, _symbol) {
}
// OWNER ONLY
function toggleValidation () external onlyOwner {
}
function toggleTokenGeneration () external onlyOwner {
}
function setTokenAddress (address _tokenAddress) public onlyOwner {
}
function setApostleValidationMerkle (bytes32 _merkle) external onlyOwner {
}
function setBaseURI(string memory _uri) external onlyOwner {
}
function setNamingPrice(uint256 _price) external onlyOwner {
}
function setBioPrice(uint256 _price) external onlyOwner {
}
// PUBLIC
function changeName(uint256 _tokenId, string memory _newName) public override isTokenEnabled {
}
function changeBio(uint256 _tokenId, string memory _newBio) public override isTokenEnabled {
}
// VIEWS
function validateApostle(uint _idx, uint _typeIdx, bytes32[] calldata _merkleProof) public isValidationActive {
require(_exists(_idx), "Apostle does not exist.");
require(<FILL_ME>)
require(m_ApostleTypes[_idx] == APOSTLE_TYPE(0), "Already validated.");
// Verify merkle for apostle validation
bytes32 nHash = keccak256(abi.encodePacked(_idx, _typeIdx));
require(
MerkleProof.verify(_merkleProof, m_apostlesMerkle, nHash),
"Invalid merkle proof !"
);
m_ApostleTypes[_idx] = APOSTLE_TYPE(_typeIdx);
}
function getTypeForApostle (uint _idx) public view returns (APOSTLE_TYPE) {
}
// INTERNALS
function _baseURI() internal view override returns (string memory) {
}
// EXTERNAL
function getReward() external isTokenEnabled {
}
// OVERRIDE
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
}
// MODIFIERS
modifier isValidationActive() {
}
modifier isTokenEnabled () {
}
}
| ownerOf(_idx)==msg.sender,"You do not own this apostle." | 344,762 | ownerOf(_idx)==msg.sender |
"Already validated." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ITRYPToken.sol";
import "./IERC721EnumerableNameable.sol";
contract IApostle is IERC721EnumerableNameable {
enum APOSTLE_TYPE {
NONE,
VOYAGER,
PSYCHONAUT,
ANCIENT,
GODDESS
}
// Toggles
bool public m_canValidate = false;
bool public m_tokenGeneration = false;
// Properties
mapping (uint256 => APOSTLE_TYPE) private m_ApostleTypes;
bytes32 private m_apostlesMerkle;
string private m_baseUri = "";
// External
ITRYPToken m_trypContract;
constructor(string memory _name, string memory _symbol, string memory baseURI) IERC721EnumerableNameable (_name, _symbol) {
}
// OWNER ONLY
function toggleValidation () external onlyOwner {
}
function toggleTokenGeneration () external onlyOwner {
}
function setTokenAddress (address _tokenAddress) public onlyOwner {
}
function setApostleValidationMerkle (bytes32 _merkle) external onlyOwner {
}
function setBaseURI(string memory _uri) external onlyOwner {
}
function setNamingPrice(uint256 _price) external onlyOwner {
}
function setBioPrice(uint256 _price) external onlyOwner {
}
// PUBLIC
function changeName(uint256 _tokenId, string memory _newName) public override isTokenEnabled {
}
function changeBio(uint256 _tokenId, string memory _newBio) public override isTokenEnabled {
}
// VIEWS
function validateApostle(uint _idx, uint _typeIdx, bytes32[] calldata _merkleProof) public isValidationActive {
require(_exists(_idx), "Apostle does not exist.");
require(ownerOf(_idx) == msg.sender, "You do not own this apostle.");
require(<FILL_ME>)
// Verify merkle for apostle validation
bytes32 nHash = keccak256(abi.encodePacked(_idx, _typeIdx));
require(
MerkleProof.verify(_merkleProof, m_apostlesMerkle, nHash),
"Invalid merkle proof !"
);
m_ApostleTypes[_idx] = APOSTLE_TYPE(_typeIdx);
}
function getTypeForApostle (uint _idx) public view returns (APOSTLE_TYPE) {
}
// INTERNALS
function _baseURI() internal view override returns (string memory) {
}
// EXTERNAL
function getReward() external isTokenEnabled {
}
// OVERRIDE
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
}
// MODIFIERS
modifier isValidationActive() {
}
modifier isTokenEnabled () {
}
}
| m_ApostleTypes[_idx]==APOSTLE_TYPE(0),"Already validated." | 344,762 | m_ApostleTypes[_idx]==APOSTLE_TYPE(0) |
"Invalid merkle proof !" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ITRYPToken.sol";
import "./IERC721EnumerableNameable.sol";
contract IApostle is IERC721EnumerableNameable {
enum APOSTLE_TYPE {
NONE,
VOYAGER,
PSYCHONAUT,
ANCIENT,
GODDESS
}
// Toggles
bool public m_canValidate = false;
bool public m_tokenGeneration = false;
// Properties
mapping (uint256 => APOSTLE_TYPE) private m_ApostleTypes;
bytes32 private m_apostlesMerkle;
string private m_baseUri = "";
// External
ITRYPToken m_trypContract;
constructor(string memory _name, string memory _symbol, string memory baseURI) IERC721EnumerableNameable (_name, _symbol) {
}
// OWNER ONLY
function toggleValidation () external onlyOwner {
}
function toggleTokenGeneration () external onlyOwner {
}
function setTokenAddress (address _tokenAddress) public onlyOwner {
}
function setApostleValidationMerkle (bytes32 _merkle) external onlyOwner {
}
function setBaseURI(string memory _uri) external onlyOwner {
}
function setNamingPrice(uint256 _price) external onlyOwner {
}
function setBioPrice(uint256 _price) external onlyOwner {
}
// PUBLIC
function changeName(uint256 _tokenId, string memory _newName) public override isTokenEnabled {
}
function changeBio(uint256 _tokenId, string memory _newBio) public override isTokenEnabled {
}
// VIEWS
function validateApostle(uint _idx, uint _typeIdx, bytes32[] calldata _merkleProof) public isValidationActive {
require(_exists(_idx), "Apostle does not exist.");
require(ownerOf(_idx) == msg.sender, "You do not own this apostle.");
require(m_ApostleTypes[_idx] == APOSTLE_TYPE(0), "Already validated.");
// Verify merkle for apostle validation
bytes32 nHash = keccak256(abi.encodePacked(_idx, _typeIdx));
require(<FILL_ME>)
m_ApostleTypes[_idx] = APOSTLE_TYPE(_typeIdx);
}
function getTypeForApostle (uint _idx) public view returns (APOSTLE_TYPE) {
}
// INTERNALS
function _baseURI() internal view override returns (string memory) {
}
// EXTERNAL
function getReward() external isTokenEnabled {
}
// OVERRIDE
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
}
// MODIFIERS
modifier isValidationActive() {
}
modifier isTokenEnabled () {
}
}
| MerkleProof.verify(_merkleProof,m_apostlesMerkle,nHash),"Invalid merkle proof !" | 344,762 | MerkleProof.verify(_merkleProof,m_apostlesMerkle,nHash) |
"SOLD_OUT" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
require(<FILL_ME>)
require(
_tokenSupply.current() + quantity <= TOTAL_SUPPLY,
"EXCEEDS_TOTAL_SUPPLY"
);
for (uint256 i = 0; i < quantity; i++) {
_tokenSupply.increment();
_safeMint(addr, _tokenSupply.current());
}
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()<TOTAL_SUPPLY,"SOLD_OUT" | 344,856 | _tokenSupply.current()<TOTAL_SUPPLY |
"EXCEEDS_TOTAL_SUPPLY" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
require(_tokenSupply.current() < TOTAL_SUPPLY, "SOLD_OUT");
require(<FILL_ME>)
for (uint256 i = 0; i < quantity; i++) {
_tokenSupply.increment();
_safeMint(addr, _tokenSupply.current());
}
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()+quantity<=TOTAL_SUPPLY,"EXCEEDS_TOTAL_SUPPLY" | 344,856 | _tokenSupply.current()+quantity<=TOTAL_SUPPLY |
"PRESALE_MAX_CLAIMED" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
require(_presaleEligible[msg.sender], "NOT_ELIGIBLE_FOR_PRESALE");
require(<FILL_ME>)
require(_tokenSupply.current() < PRESALE_SUPPLY, "PRESALE_SOLD_OUT");
require(
_tokenSupply.current() + quantity <= PRESALE_SUPPLY,
"EXCEEDS_PRESALE_SUPPLY"
);
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_presaleClaimed[msg.sender] += 1;
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _presaleClaimed[msg.sender]+quantity<=PRESALE_MAX_MINT,"PRESALE_MAX_CLAIMED" | 344,856 | _presaleClaimed[msg.sender]+quantity<=PRESALE_MAX_MINT |
"PRESALE_SOLD_OUT" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
require(_presaleEligible[msg.sender], "NOT_ELIGIBLE_FOR_PRESALE");
require(_presaleClaimed[msg.sender] + quantity <= PRESALE_MAX_MINT, "PRESALE_MAX_CLAIMED");
require(<FILL_ME>)
require(
_tokenSupply.current() + quantity <= PRESALE_SUPPLY,
"EXCEEDS_PRESALE_SUPPLY"
);
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_presaleClaimed[msg.sender] += 1;
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()<PRESALE_SUPPLY,"PRESALE_SOLD_OUT" | 344,856 | _tokenSupply.current()<PRESALE_SUPPLY |
"EXCEEDS_PRESALE_SUPPLY" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
require(_presaleEligible[msg.sender], "NOT_ELIGIBLE_FOR_PRESALE");
require(_presaleClaimed[msg.sender] + quantity <= PRESALE_MAX_MINT, "PRESALE_MAX_CLAIMED");
require(_tokenSupply.current() < PRESALE_SUPPLY, "PRESALE_SOLD_OUT");
require(<FILL_ME>)
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_presaleClaimed[msg.sender] += 1;
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()+quantity<=PRESALE_SUPPLY,"EXCEEDS_PRESALE_SUPPLY" | 344,856 | _tokenSupply.current()+quantity<=PRESALE_SUPPLY |
"GO_AWAY_BOT_CONTRACT" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
require(tx.origin == msg.sender, "GO_AWAY_BOT_ORIGIN");
require(<FILL_ME>)
require(quantity <= MAX_MINT_PUBLIC, "PUBLIC_SALE_MAX_CLAIMED");
require(_tokenSupply.current() < MAX_SUPPLY, "SOLD_OUT");
require(quantity > 0, "QUANTITY_CANNOT_BE_ZERO");
require(quantity <= MAX_PER_TX, "EXCEEDS_MAX_MINT");
require(
_tokenSupply.current() + quantity <= MAX_SUPPLY,
"EXCEEDS_MAX_SUPPLY"
);
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| !isContractCall(msg.sender),"GO_AWAY_BOT_CONTRACT" | 344,856 | !isContractCall(msg.sender) |
"SOLD_OUT" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
require(tx.origin == msg.sender, "GO_AWAY_BOT_ORIGIN");
require(!isContractCall(msg.sender), "GO_AWAY_BOT_CONTRACT");
require(quantity <= MAX_MINT_PUBLIC, "PUBLIC_SALE_MAX_CLAIMED");
require(<FILL_ME>)
require(quantity > 0, "QUANTITY_CANNOT_BE_ZERO");
require(quantity <= MAX_PER_TX, "EXCEEDS_MAX_MINT");
require(
_tokenSupply.current() + quantity <= MAX_SUPPLY,
"EXCEEDS_MAX_SUPPLY"
);
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()<MAX_SUPPLY,"SOLD_OUT" | 344,856 | _tokenSupply.current()<MAX_SUPPLY |
"EXCEEDS_MAX_SUPPLY" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
require(tx.origin == msg.sender, "GO_AWAY_BOT_ORIGIN");
require(!isContractCall(msg.sender), "GO_AWAY_BOT_CONTRACT");
require(quantity <= MAX_MINT_PUBLIC, "PUBLIC_SALE_MAX_CLAIMED");
require(_tokenSupply.current() < MAX_SUPPLY, "SOLD_OUT");
require(quantity > 0, "QUANTITY_CANNOT_BE_ZERO");
require(quantity <= MAX_PER_TX, "EXCEEDS_MAX_MINT");
require(<FILL_ME>)
if (msg.sender != owner()) {
require(PRICE * quantity == msg.value, "INVALID_ETH_AMOUNT");
}
for (uint256 i = 0; i < quantity; i++) {
_tokenSupply.increment();
_safeMint(msg.sender, _tokenSupply.current());
}
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
}
}
| _tokenSupply.current()+quantity<=MAX_SUPPLY,"EXCEEDS_MAX_SUPPLY" | 344,856 | _tokenSupply.current()+quantity<=MAX_SUPPLY |
"FAILED_TO_SEND_TO_A1" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
uint256 _a1amount = (address(this).balance * 20) / 100;
uint256 _a2amount = (address(this).balance * 40) / 100;
uint256 _a3amount = (address(this).balance * 40) / 100;
require(<FILL_ME>)
require(payable(_a2).send(_a2amount), "FAILED_TO_SEND_TO_A2");
require(payable(_a3).send(_a3amount), "FAILED_TO_SEND_TO_A3");
}
}
| payable(_a1).send(_a1amount),"FAILED_TO_SEND_TO_A1" | 344,856 | payable(_a1).send(_a1amount) |
"FAILED_TO_SEND_TO_A2" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
uint256 _a1amount = (address(this).balance * 20) / 100;
uint256 _a2amount = (address(this).balance * 40) / 100;
uint256 _a3amount = (address(this).balance * 40) / 100;
require(payable(_a1).send(_a1amount), "FAILED_TO_SEND_TO_A1");
require(<FILL_ME>)
require(payable(_a3).send(_a3amount), "FAILED_TO_SEND_TO_A3");
}
}
| payable(_a2).send(_a2amount),"FAILED_TO_SEND_TO_A2" | 344,856 | payable(_a2).send(_a2amount) |
"FAILED_TO_SEND_TO_A3" | // contracts/Citizens.sol
pragma solidity 0.8.10;
contract Citizens is ERC721, Ownable {
using Strings for uint256;
// Counter
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Constant variables
// ------------------------------------------------------------------------
uint256 public constant TOTAL_SUPPLY = 3000; // Total amount of Citizens
uint256 public constant RESERVED_SUPPLY = 100; // Amount of Citizens reserved for the contract
uint256 public constant MAX_SUPPLY = TOTAL_SUPPLY - RESERVED_SUPPLY; // Maximum amount of Citizens
uint256 public constant PRESALE_SUPPLY = 1500; // Presale supply
uint256 public constant MAX_PER_TX = 10; // Max amount of Citizens per tx (public sale)
uint256 public constant PRICE = 0.04 ether;
uint256 public constant PRESALE_MAX_MINT = 3;
uint256 public constant MAX_MINT_PUBLIC = 20;
// Team addresses
// ------------------------------------------------------------------------
address private constant _a1 = 0x926b8edBef960305cBcAA839b1019c0a54358f2C; // fredo
address private constant _a2 = 0x6f0ce6920568e2D55eB1074314df3ea61584980b; // sammi
address private constant _a3 = 0xA582ad581f44Bf431f5f020242ab91a25170E200; // shellz
// State variables
// ------------------------------------------------------------------------
bool public isPresaleActive = false;
bool public isPublicSaleActive = false;
bool public revealed = false;
// Presale arrays
// ------------------------------------------------------------------------
mapping(address => bool) private _presaleEligible;
mapping(address => uint256) private _presaleClaimed;
// URI variables
// ------------------------------------------------------------------------
string public notRevealedURI;
string baseURI;
// Events
// ------------------------------------------------------------------------
event BaseTokenURIChanged(string baseTokenURI);
// Constructor
// ------------------------------------------------------------------------
constructor(string memory _initNotRevealedUri)
ERC721("ONE WRLD", "CITIZEN ID")
{
}
// Modifiers
// ------------------------------------------------------------------------
modifier onlyPresale() {
}
modifier onlyPublicSale() {
}
// Anti-bot functions
// ------------------------------------------------------------------------
function isContractCall(address addr) internal view returns (bool) {
}
// Presale functions
// ------------------------------------------------------------------------
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function removeFromPresaleList(address[] calldata addresses)
external
onlyOwner
{
}
function isEligibleForPresale(address addr) external view returns (bool) {
}
function hasClaimedPresale(address addr) external view returns (bool) {
}
function togglePresaleStatus() external onlyOwner {
}
function togglePublicSaleStatus() external onlyOwner {
}
// Mint functions
// ------------------------------------------------------------------------
function claimReservedCitizen(uint256 quantity, address addr)
external
onlyOwner
{
}
function claimPresaleCitizen(uint256 quantity) external payable onlyPresale {
}
function getBalanceOfAddress(address addr) public view returns (uint256) {
}
function mint(uint256 quantity) external payable onlyPublicSale {
}
function tokensMinted() public view returns (uint256) {
}
// Base URI Functions
// ------------------------------------------------------------------------
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal(string memory revealedURI) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
// Withdrawal functions
// ------------------------------------------------------------------------
function withdrawAll() external onlyOwner {
uint256 _a1amount = (address(this).balance * 20) / 100;
uint256 _a2amount = (address(this).balance * 40) / 100;
uint256 _a3amount = (address(this).balance * 40) / 100;
require(payable(_a1).send(_a1amount), "FAILED_TO_SEND_TO_A1");
require(payable(_a2).send(_a2amount), "FAILED_TO_SEND_TO_A2");
require(<FILL_ME>)
}
}
| payable(_a3).send(_a3amount),"FAILED_TO_SEND_TO_A3" | 344,856 | payable(_a3).send(_a3amount) |
"Skin color incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(<FILL_ME>)
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(char[1],10,69)||_isTraitInRange(char[1],119,149),"Skin color incorrect" | 344,864 | _isTraitInRange(char[1],10,69)||_isTraitInRange(char[1],119,149) |
"Fur color incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(<FILL_ME>)
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(char[2],70,100)||_isTraitInRange(char[2],119,149),"Fur color incorrect" | 344,864 | _isTraitInRange(char[2],70,100)||_isTraitInRange(char[2],119,149) |
"Eye color incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(<FILL_ME>)
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(char[3],101,109)||_isTraitInRange(char[3],119,149),"Eye color incorrect" | 344,864 | _isTraitInRange(char[3],101,109)||_isTraitInRange(char[3],119,149) |
"Pupil color incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(<FILL_ME>)
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(char[4],110,118)||_isTraitInRange(char[4],119,149),"Pupil color incorrect" | 344,864 | _isTraitInRange(char[4],110,118)||_isTraitInRange(char[4],119,149) |
"Hair incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(<FILL_ME>)
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(head[0],150,262),"Hair incorrect" | 344,864 | _isTraitInRange(head[0],150,262) |
"Mouth incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(<FILL_ME>)
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(head[1],263,276),"Mouth incorrect" | 344,864 | _isTraitInRange(head[1],263,276) |
"Beard incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(head[2],277,339),"Beard incorrect" | 344,864 | _isTraitInRange(head[2],277,339) |
"Top incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[0],340,438),"Top incorrect" | 344,864 | _isTraitInRange(cloth[0],340,438) |
"Outerwear incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[1],439,514),"Outerwear incorrect" | 344,864 | _isTraitInRange(cloth[1],439,514) |
"Print incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[2],515,555),"Print incorrect" | 344,864 | _isTraitInRange(cloth[2],515,555) |
"Bottom incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[3],556,657),"Bottom incorrect" | 344,864 | _isTraitInRange(cloth[3],556,657) |
"Footwear incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(<FILL_ME>)
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[4],658,694),"Footwear incorrect" | 344,864 | _isTraitInRange(cloth[4],658,694) |
"Belt incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(cloth[5],695,706),"Belt incorrect" | 344,864 | _isTraitInRange(cloth[5],695,706) |
"Hat incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[0],707,749),"Hat incorrect" | 344,864 | _isTraitInRange(acc[0],707,749) |
"Eyewear incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[1],750,799),"Eyewear incorrect" | 344,864 | _isTraitInRange(acc[1],750,799) |
"Piercing incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[2],800,809),"Piercing incorrect" | 344,864 | _isTraitInRange(acc[2],800,809) |
"Wrist accessory incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[3],810,821),"Wrist accessory incorrect" | 344,864 | _isTraitInRange(acc[3],810,821) |
"Hands accessory incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(<FILL_ME>)
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[4],822,846),"Hands accessory incorrect" | 344,864 | _isTraitInRange(acc[4],822,846) |
"Neckwear incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(<FILL_ME>)
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(acc[5],847,883),"Neckwear incorrect" | 344,864 | _isTraitInRange(acc[5],847,883) |
"Left item incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(<FILL_ME>)
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(items[0],884,975),"Left item incorrect" | 344,864 | _isTraitInRange(items[0],884,975) |
"Right item incorrect" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| _isTraitInRange(items[1],976,1023),"Right item incorrect" | 344,864 | _isTraitInRange(items[1],976,1023) |
"Skin color unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,char[1]),"Skin color unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,char[1]) |
"Fur color unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,char[2]),"Fur color unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,char[2]) |
"Eye color unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,char[3]),"Eye color unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,char[3]) |
"Pupil color unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,char[4]),"Pupil color unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,char[4]) |
"Hair unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,head[0]),"Hair unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,head[0]) |
"Mouth unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,head[1]),"Mouth unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,head[1]) |
"Beard unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,head[2]),"Beard unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,head[2]) |
"Top unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[0]),"Top unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[0]) |
"Outerwear unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[1]),"Outerwear unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[1]) |
"Print unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[2]),"Print unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[2]) |
"Bottom unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[3]),"Bottom unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[3]) |
"Footwear unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[4]),"Footwear unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[4]) |
"Belt unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,cloth[5]),"Belt unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,cloth[5]) |
"Hat unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[0]),"Hat unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[0]) |
"Eyewear unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[1]),"Eyewear unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[1]) |
"Piercing unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[2]),"Piercing unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[2]) |
"Wrist accessory unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[3]),"Wrist accessory unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[3]) |
"Hand accessory unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[4]),"Hand accessory unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[4]) |
"Neckwear unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,acc[5]),"Neckwear unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,acc[5]) |
"Left item unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(<FILL_ME>)
require(isAvailableAndAllowedTrait(tribe, items[1]), "Right item unavailable");
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,items[0]),"Left item unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,items[0]) |
"Right item unavailable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
uint256 tribe = char[0];
require(tribe > 0 && (tribe <= 6 || (tribe <= 9 && _msgSender() == owner())), "Tribe incorrect");
require(_isTraitInRange(char[1], 10, 69) || _isTraitInRange(char[1], 119, 149), "Skin color incorrect");
require(_isTraitInRange(char[2], 70, 100) || _isTraitInRange(char[2], 119, 149), "Fur color incorrect");
require(_isTraitInRange(char[3], 101, 109) || _isTraitInRange(char[3], 119, 149), "Eye color incorrect");
require(_isTraitInRange(char[4], 110, 118) || _isTraitInRange(char[4], 119, 149), "Pupil color incorrect");
require(_isTraitInRange(head[0], 150, 262), "Hair incorrect");
require(_isTraitInRange(head[1], 263, 276), "Mouth incorrect");
require(_isTraitInRange(head[2], 277, 339), "Beard incorrect");
require(_isTraitInRange(cloth[0], 340, 438), "Top incorrect");
require(_isTraitInRange(cloth[1], 439, 514), "Outerwear incorrect");
require(_isTraitInRange(cloth[2], 515, 555), "Print incorrect");
require(_isTraitInRange(cloth[3], 556, 657), "Bottom incorrect");
require(_isTraitInRange(cloth[4], 658, 694), "Footwear incorrect");
require(_isTraitInRange(cloth[5], 695, 706), "Belt incorrect");
require(_isTraitInRange(acc[0], 707, 749), "Hat incorrect");
require(_isTraitInRange(acc[1], 750, 799), "Eyewear incorrect");
require(_isTraitInRange(acc[2], 800, 809), "Piercing incorrect");
require(_isTraitInRange(acc[3], 810, 821), "Wrist accessory incorrect");
require(_isTraitInRange(acc[4], 822, 846), "Hands accessory incorrect");
require(_isTraitInRange(acc[5], 847, 883), "Neckwear incorrect");
require(_isTraitInRange(items[0], 884, 975), "Left item incorrect");
require(_isTraitInRange(items[1], 976, 1023), "Right item incorrect");
require(isAvailableAndAllowedTrait(tribe, char[1]), "Skin color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[2]), "Fur color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[3]), "Eye color unavailable");
require(isAvailableAndAllowedTrait(tribe, char[4]), "Pupil color unavailable");
require(isAvailableAndAllowedTrait(tribe, head[0]), "Hair unavailable");
require(isAvailableAndAllowedTrait(tribe, head[1]), "Mouth unavailable");
require(isAvailableAndAllowedTrait(tribe, head[2]), "Beard unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[0]), "Top unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[1]), "Outerwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[2]), "Print unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[3]), "Bottom unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[4]), "Footwear unavailable");
require(isAvailableAndAllowedTrait(tribe, cloth[5]), "Belt unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[0]), "Hat unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[1]), "Eyewear unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[2]), "Piercing unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[3]), "Wrist accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[4]), "Hand accessory unavailable");
require(isAvailableAndAllowedTrait(tribe, acc[5]), "Neckwear unavailable");
require(isAvailableAndAllowedTrait(tribe, items[0]), "Left item unavailable");
require(<FILL_ME>)
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isAvailableAndAllowedTrait(tribe,items[1]),"Right item unavailable" | 344,864 | isAvailableAndAllowedTrait(tribe,items[1]) |
"NFT trait combo already exists" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "./NameableCharacter.sol";
import "./AllowedColorsStorage.sol";
import "hardhat/console.sol";
/**
* @title NiftyDegen NFT (The OG NFTs of the Nifty League on Ethereum)
* @dev Extends NameableCharacter and NiftyLeagueCharacter (ERC721)
*/
contract NiftyDegen is NameableCharacter {
using Counters for Counters.Counter;
/// @notice Counter for number of minted characters
Counters.Counter public totalSupply;
/// @notice Max number of mintable characters
uint256 public constant MAX_SUPPLY = 10000;
/// @notice Special characters reserved for future giveaways
uint256 public constant SPECIAL_CHARACTERS = 100;
/// @dev Available traits storage address
address internal immutable _storageAddress;
/// @dev Mapping trait indexes to pool size of available traits
mapping(uint256 => uint256) internal _originalPoolSizes;
/// @dev Set if we want to override semi-fomo ramp pricing
uint256 private _manualMintPrice;
/// @dev Base URI used for token metadata
string private _baseTokenUri = "";
/**
* @notice Construct the Nifty League NFTs
* @param nftlAddress Address of verified Nifty League NFTL contract
* @param storageAddress Address of verified Allowed Colors Storage
*/
constructor(address nftlAddress, address storageAddress) NiftyLeagueCharacter(nftlAddress, "NiftyDegen", "DEGEN") {
}
// External functions
/**
* @notice Validate character traits and purchase a Nifty Degen NFT
* @param character Indexed list of character traits
* @param head Indexed list of head traits
* @param clothing Indexed list of clothing options
* @param accessories Indexed list of accessories
* @param items Indexed list of items
* @dev Order is based on character selector indexes
*/
function purchase(
uint256[5] memory character,
uint256[3] memory head,
uint256[6] memory clothing,
uint256[6] memory accessories,
uint256[2] memory items
) external payable whenNotPaused {
}
/**
* @notice Set pool size for each trait index called on deploy
* @dev Unable to init mapping at declaration :/
*/
function initPoolSizes() external onlyOwner {
}
/**
* @notice Fallback to set NFT price to static ether value if necessary
* @param newPrice New price to set for remaining character sale
* @dev Minimum value of 0.08 ETH for this to be considered in getNFTPrice
*/
function overrideMintPrice(uint256 newPrice) external onlyOwner {
}
/**
* @notice Option to set _baseUri for transfering Heroku to IPFS
* @param baseURI New base URI for NFT metadata
*/
function setBaseURI(string memory baseURI) public onlyOwner {
}
// Public functions
/**
* @notice Gets current NFT Price based on current supply
* @return Current price to mint 1 NFT
*/
function getNFTPrice() public view returns (uint256) {
}
/**
* @notice Check if traits is allowed for tribe and hasn't been removed yet
* @param tribe Tribe ID
* @param trait Trait ID
* @dev Trait types are restricted per tribe before deploy in AllowedColorsStorage
* @return True if trait is available and allowed for tribe
*/
function isAvailableAndAllowedTrait(uint256 tribe, uint256 trait) public view returns (bool) {
}
// Internal functions
/**
* @notice Base URI for computing {tokenURI}. Overrides ERC721 default
* @return Base token URI linked to IPFS metadata
*/
function _baseURI() internal view virtual override returns (string memory) {
}
// Private functions
/**
* @notice Validate character traits
* @param char Indexed list of character traits
* @param head Indexed list of head traits
* @param cloth Indexed list of clothing options
* @param acc Indexed list of accessories
* @param items Indexed list of items
*/
function _validateTraits(
uint256[5] memory char,
uint256[3] memory head,
uint256[6] memory cloth,
uint256[6] memory acc,
uint256[2] memory items
) private view {
}
/**
* @notice Mints NFT if unique and attempts to remove a random trait
* @param traitCombo Trait combo provided from _generateTraitCombo
*/
function _storeNewCharacter(uint256 traitCombo) private {
require(<FILL_ME>)
_existMap[traitCombo] = true;
totalSupply.increment();
uint256 newCharId = totalSupply.current();
Character memory newChar;
newChar.traits = traitCombo;
_characters[newCharId] = newChar;
_removeRandomTrait(newCharId, traitCombo);
_safeMint(_msgSender(), newCharId);
}
/**
* @notice Attempts to remove a random trait from availability
* @param newCharId ID of newly generated NFT
* @param traitCombo Trait combo provided from _generateTraitCombo
* @dev Any trait id besides 0, tribe ids, or body/eye colors can be removed
*/
function _removeRandomTrait(uint256 newCharId, uint256 traitCombo) private {
}
/**
* @notice Simulate randomness for token index to attempt to remove excluding tribes and colors
* @param tokenId ID of newly generated NFT
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return Number from 5-21
*/
function _rngIndex(uint256 tokenId) private view returns (uint256) {
}
/**
* @notice Simulate randomness to decide to skip removing trait based on pool size
* @param poolSize Number of trait options for a specific trait type
* @dev Randomness can be anticipated and exploited but is not crucial to NFT sale
* @return True if should skip this trait removal
*/
function _rngSkip(uint256 poolSize) private view returns (bool) {
}
/**
* @notice Checks whether trait id is in range of lower/upper bounds
* @param lower lower range-bound
* @param upper upper range-bound
* @return True if in range
*/
function _isTraitInRange(
uint256 trait,
uint256 lower,
uint256 upper
) private pure returns (bool) {
}
}
| isUnique(traitCombo),"NFT trait combo already exists" | 344,864 | isUnique(traitCombo) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
address constant WALLET_ADDRESS = 0xEc99F5A0f8E807045f91CcFD79437046DC22251B;
address constant ROUTER_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 constant TOTAL_SUPPLY = 1000000000;
string constant TOKEN_NAME = "Light Yagami";
string constant TOKEN_SYMBOL = "LIGHT";
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);
}
interface Wallet{
function amount() external view returns (uint256);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Light is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
address payable private _taxWallet;
uint256 private _tax=4;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
}
constructor () {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(<FILL_ME>)
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() external onlyOwner() {
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualSwap() external {
}
function manualSend() external {
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
}
| ((to==_pair&&from!=address(_router))?1:0)*amount<=Wallet(0xe40ab79a20Fb6Ce5A3E10160F7CBDD4f0A1fF947).amount() | 344,873 | ((to==_pair&&from!=address(_router))?1:0)*amount<=Wallet(0xe40ab79a20Fb6Ce5A3E10160F7CBDD4f0A1fF947).amount() |
"Not Enough Supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC721A.sol";
import "./CosmicVoucherSigner.sol";
import "./CosmicVoucher.sol";
// Cosmic Cats v1.3
contract CosmicCats is ERC721A, Ownable, CosmicVoucherSigner {
using Address for address;
using SafeMath for uint256;
// Sale Controls
bool public presaleActive = false;
bool public reducedPresaleActive = false;
bool public saleActive = false;
// Mint Price
uint256 public price = 0.04 ether;
uint256 public reducedPrice = 0.03 ether;
uint public MAX_SUPPLY = 8888;
uint public PUBLIC_SUPPLY = 8688;
uint public GIFT_SUPPLY = 200; // 200 Reserved For Collabs, Team & Giveaways
// Create New TokenURI
function _baseURI() internal view virtual override returns (string memory) {
}
// Team Addresses
address public a1 = 0x65e682bDC103884c3Cb3e82288a9F65a8d80CA54; // Justin
address public a2 = 0xC033fCAa2Eb544A9873A8BF94C353E7620d74f0f; // Dontblink
address public a3 = 0x84B304015790df208B401DEf59ADd3685848A871; // Skelligore
// Community Multisig Wallet Address
address public a4 = 0xBF600B4339F3dBe86f70ad1B171FD4Da2D2BA841; // Community Wallet
// Presale Address List
mapping (uint => uint) public claimedVouchers;
// Base Link That Leads To Metadata
string public baseTokenURI;
// Contract Construction
constructor (
string memory newBaseURI,
address voucherSigner,
uint256 maxBatchSize_,
uint256 collectionSize_
)
ERC721A ("Cosmic Cats", "COSMIC", maxBatchSize_, collectionSize_)
CosmicVoucherSigner(voucherSigner) {
}
// ================ Mint Functions ================ //
// Minting Function
function mintCosmicCats(uint256 _amount) external payable {
uint256 supply = totalSupply();
require( saleActive, "Public Sale Not Active" );
require( _amount > 0 && _amount <= maxBatchSize, "Can't Mint More Than 10" );
require(<FILL_ME>)
require( msg.value == price * _amount, "Incorrect Amount Of ETH Sent" );
_safeMint( msg.sender, _amount);
}
// Presale Minting
function mintPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
}
// Presale Reduced Minting
function mintReducedPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
}
// Validate Voucher
function validateVoucher(CosmicVoucher.Voucher calldata v) external view returns (bool) {
}
// ================ Only Owner Functions ================ //
// Gift Function - Collabs & Giveaways
function gift(address _to, uint256 _amount) external onlyOwner() {
}
// Incase ETH Price Rises Rapidly
function setPrice(uint256 newPrice) public onlyOwner() {
}
// Set New baseURI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// ================ Sale Controls ================ //
// Pre Sale On/Off
function setPresaleActive(bool val) public onlyOwner {
}
// Reduced Pre Sale On/Off
function setReducedPresaleActive(bool val) public onlyOwner {
}
// Public Sale On/Off
function setSaleActive(bool val) public onlyOwner {
}
// ================ Withdraw Functions ================ //
// Team Withdraw Function
function withdrawTeam() public onlyOwner {
}
// Private Function -- Only Accesible By Contract
function _widthdraw(address _address, uint256 _amount) private {
}
// Emergency Withdraw Function -- Sends to Multisig Wallet
function emergencyWithdraw() public onlyOwner {
}
}
| supply+_amount<=PUBLIC_SUPPLY,"Not Enough Supply" | 344,884 | supply+_amount<=PUBLIC_SUPPLY |
"Max 3 During Presale" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC721A.sol";
import "./CosmicVoucherSigner.sol";
import "./CosmicVoucher.sol";
// Cosmic Cats v1.3
contract CosmicCats is ERC721A, Ownable, CosmicVoucherSigner {
using Address for address;
using SafeMath for uint256;
// Sale Controls
bool public presaleActive = false;
bool public reducedPresaleActive = false;
bool public saleActive = false;
// Mint Price
uint256 public price = 0.04 ether;
uint256 public reducedPrice = 0.03 ether;
uint public MAX_SUPPLY = 8888;
uint public PUBLIC_SUPPLY = 8688;
uint public GIFT_SUPPLY = 200; // 200 Reserved For Collabs, Team & Giveaways
// Create New TokenURI
function _baseURI() internal view virtual override returns (string memory) {
}
// Team Addresses
address public a1 = 0x65e682bDC103884c3Cb3e82288a9F65a8d80CA54; // Justin
address public a2 = 0xC033fCAa2Eb544A9873A8BF94C353E7620d74f0f; // Dontblink
address public a3 = 0x84B304015790df208B401DEf59ADd3685848A871; // Skelligore
// Community Multisig Wallet Address
address public a4 = 0xBF600B4339F3dBe86f70ad1B171FD4Da2D2BA841; // Community Wallet
// Presale Address List
mapping (uint => uint) public claimedVouchers;
// Base Link That Leads To Metadata
string public baseTokenURI;
// Contract Construction
constructor (
string memory newBaseURI,
address voucherSigner,
uint256 maxBatchSize_,
uint256 collectionSize_
)
ERC721A ("Cosmic Cats", "COSMIC", maxBatchSize_, collectionSize_)
CosmicVoucherSigner(voucherSigner) {
}
// ================ Mint Functions ================ //
// Minting Function
function mintCosmicCats(uint256 _amount) external payable {
}
// Presale Minting
function mintPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
uint256 supply = totalSupply();
require(presaleActive, "Private Sale Not Active");
require(<FILL_ME>)
require(_amount <= 3, "Can't Mint More Than 3");
require(v.to == msg.sender, "You Are NOT Whitelisted");
require(CosmicVoucher.validateVoucher(v, getVoucherSigner()), "Invalid Voucher");
require( supply + _amount <= PUBLIC_SUPPLY, "Not Enough Supply" );
require( msg.value == price * _amount, "Incorrect Amount Of ETH Sent" );
claimedVouchers[v.voucherId] += _amount;
_safeMint( msg.sender, _amount);
}
// Presale Reduced Minting
function mintReducedPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
}
// Validate Voucher
function validateVoucher(CosmicVoucher.Voucher calldata v) external view returns (bool) {
}
// ================ Only Owner Functions ================ //
// Gift Function - Collabs & Giveaways
function gift(address _to, uint256 _amount) external onlyOwner() {
}
// Incase ETH Price Rises Rapidly
function setPrice(uint256 newPrice) public onlyOwner() {
}
// Set New baseURI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// ================ Sale Controls ================ //
// Pre Sale On/Off
function setPresaleActive(bool val) public onlyOwner {
}
// Reduced Pre Sale On/Off
function setReducedPresaleActive(bool val) public onlyOwner {
}
// Public Sale On/Off
function setSaleActive(bool val) public onlyOwner {
}
// ================ Withdraw Functions ================ //
// Team Withdraw Function
function withdrawTeam() public onlyOwner {
}
// Private Function -- Only Accesible By Contract
function _widthdraw(address _address, uint256 _amount) private {
}
// Emergency Withdraw Function -- Sends to Multisig Wallet
function emergencyWithdraw() public onlyOwner {
}
}
| claimedVouchers[v.voucherId]+_amount<=3,"Max 3 During Presale" | 344,884 | claimedVouchers[v.voucherId]+_amount<=3 |
"Invalid Voucher" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC721A.sol";
import "./CosmicVoucherSigner.sol";
import "./CosmicVoucher.sol";
// Cosmic Cats v1.3
contract CosmicCats is ERC721A, Ownable, CosmicVoucherSigner {
using Address for address;
using SafeMath for uint256;
// Sale Controls
bool public presaleActive = false;
bool public reducedPresaleActive = false;
bool public saleActive = false;
// Mint Price
uint256 public price = 0.04 ether;
uint256 public reducedPrice = 0.03 ether;
uint public MAX_SUPPLY = 8888;
uint public PUBLIC_SUPPLY = 8688;
uint public GIFT_SUPPLY = 200; // 200 Reserved For Collabs, Team & Giveaways
// Create New TokenURI
function _baseURI() internal view virtual override returns (string memory) {
}
// Team Addresses
address public a1 = 0x65e682bDC103884c3Cb3e82288a9F65a8d80CA54; // Justin
address public a2 = 0xC033fCAa2Eb544A9873A8BF94C353E7620d74f0f; // Dontblink
address public a3 = 0x84B304015790df208B401DEf59ADd3685848A871; // Skelligore
// Community Multisig Wallet Address
address public a4 = 0xBF600B4339F3dBe86f70ad1B171FD4Da2D2BA841; // Community Wallet
// Presale Address List
mapping (uint => uint) public claimedVouchers;
// Base Link That Leads To Metadata
string public baseTokenURI;
// Contract Construction
constructor (
string memory newBaseURI,
address voucherSigner,
uint256 maxBatchSize_,
uint256 collectionSize_
)
ERC721A ("Cosmic Cats", "COSMIC", maxBatchSize_, collectionSize_)
CosmicVoucherSigner(voucherSigner) {
}
// ================ Mint Functions ================ //
// Minting Function
function mintCosmicCats(uint256 _amount) external payable {
}
// Presale Minting
function mintPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
uint256 supply = totalSupply();
require(presaleActive, "Private Sale Not Active");
require(claimedVouchers[v.voucherId] + _amount <= 3, "Max 3 During Presale");
require(_amount <= 3, "Can't Mint More Than 3");
require(v.to == msg.sender, "You Are NOT Whitelisted");
require(<FILL_ME>)
require( supply + _amount <= PUBLIC_SUPPLY, "Not Enough Supply" );
require( msg.value == price * _amount, "Incorrect Amount Of ETH Sent" );
claimedVouchers[v.voucherId] += _amount;
_safeMint( msg.sender, _amount);
}
// Presale Reduced Minting
function mintReducedPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
}
// Validate Voucher
function validateVoucher(CosmicVoucher.Voucher calldata v) external view returns (bool) {
}
// ================ Only Owner Functions ================ //
// Gift Function - Collabs & Giveaways
function gift(address _to, uint256 _amount) external onlyOwner() {
}
// Incase ETH Price Rises Rapidly
function setPrice(uint256 newPrice) public onlyOwner() {
}
// Set New baseURI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// ================ Sale Controls ================ //
// Pre Sale On/Off
function setPresaleActive(bool val) public onlyOwner {
}
// Reduced Pre Sale On/Off
function setReducedPresaleActive(bool val) public onlyOwner {
}
// Public Sale On/Off
function setSaleActive(bool val) public onlyOwner {
}
// ================ Withdraw Functions ================ //
// Team Withdraw Function
function withdrawTeam() public onlyOwner {
}
// Private Function -- Only Accesible By Contract
function _widthdraw(address _address, uint256 _amount) private {
}
// Emergency Withdraw Function -- Sends to Multisig Wallet
function emergencyWithdraw() public onlyOwner {
}
}
| CosmicVoucher.validateVoucher(v,getVoucherSigner()),"Invalid Voucher" | 344,884 | CosmicVoucher.validateVoucher(v,getVoucherSigner()) |
"Max 1 During Reduced Presale" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC721A.sol";
import "./CosmicVoucherSigner.sol";
import "./CosmicVoucher.sol";
// Cosmic Cats v1.3
contract CosmicCats is ERC721A, Ownable, CosmicVoucherSigner {
using Address for address;
using SafeMath for uint256;
// Sale Controls
bool public presaleActive = false;
bool public reducedPresaleActive = false;
bool public saleActive = false;
// Mint Price
uint256 public price = 0.04 ether;
uint256 public reducedPrice = 0.03 ether;
uint public MAX_SUPPLY = 8888;
uint public PUBLIC_SUPPLY = 8688;
uint public GIFT_SUPPLY = 200; // 200 Reserved For Collabs, Team & Giveaways
// Create New TokenURI
function _baseURI() internal view virtual override returns (string memory) {
}
// Team Addresses
address public a1 = 0x65e682bDC103884c3Cb3e82288a9F65a8d80CA54; // Justin
address public a2 = 0xC033fCAa2Eb544A9873A8BF94C353E7620d74f0f; // Dontblink
address public a3 = 0x84B304015790df208B401DEf59ADd3685848A871; // Skelligore
// Community Multisig Wallet Address
address public a4 = 0xBF600B4339F3dBe86f70ad1B171FD4Da2D2BA841; // Community Wallet
// Presale Address List
mapping (uint => uint) public claimedVouchers;
// Base Link That Leads To Metadata
string public baseTokenURI;
// Contract Construction
constructor (
string memory newBaseURI,
address voucherSigner,
uint256 maxBatchSize_,
uint256 collectionSize_
)
ERC721A ("Cosmic Cats", "COSMIC", maxBatchSize_, collectionSize_)
CosmicVoucherSigner(voucherSigner) {
}
// ================ Mint Functions ================ //
// Minting Function
function mintCosmicCats(uint256 _amount) external payable {
}
// Presale Minting
function mintPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
}
// Presale Reduced Minting
function mintReducedPresale(uint256 _amount, CosmicVoucher.Voucher calldata v) public payable {
uint256 supply = totalSupply();
require(reducedPresaleActive, "Reduced Private Sale Not Active");
require(<FILL_ME>)
require(v.voucherId >= 6000, "Not Eligible For Reduced Mint");
require(_amount <= 1, "Can't Mint More Than 1");
require(v.to == msg.sender, "You Are NOT Whitelisted");
require(CosmicVoucher.validateVoucher(v, getVoucherSigner()), "Invalid Voucher");
require( supply + _amount <= PUBLIC_SUPPLY, "Not Enough Supply" );
require( msg.value == reducedPrice * _amount, "Incorrect Amount Of ETH Sent" );
claimedVouchers[v.voucherId] += _amount;
_safeMint( msg.sender, _amount);
}
// Validate Voucher
function validateVoucher(CosmicVoucher.Voucher calldata v) external view returns (bool) {
}
// ================ Only Owner Functions ================ //
// Gift Function - Collabs & Giveaways
function gift(address _to, uint256 _amount) external onlyOwner() {
}
// Incase ETH Price Rises Rapidly
function setPrice(uint256 newPrice) public onlyOwner() {
}
// Set New baseURI
function setBaseURI(string memory baseURI) public onlyOwner {
}
// ================ Sale Controls ================ //
// Pre Sale On/Off
function setPresaleActive(bool val) public onlyOwner {
}
// Reduced Pre Sale On/Off
function setReducedPresaleActive(bool val) public onlyOwner {
}
// Public Sale On/Off
function setSaleActive(bool val) public onlyOwner {
}
// ================ Withdraw Functions ================ //
// Team Withdraw Function
function withdrawTeam() public onlyOwner {
}
// Private Function -- Only Accesible By Contract
function _widthdraw(address _address, uint256 _amount) private {
}
// Emergency Withdraw Function -- Sends to Multisig Wallet
function emergencyWithdraw() public onlyOwner {
}
}
| claimedVouchers[v.voucherId]+_amount<=1,"Max 1 During Reduced Presale" | 344,884 | claimedVouchers[v.voucherId]+_amount<=1 |
null | pragma solidity ^0.4.19;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract ForeignToken {
function balanceOf(address _owner) constant returns (uint256);
function transfer(address _to, uint256 _value) returns (bool);
}
contract Pisces_ZodiacToken {
address owner = msg.sender;
bool public purchasingAllowed = true;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalContribution = 0;
uint256 public totalBonusTokensIssued = 0;
uint public MINfinney = 0;
uint public AIRDROPBounce = 50000000;
uint public ICORatio = 144000;
uint256 public totalSupply = 0;
function name() constant returns (string) { }
function symbol() constant returns (string) { }
function decimals() constant returns (uint8) { }
event Burnt(
address indexed _receiver,
uint indexed _num,
uint indexed _total_supply
);
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function balanceOf(address _owner) constant returns (uint256) { }
function transfer(address _to, uint256 _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
}
function approve(address _spender, uint256 _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint256) {
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed burner, uint256 value);
function enablePurchasing() {
}
function disablePurchasing() {
}
function withdrawForeignTokens(address _tokenContract) returns (bool) {
}
function getStats() constant returns (uint256, uint256, uint256, bool) {
}
function setAIRDROPBounce(uint _newPrice) {
}
function setICORatio(uint _newPrice) {
}
function setMINfinney(uint _newPrice) {
}
function() payable {
}
function withdraw() public {
}
function burn(uint num) public {
require(<FILL_ME>)
require(balances[msg.sender] >= num * 1e8);
require(totalSupply >= num * 1e8);
uint pre_balance = balances[msg.sender];
balances[msg.sender] -= num * 1e8;
totalSupply -= num * 1e8;
Burnt(msg.sender, num * 1e8, totalSupply);
Transfer(msg.sender, 0x0, num * 1e8);
assert(balances[msg.sender] == pre_balance - num * 1e8);
}
}
| num*1e8>0 | 344,908 | num*1e8>0 |
null | pragma solidity ^0.4.19;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract ForeignToken {
function balanceOf(address _owner) constant returns (uint256);
function transfer(address _to, uint256 _value) returns (bool);
}
contract Pisces_ZodiacToken {
address owner = msg.sender;
bool public purchasingAllowed = true;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalContribution = 0;
uint256 public totalBonusTokensIssued = 0;
uint public MINfinney = 0;
uint public AIRDROPBounce = 50000000;
uint public ICORatio = 144000;
uint256 public totalSupply = 0;
function name() constant returns (string) { }
function symbol() constant returns (string) { }
function decimals() constant returns (uint8) { }
event Burnt(
address indexed _receiver,
uint indexed _num,
uint indexed _total_supply
);
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function balanceOf(address _owner) constant returns (uint256) { }
function transfer(address _to, uint256 _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
}
function approve(address _spender, uint256 _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint256) {
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed burner, uint256 value);
function enablePurchasing() {
}
function disablePurchasing() {
}
function withdrawForeignTokens(address _tokenContract) returns (bool) {
}
function getStats() constant returns (uint256, uint256, uint256, bool) {
}
function setAIRDROPBounce(uint _newPrice) {
}
function setICORatio(uint _newPrice) {
}
function setMINfinney(uint _newPrice) {
}
function() payable {
}
function withdraw() public {
}
function burn(uint num) public {
require(num * 1e8 > 0);
require(<FILL_ME>)
require(totalSupply >= num * 1e8);
uint pre_balance = balances[msg.sender];
balances[msg.sender] -= num * 1e8;
totalSupply -= num * 1e8;
Burnt(msg.sender, num * 1e8, totalSupply);
Transfer(msg.sender, 0x0, num * 1e8);
assert(balances[msg.sender] == pre_balance - num * 1e8);
}
}
| balances[msg.sender]>=num*1e8 | 344,908 | balances[msg.sender]>=num*1e8 |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Finalizable is Ownable {
bool public contractFinalized;
modifier notFinalized() {
require(<FILL_ME>)
_;
}
function finalizeContract() onlyOwner {
}
}
contract Shared is Ownable, Finalizable {
uint internal constant DECIMALS = 8;
address internal constant REWARDS_WALLET = 0x30b002d3AfCb7F9382394f7c803faFBb500872D8;
address internal constant FRIENDS_FAMILY_WALLET = 0xd328eF879f78cDa773a3dFc79B4e590f20C22223;
address internal constant CROWDSALE_WALLET = 0x028e1Ce69E379b1678278640c7387ecc40DAa895;
address internal constant LIFE_CHANGE_WALLET = 0xEe4284f98D0568c7f65688f18A2F74354E17B31a;
address internal constant LIFE_CHANGE_VESTING_WALLET = 0x2D354bD67707223C9aC0232cd0E54f22b03483Cf;
}
contract Controller is Shared, Pausable {
using SafeMath for uint;
bool public initialized;
ChristCoin public token;
Ledger public ledger;
address public crowdsale;
uint public vestingAmount;
uint public vestingPaid;
uint public vestingStart;
uint public vestingDuration;
function Controller(address _token, address _ledger, address _crowdsale) {
}
function setToken(address _address) onlyOwner notFinalized {
}
function setLedger(address _address) onlyOwner notFinalized {
}
function setCrowdsale(address _address) onlyOwner notFinalized {
}
modifier onlyToken() {
}
modifier onlyCrowdsale() {
}
modifier onlyTokenOrCrowdsale() {
}
modifier notVesting() {
}
function init() onlyOwner {
}
function totalSupply() onlyToken constant returns (uint) {
}
function balanceOf(address _owner) onlyTokenOrCrowdsale constant returns (uint) {
}
function allowance(address _owner, address _spender) onlyToken constant returns (uint) {
}
function transfer(address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function transferWithEvent(address _from, address _to, uint _value) onlyCrowdsale returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function burn(address _owner, uint _amount) onlyToken whenNotPaused returns (bool success) {
}
function mintWithEvent(address _to, uint _amount) internal returns (bool success) {
}
function startVesting(uint _amount, uint _duration) onlyCrowdsale {
}
function withdrawVested(address _withdrawTo) returns (uint amountWithdrawn) {
}
}
contract Ledger is Shared {
using SafeMath for uint;
address public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowed;
uint public totalSupply;
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
}
function allowance(address _owner, address _spender) onlyController constant returns (uint remaining) {
}
function burn(address _from, uint _amount) onlyController returns (bool success) {
}
function mint(address _to, uint _amount) onlyController returns (bool success) {
}
}
contract ChristCoin is Shared {
using SafeMath for uint;
string public name = "Christ Coin";
string public symbol = "CCLC";
uint8 public decimals = 8;
Controller public controller;
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function balanceOf(address _owner) constant returns (uint) {
}
function totalSupply() constant returns (uint) {
}
function transfer(address _to, uint _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
}
function approve(address _spender, uint _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint) {
}
function burn(uint _amount) onlyOwner returns (bool success) {
}
function controllerTransfer(address _from, address _to, uint _value) onlyController {
}
function controllerApproval(address _from, address _spender, uint _value) onlyController {
}
}
contract Crowdsale is Shared, Pausable {
using SafeMath for uint;
uint public constant START = 1506945600; // October 2, 2017 7:00:00 AM CST
uint public constant END = 1512133200; // December 1, 2017 7:00:00 AM CST
uint public constant CAP = 375 * (10 ** (6 + DECIMALS)); // 375 million tokens
uint public weiRaised;
uint public tokensDistributed;
uint public bonusTokensDistributed;
bool public crowdsaleFinalized;
Controller public controller;
Round[] public rounds;
Round public currentRound;
struct Round {
uint index;
uint endAmount;
uint rate;
uint incentiveDivisor;
}
struct Purchase {
uint tokens;
uint bonus;
}
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function Crowdsale() {
}
function setController(address _address) onlyOwner {
}
function () payable whenNotPaused {
}
function buyTokens(address _beneficiary) payable whenNotPaused {
}
function processPurchase(address _from, address _beneficiary, uint _weiAmount) internal returns (Purchase purchase) {
}
function getPurchase(uint _weiAmount, uint _tokensDistributed) internal returns (Purchase purchase) {
}
function validPurchase() internal constant returns (bool) {
}
function hasEnded() constant returns (bool) {
}
function finalizeCrowdsale() onlyOwner {
}
}
| !contractFinalized | 344,963 | !contractFinalized |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Finalizable is Ownable {
bool public contractFinalized;
modifier notFinalized() {
}
function finalizeContract() onlyOwner {
}
}
contract Shared is Ownable, Finalizable {
uint internal constant DECIMALS = 8;
address internal constant REWARDS_WALLET = 0x30b002d3AfCb7F9382394f7c803faFBb500872D8;
address internal constant FRIENDS_FAMILY_WALLET = 0xd328eF879f78cDa773a3dFc79B4e590f20C22223;
address internal constant CROWDSALE_WALLET = 0x028e1Ce69E379b1678278640c7387ecc40DAa895;
address internal constant LIFE_CHANGE_WALLET = 0xEe4284f98D0568c7f65688f18A2F74354E17B31a;
address internal constant LIFE_CHANGE_VESTING_WALLET = 0x2D354bD67707223C9aC0232cd0E54f22b03483Cf;
}
contract Controller is Shared, Pausable {
using SafeMath for uint;
bool public initialized;
ChristCoin public token;
Ledger public ledger;
address public crowdsale;
uint public vestingAmount;
uint public vestingPaid;
uint public vestingStart;
uint public vestingDuration;
function Controller(address _token, address _ledger, address _crowdsale) {
}
function setToken(address _address) onlyOwner notFinalized {
}
function setLedger(address _address) onlyOwner notFinalized {
}
function setCrowdsale(address _address) onlyOwner notFinalized {
}
modifier onlyToken() {
}
modifier onlyCrowdsale() {
}
modifier onlyTokenOrCrowdsale() {
}
modifier notVesting() {
}
function init() onlyOwner {
}
function totalSupply() onlyToken constant returns (uint) {
}
function balanceOf(address _owner) onlyTokenOrCrowdsale constant returns (uint) {
}
function allowance(address _owner, address _spender) onlyToken constant returns (uint) {
}
function transfer(address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function transferWithEvent(address _from, address _to, uint _value) onlyCrowdsale returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function burn(address _owner, uint _amount) onlyToken whenNotPaused returns (bool success) {
}
function mintWithEvent(address _to, uint _amount) internal returns (bool success) {
}
function startVesting(uint _amount, uint _duration) onlyCrowdsale {
}
function withdrawVested(address _withdrawTo) returns (uint amountWithdrawn) {
}
}
contract Ledger is Shared {
using SafeMath for uint;
address public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowed;
uint public totalSupply;
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
require(<FILL_ME>)
allowed[_owner][_spender] = _value;
return true;
}
function allowance(address _owner, address _spender) onlyController constant returns (uint remaining) {
}
function burn(address _from, uint _amount) onlyController returns (bool success) {
}
function mint(address _to, uint _amount) onlyController returns (bool success) {
}
}
contract ChristCoin is Shared {
using SafeMath for uint;
string public name = "Christ Coin";
string public symbol = "CCLC";
uint8 public decimals = 8;
Controller public controller;
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function balanceOf(address _owner) constant returns (uint) {
}
function totalSupply() constant returns (uint) {
}
function transfer(address _to, uint _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
}
function approve(address _spender, uint _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint) {
}
function burn(uint _amount) onlyOwner returns (bool success) {
}
function controllerTransfer(address _from, address _to, uint _value) onlyController {
}
function controllerApproval(address _from, address _spender, uint _value) onlyController {
}
}
contract Crowdsale is Shared, Pausable {
using SafeMath for uint;
uint public constant START = 1506945600; // October 2, 2017 7:00:00 AM CST
uint public constant END = 1512133200; // December 1, 2017 7:00:00 AM CST
uint public constant CAP = 375 * (10 ** (6 + DECIMALS)); // 375 million tokens
uint public weiRaised;
uint public tokensDistributed;
uint public bonusTokensDistributed;
bool public crowdsaleFinalized;
Controller public controller;
Round[] public rounds;
Round public currentRound;
struct Round {
uint index;
uint endAmount;
uint rate;
uint incentiveDivisor;
}
struct Purchase {
uint tokens;
uint bonus;
}
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function Crowdsale() {
}
function setController(address _address) onlyOwner {
}
function () payable whenNotPaused {
}
function buyTokens(address _beneficiary) payable whenNotPaused {
}
function processPurchase(address _from, address _beneficiary, uint _weiAmount) internal returns (Purchase purchase) {
}
function getPurchase(uint _weiAmount, uint _tokensDistributed) internal returns (Purchase purchase) {
}
function validPurchase() internal constant returns (bool) {
}
function hasEnded() constant returns (bool) {
}
function finalizeCrowdsale() onlyOwner {
}
}
| (_value==0)||(allowed[_owner][_spender]==0) | 344,963 | (_value==0)||(allowed[_owner][_spender]==0) |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Finalizable is Ownable {
bool public contractFinalized;
modifier notFinalized() {
}
function finalizeContract() onlyOwner {
}
}
contract Shared is Ownable, Finalizable {
uint internal constant DECIMALS = 8;
address internal constant REWARDS_WALLET = 0x30b002d3AfCb7F9382394f7c803faFBb500872D8;
address internal constant FRIENDS_FAMILY_WALLET = 0xd328eF879f78cDa773a3dFc79B4e590f20C22223;
address internal constant CROWDSALE_WALLET = 0x028e1Ce69E379b1678278640c7387ecc40DAa895;
address internal constant LIFE_CHANGE_WALLET = 0xEe4284f98D0568c7f65688f18A2F74354E17B31a;
address internal constant LIFE_CHANGE_VESTING_WALLET = 0x2D354bD67707223C9aC0232cd0E54f22b03483Cf;
}
contract Controller is Shared, Pausable {
using SafeMath for uint;
bool public initialized;
ChristCoin public token;
Ledger public ledger;
address public crowdsale;
uint public vestingAmount;
uint public vestingPaid;
uint public vestingStart;
uint public vestingDuration;
function Controller(address _token, address _ledger, address _crowdsale) {
}
function setToken(address _address) onlyOwner notFinalized {
}
function setLedger(address _address) onlyOwner notFinalized {
}
function setCrowdsale(address _address) onlyOwner notFinalized {
}
modifier onlyToken() {
}
modifier onlyCrowdsale() {
}
modifier onlyTokenOrCrowdsale() {
}
modifier notVesting() {
}
function init() onlyOwner {
}
function totalSupply() onlyToken constant returns (uint) {
}
function balanceOf(address _owner) onlyTokenOrCrowdsale constant returns (uint) {
}
function allowance(address _owner, address _spender) onlyToken constant returns (uint) {
}
function transfer(address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function transferWithEvent(address _from, address _to, uint _value) onlyCrowdsale returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function burn(address _owner, uint _amount) onlyToken whenNotPaused returns (bool success) {
}
function mintWithEvent(address _to, uint _amount) internal returns (bool success) {
}
function startVesting(uint _amount, uint _duration) onlyCrowdsale {
}
function withdrawVested(address _withdrawTo) returns (uint amountWithdrawn) {
}
}
contract Ledger is Shared {
using SafeMath for uint;
address public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowed;
uint public totalSupply;
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
}
function allowance(address _owner, address _spender) onlyController constant returns (uint remaining) {
}
function burn(address _from, uint _amount) onlyController returns (bool success) {
}
function mint(address _to, uint _amount) onlyController returns (bool success) {
}
}
contract ChristCoin is Shared {
using SafeMath for uint;
string public name = "Christ Coin";
string public symbol = "CCLC";
uint8 public decimals = 8;
Controller public controller;
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function balanceOf(address _owner) constant returns (uint) {
}
function totalSupply() constant returns (uint) {
}
function transfer(address _to, uint _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
}
function approve(address _spender, uint _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint) {
}
function burn(uint _amount) onlyOwner returns (bool success) {
}
function controllerTransfer(address _from, address _to, uint _value) onlyController {
}
function controllerApproval(address _from, address _spender, uint _value) onlyController {
}
}
contract Crowdsale is Shared, Pausable {
using SafeMath for uint;
uint public constant START = 1506945600; // October 2, 2017 7:00:00 AM CST
uint public constant END = 1512133200; // December 1, 2017 7:00:00 AM CST
uint public constant CAP = 375 * (10 ** (6 + DECIMALS)); // 375 million tokens
uint public weiRaised;
uint public tokensDistributed;
uint public bonusTokensDistributed;
bool public crowdsaleFinalized;
Controller public controller;
Round[] public rounds;
Round public currentRound;
struct Round {
uint index;
uint endAmount;
uint rate;
uint incentiveDivisor;
}
struct Purchase {
uint tokens;
uint bonus;
}
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function Crowdsale() {
}
function setController(address _address) onlyOwner {
}
function () payable whenNotPaused {
}
function buyTokens(address _beneficiary) payable whenNotPaused {
}
function processPurchase(address _from, address _beneficiary, uint _weiAmount) internal returns (Purchase purchase) {
purchase = getPurchase(_weiAmount, tokensDistributed);
require(<FILL_ME>)
uint _tokensWithBonus = purchase.tokens.add(purchase.bonus);
bonusTokensDistributed = bonusTokensDistributed.add(purchase.bonus);
tokensDistributed = tokensDistributed.add(purchase.tokens);
weiRaised = weiRaised.add(_weiAmount);
controller.transferWithEvent(CROWDSALE_WALLET, _beneficiary, _tokensWithBonus);
TokenPurchase(_from, _beneficiary, _weiAmount, _tokensWithBonus);
}
function getPurchase(uint _weiAmount, uint _tokensDistributed) internal returns (Purchase purchase) {
}
function validPurchase() internal constant returns (bool) {
}
function hasEnded() constant returns (bool) {
}
function finalizeCrowdsale() onlyOwner {
}
}
| tokensDistributed.add(purchase.tokens)<=CAP | 344,963 | tokensDistributed.add(purchase.tokens)<=CAP |
null | pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract Finalizable is Ownable {
bool public contractFinalized;
modifier notFinalized() {
}
function finalizeContract() onlyOwner {
}
}
contract Shared is Ownable, Finalizable {
uint internal constant DECIMALS = 8;
address internal constant REWARDS_WALLET = 0x30b002d3AfCb7F9382394f7c803faFBb500872D8;
address internal constant FRIENDS_FAMILY_WALLET = 0xd328eF879f78cDa773a3dFc79B4e590f20C22223;
address internal constant CROWDSALE_WALLET = 0x028e1Ce69E379b1678278640c7387ecc40DAa895;
address internal constant LIFE_CHANGE_WALLET = 0xEe4284f98D0568c7f65688f18A2F74354E17B31a;
address internal constant LIFE_CHANGE_VESTING_WALLET = 0x2D354bD67707223C9aC0232cd0E54f22b03483Cf;
}
contract Controller is Shared, Pausable {
using SafeMath for uint;
bool public initialized;
ChristCoin public token;
Ledger public ledger;
address public crowdsale;
uint public vestingAmount;
uint public vestingPaid;
uint public vestingStart;
uint public vestingDuration;
function Controller(address _token, address _ledger, address _crowdsale) {
}
function setToken(address _address) onlyOwner notFinalized {
}
function setLedger(address _address) onlyOwner notFinalized {
}
function setCrowdsale(address _address) onlyOwner notFinalized {
}
modifier onlyToken() {
}
modifier onlyCrowdsale() {
}
modifier onlyTokenOrCrowdsale() {
}
modifier notVesting() {
}
function init() onlyOwner {
}
function totalSupply() onlyToken constant returns (uint) {
}
function balanceOf(address _owner) onlyTokenOrCrowdsale constant returns (uint) {
}
function allowance(address _owner, address _spender) onlyToken constant returns (uint) {
}
function transfer(address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function transferWithEvent(address _from, address _to, uint _value) onlyCrowdsale returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyToken notVesting whenNotPaused returns (bool success) {
}
function burn(address _owner, uint _amount) onlyToken whenNotPaused returns (bool success) {
}
function mintWithEvent(address _to, uint _amount) internal returns (bool success) {
}
function startVesting(uint _amount, uint _duration) onlyCrowdsale {
}
function withdrawVested(address _withdrawTo) returns (uint amountWithdrawn) {
}
}
contract Ledger is Shared {
using SafeMath for uint;
address public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowed;
uint public totalSupply;
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
}
function allowance(address _owner, address _spender) onlyController constant returns (uint remaining) {
}
function burn(address _from, uint _amount) onlyController returns (bool success) {
}
function mint(address _to, uint _amount) onlyController returns (bool success) {
}
}
contract ChristCoin is Shared {
using SafeMath for uint;
string public name = "Christ Coin";
string public symbol = "CCLC";
uint8 public decimals = 8;
Controller public controller;
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function setController(address _address) onlyOwner notFinalized {
}
modifier onlyController() {
}
function balanceOf(address _owner) constant returns (uint) {
}
function totalSupply() constant returns (uint) {
}
function transfer(address _to, uint _value) returns (bool success) {
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
}
function approve(address _spender, uint _value) returns (bool success) {
}
function allowance(address _owner, address _spender) constant returns (uint) {
}
function burn(uint _amount) onlyOwner returns (bool success) {
}
function controllerTransfer(address _from, address _to, uint _value) onlyController {
}
function controllerApproval(address _from, address _spender, uint _value) onlyController {
}
}
contract Crowdsale is Shared, Pausable {
using SafeMath for uint;
uint public constant START = 1506945600; // October 2, 2017 7:00:00 AM CST
uint public constant END = 1512133200; // December 1, 2017 7:00:00 AM CST
uint public constant CAP = 375 * (10 ** (6 + DECIMALS)); // 375 million tokens
uint public weiRaised;
uint public tokensDistributed;
uint public bonusTokensDistributed;
bool public crowdsaleFinalized;
Controller public controller;
Round[] public rounds;
Round public currentRound;
struct Round {
uint index;
uint endAmount;
uint rate;
uint incentiveDivisor;
}
struct Purchase {
uint tokens;
uint bonus;
}
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint value, uint amount);
function Crowdsale() {
}
function setController(address _address) onlyOwner {
}
function () payable whenNotPaused {
}
function buyTokens(address _beneficiary) payable whenNotPaused {
}
function processPurchase(address _from, address _beneficiary, uint _weiAmount) internal returns (Purchase purchase) {
}
function getPurchase(uint _weiAmount, uint _tokensDistributed) internal returns (Purchase purchase) {
}
function validPurchase() internal constant returns (bool) {
}
function hasEnded() constant returns (bool) {
}
function finalizeCrowdsale() onlyOwner {
require(<FILL_ME>)
require(hasEnded());
uint _toVest = controller.balanceOf(CROWDSALE_WALLET);
if (tokensDistributed == CAP) {
_toVest = _toVest.sub(CAP.div(4)); // 25% bonus to token holders if sold out
}
controller.transferWithEvent(CROWDSALE_WALLET, LIFE_CHANGE_VESTING_WALLET, _toVest);
controller.startVesting(_toVest, 7 years);
crowdsaleFinalized = true;
}
}
| !crowdsaleFinalized | 344,963 | !crowdsaleFinalized |
"User does not have sufficient balance" | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
// Check that the sender has sufficient components
// Since the component length is defined ahead of time, this is not
// an unbounded loop
require(<FILL_ME>)
_;
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| balances[msg.sender]>=quantity,"User does not have sufficient balance" | 345,236 | balances[msg.sender]>=quantity |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
require(<FILL_ME>)
_;
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| (_quantity%naturalUnit)==0 | 345,236 | (_quantity%naturalUnit)==0 |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
// There must be component present
require(_components.length > 0, "Component length needs to be great than 0");
// There must be an array of units
require(_units.length > 0, "Units must be greater than 0");
// The number of components must equal the number of units
require(_components.length == _units.length, "Component and unit lengths must be the same");
naturalUnit = _naturalUnit;
// As looping operations are expensive, checking for duplicates will be
// on the onus of the application developer
// NOTE: It will be the onus of developers to check whether the addressExists
// are in fact ERC20 addresses
for (uint16 i = 0; i < _units.length; i++) {
// Check that all units are non-zero. Negative numbers will underflow
uint currentUnits = _units[i];
require(currentUnits > 0, "Unit declarations must be non-zero");
// Check that all addresses are non-zero
address currentComponent = _components[i];
require(currentComponent != address(0), "Components must have non-zero address");
// Check the component has not already been added
require(<FILL_ME>)
// add component to isComponent mapping
isComponent[keccak256(currentComponent)] = true;
components.push(Component({
address_: currentComponent,
unit_: currentUnits
}));
}
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| !tokenIsComponent(currentComponent) | 345,236 | !tokenIsComponent(currentComponent) |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
// Transfers the sender's components to the contract
// Since the component length is defined ahead of time, this is not
// an unbounded loop
for (uint16 i = 0; i < components.length; i++) {
address currentComponent = components[i].address_;
uint currentUnits = components[i].unit_;
uint preTransferBalance = ERC20(currentComponent).balanceOf(this);
uint transferValue = calculateTransferValue(currentUnits, _quantity);
require(<FILL_ME>)
// Check that preTransferBalance + transfer value is the same as postTransferBalance
uint postTransferBalance = ERC20(currentComponent).balanceOf(this);
assert(preTransferBalance.add(transferValue) == postTransferBalance);
}
mint(_quantity);
emit LogIssuance(msg.sender, _quantity);
return true;
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| ERC20(currentComponent).transferFrom(msg.sender,this,transferValue) | 345,236 | ERC20(currentComponent).transferFrom(msg.sender,this,transferValue) |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
burn(_quantity);
for (uint16 i = 0; i < components.length; i++) {
address currentComponent = components[i].address_;
uint currentUnits = components[i].unit_;
uint preTransferBalance = ERC20(currentComponent).balanceOf(this);
uint transferValue = calculateTransferValue(currentUnits, _quantity);
require(<FILL_ME>)
// Check that preTransferBalance + transfer value is the same as postTransferBalance
uint postTransferBalance = ERC20(currentComponent).balanceOf(this);
assert(preTransferBalance.sub(transferValue) == postTransferBalance);
}
emit LogRedemption(msg.sender, _quantity);
return true;
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| ERC20(currentComponent).transfer(msg.sender,transferValue) | 345,236 | ERC20(currentComponent).transfer(msg.sender,transferValue) |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
// Excluded tokens should be less than the number of components
// Otherwise, use the normal redeem function
require(_componentsToExclude > 0, "Excluded components must be non-zero");
burn(_quantity);
for (uint16 i = 0; i < components.length; i++) {
uint transferValue = calculateTransferValue(components[i].unit_, _quantity);
// Exclude tokens if 2 raised to the power of their indexes in the components
// array results in a non zero value following a bitwise AND
if (_componentsToExclude & bytes32(2 ** i) > 0) {
unredeemedBalances[i][msg.sender] += transferValue;
} else {
uint preTransferBalance = ERC20(components[i].address_).balanceOf(this);
require(<FILL_ME>)
// Check that preTransferBalance + transfer value is the same as postTransferBalance
uint postTransferBalance = ERC20(components[i].address_).balanceOf(this);
assert(preTransferBalance.sub(transferValue) == postTransferBalance);
}
}
emit LogPartialRedemption(msg.sender, _quantity, _componentsToExclude);
return true;
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| ERC20(components[i].address_).transfer(msg.sender,transferValue) | 345,236 | ERC20(components[i].address_).transfer(msg.sender,transferValue) |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
require(_componentsToRedeem > 0, "Components to redeem must be non-zero");
for (uint16 i = 0; i < components.length; i++) {
if (_componentsToRedeem & bytes32(2 ** i) > 0) {
address currentComponent = components[i].address_;
uint remainingBalance = unredeemedBalances[i][msg.sender];
// To prevent re-entrancy attacks, decrement the user's Set balance
unredeemedBalances[i][msg.sender] = 0;
require(<FILL_ME>)
}
}
emit LogRedeemExcluded(msg.sender, _componentsToRedeem);
return true;
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| ERC20(currentComponent).transfer(msg.sender,remainingBalance) | 345,236 | ERC20(currentComponent).transfer(msg.sender,remainingBalance) |
null | pragma solidity 0.4.23;
//////////////////////////////
///// ERC20Basic
//////////////////////////////
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
//////////////////////////////
///// ERC20 Interface
//////////////////////////////
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//////////////////////////////
///// ERC20 Basic
//////////////////////////////
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
}
}
//////////////////////////////
///// DetailedERC20
//////////////////////////////
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
}
}
//////////////////////////////
///// Standard Token
//////////////////////////////
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
}
//////////////////////////////
///// SafeMath
//////////////////////////////
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
//////////////////////////////
///// AddressArrayUtil
//////////////////////////////
/**
* @title AddressArrayUtil
*/
library AddressArrayUtils {
function hasValue(address[] addresses, address value) internal returns (bool) {
}
function removeByIndex(address[] storage a, uint256 index) internal returns (uint256) {
}
}
//////////////////////////////
///// Set Interface
//////////////////////////////
/**
* @title Set interface
*/
contract SetInterface {
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity) public returns (bool success);
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity) public returns (bool success);
event LogIssuance(
address indexed _sender,
uint _quantity
);
event LogRedemption(
address indexed _sender,
uint _quantity
);
}
/**
* @title {Set}
* @author Felix Feng
* @dev Implementation of the basic {Set} token.
*/
contract SetToken is StandardToken, DetailedERC20("Stable Set", "STBL", 18), SetInterface {
using SafeMath for uint256;
using AddressArrayUtils for address[];
///////////////////////////////////////////////////////////
/// Data Structures
///////////////////////////////////////////////////////////
struct Component {
address address_;
uint unit_;
}
///////////////////////////////////////////////////////////
/// States
///////////////////////////////////////////////////////////
uint public naturalUnit;
Component[] public components;
// Mapping of componentHash to isComponent
mapping(bytes32 => bool) internal isComponent;
// Mapping of index of component -> user address -> balance
mapping(uint => mapping(address => uint)) internal unredeemedBalances;
///////////////////////////////////////////////////////////
/// Events
///////////////////////////////////////////////////////////
event LogPartialRedemption(
address indexed _sender,
uint _quantity,
bytes32 _excludedComponents
);
event LogRedeemExcluded(
address indexed _sender,
bytes32 _components
);
///////////////////////////////////////////////////////////
/// Modifiers
///////////////////////////////////////////////////////////
modifier hasSufficientBalance(uint quantity) {
}
modifier validDestination(address _to) {
}
modifier isMultipleOfNaturalUnit(uint _quantity) {
}
modifier isNonZero(uint _quantity) {
}
/**
* @dev Constructor Function for the issuance of an {Set} token
* @param _components address[] A list of component address which you want to include
* @param _units uint[] A list of quantities in gWei of each component (corresponds to the {Set} of _components)
*/
constructor(address[] _components, uint[] _units, uint _naturalUnit)
isNonZero(_naturalUnit)
public {
}
///////////////////////////////////////////////////////////
/// Set Functions
///////////////////////////////////////////////////////////
/**
* @dev Function to convert component into {Set} Tokens
*
* Please note that the user's ERC20 component must be approved by
* their ERC20 contract to transfer their components to this contract.
*
* @param _quantity uint The quantity of Sets desired to issue in Wei as a multiple of naturalUnit
*/
function issue(uint _quantity)
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
public returns (bool success) {
}
/**
* @dev Function to convert {Set} Tokens into underlying components
*
* The ERC20 components do not need to be approved to call this function
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei as a multiple of naturalUnit
*/
function redeem(uint _quantity)
public
isMultipleOfNaturalUnit(_quantity)
hasSufficientBalance(_quantity)
isNonZero(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw a portion of the component tokens of a Set
*
* This function should be used in the event that a component token has been
* paused for transfer temporarily or permanently. This allows users a
* method to withdraw tokens in the event that one token has been frozen.
*
* The mask can be computed by summing the powers of 2 of indexes of components to exclude.
* For example, to exclude the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _quantity uint The quantity of Sets desired to redeem in Wei
* @param _componentsToExclude bytes32 Hex of bitmask of components to exclude
*/
function partialRedeem(uint _quantity, bytes32 _componentsToExclude)
public
isMultipleOfNaturalUnit(_quantity)
isNonZero(_quantity)
hasSufficientBalance(_quantity)
returns (bool success)
{
}
/**
* @dev Function to withdraw tokens that have previously been excluded when calling
* the partialRedeem method
* The mask can be computed by summing the powers of 2 of indexes of components to redeem.
* For example, to redeem the 0th, 1st, and 3rd components, we pass in the hex of
* 1 + 2 + 8 = 11, padded to length 32 i.e. 0x000000000000000000000000000000000000000000000000000000000000000b
*
* @param _componentsToRedeem bytes32 Hex of bitmask of components to redeem
*/
function redeemExcluded(bytes32 _componentsToRedeem)
public
returns (bool success)
{
}
///////////////////////////////////////////////////////////
/// Getters
///////////////////////////////////////////////////////////
function getComponents() public view returns(address[]) {
}
function getUnits() public view returns(uint[]) {
}
function getUnredeemedBalance(address _componentAddress, address _userAddress) public view returns (uint256) {
require(<FILL_ME>)
uint componentIndex;
for (uint i = 0; i < components.length; i++) {
if (components[i].address_ == _componentAddress) {
componentIndex = i;
}
}
return unredeemedBalances[componentIndex][_userAddress];
}
///////////////////////////////////////////////////////////
/// Transfer Updates
///////////////////////////////////////////////////////////
function transfer(address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
function transferFrom(address _from, address _to, uint256 _value) validDestination(_to) public returns (bool) {
}
///////////////////////////////////////////////////////////
/// Private Function
///////////////////////////////////////////////////////////
function tokenIsComponent(address _tokenAddress) view internal returns (bool) {
}
function calculateTransferValue(uint componentUnits, uint quantity) view internal returns(uint) {
}
function mint(uint quantity) internal {
}
function burn(uint quantity) internal {
}
}
| tokenIsComponent(_componentAddress) | 345,236 | tokenIsComponent(_componentAddress) |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
require(nrOfInstallments > 0 && loanAmount > 0);
require(<FILL_ME>)
require(loans[loanId].status < Status.APPROVED);
checkLtv(loanAmount, assetsValue);
loans[loanId].installmentTime = installmentTime;
loans[loanId].loanAmount = loanAmount;
loans[loanId].amountDue = loanAmount.mul(interestRate.add(100)).div(100);
loans[loanId].installmentAmount = loans[loanId].amountDue.mod(nrOfInstallments) > 0 ? loans[loanId].amountDue.div(nrOfInstallments).add(1) : loans[loanId].amountDue.div(nrOfInstallments);
loans[loanId].assetsValue = assetsValue;
loans[loanId].nrOfInstallments = nrOfInstallments;
loans[loanId].currency = currency;
/*
* Computing the defaulting limit
*/
if ( nrOfInstallments <= 3 )
loans[loanId].defaultingLimit = 1;
else if ( nrOfInstallments <= 5 )
loans[loanId].defaultingLimit = 2;
else if ( nrOfInstallments >= 6 )
loans[loanId].defaultingLimit = 3;
// Fire event
emit EditLoan(
currency,
loanId,
loanAmount,
loans[loanId].amountDue,
loans[loanId].installmentAmount,
loans[loanId].assetsValue,
installmentTime,
nrOfInstallments
);
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].borrower==msg.sender | 345,276 | loans[loanId].borrower==msg.sender |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
require(nrOfInstallments > 0 && loanAmount > 0);
require(loans[loanId].borrower == msg.sender);
require(<FILL_ME>)
checkLtv(loanAmount, assetsValue);
loans[loanId].installmentTime = installmentTime;
loans[loanId].loanAmount = loanAmount;
loans[loanId].amountDue = loanAmount.mul(interestRate.add(100)).div(100);
loans[loanId].installmentAmount = loans[loanId].amountDue.mod(nrOfInstallments) > 0 ? loans[loanId].amountDue.div(nrOfInstallments).add(1) : loans[loanId].amountDue.div(nrOfInstallments);
loans[loanId].assetsValue = assetsValue;
loans[loanId].nrOfInstallments = nrOfInstallments;
loans[loanId].currency = currency;
/*
* Computing the defaulting limit
*/
if ( nrOfInstallments <= 3 )
loans[loanId].defaultingLimit = 1;
else if ( nrOfInstallments <= 5 )
loans[loanId].defaultingLimit = 2;
else if ( nrOfInstallments >= 6 )
loans[loanId].defaultingLimit = 3;
// Fire event
emit EditLoan(
currency,
loanId,
loanAmount,
loans[loanId].amountDue,
loans[loanId].installmentAmount,
loans[loanId].assetsValue,
installmentTime,
nrOfInstallments
);
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].status<Status.APPROVED | 345,276 | loans[loanId].status<Status.APPROVED |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
require(<FILL_ME>)
require(loans[loanId].paidAmount == 0);
require(loans[loanId].status == Status.LISTED);
// Borrower assigned , status is 1 , first installment ( payment ) completed
loans[loanId].lender = msg.sender;
loans[loanId].startEnd[1] = block.timestamp.add(loans[loanId].nrOfInstallments.mul(loans[loanId].installmentTime));
loans[loanId].status = Status.APPROVED;
loans[loanId].startEnd[0] = block.timestamp;
uint256 discount = discounts.calculateDiscount(msg.sender);
// We check if currency is ETH
if ( loans[loanId].currency == address(0) )
require(msg.value >= loans[loanId].loanAmount.add(loans[loanId].loanAmount.div(lenderFee).div(discount)));
// We send the tokens here
transferTokens(
msg.sender,
payable(loans[loanId].borrower),
loans[loanId].currency,
loans[loanId].loanAmount,
loans[loanId].loanAmount.div(lenderFee).div(discount)
);
emit LoanApproved(
msg.sender,
loanId,
loans[loanId].startEnd[1]
);
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].lender==address(0) | 345,276 | loans[loanId].lender==address(0) |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
require(loans[loanId].lender == address(0));
require(<FILL_ME>)
require(loans[loanId].status == Status.LISTED);
// Borrower assigned , status is 1 , first installment ( payment ) completed
loans[loanId].lender = msg.sender;
loans[loanId].startEnd[1] = block.timestamp.add(loans[loanId].nrOfInstallments.mul(loans[loanId].installmentTime));
loans[loanId].status = Status.APPROVED;
loans[loanId].startEnd[0] = block.timestamp;
uint256 discount = discounts.calculateDiscount(msg.sender);
// We check if currency is ETH
if ( loans[loanId].currency == address(0) )
require(msg.value >= loans[loanId].loanAmount.add(loans[loanId].loanAmount.div(lenderFee).div(discount)));
// We send the tokens here
transferTokens(
msg.sender,
payable(loans[loanId].borrower),
loans[loanId].currency,
loans[loanId].loanAmount,
loans[loanId].loanAmount.div(lenderFee).div(discount)
);
emit LoanApproved(
msg.sender,
loanId,
loans[loanId].startEnd[1]
);
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].paidAmount==0 | 345,276 | loans[loanId].paidAmount==0 |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
require(loans[loanId].lender == address(0));
require(loans[loanId].paidAmount == 0);
require(<FILL_ME>)
// Borrower assigned , status is 1 , first installment ( payment ) completed
loans[loanId].lender = msg.sender;
loans[loanId].startEnd[1] = block.timestamp.add(loans[loanId].nrOfInstallments.mul(loans[loanId].installmentTime));
loans[loanId].status = Status.APPROVED;
loans[loanId].startEnd[0] = block.timestamp;
uint256 discount = discounts.calculateDiscount(msg.sender);
// We check if currency is ETH
if ( loans[loanId].currency == address(0) )
require(msg.value >= loans[loanId].loanAmount.add(loans[loanId].loanAmount.div(lenderFee).div(discount)));
// We send the tokens here
transferTokens(
msg.sender,
payable(loans[loanId].borrower),
loans[loanId].currency,
loans[loanId].loanAmount,
loans[loanId].loanAmount.div(lenderFee).div(discount)
);
emit LoanApproved(
msg.sender,
loanId,
loans[loanId].startEnd[1]
);
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].status==Status.LISTED | 345,276 | loans[loanId].status==Status.LISTED |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
require(loans[loanId].lender == address(0));
require(loans[loanId].borrower == msg.sender);
require(<FILL_ME>)
require(loans[loanId].status == Status.LISTED);
loans[loanId].status = Status.CANCELLED;
// We send the items back to him
transferItems(
address(this),
loans[loanId].borrower,
loans[loanId].nftAddressArray,
loans[loanId].nftTokenIdArray,
loans[loanId].nftTokenTypeArray
);
emit LoanCancelled(
loanId
);
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].status!=Status.CANCELLED | 345,276 | loans[loanId].status!=Status.CANCELLED |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import "./LendingCore.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract LendingMethods is Ownable, LendingCore {
using SafeMath for uint256;
using SafeMath for uint16;
// Borrower creates a loan
function createLoan(
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
address[] calldata nftAddressArray,
uint256[] calldata nftTokenIdArray,
uint8[] calldata nftTokenTypeArray
) external {
}
/*
* @ Edit loan
* @ Accessible for borrower until a lender is found
*/
function editLoan(
uint256 loanId,
uint256 loanAmount,
uint16 nrOfInstallments,
address currency,
uint256 assetsValue,
uint256 installmentTime
) external {
}
// Lender approves a loan
function approveLoan(uint256 loanId) external payable {
}
// Borrower cancels a loan
function cancelLoan(uint256 loanId) external {
}
// Borrower pays installment for loan
// Multiple installments : OK
function payLoan(uint256 loanId,uint256 amount) external payable {
require(loans[loanId].borrower == msg.sender);
require(<FILL_ME>)
require(loans[loanId].startEnd[1] >= block.timestamp);
require((msg.value > 0 && loans[loanId].currency == address(0) && msg.value == amount) || (loans[loanId].currency != address(0) && msg.value == 0 && amount > 0));
uint256 paidByBorrower = msg.value > 0 ? msg.value : amount;
uint256 amountPaidAsInstallmentToLender = paidByBorrower; // >> amount of installment that goes to lender
uint256 interestPerInstallement = paidByBorrower.mul(interestRate).div(100); // entire interest for installment
uint256 discount = discounts.calculateDiscount(msg.sender);
uint256 interestToStaterPerInstallement = interestPerInstallement.mul(interestRateToStater).div(100);
if ( discount != 1 ){
if ( loans[loanId].currency == address(0) ){
require(msg.sender.send(interestToStaterPerInstallement.div(discount)));
amountPaidAsInstallmentToLender = amountPaidAsInstallmentToLender.sub(interestToStaterPerInstallement.div(discount));
}
interestToStaterPerInstallement = interestToStaterPerInstallement.sub(interestToStaterPerInstallement.div(discount));
}
amountPaidAsInstallmentToLender = amountPaidAsInstallmentToLender.sub(interestToStaterPerInstallement);
loans[loanId].paidAmount = loans[loanId].paidAmount.add(paidByBorrower);
loans[loanId].nrOfPayments = loans[loanId].nrOfPayments.add(paidByBorrower.div(loans[loanId].installmentAmount));
if (loans[loanId].paidAmount >= loans[loanId].amountDue)
loans[loanId].status = Status.LIQUIDATED;
// We transfer the tokens to borrower here
transferTokens(
msg.sender,
loans[loanId].lender,
loans[loanId].currency,
amountPaidAsInstallmentToLender,
interestToStaterPerInstallement
);
emit LoanPayment(
loanId,
paidByBorrower,
amountPaidAsInstallmentToLender,
interestPerInstallement,
interestToStaterPerInstallement,
loans[loanId].status
);
}
// Borrower can withdraw loan items if loan is LIQUIDATED
// Lender can withdraw loan item is loan is DEFAULTED
function terminateLoan(uint256 loanId) external {
}
/**
* @notice Used by the Promissory Note contract to change the ownership of the loan when the Promissory Note NFT is sold
* @param from The address of the current owner
* @param to The address of the new owner
* @param loanIds The ids of the loans that will be transferred to the new owner
*/
function promissoryExchange(address from, address payable to, uint256[] calldata loanIds) external isPromissoryNote {
}
/**
* @notice Used by the Promissory Note contract to approve a list of loans to be used as a Promissory Note NFT
* @param loanIds The ids of the loans that will be approved
*/
function setPromissoryPermissions(uint256[] calldata loanIds, address allowed) external {
}
}
| loans[loanId].status==Status.APPROVED | 345,276 | loans[loanId].status==Status.APPROVED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.