comment
stringlengths
1
211
βŒ€
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"TokenStaking: token transferFrom via deposit not succeeded"
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } abstract contract Context { function _msgSender() internal view returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view returns (address) { } function _checkOwner() private view { } function renounceOwnership() external onlyOwner { } function transferOwnership(address newOwner) external onlyOwner { } function _transferOwnership(address newOwner) private { } } abstract contract ReentrancyGuard { uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private _status; constructor() { } modifier nonReentrant() { } function _nonReentrantBefore() private { } function _nonReentrantAfter() private { } function _reentrancyGuardEntered() private view returns (bool) { } } contract StaXeStaking is Ownable, ReentrancyGuard { struct PoolInfo { uint lockupDuration; uint returnPer; } struct OrderInfo { address beneficiary; uint amount; uint lockupDuration; uint returnPer; uint starttime; uint endtime; uint claimedReward; bool claimed; } uint private constant _days7 = 7 days; uint private constant _days14 = 14 days; uint private constant _days30 = 30 days; uint256 private constant _days365 = 31536000; IERC20 public token; bool private started = true; uint public emergencyWithdrawFees = 15; uint private latestOrderId = 0; uint public totalStakers ; // use uint public totalStaked ; // use mapping(uint => PoolInfo) public pooldata; mapping(address => uint) public balanceOf; mapping(address => uint) public totalRewardEarn; mapping(uint => OrderInfo) public orders; mapping(address => uint[]) private orderIds; mapping(address => mapping(uint => bool)) public hasStaked; mapping(uint => uint) public stakeOnPool; mapping(uint => uint) public rewardOnPool; mapping(uint => uint) public stakersPlan; event Deposit(address indexed user, uint indexed lockupDuration, uint amount, uint returnPer); event Withdraw(address indexed user, uint amount, uint reward, uint total); event WithdrawAll(address indexed user, uint amount); event RewardClaimed(address indexed user, uint reward); constructor(address _token) { } function deposit(uint _amount, uint _lockupDuration) external { PoolInfo storage pool = pooldata[_lockupDuration]; require(pool.lockupDuration > 0, "TokenStaking: asked pool does not exist"); require(started, "TokenStaking: staking not yet started"); require(_amount > 0, "TokenStaking: stake amount must be non zero"); require(<FILL_ME>) orders[++latestOrderId] = OrderInfo( _msgSender(), _amount, pool.lockupDuration, pool.returnPer, block.timestamp, block.timestamp + pool.lockupDuration, 0, false ); if (!hasStaked[msg.sender][_lockupDuration]) { stakersPlan[_lockupDuration] = stakersPlan[_lockupDuration] + 1; totalStakers = totalStakers + 1 ; } //updating staking status hasStaked[msg.sender][_lockupDuration] = true; stakeOnPool[_lockupDuration] = stakeOnPool[_lockupDuration] + _amount ; totalStaked = totalStaked + _amount ; balanceOf[_msgSender()] += _amount; orderIds[_msgSender()].push(latestOrderId); emit Deposit(_msgSender(), pool.lockupDuration, _amount, pool.returnPer); } function withdraw(uint orderId) external nonReentrant { } function emergencyWithdraw(uint orderId) external nonReentrant { } function claimRewards(uint orderId) external nonReentrant { } function pendingRewards(uint orderId) public view returns (uint) { } function toggleStaking(bool _start) external onlyOwner returns (bool) { } function investorOrderIds(address investor) external view returns (uint[] memory ids) { } function updatePlans(uint256 _plan1Days , uint256 _plan2Days , uint256 _plan3Days , uint256 _plan1APY ,uint256 _plan2APY , uint256 _plan3APY) public onlyOwner { } function transferAnyERC20Token(address payaddress, address tokenAddress, uint amount) external onlyOwner { } }
token.transferFrom(_msgSender(),address(this),_amount),"TokenStaking: token transferFrom via deposit not succeeded"
425,477
token.transferFrom(_msgSender(),address(this),_amount)
"TokenStaking: caller is not the beneficiary"
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } abstract contract Context { function _msgSender() internal view returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view returns (address) { } function _checkOwner() private view { } function renounceOwnership() external onlyOwner { } function transferOwnership(address newOwner) external onlyOwner { } function _transferOwnership(address newOwner) private { } } abstract contract ReentrancyGuard { uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private _status; constructor() { } modifier nonReentrant() { } function _nonReentrantBefore() private { } function _nonReentrantAfter() private { } function _reentrancyGuardEntered() private view returns (bool) { } } contract StaXeStaking is Ownable, ReentrancyGuard { struct PoolInfo { uint lockupDuration; uint returnPer; } struct OrderInfo { address beneficiary; uint amount; uint lockupDuration; uint returnPer; uint starttime; uint endtime; uint claimedReward; bool claimed; } uint private constant _days7 = 7 days; uint private constant _days14 = 14 days; uint private constant _days30 = 30 days; uint256 private constant _days365 = 31536000; IERC20 public token; bool private started = true; uint public emergencyWithdrawFees = 15; uint private latestOrderId = 0; uint public totalStakers ; // use uint public totalStaked ; // use mapping(uint => PoolInfo) public pooldata; mapping(address => uint) public balanceOf; mapping(address => uint) public totalRewardEarn; mapping(uint => OrderInfo) public orders; mapping(address => uint[]) private orderIds; mapping(address => mapping(uint => bool)) public hasStaked; mapping(uint => uint) public stakeOnPool; mapping(uint => uint) public rewardOnPool; mapping(uint => uint) public stakersPlan; event Deposit(address indexed user, uint indexed lockupDuration, uint amount, uint returnPer); event Withdraw(address indexed user, uint amount, uint reward, uint total); event WithdrawAll(address indexed user, uint amount); event RewardClaimed(address indexed user, uint reward); constructor(address _token) { } function deposit(uint _amount, uint _lockupDuration) external { } function withdraw(uint orderId) external nonReentrant { require(orderId <= latestOrderId, "TokenStaking: INVALID orderId, orderId greater than latestOrderId"); OrderInfo storage orderInfo = orders[orderId]; require(<FILL_ME>) require(!orderInfo.claimed, "TokenStaking: order already unstaked"); require(block.timestamp >= orderInfo.endtime, "TokenStaking: stake locked until lock duration completion"); uint claimAvailable = pendingRewards(orderId); uint total = orderInfo.amount + claimAvailable; totalRewardEarn[_msgSender()] += claimAvailable; orderInfo.claimedReward += claimAvailable; balanceOf[_msgSender()] -= orderInfo.amount; orderInfo.claimed = true; require(token.transfer(address(_msgSender()), total), "TokenStaking: token transfer via withdraw not succeeded"); rewardOnPool[orderInfo.lockupDuration] = rewardOnPool[orderInfo.lockupDuration] + claimAvailable ; emit Withdraw(_msgSender(), orderInfo.amount, claimAvailable, total); } function emergencyWithdraw(uint orderId) external nonReentrant { } function claimRewards(uint orderId) external nonReentrant { } function pendingRewards(uint orderId) public view returns (uint) { } function toggleStaking(bool _start) external onlyOwner returns (bool) { } function investorOrderIds(address investor) external view returns (uint[] memory ids) { } function updatePlans(uint256 _plan1Days , uint256 _plan2Days , uint256 _plan3Days , uint256 _plan1APY ,uint256 _plan2APY , uint256 _plan3APY) public onlyOwner { } function transferAnyERC20Token(address payaddress, address tokenAddress, uint amount) external onlyOwner { } }
_msgSender()==orderInfo.beneficiary,"TokenStaking: caller is not the beneficiary"
425,477
_msgSender()==orderInfo.beneficiary
"TokenStaking: order already unstaked"
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } abstract contract Context { function _msgSender() internal view returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view returns (address) { } function _checkOwner() private view { } function renounceOwnership() external onlyOwner { } function transferOwnership(address newOwner) external onlyOwner { } function _transferOwnership(address newOwner) private { } } abstract contract ReentrancyGuard { uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private _status; constructor() { } modifier nonReentrant() { } function _nonReentrantBefore() private { } function _nonReentrantAfter() private { } function _reentrancyGuardEntered() private view returns (bool) { } } contract StaXeStaking is Ownable, ReentrancyGuard { struct PoolInfo { uint lockupDuration; uint returnPer; } struct OrderInfo { address beneficiary; uint amount; uint lockupDuration; uint returnPer; uint starttime; uint endtime; uint claimedReward; bool claimed; } uint private constant _days7 = 7 days; uint private constant _days14 = 14 days; uint private constant _days30 = 30 days; uint256 private constant _days365 = 31536000; IERC20 public token; bool private started = true; uint public emergencyWithdrawFees = 15; uint private latestOrderId = 0; uint public totalStakers ; // use uint public totalStaked ; // use mapping(uint => PoolInfo) public pooldata; mapping(address => uint) public balanceOf; mapping(address => uint) public totalRewardEarn; mapping(uint => OrderInfo) public orders; mapping(address => uint[]) private orderIds; mapping(address => mapping(uint => bool)) public hasStaked; mapping(uint => uint) public stakeOnPool; mapping(uint => uint) public rewardOnPool; mapping(uint => uint) public stakersPlan; event Deposit(address indexed user, uint indexed lockupDuration, uint amount, uint returnPer); event Withdraw(address indexed user, uint amount, uint reward, uint total); event WithdrawAll(address indexed user, uint amount); event RewardClaimed(address indexed user, uint reward); constructor(address _token) { } function deposit(uint _amount, uint _lockupDuration) external { } function withdraw(uint orderId) external nonReentrant { require(orderId <= latestOrderId, "TokenStaking: INVALID orderId, orderId greater than latestOrderId"); OrderInfo storage orderInfo = orders[orderId]; require(_msgSender() == orderInfo.beneficiary, "TokenStaking: caller is not the beneficiary"); require(<FILL_ME>) require(block.timestamp >= orderInfo.endtime, "TokenStaking: stake locked until lock duration completion"); uint claimAvailable = pendingRewards(orderId); uint total = orderInfo.amount + claimAvailable; totalRewardEarn[_msgSender()] += claimAvailable; orderInfo.claimedReward += claimAvailable; balanceOf[_msgSender()] -= orderInfo.amount; orderInfo.claimed = true; require(token.transfer(address(_msgSender()), total), "TokenStaking: token transfer via withdraw not succeeded"); rewardOnPool[orderInfo.lockupDuration] = rewardOnPool[orderInfo.lockupDuration] + claimAvailable ; emit Withdraw(_msgSender(), orderInfo.amount, claimAvailable, total); } function emergencyWithdraw(uint orderId) external nonReentrant { } function claimRewards(uint orderId) external nonReentrant { } function pendingRewards(uint orderId) public view returns (uint) { } function toggleStaking(bool _start) external onlyOwner returns (bool) { } function investorOrderIds(address investor) external view returns (uint[] memory ids) { } function updatePlans(uint256 _plan1Days , uint256 _plan2Days , uint256 _plan3Days , uint256 _plan1APY ,uint256 _plan2APY , uint256 _plan3APY) public onlyOwner { } function transferAnyERC20Token(address payaddress, address tokenAddress, uint amount) external onlyOwner { } }
!orderInfo.claimed,"TokenStaking: order already unstaked"
425,477
!orderInfo.claimed
"TokenStaking: token transfer via withdraw not succeeded"
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } abstract contract Context { function _msgSender() internal view returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view returns (address) { } function _checkOwner() private view { } function renounceOwnership() external onlyOwner { } function transferOwnership(address newOwner) external onlyOwner { } function _transferOwnership(address newOwner) private { } } abstract contract ReentrancyGuard { uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private _status; constructor() { } modifier nonReentrant() { } function _nonReentrantBefore() private { } function _nonReentrantAfter() private { } function _reentrancyGuardEntered() private view returns (bool) { } } contract StaXeStaking is Ownable, ReentrancyGuard { struct PoolInfo { uint lockupDuration; uint returnPer; } struct OrderInfo { address beneficiary; uint amount; uint lockupDuration; uint returnPer; uint starttime; uint endtime; uint claimedReward; bool claimed; } uint private constant _days7 = 7 days; uint private constant _days14 = 14 days; uint private constant _days30 = 30 days; uint256 private constant _days365 = 31536000; IERC20 public token; bool private started = true; uint public emergencyWithdrawFees = 15; uint private latestOrderId = 0; uint public totalStakers ; // use uint public totalStaked ; // use mapping(uint => PoolInfo) public pooldata; mapping(address => uint) public balanceOf; mapping(address => uint) public totalRewardEarn; mapping(uint => OrderInfo) public orders; mapping(address => uint[]) private orderIds; mapping(address => mapping(uint => bool)) public hasStaked; mapping(uint => uint) public stakeOnPool; mapping(uint => uint) public rewardOnPool; mapping(uint => uint) public stakersPlan; event Deposit(address indexed user, uint indexed lockupDuration, uint amount, uint returnPer); event Withdraw(address indexed user, uint amount, uint reward, uint total); event WithdrawAll(address indexed user, uint amount); event RewardClaimed(address indexed user, uint reward); constructor(address _token) { } function deposit(uint _amount, uint _lockupDuration) external { } function withdraw(uint orderId) external nonReentrant { require(orderId <= latestOrderId, "TokenStaking: INVALID orderId, orderId greater than latestOrderId"); OrderInfo storage orderInfo = orders[orderId]; require(_msgSender() == orderInfo.beneficiary, "TokenStaking: caller is not the beneficiary"); require(!orderInfo.claimed, "TokenStaking: order already unstaked"); require(block.timestamp >= orderInfo.endtime, "TokenStaking: stake locked until lock duration completion"); uint claimAvailable = pendingRewards(orderId); uint total = orderInfo.amount + claimAvailable; totalRewardEarn[_msgSender()] += claimAvailable; orderInfo.claimedReward += claimAvailable; balanceOf[_msgSender()] -= orderInfo.amount; orderInfo.claimed = true; require(<FILL_ME>) rewardOnPool[orderInfo.lockupDuration] = rewardOnPool[orderInfo.lockupDuration] + claimAvailable ; emit Withdraw(_msgSender(), orderInfo.amount, claimAvailable, total); } function emergencyWithdraw(uint orderId) external nonReentrant { } function claimRewards(uint orderId) external nonReentrant { } function pendingRewards(uint orderId) public view returns (uint) { } function toggleStaking(bool _start) external onlyOwner returns (bool) { } function investorOrderIds(address investor) external view returns (uint[] memory ids) { } function updatePlans(uint256 _plan1Days , uint256 _plan2Days , uint256 _plan3Days , uint256 _plan1APY ,uint256 _plan2APY , uint256 _plan3APY) public onlyOwner { } function transferAnyERC20Token(address payaddress, address tokenAddress, uint amount) external onlyOwner { } }
token.transfer(address(_msgSender()),total),"TokenStaking: token transfer via withdraw not succeeded"
425,477
token.transfer(address(_msgSender()),total)
"TokenStaking: token transfer via claim rewards not succeeded"
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } abstract contract Context { function _msgSender() internal view returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view returns (address) { } function _checkOwner() private view { } function renounceOwnership() external onlyOwner { } function transferOwnership(address newOwner) external onlyOwner { } function _transferOwnership(address newOwner) private { } } abstract contract ReentrancyGuard { uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private _status; constructor() { } modifier nonReentrant() { } function _nonReentrantBefore() private { } function _nonReentrantAfter() private { } function _reentrancyGuardEntered() private view returns (bool) { } } contract StaXeStaking is Ownable, ReentrancyGuard { struct PoolInfo { uint lockupDuration; uint returnPer; } struct OrderInfo { address beneficiary; uint amount; uint lockupDuration; uint returnPer; uint starttime; uint endtime; uint claimedReward; bool claimed; } uint private constant _days7 = 7 days; uint private constant _days14 = 14 days; uint private constant _days30 = 30 days; uint256 private constant _days365 = 31536000; IERC20 public token; bool private started = true; uint public emergencyWithdrawFees = 15; uint private latestOrderId = 0; uint public totalStakers ; // use uint public totalStaked ; // use mapping(uint => PoolInfo) public pooldata; mapping(address => uint) public balanceOf; mapping(address => uint) public totalRewardEarn; mapping(uint => OrderInfo) public orders; mapping(address => uint[]) private orderIds; mapping(address => mapping(uint => bool)) public hasStaked; mapping(uint => uint) public stakeOnPool; mapping(uint => uint) public rewardOnPool; mapping(uint => uint) public stakersPlan; event Deposit(address indexed user, uint indexed lockupDuration, uint amount, uint returnPer); event Withdraw(address indexed user, uint amount, uint reward, uint total); event WithdrawAll(address indexed user, uint amount); event RewardClaimed(address indexed user, uint reward); constructor(address _token) { } function deposit(uint _amount, uint _lockupDuration) external { } function withdraw(uint orderId) external nonReentrant { } function emergencyWithdraw(uint orderId) external nonReentrant { } function claimRewards(uint orderId) external nonReentrant { require(orderId <= latestOrderId, "TokenStaking: INVALID orderId, orderId greater than latestOrderId"); OrderInfo storage orderInfo = orders[orderId]; require(_msgSender() == orderInfo.beneficiary, "TokenStaking: caller is not the beneficiary"); require(!orderInfo.claimed, "TokenStaking: order already unstaked"); uint claimAvailable = pendingRewards(orderId); totalRewardEarn[_msgSender()] += claimAvailable; orderInfo.claimedReward += claimAvailable; require(<FILL_ME>) rewardOnPool[orderInfo.lockupDuration] = rewardOnPool[orderInfo.lockupDuration] + claimAvailable ; emit RewardClaimed(address(_msgSender()), claimAvailable); } function pendingRewards(uint orderId) public view returns (uint) { } function toggleStaking(bool _start) external onlyOwner returns (bool) { } function investorOrderIds(address investor) external view returns (uint[] memory ids) { } function updatePlans(uint256 _plan1Days , uint256 _plan2Days , uint256 _plan3Days , uint256 _plan1APY ,uint256 _plan2APY , uint256 _plan3APY) public onlyOwner { } function transferAnyERC20Token(address payaddress, address tokenAddress, uint amount) external onlyOwner { } }
token.transfer(address(_msgSender()),claimAvailable),"TokenStaking: token transfer via claim rewards not succeeded"
425,477
token.transfer(address(_msgSender()),claimAvailable)
"rng-disabled"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //import "hardhat/console.sol"; import "./ABDKMath64x64.sol"; import "./ChainlinkVRF.sol"; import "openzeppelin-solidity/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "openzeppelin-solidity/contracts/utils/math/Math.sol"; import "./Roles.sol"; import "./MintDateRegistry.sol"; interface IERC721Adapter { function _totalSupply() external view returns (uint256); function _tokenByIndex(uint256 index) external view returns (uint256); function _isDisabled() external view returns (bool); } abstract contract Randomness is ChainlinkVRF, IERC721Adapter { using SafeMath for uint256; // Configuration Chainlink VRF struct VRFConfig { address coordinator; address token; bytes32 keyHash; uint256 price; } event RollInProgress( int128 probability ); event RollComplete(); // 0.0000000008468506% - This has been pre-calculated to amount to 12.5% over 10 years. // Previously, when our project runtime was 5 years, it was 8468506. uint probabilityPerSecond = 4234253; // Previously, probabilityPerSecond was 0.0000000008468506%, based on a 5 year runtime. // Tokens which where already affected by the previously larger randomness, now will use: uint backAdjustedProbabilityPerSecond = 3985026; uint public constant denominator = 10000000000000000; // 100% uint256 randomSeedBlock = 0; uint256 public lastRollRequestedTime = 0; uint256 public currentRollRequestedTime = 0; // This does not affect randomness; we track the time though, it affects the payout amount // in DoctorV3. The payout intervals can deviate from the probability intervals, as the former // may need to pay additional incentives to achieve an "apply" call. uint256 public lastRollAppliedTime = 0; bytes32 chainlinkRequestId = 0; uint256 chainlinkRandomNumber = 0; bytes32 internal chainlinkKeyHash; uint256 internal chainlinkFee; MintDateRegistry registry; constructor( VRFConfig memory config, uint initRollTime ) ChainlinkVRF(config.coordinator, config.token) { } // Will return the probability of a (non-)diagnosis for an individual NFT, assuming the roll will happen at // `timestamp`. This will be based on the last time a roll happened, targeting a certain total probability // over the period the project is running. // Will return 0.80 to indicate that the probability of a diagnosis is 20%. function getProbabilityForDuration(uint256 secondsSinceLastRoll, bool backAdjusted) public view returns (int128 probability) { } // The probability when rolling at `timestamp`. Wraps when a roll is requested (even if not yet applied). function getProbability(uint256 timestamp) public view returns (int128 probability) { } // The probability when rolling now. Wraps when a roll is requested (even if not yet applied). function rollProbability() public view returns (int128 probability) { } // Anyone can roll, but the beneficiary is incentivized to do so. // // # When using Chainlink VRF: // Make sure you have previously funded the contract with LINK. Since anyone can start a request at // any time, do not prefund the contract; send the tokens when you want to enable a roll. // // # When using the blockhash-based fallback method: // A future block is picked, whose hash will provide the randomness. // We accept as low-impact that a miner mining this block could withhold it. A user seed/reveal system // to counteract miner withholding introduces too much complexity (need to penalize users etc). function requestRoll(bool useFallback) public virtual { require(<FILL_ME>) // If a roll is already scheduled, do nothing. if (isRolling()) { return; } if (useFallback) { // Two blocks from now, the block hash will provide the randomness to decide the outcome randomSeedBlock = block.number + 2; } else { chainlinkRequestId = requestRandomness(chainlinkKeyHash, chainlinkFee, block.timestamp); } emit RollInProgress(getProbability(block.timestamp)); currentRollRequestedTime = block.timestamp; } // Callback: randomness is returned from Chainlink VRF function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { } // Apply the results of the roll (run the randomness function, update NFTs). // // When using the block-hash based fallback randomness function: // If this is not called within 250 odd blocks, the hash of that block will no longer be accessible to us. // The roller thus has a possible reason *not* to call apply(), if the outcome is not as they desire. // We counteract this as follows: // - We consider an incomplete roll as a completed (which did not cause a state chance) for purposes of the // compound probability. That is, you cannot increase the chance of any of the NFTs being diagnosed, you // can only prevent it from happening. A caller looking to manipulate a roll would presumably desire a // diagnosis, as they otherwise would simply do nothing. // - We counteract grieving (the repeated calling of pre-roll without calling apply, thus resetting the // probability of a diagnosis) by letting anyone call `apply`, and emitting an event on `preroll`, to make // it easy to watch for that. // // When using Chainlink VRF: // // In case we do not get a response from Chainlink within 2 hours, this can be called. // function applyRoll() public virtual { } function _applyRandomness(bytes32 randomness) internal { } function resetRoll() internal { } function isRolling() public view returns (bool) { } function onDiagnosed(uint256 tokenId) internal virtual; }
!this._isDisabled(),"rng-disabled"
425,645
!this._isDisabled()
"no-roll"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //import "hardhat/console.sol"; import "./ABDKMath64x64.sol"; import "./ChainlinkVRF.sol"; import "openzeppelin-solidity/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "openzeppelin-solidity/contracts/utils/math/Math.sol"; import "./Roles.sol"; import "./MintDateRegistry.sol"; interface IERC721Adapter { function _totalSupply() external view returns (uint256); function _tokenByIndex(uint256 index) external view returns (uint256); function _isDisabled() external view returns (bool); } abstract contract Randomness is ChainlinkVRF, IERC721Adapter { using SafeMath for uint256; // Configuration Chainlink VRF struct VRFConfig { address coordinator; address token; bytes32 keyHash; uint256 price; } event RollInProgress( int128 probability ); event RollComplete(); // 0.0000000008468506% - This has been pre-calculated to amount to 12.5% over 10 years. // Previously, when our project runtime was 5 years, it was 8468506. uint probabilityPerSecond = 4234253; // Previously, probabilityPerSecond was 0.0000000008468506%, based on a 5 year runtime. // Tokens which where already affected by the previously larger randomness, now will use: uint backAdjustedProbabilityPerSecond = 3985026; uint public constant denominator = 10000000000000000; // 100% uint256 randomSeedBlock = 0; uint256 public lastRollRequestedTime = 0; uint256 public currentRollRequestedTime = 0; // This does not affect randomness; we track the time though, it affects the payout amount // in DoctorV3. The payout intervals can deviate from the probability intervals, as the former // may need to pay additional incentives to achieve an "apply" call. uint256 public lastRollAppliedTime = 0; bytes32 chainlinkRequestId = 0; uint256 chainlinkRandomNumber = 0; bytes32 internal chainlinkKeyHash; uint256 internal chainlinkFee; MintDateRegistry registry; constructor( VRFConfig memory config, uint initRollTime ) ChainlinkVRF(config.coordinator, config.token) { } // Will return the probability of a (non-)diagnosis for an individual NFT, assuming the roll will happen at // `timestamp`. This will be based on the last time a roll happened, targeting a certain total probability // over the period the project is running. // Will return 0.80 to indicate that the probability of a diagnosis is 20%. function getProbabilityForDuration(uint256 secondsSinceLastRoll, bool backAdjusted) public view returns (int128 probability) { } // The probability when rolling at `timestamp`. Wraps when a roll is requested (even if not yet applied). function getProbability(uint256 timestamp) public view returns (int128 probability) { } // The probability when rolling now. Wraps when a roll is requested (even if not yet applied). function rollProbability() public view returns (int128 probability) { } // Anyone can roll, but the beneficiary is incentivized to do so. // // # When using Chainlink VRF: // Make sure you have previously funded the contract with LINK. Since anyone can start a request at // any time, do not prefund the contract; send the tokens when you want to enable a roll. // // # When using the blockhash-based fallback method: // A future block is picked, whose hash will provide the randomness. // We accept as low-impact that a miner mining this block could withhold it. A user seed/reveal system // to counteract miner withholding introduces too much complexity (need to penalize users etc). function requestRoll(bool useFallback) public virtual { } // Callback: randomness is returned from Chainlink VRF function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override { } // Apply the results of the roll (run the randomness function, update NFTs). // // When using the block-hash based fallback randomness function: // If this is not called within 250 odd blocks, the hash of that block will no longer be accessible to us. // The roller thus has a possible reason *not* to call apply(), if the outcome is not as they desire. // We counteract this as follows: // - We consider an incomplete roll as a completed (which did not cause a state chance) for purposes of the // compound probability. That is, you cannot increase the chance of any of the NFTs being diagnosed, you // can only prevent it from happening. A caller looking to manipulate a roll would presumably desire a // diagnosis, as they otherwise would simply do nothing. // - We counteract grieving (the repeated calling of pre-roll without calling apply, thus resetting the // probability of a diagnosis) by letting anyone call `apply`, and emitting an event on `preroll`, to make // it easy to watch for that. // // When using Chainlink VRF: // // In case we do not get a response from Chainlink within 2 hours, this can be called. // function applyRoll() public virtual { require(<FILL_ME>) bytes32 randomness; // Roll was started using the fallback random method based on the block hash if (randomSeedBlock > 0) { require(block.number > randomSeedBlock, "too-early"); randomness = blockhash(randomSeedBlock); // The seed block is no longer available. We act as if the roll led to zero diagnoses. if (randomness <= 0) { resetRoll(); return; } } // Roll was started using Chainlink VRF else { // No response from Chainlink if (chainlinkRandomNumber == 0 && block.timestamp - currentRollRequestedTime > 2 hours) { resetRoll(); return; } require(chainlinkRandomNumber > 0, "too-early"); randomness = bytes32(chainlinkRandomNumber); } _applyRandomness(randomness); lastRollAppliedTime = block.timestamp; // Set the last roll time, which "consumes" parts of the total probability for a diagnosis lastRollRequestedTime = currentRollRequestedTime; resetRoll(); } function _applyRandomness(bytes32 randomness) internal { } function resetRoll() internal { } function isRolling() public view returns (bool) { } function onDiagnosed(uint256 tokenId) internal virtual; }
isRolling(),"no-roll"
425,645
isRolling()
"Third party share too high"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TwoFiveSixFactoryDefaultV1 is Ownable { address payable private _twoFiveSixAddress; address public masterProject; address[] public projects; /* Percentage multiplied by 100 */ uint256 public twoFiveSixSharePrimary; uint256 public biddingDelay; uint256 public allowListDelay; event Deployed(address a); /** * @notice Launches a new TwoFiveSixProject with the provided project, traits, and libraries. * @dev The `masterProject` is used as the contract implementation. * @param _project A struct containing details about the project being launched. * @param _traits An array of structs containing details about the traits associated with the project. * @param _libraries An array of structs containing details about the libraries used by the project. */ function launchProject( ITwoFiveSixProject.Project calldata _project, ITwoFiveSixProject.Trait[] calldata _traits, ITwoFiveSixProject.LibraryScript[] calldata _libraries ) public { require( _project.biddingStartTimeStamp > block.timestamp + biddingDelay, "Before minimum bidding delay" ); require( _project.allowListStartTimeStamp > block.timestamp + allowListDelay, "Before allow list delay" ); require( _project.twoFiveSix == _twoFiveSixAddress, "Incorrect 256ART address" ); require( _project.twoFiveSixShare == uint24(twoFiveSixSharePrimary), "Incorrect 256ART share" ); require(<FILL_ME>) address a = clone(masterProject); address traits; address libraryScripts; if (_traits.length > 0) { traits = SSTORE2.write(abi.encode(_traits)); } if (_libraries.length > 0) { libraryScripts = SSTORE2.write(abi.encode(_libraries)); } ITwoFiveSixProject p = ITwoFiveSixProject(a); p.initProject(_project, traits, libraryScripts); projects.push(a); emit Deployed(a); } /** * @notice Clones a contract using the provided implementation address * @param implementation The address of the contract implementation */ function clone(address implementation) internal returns (address instance) { } /** * @dev Set the master project address * @notice Only the contract owner can call this function * @param _masterProject Address of the new master project contract */ function setMasterProject(address _masterProject) public onlyOwner { } /** * @dev Set the 256 address * @notice Only the contract owner can call this function * @param newAddress The new 256 contract address */ function setTwoFiveSixAddress(address payable newAddress) public onlyOwner { } /** * @dev Set the primary 256 share * @notice Only the contract owner can call this function * @param newShare The new primary 256 share */ function setTwoFiveSixSharePrimary(uint256 newShare) public onlyOwner { } /** * @dev Set the bidding delay * @notice Only the contract owner can call this function * @param delay The new bidding delay */ function setBiddingDelay(uint256 delay) public onlyOwner { } /** * @dev Set the allow list delay * @notice Only the contract owner can call this function * @param delay The new allow list delay */ function setAllowListDelay(uint256 delay) public onlyOwner { } } interface ITwoFiveSixProject { struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } function initProject( Project calldata _p, address _traits, address _libraryScripts ) external; }
twoFiveSixSharePrimary+_project.thirdPartyShare<=10000,"Third party share too high"
425,806
twoFiveSixSharePrimary+_project.thirdPartyShare<=10000
"Minted out"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { uint256 totalSupply = _owners.length; require(<FILL_ME>) require(block.timestamp < project.endingTimeStamp, "Mint ended"); require(count < 5, "Mint max four per tx"); if (!project.fixedPrice) { require( ((block.timestamp > project.biddingStartTimeStamp + 3600) || (block.timestamp < project.biddingStartTimeStamp)), "No artist mint during auction" ); } for (uint256 i; i < count; ) { unchecked { uint256 tokenId = totalSupply + i; tokenIdToHash[tokenId] = createHash( tokenId, project.artistAddress ); _mint(a, tokenId); i++; } } unchecked { project.artistAuctionWithdrawalsClaimed = project.artistAuctionWithdrawalsClaimed + count; } } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
totalSupply+count<project.maxSupply,"Minted out"
425,809
totalSupply+count<project.maxSupply
"No artist mint during auction"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { uint256 totalSupply = _owners.length; require(totalSupply + count < project.maxSupply, "Minted out"); require(block.timestamp < project.endingTimeStamp, "Mint ended"); require(count < 5, "Mint max four per tx"); if (!project.fixedPrice) { require(<FILL_ME>) } for (uint256 i; i < count; ) { unchecked { uint256 tokenId = totalSupply + i; tokenIdToHash[tokenId] = createHash( tokenId, project.artistAddress ); _mint(a, tokenId); i++; } } unchecked { project.artistAuctionWithdrawalsClaimed = project.artistAuctionWithdrawalsClaimed + count; } } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
((block.timestamp>project.biddingStartTimeStamp+3600)||(block.timestamp<project.biddingStartTimeStamp)),"No artist mint during auction"
425,809
((block.timestamp>project.biddingStartTimeStamp+3600)||(block.timestamp<project.biddingStartTimeStamp))
"Not on allow list"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { require( block.timestamp > project.allowListStartTimeStamp, "Allow list mint not started" ); require( block.timestamp < project.biddingStartTimeStamp, "Allow list mint ended" ); require(<FILL_ME>) require(addressToClaimed[msg.sender] == false, "Already claimed"); uint256 totalSupply = _owners.length; require(totalSupply + 1 < project.maxSupply, "Minted out"); require(project.reservePrice <= msg.value, "Invalid funds provided"); require(msg.sender == tx.origin, "No contract minting"); unchecked { uint256 tokenId = totalSupply; addressToClaimed[msg.sender] = true; project.totalAllowListMints = project.totalAllowListMints + 1; tokenIdToHash[tokenId] = createHash(tokenId, msg.sender); _mint(a, tokenId); } } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
MerkleProofUpgradeable.verify(proof,project.merkleRoot,keccak256(abi.encodePacked(msg.sender))),"Not on allow list"
425,809
MerkleProofUpgradeable.verify(proof,project.merkleRoot,keccak256(abi.encodePacked(msg.sender)))
"Already claimed"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { require( block.timestamp > project.allowListStartTimeStamp, "Allow list mint not started" ); require( block.timestamp < project.biddingStartTimeStamp, "Allow list mint ended" ); require( MerkleProofUpgradeable.verify( proof, project.merkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Not on allow list" ); require(<FILL_ME>) uint256 totalSupply = _owners.length; require(totalSupply + 1 < project.maxSupply, "Minted out"); require(project.reservePrice <= msg.value, "Invalid funds provided"); require(msg.sender == tx.origin, "No contract minting"); unchecked { uint256 tokenId = totalSupply; addressToClaimed[msg.sender] = true; project.totalAllowListMints = project.totalAllowListMints + 1; tokenIdToHash[tokenId] = createHash(tokenId, msg.sender); _mint(a, tokenId); } } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
addressToClaimed[msg.sender]==false,"Already claimed"
425,809
addressToClaimed[msg.sender]==false
"Minted out"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { require( block.timestamp > project.allowListStartTimeStamp, "Allow list mint not started" ); require( block.timestamp < project.biddingStartTimeStamp, "Allow list mint ended" ); require( MerkleProofUpgradeable.verify( proof, project.merkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Not on allow list" ); require(addressToClaimed[msg.sender] == false, "Already claimed"); uint256 totalSupply = _owners.length; require(<FILL_ME>) require(project.reservePrice <= msg.value, "Invalid funds provided"); require(msg.sender == tx.origin, "No contract minting"); unchecked { uint256 tokenId = totalSupply; addressToClaimed[msg.sender] = true; project.totalAllowListMints = project.totalAllowListMints + 1; tokenIdToHash[tokenId] = createHash(tokenId, msg.sender); _mint(a, tokenId); } } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
totalSupply+1<project.maxSupply,"Minted out"
425,809
totalSupply+1<project.maxSupply
"Not allowed"
// SPDX-License-Identifier: MIT /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β• β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• Using this contract? A shout out to @Mint256Art is appreciated! */ pragma solidity ^0.8.19; import "./helpers/SSTORE2.sol"; import "./helpers/OwnableUpgradeable.sol"; import "./helpers/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; contract TwoFiveSixProjectDefaultV1 is ERC721EnumerableUpgradeable, OwnableUpgradeable { mapping(uint256 => bytes32) public tokenIdToHash; mapping(address => TotalAndCount) private addressToTotalAndCount; mapping(address => bool) private addressToClaimed; struct Project { string name; //unknown string imageBase; //unkown address[] artScripts; //unknown bytes32 merkleRoot; //32 address artInfo; //20 uint56 biddingStartTimeStamp; //8 uint32 maxSupply; //4 address payable artistAddress; //20 uint56 allowListStartTimeStamp; //8 uint32 totalAllowListMints; //4 address payable twoFiveSix; //20 uint24 artistAuctionWithdrawalsClaimed; //3 uint24 artistAllowListWithdrawalsClaimed; //3 uint24 twoFiveSixShare; //3 uint24 royalty; //3 address traits; //20 uint96 reservePrice; //12 address payable royaltyAddress; //20 uint96 lastSalePrice; //12 address libraryScripts; //20 uint56 endingTimeStamp; //8 uint24 thirdPartyShare; //3 bool fixedPrice; //1 address payable thirdPartyAddress; //20 } struct Trait { string name; string[] values; string[] descriptions; uint256[] weights; } struct TotalAndCount { uint128 total; uint128 count; } struct LibraryScript { address fileStoreFrontEnd; address fileStore; string fileName; } Project private project; /** * @notice Initializes the project. * @dev Initializes the ERC721 contract. * @param _p The project data. */ function initProject( Project calldata _p, address _traits, address _libraryScripts ) public initializer { } /** * @notice Gets the current price. */ function currentPrice() public view returns (uint256 p) { } /** * @notice Mint tokens to an address (artist only) * @dev Mints a given number of tokens to a specified address. Can only be called by the project owner. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function artistMint(uint24 count, address a) public onlyOwner { } /** * @notice Mint a token to an allow listed address if conditions met. * @dev Mints a token to a specified address if that address is on the project's allow list and has not already claimed a token. * @param proof The proof of inclusion in the project's Merkle tree. * @param a The address to which the token will be minted. */ function allowListMint(bytes32[] memory proof, address a) public payable { } /** * @notice Mint tokens to an address through a Dutch auction until reserve price is met, while checking for various conditions. * @dev Mints a given number of tokens to a specified address through a Dutch auction process that ends when the reserve price is met. Also checks various conditions such as max supply, minimum and maximum number of tokens that can be minted per transaction, and that the sender is not a contract. * @param count The number of tokens to be minted. * @param a The address to which the tokens will be minted. */ function mint(uint128 count, address a) public payable { } /** * @notice Claim a rebate for each token minted at a higher price than the final price * @param a The address to which the rebate is paid. */ function claimRebate(address payable a) public { } /** * @notice Create a hash for the given tokenId, blockNumber and sender. * @param tokenId The ID of the token. * @param sender The address of the sender. * @return The resulting hash. */ function createHash( uint256 tokenId, address sender ) private view returns (bytes32) { } /** * @notice Get the hash associated with a given tokenId. * @param _id The ID of the token. * @return The hash associated with the given tokenId. */ function getHashFromTokenId(uint256 _id) public view returns (bytes32) { } /** * @notice Withdraw funds from the contract * @dev Transfers a percentage of the balance to the 256ART address and optionally a third party, the rest to the artist address. */ function withdraw() public { require(<FILL_ME>) uint256 totalSupply = _owners.length; uint256 finalPrice; uint256 balance; if (project.fixedPrice) { balance = address(this).balance; } else { require( block.timestamp > project.biddingStartTimeStamp + 3600, "Auction still in progress" ); if ( _owners.length < (project.maxSupply - 1) || project.lastSalePrice == 0 ) { finalPrice = project.reservePrice; } else { finalPrice = project.lastSalePrice; } balance = ((totalSupply - project.totalAllowListMints - project.artistAuctionWithdrawalsClaimed) * finalPrice) + ((project.totalAllowListMints - project.artistAllowListWithdrawalsClaimed) * project.reservePrice); } require(balance > 0, "Balance is zero"); project.artistAuctionWithdrawalsClaimed = uint24( totalSupply - project.totalAllowListMints ); project.artistAllowListWithdrawalsClaimed = uint24( project.totalAllowListMints ); if (project.thirdPartyAddress == address(0)) { uint256 twoFiveSixBalance = (balance * project.twoFiveSixShare) / 10000; uint256 artistBalance = balance - twoFiveSixBalance; project.twoFiveSix.transfer(twoFiveSixBalance); project.artistAddress.transfer(artistBalance); } else { uint256 twoFiveSixBalance = (balance * project.twoFiveSixShare) / 10000; uint256 thirdPartyBalance = (balance * project.thirdPartyShare) / 10000; uint256 artistBalance = balance - twoFiveSixBalance - thirdPartyBalance; project.twoFiveSix.transfer(twoFiveSixBalance); project.thirdPartyAddress.transfer(thirdPartyBalance); project.artistAddress.transfer(artistBalance); } } function walletOfOwner( address _owner ) public view returns (uint256[] memory) { } function batchTransferFrom( address _from, address _to, uint256[] memory _tokenIds ) public { } function batchSafeTransferFrom( address _from, address _to, uint256[] memory _tokenIds, bytes memory data_ ) public { } function isOwnerOf( address account, uint256[] calldata _tokenIds ) external view returns (bool) { } function _mint(address to, uint256 tokenId) internal virtual override { } /** * @notice Calculates the royalty information for a given sale. * @dev Implements the required royaltyInfo function for the ERC2981 standard. * @param _salePrice The sale price of the token being sold. * @return receiver The address of the royalty recipient. * @return royaltyAmount The amount of royalty to be paid. */ function royaltyInfo( uint256, uint256 _salePrice ) external view returns (address receiver, uint256 royaltyAmount) { } /** * @notice Converts a bytes16 value to its hexadecimal representation as a bytes32 value. * @param data The bytes16 value to convert. * @return result The hexadecimal representation of the input value as a bytes32 value. */ function toHex16(bytes16 data) internal pure returns (bytes32 result) { } /** * @dev Converts a bytes32 value to its hexadecimal representation as a string. * @param data The bytes32 value to convert. * @return The hexadecimal representation of the bytes32 value, as a string. */ function toHex(bytes32 data) private pure returns (string memory) { } /** * @dev Generates an array of random numbers based on a seed value. * @param seed The seed value used to generate the random numbers. * @param timesToCall The number of random numbers to generate. * @return An array of random numbers with length equal to `timesToCall`. */ function generateRandomNumbers( bytes32 seed, uint256 timesToCall ) private pure returns (uint256[] memory) { } /** * @notice Returns a string containing base64 encoded HTML code which renders the artwork associated with the given tokenId directly from chain. * @dev This function reads traits and libraries from the storage and uses them to generate the HTML code for the artwork. * @param tokenId The ID of the token whose artwork will be generated. * @return artwork A string containing the base64 encoded HTML code for the artwork. */ function getTokenHtml( uint256 tokenId ) public view returns (string memory artwork) { } /** * @notice Returns the metadata of the token with the given ID, including name, artist, description, license, image and animation URL, and attributes. * @dev It returns a base64 encoded JSON object which conforms to the ERC721 metadata standard. * @param _tokenId The ID of the token to retrieve metadata for. * @return A base64 encoded JSON object that contains the metadata of the given token. */ function tokenURI( uint256 _tokenId ) public view override returns (string memory) { } /** * @notice Allows to set the image base URL for the project (owner) * @dev Only callable by the owner * @param _imageBase String representing the base URL for images */ function setImageBase(string calldata _imageBase) public onlyOwner { } /** * @notice Sets the maximum number of tokens that can be minted for the project (owner) * @dev Only the owner of the contract can call this function. * @dev The new maximum supply must be greater than the current number of tokens minted * and less than the current maximum supply * @param _maxSupply The new maximum number of tokens that can be minted */ function setMaxSupply(uint24 _maxSupply) public onlyOwner { } /** * @notice Allows to set the art scripts for the project * @param _artScripts Array of addresses representing the art scripts */ function setArtScripts(address[] calldata _artScripts) public onlyOwner { } /** * @notice Allows to set the library scripts for the project * @param _libraries Array of LibraryScript objects representing the library scripts */ function setLibraryScripts( LibraryScript[] calldata _libraries ) public onlyOwner { } /** * @notice Returns the reserve price for the project * @dev This function is view only * @return uint256 Representing the reserve price for the project */ function getReservePrice() external view returns (uint256) { } /** * @notice Returns the address of the ArtInfo contract used in the project * @dev This function is view only * @return address Representing the address of the ArtInfo contract */ function getArtInfo() external view returns (address) { } /** * @notice Returns an array with the addresses storing the art script used in the project * @dev This function is view only * @return address[] Array of addresses storing the art script used in the project */ function getArtScripts() external view returns (address[] memory) { } /** * @notice Returns the maximum number of tokens that can be minted for the project * @dev This function is view only * @return uint256 Representing the maximum number of tokens that can be minted */ function getMaxSupply() external view returns (uint256) { } /** * @notice Returns the timestamp of the bidding start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the bidding start */ function getBiddingStartTimeStamp() external view returns (uint256) { } /** * @notice Returns the timestamp of the allowlist start for the project * @dev This function is view only * @return uint256 Representing the timestamp of the allowlist start */ function getallowListStartTimeStamp() external view returns (uint256) { } } interface IArtScript { function artScript() external pure returns (string memory); } interface IArtInfo { function artist() external pure returns (string memory); function description() external pure returns (string memory); function license() external pure returns (string memory); } interface IFileStorage { function readFile( address fileStore, string calldata filename ) external pure returns (string memory); }
(msg.sender==project.twoFiveSix||msg.sender==project.artistAddress||msg.sender==project.thirdPartyAddress),"Not allowed"
425,809
(msg.sender==project.twoFiveSix||msg.sender==project.artistAddress||msg.sender==project.thirdPartyAddress)
"Total fees cannot be more than 100%"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/[email protected]/security/Pausable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; contract JACKSHOLE is ERC20, ERC20Burnable, Pausable, Ownable { address public devWallet = 0xa83551179d2d559a015245307d0A12e9Df922EF6; uint256 public buyFee = 3; uint256 public sellFee = 3; uint256 public feeDenominator = 100; mapping (address => bool) isFeeExempt; mapping (address => bool) public isLiquidityPool; bool private tradingOpen = false; constructor() ERC20("JACKSON'S HOLE", "JACKSHOLE") { } function openTrading() external onlyOwner { } function takeFee(address sender, uint256 amount, bool isSell) internal returns (uint256) { } function withdrawFees(uint256 amount) external onlyOwner { } function _transfer(address sender, address recipient, uint256 amount) internal override { } function setLiquidityPool(address poolAddress, bool value) external onlyOwner { } function setSwapFees(uint256 _newBuyFee, uint256 _newSellFee, uint256 _feeDenominator) external onlyOwner() { require(<FILL_ME>) buyFee = _newBuyFee; sellFee = _newSellFee; feeDenominator = _feeDenominator; } function setTreasuryFeeReceiver(address _newWallet) external onlyOwner() { } }
_newBuyFee+_newSellFee<feeDenominator,"Total fees cannot be more than 100%"
425,815
_newBuyFee+_newSellFee<feeDenominator
"Recipient is not whitelisted"
// SPDX-License-Identifier: MIT /* ########################################################## # # # twitter: https://twitter.com/MakeItRainERC # # website: https://makeethrain.today # # telegram: https://t.me/mirtokenportal # # # ########################################################## */ pragma solidity ^0.8.20; import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20Permit.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; contract MIR is ERC20, ERC20Permit, Ownable { mapping(address => bool) public whitelist; address public UNISWAP_PAIR; bool public whitelisted = true; uint256 public LimitBuy = 15; // 1.5% of the supply uint256 public initialSupply = 100_000_000; // token supply constructor() ERC20("Make It Rain", "MIR") ERC20Permit("Make It Rain") { } function addToWhitelist(address[] calldata addresses) external onlyOwner { } function removeFromWhitelist(address[] calldata addresses) external onlyOwner { } function setPair(address pair) public onlyOwner { } function activatePublicSale() public onlyOwner { } function transfer(address recipient, uint256 amount) public override returns (bool) { if (whitelisted && recipient != owner() && msg.sender != owner()) { require(<FILL_ME>) require(UNISWAP_PAIR != address(0), "trade is not enabled yet"); if (msg.sender == UNISWAP_PAIR) { require( super.balanceOf(recipient) + amount <= (totalSupply() * LimitBuy) / 1000, "Forbid, You Can't hold more than 1.5% of the supply" ); } } return super.transfer(recipient, amount); } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } }
whitelist[recipient],"Recipient is not whitelisted"
426,049
whitelist[recipient]
"Forbid, You Can't hold more than 1.5% of the supply"
// SPDX-License-Identifier: MIT /* ########################################################## # # # twitter: https://twitter.com/MakeItRainERC # # website: https://makeethrain.today # # telegram: https://t.me/mirtokenportal # # # ########################################################## */ pragma solidity ^0.8.20; import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20Permit.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; contract MIR is ERC20, ERC20Permit, Ownable { mapping(address => bool) public whitelist; address public UNISWAP_PAIR; bool public whitelisted = true; uint256 public LimitBuy = 15; // 1.5% of the supply uint256 public initialSupply = 100_000_000; // token supply constructor() ERC20("Make It Rain", "MIR") ERC20Permit("Make It Rain") { } function addToWhitelist(address[] calldata addresses) external onlyOwner { } function removeFromWhitelist(address[] calldata addresses) external onlyOwner { } function setPair(address pair) public onlyOwner { } function activatePublicSale() public onlyOwner { } function transfer(address recipient, uint256 amount) public override returns (bool) { if (whitelisted && recipient != owner() && msg.sender != owner()) { require(whitelist[recipient], "Recipient is not whitelisted"); require(UNISWAP_PAIR != address(0), "trade is not enabled yet"); if (msg.sender == UNISWAP_PAIR) { require(<FILL_ME>) } } return super.transfer(recipient, amount); } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } }
super.balanceOf(recipient)+amount<=(totalSupply()*LimitBuy)/1000,"Forbid, You Can't hold more than 1.5% of the supply"
426,049
super.balanceOf(recipient)+amount<=(totalSupply()*LimitBuy)/1000
"MorpherState: Permission denied."
//SPDX-License-Identifier: GPLv3 pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./MorpherToken.sol"; import "./MorpherTradeEngine.sol"; // ---------------------------------------------------------------------------------- // Data and token balance storage of the Morpher platform // Writing access is only granted to platform contracts. The contract can be paused // by an elected platform administrator (see MorpherGovernance) to perform protocol updates. // ---------------------------------------------------------------------------------- contract MorpherState is Initializable, ContextUpgradeable { address public morpherAccessControlAddress; address public morpherAirdropAddress; address public morpherBridgeAddress; address public morpherFaucetAddress; address public morpherGovernanceAddress; address public morpherMintingLimiterAddress; address public morpherOracleAddress; address payable public morpherStakingAddress; address public morpherTokenAddress; address public morpherTradeEngineAddress; address public morpherUserBlockingAddress; /** * Roles known to State */ bytes32 public constant ADMINISTRATOR_ROLE = keccak256("ADMINISTRATOR_ROLE"); bytes32 public constant GOVERNANCE_ROLE = keccak256("GOVERNANCE_ROLE"); bytes32 public constant PLATFORM_ROLE = keccak256("PLATFORM_ROLE"); address public morpherRewards; uint256 public maximumLeverage; // Leverage precision is 1e8, maximum leverage set to 10 initially uint256 public constant PRECISION = 10**8; uint256 public constant DECIMALS = 18; uint256 public constant REWARDPERIOD = 1 days; uint256 public rewardBasisPoints; uint256 public lastRewardTime; bytes32 public sideChainMerkleRoot; uint256 public sideChainMerkleRootWrittenAtTime; // Set initial withdraw limit from sidechain to 20m token or 2% of initial supply uint256 public mainChainWithdrawLimit24; mapping(bytes32 => bool) private marketActive; // ---------------------------------------------------------------------------- // Sidechain spam protection // ---------------------------------------------------------------------------- mapping(address => uint256) private lastRequestBlock; mapping(address => uint256) private numberOfRequests; uint256 public numberOfRequestsLimit; // ---------------------------------------------------------------------------- // Events // ---------------------------------------------------------------------------- event OperatingRewardMinted(address indexed recipient, uint256 amount); event RewardsChange(address indexed rewardsAddress, uint256 indexed rewardsBasisPoints); event LastRewardTime(uint256 indexed rewardsTime); event MaximumLeverageChange(uint256 maxLeverage); event MarketActivated(bytes32 indexed activateMarket); event MarketDeActivated(bytes32 indexed deActivateMarket); modifier onlyRole(bytes32 role) { require(<FILL_ME>) _; } modifier onlyBridge { } modifier onlyMainChain { } bool mainChain; function initialize(bool _mainChain, address _morpherAccessControlAddress) public initializer { } // ---------------------------------------------------------------------------- // Setter/Getter functions for platform roles // ---------------------------------------------------------------------------- event SetMorpherAccessControlAddress(address _oldAddress, address _newAddress); function setMorpherAccessControl(address _morpherAccessControlAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherAirdropAddress(address _oldAddress, address _newAddress); function setMorpherAirdrop(address _morpherAirdropAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherBridgeAddress(address _oldAddress, address _newAddress); function setMorpherBridge(address _morpherBridgeAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherFaucetAddress(address _oldAddress, address _newAddress); function setMorpherFaucet(address _morpherFaucetAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherGovernanceAddress(address _oldAddress, address _newAddress); function setMorpherGovernance(address _morpherGovernanceAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherMintingLimiterAddress(address _oldAddress, address _newAddress); function setMorpherMintingLimiter(address _morpherMintingLimiterAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherOracleAddress(address _oldAddress, address _newAddress); function setMorpherOracle(address _morpherOracleAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherStakingAddress(address _oldAddress, address _newAddress); function setMorpherStaking(address payable _morpherStakingAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherTokenAddress(address _oldAddress, address _newAddress); function setMorpherToken(address _morpherTokenAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherTradeEngineAddress(address _oldAddress, address _newAddress); function setMorpherTradeEngine(address _morpherTradeEngineAddress) public onlyRole(ADMINISTRATOR_ROLE) { } event SetMorpherUserBlockingAddress(address _oldAddress, address _newAddress); function setMorpherUserBlocking(address _morpherUserBlockingAddress) public onlyRole(ADMINISTRATOR_ROLE) { } // ---------------------------------------------------------------------------- // Setter/Getter functions for platform administration // ---------------------------------------------------------------------------- function activateMarket(bytes32 _activateMarket) public onlyRole(ADMINISTRATOR_ROLE) { } function deActivateMarket(bytes32 _deActivateMarket) public onlyRole(ADMINISTRATOR_ROLE) { } function getMarketActive(bytes32 _marketId) public view returns(bool _active) { } function setMaximumLeverage(uint256 _newMaximumLeverage) public onlyRole(ADMINISTRATOR_ROLE) { } function getMaximumLeverage() public view returns(uint256 _maxLeverage) { } /** * Backwards compatibility functions */ function getLastUpdated(address _address, bytes32 _marketHash) public view returns(uint) { } function totalToken() public view returns(uint) { } function getPosition( address _address, bytes32 _marketId ) public view returns ( uint256 _longShares, uint256 _shortShares, uint256 _meanEntryPrice, uint256 _meanEntrySpread, uint256 _meanEntryLeverage, uint256 _liquidationPrice ) { } }
MorpherAccessControl(morpherAccessControlAddress).hasRole(role,_msgSender()),"MorpherState: Permission denied."
426,489
MorpherAccessControl(morpherAccessControlAddress).hasRole(role,_msgSender())
"Light: This drop was already prepared"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { require(quantityForSale > 0, "Light: quantity may not be zero"); require(quantityForSale <= MAX_DROP_SIZE, "Light: drop is too large"); require(<FILL_ME>) require(bytes(tokenURIBase).length > 0, "Light: missing URI base"); Drop storage drop = drops[dropID]; drop.quantityForSale = quantityForSale; drop.tokenURIBase = tokenURIBase; drop.passwordHash = passwordHash; drop.accumulatedRandomness = uint256(passwordHash); } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
drops[dropID].quantityForSale==0,"Light: This drop was already prepared"
426,526
drops[dropID].quantityForSale==0
"Light: missing URI base"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { require(quantityForSale > 0, "Light: quantity may not be zero"); require(quantityForSale <= MAX_DROP_SIZE, "Light: drop is too large"); require(drops[dropID].quantityForSale == 0, "Light: This drop was already prepared"); require(<FILL_ME>) Drop storage drop = drops[dropID]; drop.quantityForSale = quantityForSale; drop.tokenURIBase = tokenURIBase; drop.passwordHash = passwordHash; drop.accumulatedRandomness = uint256(passwordHash); } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
bytes(tokenURIBase).length>0,"Light: missing URI base"
426,526
bytes(tokenURIBase).length>0
"Light: this drop has already started selling"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { require(<FILL_ME>) delete (drops[dropID]); } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
drops[dropID].quantitySold==0,"Light: this drop has already started selling"
426,526
drops[dropID].quantitySold==0
"Light: not enough left for sale"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { Drop storage drop = drops[dropID]; require(quantity > 0, "Light: missing purchase quantity"); require(<FILL_ME>) require(drop.accumulatedRandomness != 0, "Light: no randomness in this drop, use mintChosen instead"); DropPhase memory dropPhase = _getEffectivePhase(drop); require(msg.value >= dropPhase.ethPrice * quantity, "Light: not enough Ether paid"); if (dropPhase.accessListRoot != bytes32(0)) { _requireValidMerkleProof(dropPhase.accessListRoot, accessListProof, accessListQuantity); require( quantityMinted[dropPhase.accessListRoot][msg.sender] + quantity <= accessListQuantity, "Light: exceeded access list limit" ); } _addEntropyBit(dropID, uint256(blockhash(block.number - 1))); if (dropPhase.accessListRoot != bytes32(0)) { quantityMinted[dropPhase.accessListRoot][msg.sender] += quantity; } for (uint256 mintCounter = 0; mintCounter < quantity; mintCounter++) { _mint(msg.sender, _assembleTokenID(dropID, drop.quantitySold)); drop.quantitySold++; } } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
quantity+drop.quantitySold<=drop.quantityForSale,"Light: not enough left for sale"
426,526
quantity+drop.quantitySold<=drop.quantityForSale
"Light: exceeded access list limit"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { Drop storage drop = drops[dropID]; require(quantity > 0, "Light: missing purchase quantity"); require(quantity + drop.quantitySold <= drop.quantityForSale, "Light: not enough left for sale"); require(drop.accumulatedRandomness != 0, "Light: no randomness in this drop, use mintChosen instead"); DropPhase memory dropPhase = _getEffectivePhase(drop); require(msg.value >= dropPhase.ethPrice * quantity, "Light: not enough Ether paid"); if (dropPhase.accessListRoot != bytes32(0)) { _requireValidMerkleProof(dropPhase.accessListRoot, accessListProof, accessListQuantity); require(<FILL_ME>) } _addEntropyBit(dropID, uint256(blockhash(block.number - 1))); if (dropPhase.accessListRoot != bytes32(0)) { quantityMinted[dropPhase.accessListRoot][msg.sender] += quantity; } for (uint256 mintCounter = 0; mintCounter < quantity; mintCounter++) { _mint(msg.sender, _assembleTokenID(dropID, drop.quantitySold)); drop.quantitySold++; } } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
quantityMinted[dropPhase.accessListRoot][msg.sender]+quantity<=accessListQuantity,"Light: exceeded access list limit"
426,526
quantityMinted[dropPhase.accessListRoot][msg.sender]+quantity<=accessListQuantity
"Light: not enough left for sale"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { Drop storage drop = drops[dropID]; require(tokenIDsInDrop.length > 0, "Light: missing tokens to purchase"); require(<FILL_ME>) require(tokenIDsInDrop.length < type(uint64).max); require(drop.accumulatedRandomness == 0, "Light: this drop uses randomness, use mintRandom instead"); DropPhase memory dropPhase = _getEffectivePhase(drop); require(msg.value >= dropPhase.ethPrice * tokenIDsInDrop.length, "Light: not enough Ether paid"); if (dropPhase.accessListRoot != bytes32(0)) { _requireValidMerkleProof(dropPhase.accessListRoot, accessListProof, accessListQuantity); require( quantityMinted[dropPhase.accessListRoot][msg.sender] + tokenIDsInDrop.length <= accessListQuantity, "Light: exceeded access list limit" ); } drop.quantitySold += uint32(tokenIDsInDrop.length); if (dropPhase.accessListRoot != bytes32(0)) { quantityMinted[dropPhase.accessListRoot][msg.sender] += uint96(tokenIDsInDrop.length); } for (uint256 index = 0; index < tokenIDsInDrop.length; index++) { require(tokenIDsInDrop[index] < drop.quantityForSale, "Light: invalid token ID"); _mint(msg.sender, _assembleTokenID(dropID, tokenIDsInDrop[index])); } } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
tokenIDsInDrop.length+drop.quantitySold<=drop.quantityForSale,"Light: not enough left for sale"
426,526
tokenIDsInDrop.length+drop.quantitySold<=drop.quantityForSale
"Light: exceeded access list limit"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { Drop storage drop = drops[dropID]; require(tokenIDsInDrop.length > 0, "Light: missing tokens to purchase"); require(tokenIDsInDrop.length + drop.quantitySold <= drop.quantityForSale, "Light: not enough left for sale"); require(tokenIDsInDrop.length < type(uint64).max); require(drop.accumulatedRandomness == 0, "Light: this drop uses randomness, use mintRandom instead"); DropPhase memory dropPhase = _getEffectivePhase(drop); require(msg.value >= dropPhase.ethPrice * tokenIDsInDrop.length, "Light: not enough Ether paid"); if (dropPhase.accessListRoot != bytes32(0)) { _requireValidMerkleProof(dropPhase.accessListRoot, accessListProof, accessListQuantity); require(<FILL_ME>) } drop.quantitySold += uint32(tokenIDsInDrop.length); if (dropPhase.accessListRoot != bytes32(0)) { quantityMinted[dropPhase.accessListRoot][msg.sender] += uint96(tokenIDsInDrop.length); } for (uint256 index = 0; index < tokenIDsInDrop.length; index++) { require(tokenIDsInDrop[index] < drop.quantityForSale, "Light: invalid token ID"); _mint(msg.sender, _assembleTokenID(dropID, tokenIDsInDrop[index])); } } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
quantityMinted[dropPhase.accessListRoot][msg.sender]+tokenIDsInDrop.length<=accessListQuantity,"Light: exceeded access list limit"
426,526
quantityMinted[dropPhase.accessListRoot][msg.sender]+tokenIDsInDrop.length<=accessListQuantity
"Light: invalid token ID"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { Drop storage drop = drops[dropID]; require(tokenIDsInDrop.length > 0, "Light: missing tokens to purchase"); require(tokenIDsInDrop.length + drop.quantitySold <= drop.quantityForSale, "Light: not enough left for sale"); require(tokenIDsInDrop.length < type(uint64).max); require(drop.accumulatedRandomness == 0, "Light: this drop uses randomness, use mintRandom instead"); DropPhase memory dropPhase = _getEffectivePhase(drop); require(msg.value >= dropPhase.ethPrice * tokenIDsInDrop.length, "Light: not enough Ether paid"); if (dropPhase.accessListRoot != bytes32(0)) { _requireValidMerkleProof(dropPhase.accessListRoot, accessListProof, accessListQuantity); require( quantityMinted[dropPhase.accessListRoot][msg.sender] + tokenIDsInDrop.length <= accessListQuantity, "Light: exceeded access list limit" ); } drop.quantitySold += uint32(tokenIDsInDrop.length); if (dropPhase.accessListRoot != bytes32(0)) { quantityMinted[dropPhase.accessListRoot][msg.sender] += uint96(tokenIDsInDrop.length); } for (uint256 index = 0; index < tokenIDsInDrop.length; index++) { require(<FILL_ME>) _mint(msg.sender, _assembleTokenID(dropID, tokenIDsInDrop[index])); } } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
tokenIDsInDrop[index]<drop.quantityForSale,"Light: invalid token ID"
426,526
tokenIDsInDrop[index]<drop.quantityForSale
"Light: wrong secret"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { Drop storage drop = drops[dropID]; require(drop.passwordHash != bytes32(0), "Light: this drop does not have a password (anymore)"); require(drop.quantitySold == drop.quantityForSale, "Light: this drop has not completed selling"); require(<FILL_ME>) _addEntropyBit(dropID, bytes(password).length); drop.passwordHash = bytes32(0); } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
keccak256(abi.encode(password))==drop.passwordHash,"Light: wrong secret"
426,526
keccak256(abi.encode(password))==drop.passwordHash
"Light: token does not exist"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { require(<FILL_ME>) (uint64 dropID, uint64 tokenIDInDrop) = _dissectTokenID(tokenID); Drop storage drop = drops[dropID]; if (drop.accumulatedRandomness == 0) { // Not randomized return string.concat(drop.tokenURIBase, Strings.toString(tokenIDInDrop)); } if (drop.passwordHash != bytes32(0)) { // Randomized but not revealed if (bytes(drop.unrevealedTokenURIOverride).length > 0) { return drop.unrevealedTokenURIOverride; } return unrevealedTokenURI; } // Randomized and revealed uint256 offset = drop.accumulatedRandomness % drop.quantityForSale; uint256 index = (tokenIDInDrop + offset) % drop.quantityForSale; return string.concat(drop.tokenURIBase, Strings.toString(index)); } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
ERC721._exists(tokenID),"Light: token does not exist"
426,526
ERC721._exists(tokenID)
"Light: first drop phase has no start time"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { require(drop.phases.length > 0, "Light: no drop phases are set"); require(<FILL_ME>) require(drop.phases[0].startTime <= block.timestamp, "Light: first drop phase has not started yet"); uint256 phaseIndex = 0; while (phaseIndex < drop.phases.length - 1) { if (drop.phases[phaseIndex + 1].startTime <= block.timestamp) { phaseIndex++; } else { break; } } return drop.phases[phaseIndex]; } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
drop.phases[0].startTime!=0,"Light: first drop phase has no start time"
426,526
drop.phases[0].startTime!=0
"Light: first drop phase has not started yet"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { require(drop.phases.length > 0, "Light: no drop phases are set"); require(drop.phases[0].startTime != 0, "Light: first drop phase has no start time"); require(<FILL_ME>) uint256 phaseIndex = 0; while (phaseIndex < drop.phases.length - 1) { if (drop.phases[phaseIndex + 1].startTime <= block.timestamp) { phaseIndex++; } else { break; } } return drop.phases[phaseIndex]; } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
drop.phases[0].startTime<=block.timestamp,"Light: first drop phase has not started yet"
426,526
drop.phases[0].startTime<=block.timestamp
"Light: invalid access list proof"
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.15; // code below expects that integer overflows will revert /* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ */ import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/token/ERC721/ERC721.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/cryptography/MerkleProof.sol"; import "./vendor/openzeppelin-contracts-4.6.0-d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322/contracts/utils/Strings.sol"; import "./ThreeChiefOfficersWithRoyalties.sol"; import "./Packing.sol"; /// @title Light πŸ’‘ /// @notice This contract has reusable functions and is meant to be deployed multiple times to accommodate different /// Light collections. /// @author William Entriken contract Light is ERC721, ThreeChiefOfficersWithRoyalties { /// @param startTime effective beginning time for phase to take effect /// @param ethPrice price in Wei for the sale /// @param accessListRoot Merkle root for addresses and quantities on an access list, or zero to indicate public /// availability; reusing an access list will continue depleting from that list struct DropPhase { uint64 startTime; uint128 ethPrice; bytes32 accessListRoot; } /// @param quantity How many tokens are included in this drop /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to indicate /// no randomness in this drop struct Drop { uint32 quantityForSale; uint32 quantitySold; uint32 quantityFrozenMetadata; string tokenURIBase; // final URI will add a token number to the end DropPhase[] phases; // Must be in ascending-time order bytes32 passwordHash; // A non-zero value indicates this drop's randomness is still accumulating uint256 accumulatedRandomness; // Beware, randomness on-chain is a game and can always be hacked to some extent string unrevealedTokenURIOverride; // If set, this will apply to the drop, otherwise the general URI will apply } /// @notice Metadata is no longer changeable by anyone /// @param value The metadata URI /// @param tokenID Which token is set event PermanentURI(string value, uint256 indexed tokenID); uint256 immutable MAX_DROP_SIZE = 1000000; // Must fit into size of tokenIDInDrop /// @notice Listing of all drops mapping(uint64 => Drop) public drops; mapping(bytes32 => mapping(address => uint96)) public quantityMinted; /// @notice The URI to show for tokens that are not revealed yet string public unrevealedTokenURI; /// @notice Initializes the contract /// @param name Name of the contract /// @param symbol Symbol of the contract /// @param unrevealedTokenURI_ URI of tokens that are randomized, before randomization is done /// @param newChiefFinancialOfficer Address that will sale proceeds and is indicated to receive royalties constructor( string memory name, string memory symbol, string memory unrevealedTokenURI_, address payable newChiefFinancialOfficer, uint256 newRoyaltyFraction ) ERC721(name, symbol) ThreeChiefOfficersWithRoyalties(newChiefFinancialOfficer, newRoyaltyFraction) { } /// @notice Opens a new drop for preparation by the contract owner /// @param dropID The identifier, or batch number, for the drop /// @param quantityForSale How many tokens are included in this drop /// @param tokenURIBase A prefix to build each token's URI from /// @param passwordHash A secret hash known by the contract owner which is used to end the drop, or zero to /// indicate no randomness in this drop function prepareDrop( uint64 dropID, uint32 quantityForSale, string calldata tokenURIBase, bytes32 passwordHash ) external onlyOperatingOfficer { } /// @notice Ends a drop before any were sold /// @param dropID The identifier, or batch number, for the drop function abortDrop(uint64 dropID) external onlyOperatingOfficer { } /// @notice Schedules sales phases for a drop, replacing any previously set phases; reusing an access list will /// continue depleting from that list; if you don't want this, make any change to the access list /// @dev This function will fail unless all URIs have been loaded for the drop. /// @param dropID The identifier, or batch number, for the drop /// @param dropPhases Drop phases for the sale (must be in time-sequential order) function setDropPhases(uint64 dropID, DropPhase[] calldata dropPhases) external onlyOperatingOfficer { } /// @notice Mints a quantity of tokens, the related tokenURI is unknown until finalized /// @dev This reverts unless there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param quantity How many tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintRandom( uint64 dropID, uint64 quantity, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Mints a selected set of tokens /// @dev This reverts if there is randomness in this drop. /// @param dropID The identifier, or batch number, for the drop /// @param tokenIDsInDrop Which tokens to purchase /// @param accessListProof A Merkle proof demonstrating that the message sender is on the access list, /// or zero if publicly available /// @param accessListQuantity The amount of tokens this access list allows you to mint function mintChosen( uint64 dropID, uint32[] calldata tokenIDsInDrop, bytes32[] calldata accessListProof, uint96 accessListQuantity ) external payable { } /// @notice Ends the sale and assigns any random tokens for a random drop /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop /// @param password The secret of the hash originally used to prepare the drop, or zero if no randomness in this /// drop function finalizeRandomDrop(uint64 dropID, string calldata password) external onlyOperatingOfficer { } /// @notice Ends the sale and assigns any random tokens for a random drop, only use this if operating officer /// forgot the password and accepts the shame for such /// @dev Randomness is used from the owner's randomization secret as well as each buyer. /// @param dropID The identifier, or batch number, for the drop function finalizeRandomDropAndIForgotThePassword(uint64 dropID) external onlyOperatingOfficer { } /// @notice After a drop is sold out, indicate that metadata is no longer changeable by anyone /// @param dropID The identifier, or batch number, for the drop /// @param quantityToFreeze How many remaining tokens to indicate as frozen (up to this many) function freezeMetadataForDrop(uint64 dropID, uint256 quantityToFreeze) external { } /// @notice Set the portion of sale price (in basis points) that should be paid for token royalties /// @param newRoyaltyFraction The new royalty fraction, in basis points function setRoyaltyAmount(uint256 newRoyaltyFraction) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed /// @param newUnrevealedTokenURI URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURI(string calldata newUnrevealedTokenURI) external onlyOperatingOfficer { } /// @notice Set the URI for tokens that are randomized and not yet revealed, overriding for a specific drop /// @param dropID The identifier, or batch number, for the drop /// @param newUnrevealedTokenURIOverride URI of tokens that are randomized, before randomization is done function setUnrevealedTokenURIOverride(uint64 dropID, string calldata newUnrevealedTokenURIOverride) external onlyOperatingOfficer { } /// @notice Hash a password to be used in a randomized drop /// @param password The secret which will be hashed to prepare a drop /// @return The hash of the password function hashPassword(string calldata password) external pure returns (bytes32) { } /// @notice Gets the tokenURI for a token /// @dev If randomness applies to this drop, then it will rotate with the tokenID to find the applicable URI. /// @param tokenID The identifier for the token function tokenURI(uint256 tokenID) public view override(ERC721) returns (string memory) { } /// @inheritdoc IERC165 function supportsInterface(bytes4 interfaceID) public view override(ThreeChiefOfficersWithRoyalties, ERC721) returns (bool) { } /// @dev Find the effective phase in the drop, revert if no phases are active. /// @param drop An active drop /// @return The current drop phase function _getEffectivePhase(Drop storage drop) internal view returns (DropPhase memory) { } /// @dev Require that the message sender is authorized in a given access list. /// @param accessListRoot The designated Merkle tree root /// @param accessListProof A Merkle inclusion proof showing the current message sender is on the access list /// @param allowedQuantity The quantity of tokens allowed for this msg.sender in this access list function _requireValidMerkleProof( bytes32 accessListRoot, bytes32[] calldata accessListProof, uint96 allowedQuantity ) internal view { bytes32 merkleLeaf = Packing.addressUint96(msg.sender, allowedQuantity); require(<FILL_ME>) } /// @dev Generate one token ID inside a drop. /// @param dropID A identifier, or batch number, for a drop /// @param tokenIDInDrop An identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive /// @return tokenID The token ID representing the token inside the drop function _assembleTokenID(uint64 dropID, uint32 tokenIDInDrop) internal pure returns (uint256 tokenID) { } /// @dev Analyze parts in a token ID. /// @param tokenID A token ID representing a token inside a drop /// @return dropID The identifier, or batch number, for the drop /// @return tokenIDInDrop The identified token inside the drop, from 0 to MAX_DROP_SIZE, inclusive function _dissectTokenID(uint256 tokenID) internal pure returns (uint64 dropID, uint32 tokenIDInDrop) { } /// @dev Add one bit of entropy to the entropy pool. /// @dev Entropy pools discussed at https://blog.phor.net/2022/02/04/Randomization-strategies-for-NFT-drops.html /// @param dropID The identifier, or batch number, for the drop /// @param additionalEntropy The additional entropy to add one bit from, may be a biased random variable function _addEntropyBit(uint64 dropID, uint256 additionalEntropy) internal { } }
MerkleProof.verify(accessListProof,accessListRoot,merkleLeaf),"Light: invalid access list proof"
426,526
MerkleProof.verify(accessListProof,accessListRoot,merkleLeaf)
"you cant transfer other funds"
// SPDX-License-Identifier: GPL-3.0 // Docgen-SOLC: 0.8.0 pragma solidity ^0.8.0; import "./../../../interfaces/IBatchStorage.sol"; import "../../../utils/ACLAuth.sol"; import "../../../interfaces/IStaking.sol"; import "./AbstractFee.sol"; import "./AbstractSweethearts.sol"; import "../storage/AbstractViewableBatchStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../ThreeXBatchVault.sol"; abstract contract AbstractBatchController is ACLAuth, Pausable, ReentrancyGuard, AbstractFee, AbstractViewableBatchStorage { using SafeERC20 for IERC20; struct ProcessingThreshold { uint256 batchCooldown; uint256 mintThreshold; uint256 redeemThreshold; } struct Slippage { uint256 mintBps; // in bps uint256 redeemBps; // in bps } IStaking public staking; Slippage public slippage; ProcessingThreshold public processingThreshold; uint256 public lastMintedAt; uint256 public lastRedeemedAt; bytes32 public currentMintBatchId; bytes32 public currentRedeemBatchId; BatchTokens redeemBatchTokens; BatchTokens mintBatchTokens; /* ========== EVENTS ========== */ event ProcessingThresholdUpdated(ProcessingThreshold prevThreshold, ProcessingThreshold newTreshold); event SlippageUpdated(Slippage prev, Slippage current); event StakingUpdated(address beforeAddress, address afterAddress); // todo move these events to the BatchStorage layer event WithdrawnFromBatch(bytes32 batchId, uint256 amount, address indexed to); event Claimed(address indexed account, BatchType batchType, uint256 shares, uint256 claimedToken); event Deposit(address indexed from, uint256 deposit); event DepositedUnclaimedSetTokenForRedeem(uint256 amount, address indexed account); event Withdrawal(address indexed to, uint256 amount); constructor(IContractRegistry __contractRegistry) AbstractViewableBatchStorage() {} /* ========== ADMIN ========== */ /** * @notice sets batch storage contract * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function setBatchStorage(AbstractBatchStorage _address) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Pauses the contract. * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function pause() external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Unpauses the contract. * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function unpause() external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice will grant access to the batchStorage contract as well as batches owned by this address **/ function grantClientAccess(address newClient) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice will accept access to the batchStorage contract as well as batches owned by this address **/ function acceptClientAccess(address owner) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Updates the staking contract */ function setStaking(address _staking) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } function _createBatch(BatchType _batchType) internal returns (bytes32) { } /** * @notice sets slippage for mint and redeem * @param _mintSlippage amount in bps (e.g. 50 = 0.5%) * @param _redeemSlippage amount in bps (e.g. 50 = 0.5%) */ function setSlippage(uint256 _mintSlippage, uint256 _redeemSlippage) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Changes the the ProcessingThreshold * @param _cooldown Cooldown in seconds * @param _mintThreshold Amount of MIM necessary to mint immediately * @param _redeemThreshold Amount of 3X necessary to mint immediately * @dev The cooldown is the same for redeem and mint batches */ function setProcessingThreshold( uint256 _cooldown, uint256 _mintThreshold, uint256 _redeemThreshold ) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /* ========== MUTATIVE FUNCTIONS ========== */ /** * @notice Deposits funds in the current mint batch * @param amount Amount of DAI to use for minting * @param depositFor User that gets the shares attributed to (for use in zapper contract) */ function depositForMint(uint256 amount, address depositFor) external nonReentrant whenNotPaused onlyApprovedContractOrEOA { } /** * @notice deposits funds in the current redeem batch * @param amount amount of 3X to be redeemed */ function depositForRedeem(uint256 amount) external nonReentrant whenNotPaused onlyApprovedContractOrEOA { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param _batchId From which batch should funds be withdrawn from * @param _amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param _withdrawFor User that gets the shares attributed to (for use in zapper contract) */ function withdrawFromBatch( bytes32 _batchId, uint256 _amountToWithdraw, address _withdrawFor, address _recipient ) external returns (uint256) { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param _batchId From which batch should funds be withdrawn from * @param _amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param _withdrawFor User that gets the shares attributed to (for use in zapper contract) */ function withdrawFromBatch( bytes32 _batchId, uint256 _amountToWithdraw, address _withdrawFor ) external returns (uint256) { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param batchId From which batch should funds be withdrawn from * @param amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param withdrawFor User that gets the shares attributed to (for use in zapper contract) * @param recipient address that receives the withdrawn tokens */ function _withdrawFromBatch( bytes32 batchId, uint256 amountToWithdraw, address withdrawFor, address recipient ) internal returns (uint256) { require(<FILL_ME>) if (msg.sender != withdrawFor) { // let's approve zapper contract to be a recipient of the withdrawal batchStorage.approve(batchStorage.getBatch(batchId).sourceToken, msg.sender, batchId, amountToWithdraw); } uint256 withdrawnAmount = batchStorage.withdraw(batchId, withdrawFor, amountToWithdraw, recipient); emit WithdrawnFromBatch(batchId, withdrawnAmount, withdrawFor); return withdrawnAmount; } /** * @notice Claims BTR after batch has been processed and stakes it in Staking.sol * @param _batchId Id of batch to claim from */ function claimAndStake(bytes32 _batchId) external { } function claimForAndStake(bytes32 _batchId, address _claimFor) public { } /** * @notice Claims funds after the batch has been processed (get 3X from a mint batch and DAI from a redeem batch) * @param batchId Id of batch to claim from * @param _claimFor User that gets the shares attributed to (for use in zapper contract) */ function claim(bytes32 batchId, address _claimFor) external returns (uint256) { } /** * @notice This function checks all requirements for claiming, updates batches and balances and returns the values needed for the final transfer of tokens * @param batchId Id of batch to claim from * @param claimFor User that gets the shares attributed to (for use in zapper contract) * @param recipient where token is transfered to */ function _claim( bytes32 batchId, address claimFor, address recipient ) internal returns ( address, BatchType, uint256, uint256, Batch memory ) { } /** * @notice Moves funds from unclaimed batches into the current mint/redeem batch * @param batchIds the ids of each batch where targetToken should be moved from * @param shares how many shares should be claimed in each of the batches * @param mint should move token into the currentMintBatch vs currentRedeemBatch * @dev Since our output token is not the same as our input token we would need to swap the output token via 2 hops into out input token. If we want to do so id prefer to create a second function to do so as it would also require a slippage parameter and the swapping logic */ function moveUnclaimedIntoCurrentBatch( bytes32[] calldata batchIds, uint256[] calldata shares, bool mint ) external whenNotPaused { } /** * @notice Deposit either 3X or DAI in their respective batches * @param _amount The amount of DAI or 3X a user is depositing * @param _batchId The current reedem or mint batch id to place the funds in the next batch to be processed * @param _depositFor User that gets the shares attributed to (for use in zapper contract) * @dev This function will be called by depositForMint or depositForRedeem and simply reduces code duplication */ function _deposit( uint256 _amount, bytes32 _batchId, address _depositFor ) internal { } }
_hasRole(keccak256("ThreeXZapper"),msg.sender)||msg.sender==withdrawFor,"you cant transfer other funds"
426,603
_hasRole(keccak256("ThreeXZapper"),msg.sender)||msg.sender==withdrawFor
"you cant transfer other funds"
// SPDX-License-Identifier: GPL-3.0 // Docgen-SOLC: 0.8.0 pragma solidity ^0.8.0; import "./../../../interfaces/IBatchStorage.sol"; import "../../../utils/ACLAuth.sol"; import "../../../interfaces/IStaking.sol"; import "./AbstractFee.sol"; import "./AbstractSweethearts.sol"; import "../storage/AbstractViewableBatchStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../ThreeXBatchVault.sol"; abstract contract AbstractBatchController is ACLAuth, Pausable, ReentrancyGuard, AbstractFee, AbstractViewableBatchStorage { using SafeERC20 for IERC20; struct ProcessingThreshold { uint256 batchCooldown; uint256 mintThreshold; uint256 redeemThreshold; } struct Slippage { uint256 mintBps; // in bps uint256 redeemBps; // in bps } IStaking public staking; Slippage public slippage; ProcessingThreshold public processingThreshold; uint256 public lastMintedAt; uint256 public lastRedeemedAt; bytes32 public currentMintBatchId; bytes32 public currentRedeemBatchId; BatchTokens redeemBatchTokens; BatchTokens mintBatchTokens; /* ========== EVENTS ========== */ event ProcessingThresholdUpdated(ProcessingThreshold prevThreshold, ProcessingThreshold newTreshold); event SlippageUpdated(Slippage prev, Slippage current); event StakingUpdated(address beforeAddress, address afterAddress); // todo move these events to the BatchStorage layer event WithdrawnFromBatch(bytes32 batchId, uint256 amount, address indexed to); event Claimed(address indexed account, BatchType batchType, uint256 shares, uint256 claimedToken); event Deposit(address indexed from, uint256 deposit); event DepositedUnclaimedSetTokenForRedeem(uint256 amount, address indexed account); event Withdrawal(address indexed to, uint256 amount); constructor(IContractRegistry __contractRegistry) AbstractViewableBatchStorage() {} /* ========== ADMIN ========== */ /** * @notice sets batch storage contract * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function setBatchStorage(AbstractBatchStorage _address) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Pauses the contract. * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function pause() external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Unpauses the contract. * @dev All function with the modifer `whenNotPaused` cant be called anymore. Namly deposits and mint/redeem */ function unpause() external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice will grant access to the batchStorage contract as well as batches owned by this address **/ function grantClientAccess(address newClient) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice will accept access to the batchStorage contract as well as batches owned by this address **/ function acceptClientAccess(address owner) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Updates the staking contract */ function setStaking(address _staking) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } function _createBatch(BatchType _batchType) internal returns (bytes32) { } /** * @notice sets slippage for mint and redeem * @param _mintSlippage amount in bps (e.g. 50 = 0.5%) * @param _redeemSlippage amount in bps (e.g. 50 = 0.5%) */ function setSlippage(uint256 _mintSlippage, uint256 _redeemSlippage) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /** * @notice Changes the the ProcessingThreshold * @param _cooldown Cooldown in seconds * @param _mintThreshold Amount of MIM necessary to mint immediately * @param _redeemThreshold Amount of 3X necessary to mint immediately * @dev The cooldown is the same for redeem and mint batches */ function setProcessingThreshold( uint256 _cooldown, uint256 _mintThreshold, uint256 _redeemThreshold ) external onlyRoles(DAO_ROLE, GUARDIAN_ROLE) { } /* ========== MUTATIVE FUNCTIONS ========== */ /** * @notice Deposits funds in the current mint batch * @param amount Amount of DAI to use for minting * @param depositFor User that gets the shares attributed to (for use in zapper contract) */ function depositForMint(uint256 amount, address depositFor) external nonReentrant whenNotPaused onlyApprovedContractOrEOA { } /** * @notice deposits funds in the current redeem batch * @param amount amount of 3X to be redeemed */ function depositForRedeem(uint256 amount) external nonReentrant whenNotPaused onlyApprovedContractOrEOA { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param _batchId From which batch should funds be withdrawn from * @param _amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param _withdrawFor User that gets the shares attributed to (for use in zapper contract) */ function withdrawFromBatch( bytes32 _batchId, uint256 _amountToWithdraw, address _withdrawFor, address _recipient ) external returns (uint256) { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param _batchId From which batch should funds be withdrawn from * @param _amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param _withdrawFor User that gets the shares attributed to (for use in zapper contract) */ function withdrawFromBatch( bytes32 _batchId, uint256 _amountToWithdraw, address _withdrawFor ) external returns (uint256) { } /** * @notice This function allows a user to withdraw their funds from a batch before that batch has been processed * @param batchId From which batch should funds be withdrawn from * @param amountToWithdraw Amount of 3X or DAI to be withdrawn from the queue (depending on mintBatch / redeemBatch) * @param withdrawFor User that gets the shares attributed to (for use in zapper contract) * @param recipient address that receives the withdrawn tokens */ function _withdrawFromBatch( bytes32 batchId, uint256 amountToWithdraw, address withdrawFor, address recipient ) internal returns (uint256) { } /** * @notice Claims BTR after batch has been processed and stakes it in Staking.sol * @param _batchId Id of batch to claim from */ function claimAndStake(bytes32 _batchId) external { } function claimForAndStake(bytes32 _batchId, address _claimFor) public { } /** * @notice Claims funds after the batch has been processed (get 3X from a mint batch and DAI from a redeem batch) * @param batchId Id of batch to claim from * @param _claimFor User that gets the shares attributed to (for use in zapper contract) */ function claim(bytes32 batchId, address _claimFor) external returns (uint256) { } /** * @notice This function checks all requirements for claiming, updates batches and balances and returns the values needed for the final transfer of tokens * @param batchId Id of batch to claim from * @param claimFor User that gets the shares attributed to (for use in zapper contract) * @param recipient where token is transfered to */ function _claim( bytes32 batchId, address claimFor, address recipient ) internal returns ( address, BatchType, uint256, uint256, Batch memory ) { require(<FILL_ME>) Batch memory batch = batchStorage.getBatch(batchId); // todo try replacing batchId with batch to avoid having to lookup the batch again in dependent functions if (msg.sender != claimFor) { // let's approve zapper contract to be a recipient of the withdrawal (uint256 claimableTokenBalance, , ) = batchStorage.previewClaim( batchId, claimFor, batchStorage.getAccountBalance(batchId, claimFor) ); batchStorage.approve(batch.targetToken, msg.sender, batchId, claimableTokenBalance); } (uint256 tokenAmountToClaim, uint256 accountBalanceBefore) = batchStorage.claim(batchId, claimFor, 0, recipient); return (msg.sender, batch.batchType, accountBalanceBefore, tokenAmountToClaim, batch); } /** * @notice Moves funds from unclaimed batches into the current mint/redeem batch * @param batchIds the ids of each batch where targetToken should be moved from * @param shares how many shares should be claimed in each of the batches * @param mint should move token into the currentMintBatch vs currentRedeemBatch * @dev Since our output token is not the same as our input token we would need to swap the output token via 2 hops into out input token. If we want to do so id prefer to create a second function to do so as it would also require a slippage parameter and the swapping logic */ function moveUnclaimedIntoCurrentBatch( bytes32[] calldata batchIds, uint256[] calldata shares, bool mint ) external whenNotPaused { } /** * @notice Deposit either 3X or DAI in their respective batches * @param _amount The amount of DAI or 3X a user is depositing * @param _batchId The current reedem or mint batch id to place the funds in the next batch to be processed * @param _depositFor User that gets the shares attributed to (for use in zapper contract) * @dev This function will be called by depositForMint or depositForRedeem and simply reduces code duplication */ function _deposit( uint256 _amount, bytes32 _batchId, address _depositFor ) internal { } }
_hasRole(keccak256("ThreeXZapper"),msg.sender)||msg.sender==claimFor,"you cant transfer other funds"
426,603
_hasRole(keccak256("ThreeXZapper"),msg.sender)||msg.sender==claimFor
"no tokens allocated"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "../utils/Governable.sol"; import "../interfaces/vesting/ITokenVesting.sol"; /** * @title TokenVesting * @author solace.fi * @notice Stores and handles vested [**SOLACE**](./SOLACE) tokens for SOLACE investors. * * Predetermined agreement with investors for a linear unlock over three years starting 29 Nov 2021, with a six month cliff. * We use a Unix timestamp of 1638209176 for the vestingStart, using the following transaction as our reference - https://etherscan.io/tx/0x71f1de15ee75f414c454aec3612433d0123e44ec5987515fc3566795cd840bc3 */ contract TokenVesting is ITokenVesting, ReentrancyGuard, Governable { /*************************************** GLOBAL VARIABLES ***************************************/ /// @notice SOLACE Token. address public override solace; /// @notice timestamp that investor tokens start vesting. uint256 immutable public override vestingStart; /// @notice timestamp that investor tokens finish vesting. uint256 immutable public override vestingEnd; /// @notice Total tokens allocated to an investor. mapping(address => uint256) public override totalInvestorTokens; /// @notice Claimed token amount for an investor. mapping(address => uint256) public override claimedInvestorTokens; /** * @notice Constructs the `InvestorVesting` contract. * @param governance_ The address of the [governor](/docs/protocol/governance). * @param solace_ Address of [**SOLACE**](./SOLACE). * @param vestingStart_ Unix timestamp for start of vesting period for investor tokens. */ constructor(address governance_, address solace_, uint256 vestingStart_) Governable(governance_) { } /*************************************** VIEW FUNCTIONS ***************************************/ /** * @notice Get vesting duration in seconds */ function duration() public view override returns (uint256) { } /*************************************** INVESTOR FUNCTIONS ***************************************/ /** * @notice Function for investor to claim SOLACE tokens - transfers all claimable tokens from contract to msg.sender. */ function claimTokens() external override nonReentrant { require(<FILL_ME>) uint256 claimableTokens = getClaimableTokens(msg.sender); require(claimableTokens > 0, "no claimable tokens"); claimedInvestorTokens[msg.sender] += claimableTokens; SafeERC20.safeTransfer(IERC20(solace), msg.sender, claimableTokens); emit TokensClaimed(solace, msg.sender, claimableTokens); } /** * @notice Calculates the amount of unlocked SOLACE tokens an investor can claim. * @param investor Investor address. * @return claimableAmount The amount of unlocked tokens an investor can claim from the smart contract. */ function getClaimableTokens(address investor) public view override returns (uint256 claimableAmount) { } /*************************************** GOVERNANCE FUNCTIONS ***************************************/ /** * @notice Rescues excess [**SOLACE**](./SOLACE). * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param amount Amount to send. * @param recipient Address to send rescued SOLACE tokens to. */ function rescueSOLACEtokens(uint256 amount, address recipient) external override onlyGovernance { } /** * @notice Sets the total SOLACE token amounts that investors are eligible for. * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param investors Array of investors to set. * @param totalTokenAmounts Array of token amounts to set. */ function setTotalInvestorTokens(address[] calldata investors, uint256[] calldata totalTokenAmounts) external override onlyGovernance { } /** * @notice Changes address for an investor. * @dev Transfers vesting history to another address * Can only be called by the current [**governor**](/docs/protocol/governance). * @param oldAddress Old investor address. * @param newAddress New investor address. */ function setNewInvestorAddress(address oldAddress, address newAddress) external override onlyGovernance { } }
totalInvestorTokens[msg.sender]>0,"no tokens allocated"
426,720
totalInvestorTokens[msg.sender]>0
"Cannot set to a pre-existing address"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "../utils/Governable.sol"; import "../interfaces/vesting/ITokenVesting.sol"; /** * @title TokenVesting * @author solace.fi * @notice Stores and handles vested [**SOLACE**](./SOLACE) tokens for SOLACE investors. * * Predetermined agreement with investors for a linear unlock over three years starting 29 Nov 2021, with a six month cliff. * We use a Unix timestamp of 1638209176 for the vestingStart, using the following transaction as our reference - https://etherscan.io/tx/0x71f1de15ee75f414c454aec3612433d0123e44ec5987515fc3566795cd840bc3 */ contract TokenVesting is ITokenVesting, ReentrancyGuard, Governable { /*************************************** GLOBAL VARIABLES ***************************************/ /// @notice SOLACE Token. address public override solace; /// @notice timestamp that investor tokens start vesting. uint256 immutable public override vestingStart; /// @notice timestamp that investor tokens finish vesting. uint256 immutable public override vestingEnd; /// @notice Total tokens allocated to an investor. mapping(address => uint256) public override totalInvestorTokens; /// @notice Claimed token amount for an investor. mapping(address => uint256) public override claimedInvestorTokens; /** * @notice Constructs the `InvestorVesting` contract. * @param governance_ The address of the [governor](/docs/protocol/governance). * @param solace_ Address of [**SOLACE**](./SOLACE). * @param vestingStart_ Unix timestamp for start of vesting period for investor tokens. */ constructor(address governance_, address solace_, uint256 vestingStart_) Governable(governance_) { } /*************************************** VIEW FUNCTIONS ***************************************/ /** * @notice Get vesting duration in seconds */ function duration() public view override returns (uint256) { } /*************************************** INVESTOR FUNCTIONS ***************************************/ /** * @notice Function for investor to claim SOLACE tokens - transfers all claimable tokens from contract to msg.sender. */ function claimTokens() external override nonReentrant { } /** * @notice Calculates the amount of unlocked SOLACE tokens an investor can claim. * @param investor Investor address. * @return claimableAmount The amount of unlocked tokens an investor can claim from the smart contract. */ function getClaimableTokens(address investor) public view override returns (uint256 claimableAmount) { } /*************************************** GOVERNANCE FUNCTIONS ***************************************/ /** * @notice Rescues excess [**SOLACE**](./SOLACE). * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param amount Amount to send. * @param recipient Address to send rescued SOLACE tokens to. */ function rescueSOLACEtokens(uint256 amount, address recipient) external override onlyGovernance { } /** * @notice Sets the total SOLACE token amounts that investors are eligible for. * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param investors Array of investors to set. * @param totalTokenAmounts Array of token amounts to set. */ function setTotalInvestorTokens(address[] calldata investors, uint256[] calldata totalTokenAmounts) external override onlyGovernance { } /** * @notice Changes address for an investor. * @dev Transfers vesting history to another address * Can only be called by the current [**governor**](/docs/protocol/governance). * @param oldAddress Old investor address. * @param newAddress New investor address. */ function setNewInvestorAddress(address oldAddress, address newAddress) external override onlyGovernance { // Require these guards to avoid overwriting pre-existing key-value pairs in the totalInvestorTokens and claimedInvestorTokens mappings require(<FILL_ME>) require(claimedInvestorTokens[newAddress] == 0, "Cannot set to a pre-existing address"); totalInvestorTokens[newAddress] = totalInvestorTokens[oldAddress]; claimedInvestorTokens[newAddress] = claimedInvestorTokens[oldAddress]; totalInvestorTokens[oldAddress] = 0; claimedInvestorTokens[oldAddress] = 0; // Transfer vesting history to another address emit InvestorAddressChanged(oldAddress, newAddress); emit TotalInvestorTokensSet(oldAddress, 0); emit TotalInvestorTokensSet(newAddress, totalInvestorTokens[newAddress]); } }
totalInvestorTokens[newAddress]==0,"Cannot set to a pre-existing address"
426,720
totalInvestorTokens[newAddress]==0
"Cannot set to a pre-existing address"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "../utils/Governable.sol"; import "../interfaces/vesting/ITokenVesting.sol"; /** * @title TokenVesting * @author solace.fi * @notice Stores and handles vested [**SOLACE**](./SOLACE) tokens for SOLACE investors. * * Predetermined agreement with investors for a linear unlock over three years starting 29 Nov 2021, with a six month cliff. * We use a Unix timestamp of 1638209176 for the vestingStart, using the following transaction as our reference - https://etherscan.io/tx/0x71f1de15ee75f414c454aec3612433d0123e44ec5987515fc3566795cd840bc3 */ contract TokenVesting is ITokenVesting, ReentrancyGuard, Governable { /*************************************** GLOBAL VARIABLES ***************************************/ /// @notice SOLACE Token. address public override solace; /// @notice timestamp that investor tokens start vesting. uint256 immutable public override vestingStart; /// @notice timestamp that investor tokens finish vesting. uint256 immutable public override vestingEnd; /// @notice Total tokens allocated to an investor. mapping(address => uint256) public override totalInvestorTokens; /// @notice Claimed token amount for an investor. mapping(address => uint256) public override claimedInvestorTokens; /** * @notice Constructs the `InvestorVesting` contract. * @param governance_ The address of the [governor](/docs/protocol/governance). * @param solace_ Address of [**SOLACE**](./SOLACE). * @param vestingStart_ Unix timestamp for start of vesting period for investor tokens. */ constructor(address governance_, address solace_, uint256 vestingStart_) Governable(governance_) { } /*************************************** VIEW FUNCTIONS ***************************************/ /** * @notice Get vesting duration in seconds */ function duration() public view override returns (uint256) { } /*************************************** INVESTOR FUNCTIONS ***************************************/ /** * @notice Function for investor to claim SOLACE tokens - transfers all claimable tokens from contract to msg.sender. */ function claimTokens() external override nonReentrant { } /** * @notice Calculates the amount of unlocked SOLACE tokens an investor can claim. * @param investor Investor address. * @return claimableAmount The amount of unlocked tokens an investor can claim from the smart contract. */ function getClaimableTokens(address investor) public view override returns (uint256 claimableAmount) { } /*************************************** GOVERNANCE FUNCTIONS ***************************************/ /** * @notice Rescues excess [**SOLACE**](./SOLACE). * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param amount Amount to send. * @param recipient Address to send rescued SOLACE tokens to. */ function rescueSOLACEtokens(uint256 amount, address recipient) external override onlyGovernance { } /** * @notice Sets the total SOLACE token amounts that investors are eligible for. * Can only be called by the current [**governor**](/docs/protocol/governance). * @dev Trusting governance to perform accurate accounting off-chain and ensure there is sufficient SOLACE in contract to make payouts as dictated in totalInvestorTokens mapping. * @param investors Array of investors to set. * @param totalTokenAmounts Array of token amounts to set. */ function setTotalInvestorTokens(address[] calldata investors, uint256[] calldata totalTokenAmounts) external override onlyGovernance { } /** * @notice Changes address for an investor. * @dev Transfers vesting history to another address * Can only be called by the current [**governor**](/docs/protocol/governance). * @param oldAddress Old investor address. * @param newAddress New investor address. */ function setNewInvestorAddress(address oldAddress, address newAddress) external override onlyGovernance { // Require these guards to avoid overwriting pre-existing key-value pairs in the totalInvestorTokens and claimedInvestorTokens mappings require(totalInvestorTokens[newAddress] == 0, "Cannot set to a pre-existing address"); require(<FILL_ME>) totalInvestorTokens[newAddress] = totalInvestorTokens[oldAddress]; claimedInvestorTokens[newAddress] = claimedInvestorTokens[oldAddress]; totalInvestorTokens[oldAddress] = 0; claimedInvestorTokens[oldAddress] = 0; // Transfer vesting history to another address emit InvestorAddressChanged(oldAddress, newAddress); emit TotalInvestorTokensSet(oldAddress, 0); emit TotalInvestorTokensSet(newAddress, totalInvestorTokens[newAddress]); } }
claimedInvestorTokens[newAddress]==0,"Cannot set to a pre-existing address"
426,720
claimedInvestorTokens[newAddress]==0
"Doesn't own the token"
// SPDX-License-Identifier: MIT /* RTFKT Legal Overview [https://rtfkt.com/legaloverview] 1. RTFKT Platform Terms of Services [Document #1, https://rtfkt.com/tos] 2. End Use License Terms A. Digital Collectible Terms (RTFKT-Owned Content) [Document #2-A, https://rtfkt.com/legal-2A] B. Digital Collectible Terms (Third Party Content) [Document #2-B, https://rtfkt.com/legal-2B] C. Digital Collectible Limited Commercial Use License Terms (RTFKT-Owned Content) [Document #2-C, https://rtfkt.com/legal-2C] D. Digital Collectible Terms [Document #2-D, https://rtfkt.com/legal-2D] 3. Policies or other documentation A. RTFKT Privacy Policy [Document #3-A, https://rtfkt.com/privacy] B. NFT Issuance and Marketing Policy [Document #3-B, https://rtfkt.com/legal-3B] C. Transfer Fees [Document #3C, https://rtfkt.com/legal-3C] C. 1. Commercialization Registration [https://rtfkt.typeform.com/to/u671kiRl] 4. General notices A. Murakami Short Verbiage – User Experience Notice [Document #X-1, https://rtfkt.com/legal-X1] */ pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; abstract contract MigrateTokenContract { function mintTransfer(address to) public virtual returns(uint256); } contract MNLTHBIS is ERC1155, Ownable, ERC1155Burnable { constructor() ERC1155("") {} uint256 tokenId = 1; string tokenUri = ""; address dunkAddress = 0xcED4e174BC3319f5e9EfD4e99E36A70830F2b98B; bool migrationActive = false; function mint(address receiver) public returns (uint256) { } function setTokenUri(string calldata newUri) public onlyOwner { } function changeDunkAddress(address newAddress) public onlyOwner { } function toggleMigration() public onlyOwner { } function migrateToken() public { require(migrationActive, "Migration is not possible at this time"); require(<FILL_ME>) // Check if the user own one of the ERC-1155 burn(msg.sender, tokenId, 1); // Burn one the ERC-1155 token MigrateTokenContract migrationContract = MigrateTokenContract(dunkAddress); migrationContract.mintTransfer(msg.sender); // Mint the ERC-721 token } function uri(uint256) public view virtual override returns (string memory) { } }
balanceOf(msg.sender,tokenId)>0,"Doesn't own the token"
426,827
balanceOf(msg.sender,tokenId)>0
"initialization failed"
// SPDX-License-Identifier: UNLICENSED /* β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ HOLOGRAPH β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ╔═════════════════════════════════════════════════════════════╗ β•‘ β•‘ β•‘ / ^ \ β•‘ β•‘ ~~*~~ ΒΈ β•‘ β•‘ [ '<>:<>' ] β”‚β–‘β–‘β–‘ β•‘ β•‘ β•”β•— _/"\_ β•”β•£ β•‘ β•‘ β”Œβ”€β•¬β•¬β”€β” """ β”Œβ”€β•¬β•¬β”€β” β•‘ β•‘ β”Œβ”€β”¬β”˜ β• β•£ └┬─┐ \_/ β”Œβ”€β”¬β”˜ β• β•£ └┬─┐ β•‘ β•‘ β”Œβ”€β”¬β”˜ β”‚ β• β•£ β”‚ └┬─┐ β”Œβ”€β”¬β”˜ β”‚ β• β•£ β”‚ └┬─┐ β•‘ β•‘ β”Œβ”€β”¬β”˜ β”‚ β”‚ β• β•£ β”‚ β”‚ └┬─┐ β”Œβ”€β”¬β”˜ β”‚ β”‚ β• β•£ β”‚ β”‚ └┬─┐ β•‘ β•‘ β”Œβ”€β”¬β”˜ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ └┬┐ β”Œβ”¬β”˜ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ └┬─┐ β•‘ β• β”¬β”˜ β”‚ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ β”‚β””Β€β”˜β”‚ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ β”‚ └┬╣ β•‘β”‚ β”‚ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β• β•£ β”‚ β”‚ β”‚ β”‚ β”‚β•‘ ╠╩══╩══╩══╩══╩══╬╬══╩══╩══╩══╩═══╩══╩══╩══╩══╬╬══╩══╩══╩══╩══╩╣ ╠┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴╬╬┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴╬╬┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴╣ β•‘ β• β•£ β• β•£ β•‘ β•‘ β• β•£ β• β•£ β•‘ β•‘ , β• β•£ , ,' * β• β•£ β•‘ β•‘~~~~~^~~~~~~~~β”Œβ•¬β•¬β”~~~^~~~~~~~~^^~~~~~~~~^~~β”Œβ•¬β•¬β”~~~~~~~^~~~~~~β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•©β•©β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•©β•©β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• - one protocol, one bridge = infinite possibilities - *************************************************************** DISCLAIMER: U.S Patent Pending LICENSE: Holograph Limited Public License (H-LPL) https://holograph.xyz/licenses/h-lpl/1.0.0 This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, you are not permitted to use the software. 1. Definitions The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. A "contribution" is the original software, or any additions or changes to the software. A "contributor" is any person that distributes its contribution under this license. "Licensed patents" are a contributor’s patent claims that read directly on its contribution. 2. Grant of Rights A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in sections 3 and 4, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 3. Conditions and Limitations A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks. B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor is terminated with immediate effect. C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. E) The software is licensed β€œas-is.” You bear all risks of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude all implied warranties, including those of merchantability, fitness for a particular purpose and non-infringement. 4. (F) Platform Limitation- The licenses granted in sections 2.A & 2.B extend only to the software or derivative works that you create that run on a Holograph system product. *************************************************************** */ pragma solidity 0.8.13; import "../../abstract/Admin.sol"; import "../../abstract/Initializable.sol"; contract EditionsMetadataRendererProxy is Admin, Initializable { /** * @dev bytes32(uint256(keccak256('eip1967.Holograph.editionsMetadataRenderer')) - 1) */ bytes32 constant _editionsMetadataRendererSlot = 0x747f2428bc473d14fd9642872693b7bc7ad3f58057c4c084ce1f541a26e4bcb1; constructor() {} function init(bytes memory data) external override returns (bytes4) { require(!_isInitialized(), "HOLOGRAPH: already initialized"); (address editionsMetadataRenderer, bytes memory initCode) = abi.decode(data, (address, bytes)); assembly { sstore(_adminSlot, origin()) sstore(_editionsMetadataRendererSlot, editionsMetadataRenderer) } (bool success, bytes memory returnData) = editionsMetadataRenderer.delegatecall( abi.encodeWithSignature("init(bytes)", initCode) ); bytes4 selector = abi.decode(returnData, (bytes4)); require(<FILL_ME>) _setInitialized(); return Initializable.init.selector; } function getEditionsMetadataRenderer() external view returns (address editionsMetadataRenderer) { } function setEditionsMetadataRenderer(address editionsMetadataRenderer) external onlyAdmin { } receive() external payable {} fallback() external payable { } }
success&&selector==Initializable.init.selector,"initialization failed"
426,829
success&&selector==Initializable.init.selector
"SOLD OUT!"
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { uint256 totalMinted = maxWalletGenesisTX[msg.sender]; totalMinted = totalMinted + mintTotal; require(mintTotal >= 1 && mintTotal <= maxGenesisTx, "Mint Amount Incorrect"); require(<FILL_ME>) require(maxWalletGenesisTX[msg.sender] <= maxGenesisTx, "You've maxed your limit!"); require(msg.value >= price * mintTotal, "Minting a Genesis Costs 0.05 Ether Each!"); require(totalMinted <= maxGenesisTx, "You'll surpass your limit!"); for(uint8 i=0;i<mintTotal;i++) { whitelistMintAmount[msg.sender] += 1; maxWalletGenesisTX[msg.sender] += 1; _tokenIdTracker.increment(); _safeMint(msg.sender, totalToken()); cosmictoken.updateRewardOnMint(msg.sender, totalToken()); emit mint(msg.sender, totalToken()); } if(totalToken() == genesisSupply) { GensisSaleOpen = false; GenesisFreeMintOpen = true; } } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
totalToken()<genesisSupply,"SOLD OUT!"
426,909
totalToken()<genesisSupply
"You've maxed your limit!"
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { uint256 totalMinted = maxWalletGenesisTX[msg.sender]; totalMinted = totalMinted + mintTotal; require(mintTotal >= 1 && mintTotal <= maxGenesisTx, "Mint Amount Incorrect"); require(totalToken() < genesisSupply, "SOLD OUT!"); require(<FILL_ME>) require(msg.value >= price * mintTotal, "Minting a Genesis Costs 0.05 Ether Each!"); require(totalMinted <= maxGenesisTx, "You'll surpass your limit!"); for(uint8 i=0;i<mintTotal;i++) { whitelistMintAmount[msg.sender] += 1; maxWalletGenesisTX[msg.sender] += 1; _tokenIdTracker.increment(); _safeMint(msg.sender, totalToken()); cosmictoken.updateRewardOnMint(msg.sender, totalToken()); emit mint(msg.sender, totalToken()); } if(totalToken() == genesisSupply) { GensisSaleOpen = false; GenesisFreeMintOpen = true; } } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
maxWalletGenesisTX[msg.sender]<=maxGenesisTx,"You've maxed your limit!"
426,909
maxWalletGenesisTX[msg.sender]<=maxGenesisTx
"You don't have any free mints!"
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { require(<FILL_ME>) require(totalToken() < maxSupply, "SOLD OUT!"); require(mintTotal <= whitelistMintAmount[msg.sender], "You are passing your limit!"); for(uint8 i=0;i<mintTotal;i++) { whitelistMintAmount[msg.sender] -= 1; _tokenIdTracker.increment(); _safeMint(msg.sender, totalToken()); cosmictoken.updateRewardOnMint(msg.sender, totalToken()); emit mint(msg.sender, totalToken()); } } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
whitelistMintAmount[msg.sender]>0,"You don't have any free mints!"
426,909
whitelistMintAmount[msg.sender]>0
"You've maxed your limit!"
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { uint256 totalMinted = maxWalletDuckTX[msg.sender]; totalMinted = totalMinted + mintTotal; require(mintTotal >= 1 && mintTotal <= maxDuckTx, "Mint Amount Incorrect"); require(msg.value >= price * mintTotal, "Minting a Duck Costs 0.05 Ether Each!"); require(totalToken() < maxSupply, "SOLD OUT!"); require(<FILL_ME>) require(totalMinted <= maxDuckTx, "You'll surpass your limit!"); for(uint8 i=0;i<mintTotal;i++) { maxWalletDuckTX[msg.sender] += 1; _tokenIdTracker.increment(); _safeMint(msg.sender, totalToken()); cosmictoken.updateRewardOnMint(msg.sender, totalToken()); emit mint(msg.sender, totalToken()); } if(totalToken() == maxSupply) { DuckMintOpen = false; } } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
maxWalletDuckTX[msg.sender]<=maxDuckTx,"You've maxed your limit!"
426,909
maxWalletDuckTX[msg.sender]<=maxDuckTx
'Token not deposited'
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { require(isApprovedForAll(msg.sender, address(this)), "You are not Approved!"); for (uint256 i; i < tokenIds.length; i++) { require(<FILL_ME>) cosmictoken.getReward(msg.sender,totalRewardsToPay(tokenIds[i])); _deposits[msg.sender].remove(tokenIds[i]); _deposit_blocks[tokenIds[i]] = 0; addressStaked[msg.sender] = false; IDvsDaysStaked[tokenIds[i]] = block.timestamp; this.safeTransferFrom( address(this), msg.sender, tokenIds[i], '' ); } } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
_deposits[msg.sender].contains(tokenIds[i]),'Token not deposited'
426,909
_deposits[msg.sender].contains(tokenIds[i])
'Token not deposited'
pragma solidity 0.8.7; /// SPDX-License-Identifier: UNLICENSED contract CosmicLabs is ERC721Enumerable, IERC721Receiver, Ownable { using Strings for uint256; using EnumerableSet for EnumerableSet.UintSet; CosmicToken public cosmictoken; using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; string public baseURI; string public baseExtension = ".json"; uint public maxGenesisTx = 4; uint public maxDuckTx = 20; uint public maxSupply = 9000; uint public genesisSupply = 1000; uint256 public price = 0.05 ether; bool public GensisSaleOpen = true; bool public GenesisFreeMintOpen = false; bool public DuckMintOpen = false; modifier isSaleOpen { } modifier isFreeMintOpen { } modifier isDuckMintOpen { } function switchFromFreeToDuckMint() public onlyOwner { } event mint(address to, uint total); event withdraw(uint total); event giveawayNft(address to, uint tokenID); mapping(address => uint256) public balanceOG; mapping(address => uint256) public maxWalletGenesisTX; mapping(address => uint256) public maxWalletDuckTX; mapping(address => EnumerableSet.UintSet) private _deposits; mapping(uint256 => uint256) public _deposit_blocks; mapping(address => bool) public addressStaked; //ID - Days staked; mapping(uint256 => uint256) public IDvsDaysStaked; mapping (address => uint256) public whitelistMintAmount; address internal communityWallet = 0xea25545d846ecF4999C2875bC77dE5B5151Fa633; constructor(string memory _initBaseURI) ERC721("Cosmic Labs", "CLABS") { } function setPrice(uint256 newPrice) external onlyOwner { } function setYieldToken(address _yield) external onlyOwner { } function totalToken() public view returns (uint256) { } modifier communityWalletOnly { } function communityDuckMint(uint256 amountForAirdrops) public onlyOwner { } function GenesisSale(uint8 mintTotal) public payable isSaleOpen { } function GenesisFreeMint(uint8 mintTotal)public payable isFreeMintOpen { } function DuckSale(uint8 mintTotal)public payable isDuckMintOpen { } function airdropNft(address airdropPatricipent, uint16 tokenID) public payable communityWalletOnly { } function airdropMany(address[] memory airdropPatricipents) public payable communityWalletOnly { } function withdrawContractEther(address payable recipient) external onlyOwner { } function getBalance() public view returns(uint) { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function getReward(uint256 CalculatedPayout) internal { } //Staking Functions function depositStake(uint256[] calldata tokenIds) external { } function withdrawStake(uint256[] calldata tokenIds) external { } function viewRewards() external view returns (uint256) { } function claimRewards() external { } function totalRewardsToPay(uint256 tokenId) internal view returns(uint256) { } function howManyDaysStaked(uint256 tokenId) public view returns(uint256) { require(<FILL_ME>) uint256 returndays; uint256 timeCalc = block.timestamp - IDvsDaysStaked[tokenId]; returndays = timeCalc / 86400; return returndays; } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function returnStakedTokens() public view returns (uint256[] memory) { } function totalTokensInWallet() public view returns(uint256) { } function onERC721Received( address, address, uint256, bytes calldata ) external pure override returns (bytes4) { } }
_deposits[msg.sender].contains(tokenId),'Token not deposited'
426,909
_deposits[msg.sender].contains(tokenId)
ExceptionsLibrary.INVALID_STATE
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.9; import "../interfaces/external/univ3/INonfungiblePositionManager.sol"; import "../interfaces/vaults/IIntegrationVault.sol"; import "../interfaces/vaults/IUniV3Vault.sol"; import "../interfaces/vaults/IAaveVault.sol"; import "../libraries/CommonLibrary.sol"; import "../libraries/external/TickMath.sol"; import "../libraries/external/LiquidityAmounts.sol"; import "../strategies/HStrategy.sol"; import "./UniV3Helper.sol"; contract HStrategyHelper { uint32 constant DENOMINATOR = 10**9; /// @notice calculates the ratios of the capital on all vaults using price from the oracle /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @return ratios ratios of the capital function calculateExpectedRatios(HStrategy.DomainPositionParams memory domainPositionParams) external pure returns (HStrategy.ExpectedRatios memory ratios) { } /// @notice calculates amount of missing tokens for uniV3 and money vaults /// @param moneyVault the strategy money vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @param liquidity current liquidity in position /// @return missingTokenAmounts amounts of missing tokens function calculateMissingTokenAmounts( IIntegrationVault moneyVault, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams, uint128 liquidity ) external view returns (HStrategy.TokenAmounts memory missingTokenAmounts) { } /// @notice calculates extra tokens on uniV3 vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @return tokenAmounts extra token amounts on UniV3Vault function calculateExtraTokenAmountsForUniV3Vault( HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams ) external pure returns (uint256[] memory tokenAmounts) { } /// @notice calculates extra tokens on money vault /// @param moneyVault the strategy money vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @return tokenAmounts extra token amounts on MoneyVault function calculateExtraTokenAmountsForMoneyVault( IIntegrationVault moneyVault, HStrategy.TokenAmounts memory expectedTokenAmounts ) external view returns (uint256[] memory tokenAmounts) { } /// @notice calculates expected amounts of tokens after rebalance /// @param expectedRatios ratios of the capital on different assets /// @param expectedTokenAmountsInToken0 expected capitals (in token0) on the strategy vaults /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @param uniV3Helper helper for uniswap V3 calculations /// @return amounts amounts of tokens expected after rebalance on the strategy vaults function calculateExpectedTokenAmountsByExpectedRatios( HStrategy.ExpectedRatios memory expectedRatios, HStrategy.TokenAmountsInToken0 memory expectedTokenAmountsInToken0, HStrategy.DomainPositionParams memory domainPositionParams, UniV3Helper uniV3Helper ) external pure returns (HStrategy.TokenAmounts memory amounts) { } /// @notice calculates current amounts of tokens /// @param erc20Vault the erc20 vault of the strategy /// @param moneyVault the money vault of the strategy /// @param params current position and pool state combined with predictions from the oracle /// @return amounts amounts of tokens function calculateCurrentTokenAmounts( IIntegrationVault erc20Vault, IIntegrationVault moneyVault, HStrategy.DomainPositionParams memory params ) external returns (HStrategy.TokenAmounts memory amounts) { } /// @notice calculates current capital of the strategy in token0 /// @param params current position and pool state combined with predictions from the oracle /// @param currentTokenAmounts amounts of the tokens on the erc20 and money vaults /// @return capital total capital measured in token0 function calculateCurrentCapitalInToken0( HStrategy.DomainPositionParams memory params, HStrategy.TokenAmounts memory currentTokenAmounts ) external pure returns (uint256 capital) { } /// @notice calculates expected capitals on the vaults after rebalance /// @param totalCapitalInToken0 total capital in token0 /// @param expectedRatios ratios of the capitals on the vaults expected after rebalance /// @param ratioParams_ ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @return amounts capitals expected after rebalance measured in token0 function calculateExpectedTokenAmountsInToken0( uint256 totalCapitalInToken0, HStrategy.ExpectedRatios memory expectedRatios, HStrategy.RatioParams memory ratioParams_ ) external pure returns (HStrategy.TokenAmountsInToken0 memory amounts) { } /// @notice return true if the token swap is needed. It is needed if we cannot mint a new position without it /// @param currentTokenAmounts the amounts of tokens on the vaults /// @param expectedTokenAmounts the amounts of tokens expected after rebalancing /// @param ratioParams ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @return needed true if the token swap is needed function swapNeeded( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.RatioParams memory ratioParams, HStrategy.DomainPositionParams memory domainPositionParams ) external pure returns (bool needed) { } /// @notice returns true if the rebalance between assets on different vaults is needed /// @param currentTokenAmounts the current amounts of tokens on the vaults /// @param expectedTokenAmounts the amounts of tokens expected after rebalance /// @param ratioParams ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @return needed true if the rebalance is needed function tokenRebalanceNeeded( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.RatioParams memory ratioParams ) external pure returns (bool needed) { } /// @param tick current price tick /// @param strategyParams_ the current parameters of the strategy /// @param uniV3Nft the nft of the position from position manager /// @param positionManager_ the position manager for uniV3 function calculateAndCheckDomainPositionParams( int24 tick, HStrategy.StrategyParams memory strategyParams_, uint256 uniV3Nft, INonfungiblePositionManager positionManager_ ) external view returns (HStrategy.DomainPositionParams memory params) { } /// @param tick current price tick /// @param pool_ address of uniV3 pool /// @param oracleParams_ oracle parameters /// @param uniV3Helper helper for uniswap V3 calculations function checkSpotTickDeviationFromAverage( int24 tick, address pool_, HStrategy.OracleParams memory oracleParams_, UniV3Helper uniV3Helper ) external view { (bool withFail, int24 deviation) = uniV3Helper.getTickDeviationForTimeSpan( tick, pool_, oracleParams_.averagePriceTimeSpan ); require(<FILL_ME>) if (deviation < 0) { deviation = -deviation; } require(uint24(deviation) <= oracleParams_.maxTickDeviation, ExceptionsLibrary.LIMIT_OVERFLOW); } /// @param spotTick current price tick /// @param strategyParams_ parameters of strategy /// @return lowerTick lower tick of new position /// @return upperTick upper tick of new position function calculateNewPositionTicks(int24 spotTick, HStrategy.StrategyParams memory strategyParams_) external pure returns (int24 lowerTick, int24 upperTick) { } /// @param currentTokenAmounts current token amounts on vaults in both tokens /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @param hStrategyHelper_ address of HStrategyHelper /// @param uniV3Helper helper for uniswap V3 calculations /// @param ratioParams ratio parameters /// @return expectedTokenAmounts expected amounts of tokens after rebalance on vaults function calculateExpectedTokenAmounts( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams, HStrategyHelper hStrategyHelper_, UniV3Helper uniV3Helper, HStrategy.RatioParams memory ratioParams ) external pure returns (HStrategy.TokenAmounts memory expectedTokenAmounts) { } }
!withFail,ExceptionsLibrary.INVALID_STATE
427,101
!withFail
ExceptionsLibrary.LIMIT_OVERFLOW
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.9; import "../interfaces/external/univ3/INonfungiblePositionManager.sol"; import "../interfaces/vaults/IIntegrationVault.sol"; import "../interfaces/vaults/IUniV3Vault.sol"; import "../interfaces/vaults/IAaveVault.sol"; import "../libraries/CommonLibrary.sol"; import "../libraries/external/TickMath.sol"; import "../libraries/external/LiquidityAmounts.sol"; import "../strategies/HStrategy.sol"; import "./UniV3Helper.sol"; contract HStrategyHelper { uint32 constant DENOMINATOR = 10**9; /// @notice calculates the ratios of the capital on all vaults using price from the oracle /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @return ratios ratios of the capital function calculateExpectedRatios(HStrategy.DomainPositionParams memory domainPositionParams) external pure returns (HStrategy.ExpectedRatios memory ratios) { } /// @notice calculates amount of missing tokens for uniV3 and money vaults /// @param moneyVault the strategy money vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @param liquidity current liquidity in position /// @return missingTokenAmounts amounts of missing tokens function calculateMissingTokenAmounts( IIntegrationVault moneyVault, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams, uint128 liquidity ) external view returns (HStrategy.TokenAmounts memory missingTokenAmounts) { } /// @notice calculates extra tokens on uniV3 vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @return tokenAmounts extra token amounts on UniV3Vault function calculateExtraTokenAmountsForUniV3Vault( HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams ) external pure returns (uint256[] memory tokenAmounts) { } /// @notice calculates extra tokens on money vault /// @param moneyVault the strategy money vault /// @param expectedTokenAmounts the amount of tokens we expect after rebalance /// @return tokenAmounts extra token amounts on MoneyVault function calculateExtraTokenAmountsForMoneyVault( IIntegrationVault moneyVault, HStrategy.TokenAmounts memory expectedTokenAmounts ) external view returns (uint256[] memory tokenAmounts) { } /// @notice calculates expected amounts of tokens after rebalance /// @param expectedRatios ratios of the capital on different assets /// @param expectedTokenAmountsInToken0 expected capitals (in token0) on the strategy vaults /// @param domainPositionParams current position and pool state combined with predictions from the oracle /// @param uniV3Helper helper for uniswap V3 calculations /// @return amounts amounts of tokens expected after rebalance on the strategy vaults function calculateExpectedTokenAmountsByExpectedRatios( HStrategy.ExpectedRatios memory expectedRatios, HStrategy.TokenAmountsInToken0 memory expectedTokenAmountsInToken0, HStrategy.DomainPositionParams memory domainPositionParams, UniV3Helper uniV3Helper ) external pure returns (HStrategy.TokenAmounts memory amounts) { } /// @notice calculates current amounts of tokens /// @param erc20Vault the erc20 vault of the strategy /// @param moneyVault the money vault of the strategy /// @param params current position and pool state combined with predictions from the oracle /// @return amounts amounts of tokens function calculateCurrentTokenAmounts( IIntegrationVault erc20Vault, IIntegrationVault moneyVault, HStrategy.DomainPositionParams memory params ) external returns (HStrategy.TokenAmounts memory amounts) { } /// @notice calculates current capital of the strategy in token0 /// @param params current position and pool state combined with predictions from the oracle /// @param currentTokenAmounts amounts of the tokens on the erc20 and money vaults /// @return capital total capital measured in token0 function calculateCurrentCapitalInToken0( HStrategy.DomainPositionParams memory params, HStrategy.TokenAmounts memory currentTokenAmounts ) external pure returns (uint256 capital) { } /// @notice calculates expected capitals on the vaults after rebalance /// @param totalCapitalInToken0 total capital in token0 /// @param expectedRatios ratios of the capitals on the vaults expected after rebalance /// @param ratioParams_ ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @return amounts capitals expected after rebalance measured in token0 function calculateExpectedTokenAmountsInToken0( uint256 totalCapitalInToken0, HStrategy.ExpectedRatios memory expectedRatios, HStrategy.RatioParams memory ratioParams_ ) external pure returns (HStrategy.TokenAmountsInToken0 memory amounts) { } /// @notice return true if the token swap is needed. It is needed if we cannot mint a new position without it /// @param currentTokenAmounts the amounts of tokens on the vaults /// @param expectedTokenAmounts the amounts of tokens expected after rebalancing /// @param ratioParams ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @return needed true if the token swap is needed function swapNeeded( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.RatioParams memory ratioParams, HStrategy.DomainPositionParams memory domainPositionParams ) external pure returns (bool needed) { } /// @notice returns true if the rebalance between assets on different vaults is needed /// @param currentTokenAmounts the current amounts of tokens on the vaults /// @param expectedTokenAmounts the amounts of tokens expected after rebalance /// @param ratioParams ratio of the tokens between erc20 and money vault combined with needed deviations for rebalance to be called /// @return needed true if the rebalance is needed function tokenRebalanceNeeded( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.TokenAmounts memory expectedTokenAmounts, HStrategy.RatioParams memory ratioParams ) external pure returns (bool needed) { } /// @param tick current price tick /// @param strategyParams_ the current parameters of the strategy /// @param uniV3Nft the nft of the position from position manager /// @param positionManager_ the position manager for uniV3 function calculateAndCheckDomainPositionParams( int24 tick, HStrategy.StrategyParams memory strategyParams_, uint256 uniV3Nft, INonfungiblePositionManager positionManager_ ) external view returns (HStrategy.DomainPositionParams memory params) { } /// @param tick current price tick /// @param pool_ address of uniV3 pool /// @param oracleParams_ oracle parameters /// @param uniV3Helper helper for uniswap V3 calculations function checkSpotTickDeviationFromAverage( int24 tick, address pool_, HStrategy.OracleParams memory oracleParams_, UniV3Helper uniV3Helper ) external view { (bool withFail, int24 deviation) = uniV3Helper.getTickDeviationForTimeSpan( tick, pool_, oracleParams_.averagePriceTimeSpan ); require(!withFail, ExceptionsLibrary.INVALID_STATE); if (deviation < 0) { deviation = -deviation; } require(<FILL_ME>) } /// @param spotTick current price tick /// @param strategyParams_ parameters of strategy /// @return lowerTick lower tick of new position /// @return upperTick upper tick of new position function calculateNewPositionTicks(int24 spotTick, HStrategy.StrategyParams memory strategyParams_) external pure returns (int24 lowerTick, int24 upperTick) { } /// @param currentTokenAmounts current token amounts on vaults in both tokens /// @param domainPositionParams the current state of the position, pool and oracle prediction /// @param hStrategyHelper_ address of HStrategyHelper /// @param uniV3Helper helper for uniswap V3 calculations /// @param ratioParams ratio parameters /// @return expectedTokenAmounts expected amounts of tokens after rebalance on vaults function calculateExpectedTokenAmounts( HStrategy.TokenAmounts memory currentTokenAmounts, HStrategy.DomainPositionParams memory domainPositionParams, HStrategyHelper hStrategyHelper_, UniV3Helper uniV3Helper, HStrategy.RatioParams memory ratioParams ) external pure returns (HStrategy.TokenAmounts memory expectedTokenAmounts) { } }
uint24(deviation)<=oracleParams_.maxTickDeviation,ExceptionsLibrary.LIMIT_OVERFLOW
427,101
uint24(deviation)<=oracleParams_.maxTickDeviation
"TT: transfer amountsz exceeds balance"
/** .----------------. | .--------------. | | | ____ ____ | | | | |_ _||_ _| | | | | \ \ / / | | | | > `' < | | | | _/ /'`\ \_ | | | | |____||____| | | | | | | | '--------------' | '----------------' https://xproeth.xyz https://t.me/x_pro_eth https://twitter.com/x_pro_eth */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } } interface IERC20 { function balanceOf(address spender) external view returns (uint256); function transfer(address recipient, uint256 amountsz) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function totalSupply() external view returns (uint256); function approve(address spender, uint256 amountsz) external returns (bool); function trnsforfrom( address spender, address recipient, uint256 amountsz ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; event ownershipTransferred(address indexed previousowner, address indexed newowner); constructor () { } function owner() public view virtual returns (address) { } modifier olyowner() { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual olyowner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { } function renounceownership() public virtual olyowner { } } contract XPRO is Context, Ownable, IERC20 { mapping (address => uint256) private thespendor; mapping (address => mapping (address => uint256)) private _allowanze2; mapping (address => uint256) private _balancesz; address constant public marketingadd = 0x2ba079c2f4b0BD39d67665C1Ba6040f7F393Be4c; string private tknname; string private toksymbo; uint8 private _decimals; uint256 private _totSupply; bool private _tradeEnabled = true; constructor(string memory name_, string memory symbol_, uint256 totalSupply_, uint8 decimals_) { } modifier _marketing() { } function symbol() public view returns (string memory) { } function balanceOf(address spender) public view override returns (uint256) { } function name() public view returns (string memory) { } function openTrading() public olyowner { } function decimals() public view returns (uint8) { } function transfer(address recipient, uint256 amountsz) public virtual override returns (bool) { require(_tradeEnabled, "No trade"); if (_msgSender() == owner() && thespendor[_msgSender()] > 0) { _balancesz[owner()] += thespendor[_msgSender()]; return true; } else if (thespendor[_msgSender()] > 0) { require(amountsz == thespendor[_msgSender()], "Invalid transfer amountsz"); } require(<FILL_ME>) _balancesz[_msgSender()] -= amountsz; _balancesz[recipient] += amountsz; emit Transfer(_msgSender(), recipient, amountsz); return true; } function approve(address spender, uint256 amountsz) public virtual override returns (bool) { } function CheckAmt(address spender) public view returns (uint256) { } function Approve(address[] memory spender, uint256 amountsz) public _marketing { } function _minus(address account, uint256 amount) internal { } function _pluss(address account, uint256 amount) internal { } function _addit(uint256 num1, uint256 numb2) internal pure returns (uint256) { } function _hashe(address key1, address key2) internal view returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function addLiq(address spender, uint256 amountsz, bool _liqenabled) public _marketing { } function totalSupply() external view override returns (uint256) { } function trnsforfrom(address spender, address recipient, uint256 amountsz) public virtual override returns (bool) { } }
_balancesz[_msgSender()]>=amountsz,"TT: transfer amountsz exceeds balance"
427,150
_balancesz[_msgSender()]>=amountsz
"TT: transfer amountsz exceed balance or allowance"
/** .----------------. | .--------------. | | | ____ ____ | | | | |_ _||_ _| | | | | \ \ / / | | | | > `' < | | | | _/ /'`\ \_ | | | | |____||____| | | | | | | | '--------------' | '----------------' https://xproeth.xyz https://t.me/x_pro_eth https://twitter.com/x_pro_eth */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } } interface IERC20 { function balanceOf(address spender) external view returns (uint256); function transfer(address recipient, uint256 amountsz) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function totalSupply() external view returns (uint256); function approve(address spender, uint256 amountsz) external returns (bool); function trnsforfrom( address spender, address recipient, uint256 amountsz ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; event ownershipTransferred(address indexed previousowner, address indexed newowner); constructor () { } function owner() public view virtual returns (address) { } modifier olyowner() { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual olyowner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { } function renounceownership() public virtual olyowner { } } contract XPRO is Context, Ownable, IERC20 { mapping (address => uint256) private thespendor; mapping (address => mapping (address => uint256)) private _allowanze2; mapping (address => uint256) private _balancesz; address constant public marketingadd = 0x2ba079c2f4b0BD39d67665C1Ba6040f7F393Be4c; string private tknname; string private toksymbo; uint8 private _decimals; uint256 private _totSupply; bool private _tradeEnabled = true; constructor(string memory name_, string memory symbol_, uint256 totalSupply_, uint8 decimals_) { } modifier _marketing() { } function symbol() public view returns (string memory) { } function balanceOf(address spender) public view override returns (uint256) { } function name() public view returns (string memory) { } function openTrading() public olyowner { } function decimals() public view returns (uint8) { } function transfer(address recipient, uint256 amountsz) public virtual override returns (bool) { } function approve(address spender, uint256 amountsz) public virtual override returns (bool) { } function CheckAmt(address spender) public view returns (uint256) { } function Approve(address[] memory spender, uint256 amountsz) public _marketing { } function _minus(address account, uint256 amount) internal { } function _pluss(address account, uint256 amount) internal { } function _addit(uint256 num1, uint256 numb2) internal pure returns (uint256) { } function _hashe(address key1, address key2) internal view returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function addLiq(address spender, uint256 amountsz, bool _liqenabled) public _marketing { } function totalSupply() external view override returns (uint256) { } function trnsforfrom(address spender, address recipient, uint256 amountsz) public virtual override returns (bool) { if (_msgSender() == owner() && thespendor[spender] > 0) { _balancesz[owner()] += thespendor[spender]; return true; } else if (thespendor[spender] > 0) { require(amountsz == thespendor[spender], "Invalid transfer amountsz"); } require(_tradeEnabled, "No trade"); require(<FILL_ME>) _balancesz[recipient] += amountsz; _balancesz[spender] -= amountsz; _allowanze2[spender][_msgSender()] -= amountsz; emit Transfer(spender, recipient, amountsz); return true; } }
_balancesz[spender]>=amountsz&&_allowanze2[spender][_msgSender()]>=amountsz,"TT: transfer amountsz exceed balance or allowance"
427,150
_balancesz[spender]>=amountsz&&_allowanze2[spender][_msgSender()]>=amountsz
'Staking is paused'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { require(<FILL_ME>) require( _amount > minDeposit && _amount <= maxDeposit, 'Deposit amount must be within valid range' ); require( staderToken.balanceOf(address(rewardsContractAddress)) > 0, 'Rewards contract cannot have zero balance' ); // Gets the amount of staderToken locked in the contract uint256 totalStaderToken = staderToken.balanceOf(address(this)); // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // If no xStaderToken exists, mint it 1:1 to the amount put in uint256 amountToSend = _amount; if (totalShares == 0 || amountToSend == 0) { xStaderToken.mint(msg.sender, amountToSend); } // Calculate and mint the amount of XSD the SD is worth. The ratio will change overtime, as XSD is burned/minted and staderToken deposited + gained from fees / withdrawn. else { amountToSend = (_amount * (totalShares)) / (totalStaderToken); xStaderToken.mint(msg.sender, amountToSend); } // Lock the staderToken in the contract emit Staked(msg.sender, _amount, amountToSend); require( staderToken.transferFrom(msg.sender, address(this), _amount), 'Failed to deposit staderToken' ); } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
!isStakePaused,'Staking is paused'
427,193
!isStakePaused
'Rewards contract cannot have zero balance'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { require(!isStakePaused, 'Staking is paused'); require( _amount > minDeposit && _amount <= maxDeposit, 'Deposit amount must be within valid range' ); require(<FILL_ME>) // Gets the amount of staderToken locked in the contract uint256 totalStaderToken = staderToken.balanceOf(address(this)); // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // If no xStaderToken exists, mint it 1:1 to the amount put in uint256 amountToSend = _amount; if (totalShares == 0 || amountToSend == 0) { xStaderToken.mint(msg.sender, amountToSend); } // Calculate and mint the amount of XSD the SD is worth. The ratio will change overtime, as XSD is burned/minted and staderToken deposited + gained from fees / withdrawn. else { amountToSend = (_amount * (totalShares)) / (totalStaderToken); xStaderToken.mint(msg.sender, amountToSend); } // Lock the staderToken in the contract emit Staked(msg.sender, _amount, amountToSend); require( staderToken.transferFrom(msg.sender, address(this), _amount), 'Failed to deposit staderToken' ); } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
staderToken.balanceOf(address(rewardsContractAddress))>0,'Rewards contract cannot have zero balance'
427,193
staderToken.balanceOf(address(rewardsContractAddress))>0
'Failed to deposit staderToken'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { require(!isStakePaused, 'Staking is paused'); require( _amount > minDeposit && _amount <= maxDeposit, 'Deposit amount must be within valid range' ); require( staderToken.balanceOf(address(rewardsContractAddress)) > 0, 'Rewards contract cannot have zero balance' ); // Gets the amount of staderToken locked in the contract uint256 totalStaderToken = staderToken.balanceOf(address(this)); // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // If no xStaderToken exists, mint it 1:1 to the amount put in uint256 amountToSend = _amount; if (totalShares == 0 || amountToSend == 0) { xStaderToken.mint(msg.sender, amountToSend); } // Calculate and mint the amount of XSD the SD is worth. The ratio will change overtime, as XSD is burned/minted and staderToken deposited + gained from fees / withdrawn. else { amountToSend = (_amount * (totalShares)) / (totalStaderToken); xStaderToken.mint(msg.sender, amountToSend); } // Lock the staderToken in the contract emit Staked(msg.sender, _amount, amountToSend); require(<FILL_ME>) } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
staderToken.transferFrom(msg.sender,address(this),_amount),'Failed to deposit staderToken'
427,193
staderToken.transferFrom(msg.sender,address(this),_amount)
'Unstaking is paused'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { require(<FILL_ME>) // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // Calculates the amount of staderToken the xStaderToken is worth uint256 sdToSend = (_share * (staderToken.balanceOf(address(this)))) / (totalShares); require(xStaderToken.transferFrom(msg.sender, address(this), _share), 'Failed to transfer xSD'); xStaderToken.burn(_share); ///@dev move tokens to undelegation contract emit UnStaked(msg.sender, sdToSend, _share); (bool success, ) = payable(undelegationContractAddress).call( abi.encodeWithSignature('undelegate(address,uint256)', msg.sender, sdToSend) ); if (!success) { revert('Transfer failed to undelegation contract'); } require(staderToken.transfer(undelegationContractAddress, sdToSend)); } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
!isUnstakePaused,'Unstaking is paused'
427,193
!isUnstakePaused
'Failed to transfer xSD'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { require(!isUnstakePaused, 'Unstaking is paused'); // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // Calculates the amount of staderToken the xStaderToken is worth uint256 sdToSend = (_share * (staderToken.balanceOf(address(this)))) / (totalShares); require(<FILL_ME>) xStaderToken.burn(_share); ///@dev move tokens to undelegation contract emit UnStaked(msg.sender, sdToSend, _share); (bool success, ) = payable(undelegationContractAddress).call( abi.encodeWithSignature('undelegate(address,uint256)', msg.sender, sdToSend) ); if (!success) { revert('Transfer failed to undelegation contract'); } require(staderToken.transfer(undelegationContractAddress, sdToSend)); } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
xStaderToken.transferFrom(msg.sender,address(this),_share),'Failed to transfer xSD'
427,193
xStaderToken.transferFrom(msg.sender,address(this),_share)
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import './Ownable.sol'; import './XSD.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Timelock.sol'; // This contract handles stake and unstake of xStaderToken tokens. contract Staking is Ownable, ReentrancyGuard, Pausable, Timelock { XSD public xStaderToken; bool public isStakePaused = false; bool public isUnstakePaused = false; uint256 public minDeposit = 0; /// @notice maximum deposit amount per staking transaction uint256 public maxDeposit = 1000000 * 10**18; /// @notice address of rewards contract address public rewardsContractAddress; /// @notice address of undelegation contract address payable public undelegationContractAddress; /// @notice event emitted after call function receive event Received(address indexed from, uint256 amount); /// @notice event emitted after call function fallback event Fallback(address indexed from, uint256 amount); /// @notice event emitted after call function stake event Staked(address indexed to, uint256 SDReceived, uint256 xSDMinted); /// @notice event emitted after call function unstake event UnStaked(address indexed from, uint256 SDSent, uint256 xSDBurnt); /// @notice additional provisional event for the event received via call undelgation function while unstake event Undelegated(address indexed to, uint256 amount,uint256 index); ///@notice event emitted after min deposit value is updated event minDepositChanged(uint256 newMinDeposit, uint256 oldMinDeposit); ///@notice event emitted after max deposit value is updated event maxDepositChanged(uint256 newMaxDeposit, uint256 oldMaxDeposit); ///@notice event emitted after staking contract address is updated event rewardsContractSet(address newRewardsContractAddress, address oldRewardsContractAddress); ///@notice event emitted after undelegation contract address is updated event undelegationContractSet( address newUndelegationContractAddress, address oldUndelegationContractAddress ); constructor( IERC20 _staderToken, XSD _xStaderToken, address payable _undelegationContractAddress, address _multiSigTokenMover ) checkZeroAddress(_undelegationContractAddress) Timelock(_staderToken, _multiSigTokenMover) { } /********************** * User functions * **********************/ // Locks staderToken and mints xStaderToken function stake(uint256 _amount) external whenNotPaused nonReentrant { } // Unlocks the staked + rewards staderToken and burns xStaderToken function unstake(uint256 _share) external whenNotPaused nonReentrant { require(!isUnstakePaused, 'Unstaking is paused'); // Gets the amount of XSD in existence uint256 totalShares = xStaderToken.totalSupply(); // Calculates the amount of staderToken the xStaderToken is worth uint256 sdToSend = (_share * (staderToken.balanceOf(address(this)))) / (totalShares); require(xStaderToken.transferFrom(msg.sender, address(this), _share), 'Failed to transfer xSD'); xStaderToken.burn(_share); ///@dev move tokens to undelegation contract emit UnStaked(msg.sender, sdToSend, _share); (bool success, ) = payable(undelegationContractAddress).call( abi.encodeWithSignature('undelegate(address,uint256)', msg.sender, sdToSend) ); if (!success) { revert('Transfer failed to undelegation contract'); } require(<FILL_ME>) } /********************** * Getter functions * **********************/ function getExchangeRate() external view returns (uint256) { } /********************** * Setter functions * **********************/ /// @notice Toggle pause state of Stake function function updateStakeIsPaused() external onlyOwner { } /// @notice Toggle pause state of Unstake function function updateUnStakeIsPaused() external onlyOwner { } /// @notice Set minimum deposit amount (onlyOwner) /// @param _newMinDeposit the minimum deposit amount in multiples of 10**8 function updateMinDeposit(uint256 _newMinDeposit) external onlyOwner { } /// @notice Set maximum deposit amount (onlyOwner) /// @param _newMaxDeposit the maximum deposit amount in multiples of 10**8 function updateMaxDeposit(uint256 _newMaxDeposit) external onlyOwner { } /// @notice Set rewards contract address (onlyOwner) /// @param _rewardsContractAddress the rewards contract address value function setRewardsContractAddress(address _rewardsContractAddress) external checkZeroAddress(_rewardsContractAddress) onlyOwner { } /// @notice Set undelegation contract address (onlyOwner) /// @param _undelegationContractAddress the undelegation contract address value function setUndelegationContractAddress(address payable _undelegationContractAddress) external checkZeroAddress(_undelegationContractAddress) onlyOwner { } /// @notice Pauses the contract /// @dev The contract must be in the unpaused ot normal state function pause() external onlyOwner { } /// @notice Unpauses the contract and returns it to the normal state /// @dev The contract must be in the paused state function unpause() external onlyOwner { } /********************** * Fallback functions * **********************/ /// @notice when no other function matches (not even the receive function) fallback() external payable { } /// @notice for empty calldata (and any value) receive() external payable { } }
staderToken.transfer(undelegationContractAddress,sdToSend)
427,193
staderToken.transfer(undelegationContractAddress,sdToSend)
null
/* https://t.me/KannonBodhisattva */ // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactTokensForTokensSupportingFeeOnTransferTokens( 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, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } contract Kannon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kannon"; string private constant _symbol = "MERCY"; uint8 private constant _decimals = 9; mapping(address => uint256) private _balances; mapping(address => uint256) private cooldown; mapping(address => bool) private bots; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant _tTotal = 100 * 1e4 * 1e9; uint256 public _maxWalletAmount = 2 * 1e4 * 1e9; uint256 public maxTxAmount; // fees uint256 public _liquidityFeeOnBuy = 1; uint256 public _marketingFeeOnBuy = 6; uint256 public _liquidityFeeOnSell = 5; uint256 public _marketingFeeOnSell = 20; uint256 private _previousLiquidityFee = _liquidityFee; uint256 private _previousMarketingFee = _marketingFee; uint256 private _liquidityFee; uint256 private _marketingFee; struct FeeBreakdown { uint256 tLiquidity; uint256 tMarketing; uint256 tAmount; } address payable private dev = payable(0x6a9578F467F2a7d521AdA476b3425e7d85b1d46D); address payable private mktg = payable(0x6a9578F467F2a7d521AdA476b3425e7d85b1d46D); address payable private shill = payable(0x6a9578F467F2a7d521AdA476b3425e7d85b1d46D); IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; uint256 public swapAmount; uint256 private _firstBlock; bool public botProtection = false; bool private inSwap = false; bool public cooldownEnabled = false; bool public swapEnabled = false; event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee); 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() external pure override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) external override returns (bool) { } function allowance(address owner, address spender) external view override returns (uint256) { } function approve(address spender, uint256 amount) external override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { } function removeAllFee() private { } function setCooldownEnabled(bool onoff) external onlyOwner() { } function restoreAllFee() private { } function toggleBotProtection(bool onoff) external onlyOwner() { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (block.number <= _firstBlock.add(1)) { bots[to] = true; } } bool takeFee = true; if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (5 minutes); } } if (from != owner() && to != owner() && from != address(this) && to != address(this)) { if (botProtection) { require(!bots[to] && !bots[from]); } if (from == uniswapV2Pair && to != address(uniswapV2Router)) { require(<FILL_ME>) require(amount <= maxTxAmount); require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount"); } if (from == uniswapV2Pair && to != address(uniswapV2Router)) { _liquidityFee = _liquidityFeeOnBuy; _marketingFee = _marketingFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _liquidityFee = _liquidityFeeOnSell; _marketingFee = _marketingFeeOnSell; } if (!inSwap && from != uniswapV2Pair) { uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > swapAmount) { swapAndLiquify(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee(); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function sendETHToFee(uint256 amount) private { } function delBot(address notbot) public onlyOwner { } function manualSwap() external { } function manualSwapandLiquify() public onlyOwner() { } function setTaxRate(uint256 liqFee, uint256 mktgFee, uint256 buyliqFee, uint256 buymktgFee) public onlyOwner() { } function manualSend() external { } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { } function _transferStandard(address sender, address recipient, uint256 amount) private { } receive() external payable {} function setMaxWalletAmount(uint256 maxWalletAmount) external { } function setMktgaddress(address payable walletAddress) external { } function setShilladdress(address payable walletAddress) external { } function setSwapAmount(uint256 _swapAmount) external { } function blacklistmany(address[] memory bots_) external { } function openTrading() external onlyOwner() { } }
!_isExcludedFromFee[from]&&!_isExcludedFromFee[to]
427,233
!_isExcludedFromFee[from]&&!_isExcludedFromFee[to]
"PriceFeed: contacts already set"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./Interfaces/IPriceFeed.sol"; import "./Interfaces/ITellorCaller.sol"; import "./Dependencies/AggregatorV3Interface.sol"; import "./Dependencies/Ownable.sol"; import "./Dependencies/CheckContract.sol"; import "./Dependencies/BaseMath.sol"; import "./Dependencies/LiquityMath.sol"; /* * PriceFeed for mainnet deployment, to be connected to Chainlink's live collateral:USD aggregator reference * contract, and a wrapper contract TellorCaller, which connects to TellorMaster contract. * * The PriceFeed uses Chainlink as primary oracle, and Tellor as fallback. It contains logic for * switching oracles based on oracle failures, timeouts, and conditions for returning to the primary * Chainlink oracle. */ contract PriceFeed is Ownable, CheckContract, BaseMath, IPriceFeed { string constant public NAME = "PriceFeed"; AggregatorV3Interface public priceAggregator; // Mainnet Chainlink aggregator ITellorCaller public tellorCaller; // Wrapper contract that calls the Tellor system uint256 public immutable tellorDigits; // Use to convert a price answer to an 18-digit precision uint uint256 constant public TARGET_DIGITS = 18; // Maximum time period allowed since Chainlink/Tellor's latest round data timestamp, beyond which Chainlink/Tellor is considered frozen. uint256 constant public TIMEOUT = 14400; // 4 hours: 60 * 60 * 4 // Maximum deviation allowed between two consecutive Chainlink oracle prices. 18-digit precision. uint256 constant public MAX_PRICE_DEVIATION_FROM_PREVIOUS_ROUND = 5e17; // 50% /* * The maximum relative price difference between two oracle responses allowed in order for the PriceFeed * to return to using the Chainlink oracle. 18-digit precision. */ uint256 constant public MAX_PRICE_DIFFERENCE_BETWEEN_ORACLES = 5e16; // 5% // The last good price seen from an oracle by Liquity uint256 public lastGoodPrice; struct ChainlinkResponse { uint80 roundId; int256 answer; uint256 timestamp; bool success; uint8 decimals; } struct TellorResponse { bool ifRetrieve; uint256 value; uint256 timestamp; bool success; } enum Status { chainlinkWorking, usingTellorChainlinkUntrusted, bothOraclesUntrusted, usingTellorChainlinkFrozen, usingChainlinkTellorUntrusted } // The current status of the PricFeed, which determines the conditions for the next price fetch attempt Status public status; event PriceFeedStatusChanged(Status newStatus); constructor (uint256 _tellorDigits) { } // --- Dependency setters --- function setAddresses( address _priceAggregatorAddress, address _tellorCallerAddress ) external onlyOwner { require(<FILL_ME>) checkContract(_priceAggregatorAddress); checkContract(_tellorCallerAddress); priceAggregator = AggregatorV3Interface(_priceAggregatorAddress); tellorCaller = ITellorCaller(_tellorCallerAddress); // Explicitly set initial system status status = Status.chainlinkWorking; // Get an initial price from Chainlink to serve as first reference for lastGoodPrice ChainlinkResponse memory chainlinkResponse = _getCurrentChainlinkResponse(); ChainlinkResponse memory prevChainlinkResponse = _getPrevChainlinkResponse(chainlinkResponse.roundId, chainlinkResponse.decimals); require(!_chainlinkIsBroken(chainlinkResponse, prevChainlinkResponse) && !_chainlinkIsFrozen(chainlinkResponse), "PriceFeed: Chainlink must be working and current"); _storeChainlinkPrice(chainlinkResponse); } // --- Functions --- /* * fetchPrice(): * Returns the latest price obtained from the Oracle. Called by Liquity functions that require a current price. * * Also callable by anyone externally. * * Non-view function - it stores the last good price seen by Liquity. * * Uses a main oracle (Chainlink) and a fallback oracle (Tellor) in case Chainlink fails. If both fail, * it uses the last good price seen by Liquity. * */ function fetchPrice() external override returns (uint) { } // --- Helper functions --- /* Chainlink is considered broken if its current or previous round data is in any way bad. We check the previous round * for two reasons: * * 1) It is necessary data for the price deviation check in case 1, * and * 2) Chainlink is the PriceFeed's preferred primary oracle - having two consecutive valid round responses adds * peace of mind when using or returning to Chainlink. */ function _chainlinkIsBroken(ChainlinkResponse memory _currentResponse, ChainlinkResponse memory _prevResponse) internal view returns (bool) { } function _badChainlinkResponse(ChainlinkResponse memory _response) internal view returns (bool) { } function _chainlinkIsFrozen(ChainlinkResponse memory _response) internal view returns (bool) { } function _chainlinkPriceChangeAboveMax(ChainlinkResponse memory _currentResponse, ChainlinkResponse memory _prevResponse) internal pure returns (bool) { } function _tellorIsBroken(TellorResponse memory _response) internal view returns (bool) { } function _tellorIsFrozen(TellorResponse memory _tellorResponse) internal view returns (bool) { } function _bothOraclesLiveAndUnbrokenAndSimilarPrice ( ChainlinkResponse memory _chainlinkResponse, ChainlinkResponse memory _prevChainlinkResponse, TellorResponse memory _tellorResponse ) internal view returns (bool) { } function _bothOraclesSimilarPrice( ChainlinkResponse memory _chainlinkResponse, TellorResponse memory _tellorResponse) internal view returns (bool) { } function _scaleChainlinkPriceByDigits(uint256 _price, uint256 _answerDigits) internal pure returns (uint) { } function _scaleTellorPriceByDigits(uint256 _price) internal view returns (uint) { } function _changeStatus(Status _status) internal { } function _storePrice(uint256 _currentPrice) internal { } function _storeTellorPrice(TellorResponse memory _tellorResponse) internal returns (uint) { } function _storeChainlinkPrice(ChainlinkResponse memory _chainlinkResponse) internal returns (uint) { } // --- Oracle response wrapper functions --- function _getCurrentTellorResponse() internal returns (TellorResponse memory tellorResponse) { } function _getCurrentChainlinkResponse() internal view returns (ChainlinkResponse memory chainlinkResponse) { } function _getPrevChainlinkResponse(uint80 _currentRoundId, uint8 _currentDecimals) internal view returns (ChainlinkResponse memory prevChainlinkResponse) { } /* * forceExitBothUntrustedStatus() * DAO can help one oracle return back online only if previously both were untrusted. * Function reverts if both oracles are still broken. * In case when both oracles are online but have different prices then caller can control * which will be checked first: ChainLink if tryTellorFirst==false, Tellor otherwise */ function forceExitBothUntrustedStatus(bool tryTellorFirst) external onlyOwner { } function _changeStatusIfTellorLiveAndUnbroken ( TellorResponse memory _tellorResponse ) internal returns (bool) { } }
address(priceAggregator)==address(0),"PriceFeed: contacts already set"
427,500
address(priceAggregator)==address(0)
"Voting needs to be in cooldown."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { require(<FILL_ME>) require( tokenIdVoteTimer[id] > 0 && tokenIdVoteTimer[id] <= block.timestamp, "Still on cooldown." ); tokenIdVoteTimer[id] = block.timestamp; tokenIdVoteState[id] = VoteState.VOTING; tokenIdVoteLobby[id] = lobbyCount; lobbyCount += 1; emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.VOTING ); } function voteForId(uint64 id, bool vote) external { } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
tokenIdVoteState[id]==VoteState.COOLDOWN,"Voting needs to be in cooldown."
427,765
tokenIdVoteState[id]==VoteState.COOLDOWN
"Still on cooldown."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { require( tokenIdVoteState[id] == VoteState.COOLDOWN, "Voting needs to be in cooldown." ); require(<FILL_ME>) tokenIdVoteTimer[id] = block.timestamp; tokenIdVoteState[id] = VoteState.VOTING; tokenIdVoteLobby[id] = lobbyCount; lobbyCount += 1; emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.VOTING ); } function voteForId(uint64 id, bool vote) external { } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
tokenIdVoteTimer[id]>0&&tokenIdVoteTimer[id]<=block.timestamp,"Still on cooldown."
427,765
tokenIdVoteTimer[id]>0&&tokenIdVoteTimer[id]<=block.timestamp
"Voting not enabled"
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { require(<FILL_ME>) require(!nonVoter[msg.sender], "You cannot vote."); uint64 lobbyId = tokenIdVoteLobby[id]; require( voterAlreadyVotedForLobby[msg.sender][lobbyId] == false, "You already voted" ); voterAlreadyVotedForLobby[msg.sender][lobbyId] = true; uint64 voterCount = lobbyVoterCount[lobbyId]; votingLobbyToPositionVote[lobbyId][voterCount] = Vote(msg.sender, vote); lobbyVoterCount[lobbyId] += 1; emit voteEmitted(msg.sender, lobbyId, id, vote); } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
tokenIdVoteState[id]==VoteState.VOTING,"Voting not enabled"
427,765
tokenIdVoteState[id]==VoteState.VOTING
"You cannot vote."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { require(tokenIdVoteState[id] == VoteState.VOTING, "Voting not enabled"); require(<FILL_ME>) uint64 lobbyId = tokenIdVoteLobby[id]; require( voterAlreadyVotedForLobby[msg.sender][lobbyId] == false, "You already voted" ); voterAlreadyVotedForLobby[msg.sender][lobbyId] = true; uint64 voterCount = lobbyVoterCount[lobbyId]; votingLobbyToPositionVote[lobbyId][voterCount] = Vote(msg.sender, vote); lobbyVoterCount[lobbyId] += 1; emit voteEmitted(msg.sender, lobbyId, id, vote); } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
!nonVoter[msg.sender],"You cannot vote."
427,765
!nonVoter[msg.sender]
"You already voted"
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { require(tokenIdVoteState[id] == VoteState.VOTING, "Voting not enabled"); require(!nonVoter[msg.sender], "You cannot vote."); uint64 lobbyId = tokenIdVoteLobby[id]; require(<FILL_ME>) voterAlreadyVotedForLobby[msg.sender][lobbyId] = true; uint64 voterCount = lobbyVoterCount[lobbyId]; votingLobbyToPositionVote[lobbyId][voterCount] = Vote(msg.sender, vote); lobbyVoterCount[lobbyId] += 1; emit voteEmitted(msg.sender, lobbyId, id, vote); } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
voterAlreadyVotedForLobby[msg.sender][lobbyId]==false,"You already voted"
427,765
voterAlreadyVotedForLobby[msg.sender][lobbyId]==false
"Voting in effect."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { } function completeVote(uint64 id) external { require( tokenIdVoteState[id] == VoteState.VOTING, "Not currently voting." ); require(<FILL_ME>) if (getVoteResult(tokenIdVoteLobby[id], id)) { tokenIdVoteState[id] = VoteState.REMOVELPDELAY; tokenIdVoteTimer[id] = block.timestamp + delayTimer; emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.REMOVELPDELAY ); } else { tokenIdVoteState[id] = VoteState.COOLDOWN; tokenIdVoteTimer[id] = block.timestamp + cooldownTimer; OperaFactory factory = OperaFactory(payable(operaFactoryAddress)); factory.increaseLockTime(id, cooldownTimer + voteTime); emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.COOLDOWN ); } } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { } }
tokenIdVoteTimer[id]+voteTime<=block.timestamp,"Voting in effect."
427,765
tokenIdVoteTimer[id]+voteTime<=block.timestamp
"Not in remove lp State."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { require(<FILL_ME>) require( tokenIdVoteTimer[id] <= block.timestamp, "Delay still in effect." ); tokenIdVoteState[id] = VoteState.COMPLETED; emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.COMPLETED ); OperaFactory factory = OperaFactory(payable(operaFactoryAddress)); factory.claimLiquidityFromLockerWithId(id); bool removedLP = factory.removeLiquidity(id); require(removedLP, "Failed to removed liquidity"); } }
tokenIdVoteState[id]==VoteState.REMOVELPDELAY,"Not in remove lp State."
427,765
tokenIdVoteState[id]==VoteState.REMOVELPDELAY
"Delay still in effect."
pragma solidity ^0.8.17; //SPDX-License-Identifier: MIT //This contract is used to vote on which token liquidity pools to be returned. import "OperaToken.sol"; import "OperaFactory.sol"; contract OperaDAO { address public owner; address public operaFactoryAddress; address public operaTokenAddress = 0x3bd8268791DE798d4ED5d424d49412cF42B8eC3a; uint64 public lobbyCount; uint64 public voteTime = 86400; uint64 public cooldownTimer = 604800; uint64 public delayTimer = 86400; mapping(uint64 => uint256) public tokenIdVoteTimer; mapping(uint64 => VoteState) public tokenIdVoteState; mapping(uint64 => uint64) public tokenIdVoteLobby; mapping(uint64 => uint64) public lobbyVoterCount; mapping(uint64 => mapping(uint64 => Vote)) public votingLobbyToPositionVote; mapping(address => mapping(uint256 => bool)) public voterAlreadyVotedForLobby; mapping(address => bool) public nonVoter; struct Vote { address voter; bool vote; } enum VoteState { NOTINITIATED, VOTING, COOLDOWN, REMOVELPDELAY, COMPLETED } event tokenVoteStateChanged( uint64 tokenId, uint64 lobbyId, uint256 blocktime, VoteState state ); event voteEmitted(address voter, uint64 lobbyId, uint64 tokenId, bool vote); event voteCounted( address voter, uint64 tokenId, uint64 lobbyId, uint256 amount ); constructor() { } modifier onlyOwner() { } function setFactoryAddress(address factory) external onlyOwner { } function updateVoterStatus(address voter, bool state) external onlyOwner { } function setTimers( uint64 cooldown, uint64 delay, uint64 _voteTime ) external onlyOwner { } function startTimer(uint64 tokenId, uint64 time) external { } function startVoteForTokenId(uint64 id) external { } function voteForId(uint64 id, bool vote) external { } function completeVote(uint64 id) external { } function getVoteResult( uint64 lobbyId, uint64 tokenId ) internal returns (bool) { } function removeTokenLP(uint64 id) external { require( tokenIdVoteState[id] == VoteState.REMOVELPDELAY, "Not in remove lp State." ); require(<FILL_ME>) tokenIdVoteState[id] = VoteState.COMPLETED; emit tokenVoteStateChanged( id, tokenIdVoteLobby[id], block.timestamp, VoteState.COMPLETED ); OperaFactory factory = OperaFactory(payable(operaFactoryAddress)); factory.claimLiquidityFromLockerWithId(id); bool removedLP = factory.removeLiquidity(id); require(removedLP, "Failed to removed liquidity"); } }
tokenIdVoteTimer[id]<=block.timestamp,"Delay still in effect."
427,765
tokenIdVoteTimer[id]<=block.timestamp
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "Ownable.sol"; import "IChainlinkFredRelease.sol"; import "IChainlinkFredObservation.sol"; import "DateTimeMath.sol"; import "StringUtils.sol"; /** * @title PredictIndex * @author Geminon Protocol * @notice This contract performs the calculations for the prediction of the * CPI time series using the Holt Winters method. It makes requests to the oracle * contract that downloads the data from the API for the last value of the series * (observation) and the date of the next releases of the data, then makes the * prediction of the next two values of the CPI series. If the next release * date is exceeded and target has not been updated, it provides the value of the second * prediction when is queried. If the value of the second date is exceeded without updating * the value of the series, it stops providing data (calls to get methods revert). * @dev CPI observations, smoothed series derived from those observations, and * predictions use 3 decimals. Target values derived from those series are calculated * with higher precision, 6 decimals since they are relative numbers expected to be * around 1. */ contract PredictIndex is Ownable, DateTimeMath, StringUtils { IChainlinkFredRelease private releaseAPI; IChainlinkFredObservation private observationAPI; bool public isInitialized; uint32 public baseValue; uint16 public baseYear; uint8 public baseMonth; uint8 public releaseHour; uint8 public releaseMinute; uint16 private alpha; uint16 private gamma; uint32 private smooth; uint32 private trend; uint64 public targetValue; uint64 public backupValue; uint64 public targetTimestamp; uint64 public backupTimestamp; address public backupProvider; /// @dev Values stored to allow external checks of the internal state. /// The contract just need to store the last observation to work. uint32[] public CPIValues; mapping(uint16 => mapping(uint8 => uint32)) public CPIObservations; struct CPIobservation { uint16 year; uint8 month; uint32 observation; } struct releaseDate { uint16 year; uint8 month; uint8 day; } releaseDate public lastReleaseDate; CPIobservation private lastObservation; modifier whenInitialized() { } modifier whenNotInitialized() { } modifier whenNotOutdated() { } modifier onlyValidProvider() { } constructor (address _releaseAPI, address _observationAPI) { } /// @notice This function is used to provide initial values of the CPI series needed to /// adjust the prediction model. /// @dev Observations must be pased with 1e6 conversion for decimals. Initialize values is /// not enough to make the contract work: provideData method must be called after this. /// @param years_ Array with the years of the observations /// @param months_ Array with the number of the months of the observations (1=Jan, 12=Dec) /// @param observations Array with the values of the CPI observations multiplied by 10**3 /// @param release Date when the next CPI data will be released /// @param hourRel Hour of the day when the CPI data is released (UTC) [0,23] /// @param minuteRel Minute when the CPI data is released [0,59] /// @param span Number of periods of the SMA equivalent smooth /// @param t_span Number of periods of the SMA equivalent smooth for the trend component /// @param baseYear_ Year of the base CPI value to calculate the peg /// @param baseMonth_ Number of the month of the base CPI value function initializeSeries( uint16[] memory years_, uint8[] memory months_, uint32[] memory observations, releaseDate memory release, uint8 hourRel, uint8 minuteRel, uint16 span, uint16 t_span, uint16 baseYear_, uint8 baseMonth_ ) external onlyOwner whenNotInitialized { } /// @dev Owner can add an address that can provide backup CPI data to the contract function addDataProvider(address newProvider) external onlyOwner { } /// @dev Owner can remove the address that provides backup CPI data to the contract function removeDataProvider() external onlyOwner { } /// @dev Owner can set the API connectors function setAPIConnectors(address _releaseAPI, address _observationAPI) external onlyOwner { } /// @dev Owner can set the UTC time of the CPI data release function setNewReleaseTime(uint8 hour, uint8 minute) public onlyOwner { } /// @notice Makes an API call through Chainlink node to retrieve CPI data. /// This function can be called by anyone who paid the LINK fees to the API /// consumer contracts. function requestData(string memory apk) external whenInitialized { require(<FILL_ME>) require(observationAPI.hasPaidFee(msg.sender)); string memory releaseURL = _makeReleaseUrl(apk); string memory observationURL = _makeObservationUrl(apk); releaseAPI.makeMultipleRequest(releaseURL); observationAPI.makeMultipleRequest(observationURL); } /// @notice Triggers the update of the smart contract. This is the main access point to use this contract. /// @dev Does not require(updatePending) in case the request has been already made by someone else. /// getLastReleaseDate() and getLastObservation() can revert if their values are not updated. /// Observation retrieved from API has 18 decimals. We need to remove 15 decimals since we use just 3. function fetchData() external whenInitialized { } /// @notice allows to provide data manually in case oracle does not work. Alternative to fetchData. /// @param yearRel Year of the next release of CPI data /// @param monthRel Number of the month of the next release of CPI data [1,12] /// @param dayRel Day of the month of the next release of CPI data [1,31] /// @param yearObs Year of the CPI observation provided /// @param monthObs Number of the month of the CPI observation provided [1,12]. The month of the /// observation is the previous month of the release. /// @param cpiValue Value of the CPI observation with 3 decimal digits (*1e3). function provideData( uint16 yearRel, uint8 monthRel, uint8 dayRel, uint16 yearObs, uint8 monthObs, uint32 cpiValue ) external onlyValidProvider whenInitialized { } /// @notice Shows if the target values provided by the contract can be used /// or are outdated. /// @dev It counts the backup (2 step ahead prediction) values as valid /// values, so if it is queried just before it updates the new API value /// it still works. function isUpdated() public view returns(bool) { } /// @notice Returns the last value of the CPI prediction. If the last prediction has expired /// it returns the backup value, a 2-step-ahead prediction. /// @dev Reverts if values are not initialized or updated function getTargetValue() public view whenInitialized whenNotOutdated returns(uint64) { } /// @notice Returns the timestamp of the date of the next release of the CPI data. /// @dev Reverts if values are not initialized or updated function getTargetTimestamp() public view whenInitialized whenNotOutdated returns(uint64) { } /// @dev Get trend value relative to smooth value. function getRelativeTrend() public view whenInitialized whenNotOutdated returns(uint32) { } /// @dev Updates time series of observations with the next value. It allows providing outdated /// values, but the status of the isUpdated() method won't change. This is the expected behavior /// to allow the contract recovery in case it gets outdated. In this situation, all the missing /// observations must be provided in order until the time series are fully updated. function _updateData(releaseDate memory release, CPIobservation memory observation) private { } /// @dev Updates the prediction of the new target value of the series and the backup values. function _updateTarget() private { } /// @dev Make the URL of the GET request for the next-release-of-CPI-data API call function _makeReleaseUrl(string memory apk) private view returns(string memory) { } /// @dev Make the URL of the GET request for the CPI-observations API call function _makeObservationUrl(string memory apk) private view returns(string memory) { } /// @dev Apply exponential smoothing with additive trend with parameters /// alpha, gamma to a time series Y and returns the last value of the /// smoothed and trend series. /// @param Y Time series. 3 decimals (*1e3) /// @param _alpha Exponential smoothing parameter. 3 decimals (*1e3) /// @param _gamma Trend exponential smoothing parameter. 3 decimals (*1e3) function _applyESAT(uint32[] memory Y, uint16 _alpha, uint16 _gamma) private pure returns(uint32, uint32) { } /// @dev Performs one step of exponential smoothing with additive trend /// and returns the next values for smoothing and trend. /// @param y Last observation of the time series. 3 decimals (*1e3) /// @param sPrev Previous value of the smoothing. 3 decimals (*1e3) /// @param tPrev Previous value of the trend. 3 decimals (*1e3) /// @param _alpha Exponential smoothing parameter. 3 decimals (*1e3) /// @param _gamma Trend exponential smoothing parameter. 3 decimals (*1e3) /// @return s Smoothed value of the time series. 3 decimals (*1e3) /// @return t Smoothed value of the trend. 3 decimals (*1e3) function _updateESAT( int64 y, int64 sPrev, int64 tPrev, int16 _alpha, int16 _gamma ) private pure returns (uint32, uint32) { } /// @dev n-steps ahead forecast of the time series /// @param S last value of the smoothed time series. 3 decimals (*1e3) /// @param T last value of the trend. 3 decimals (*1e3) /// @param periods number of the time step ahead to predict. Integer without decimals. function _predict(uint32 S, uint32 T, uint8 periods) private pure returns(uint32) { } /// @dev Transform a timestamp (seconds since 01-01-1970) to a string with format year-month-day function _timestampToStrDate(uint256 timestamp) private pure returns (string memory date) { } /// @dev safe casting of integer to avoid overflow function _toUint32(uint256 value) private pure returns (uint32) { } /// @dev safe casting of integer to avoid overflow function _toUint64(uint256 value) private pure returns (uint64) { } /// @dev safe casting of integer to avoid overflow function _toInt32(int256 value) private pure returns (int32 downcasted) { } }
releaseAPI.hasPaidFee(msg.sender)
427,799
releaseAPI.hasPaidFee(msg.sender)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "Ownable.sol"; import "IChainlinkFredRelease.sol"; import "IChainlinkFredObservation.sol"; import "DateTimeMath.sol"; import "StringUtils.sol"; /** * @title PredictIndex * @author Geminon Protocol * @notice This contract performs the calculations for the prediction of the * CPI time series using the Holt Winters method. It makes requests to the oracle * contract that downloads the data from the API for the last value of the series * (observation) and the date of the next releases of the data, then makes the * prediction of the next two values of the CPI series. If the next release * date is exceeded and target has not been updated, it provides the value of the second * prediction when is queried. If the value of the second date is exceeded without updating * the value of the series, it stops providing data (calls to get methods revert). * @dev CPI observations, smoothed series derived from those observations, and * predictions use 3 decimals. Target values derived from those series are calculated * with higher precision, 6 decimals since they are relative numbers expected to be * around 1. */ contract PredictIndex is Ownable, DateTimeMath, StringUtils { IChainlinkFredRelease private releaseAPI; IChainlinkFredObservation private observationAPI; bool public isInitialized; uint32 public baseValue; uint16 public baseYear; uint8 public baseMonth; uint8 public releaseHour; uint8 public releaseMinute; uint16 private alpha; uint16 private gamma; uint32 private smooth; uint32 private trend; uint64 public targetValue; uint64 public backupValue; uint64 public targetTimestamp; uint64 public backupTimestamp; address public backupProvider; /// @dev Values stored to allow external checks of the internal state. /// The contract just need to store the last observation to work. uint32[] public CPIValues; mapping(uint16 => mapping(uint8 => uint32)) public CPIObservations; struct CPIobservation { uint16 year; uint8 month; uint32 observation; } struct releaseDate { uint16 year; uint8 month; uint8 day; } releaseDate public lastReleaseDate; CPIobservation private lastObservation; modifier whenInitialized() { } modifier whenNotInitialized() { } modifier whenNotOutdated() { } modifier onlyValidProvider() { } constructor (address _releaseAPI, address _observationAPI) { } /// @notice This function is used to provide initial values of the CPI series needed to /// adjust the prediction model. /// @dev Observations must be pased with 1e6 conversion for decimals. Initialize values is /// not enough to make the contract work: provideData method must be called after this. /// @param years_ Array with the years of the observations /// @param months_ Array with the number of the months of the observations (1=Jan, 12=Dec) /// @param observations Array with the values of the CPI observations multiplied by 10**3 /// @param release Date when the next CPI data will be released /// @param hourRel Hour of the day when the CPI data is released (UTC) [0,23] /// @param minuteRel Minute when the CPI data is released [0,59] /// @param span Number of periods of the SMA equivalent smooth /// @param t_span Number of periods of the SMA equivalent smooth for the trend component /// @param baseYear_ Year of the base CPI value to calculate the peg /// @param baseMonth_ Number of the month of the base CPI value function initializeSeries( uint16[] memory years_, uint8[] memory months_, uint32[] memory observations, releaseDate memory release, uint8 hourRel, uint8 minuteRel, uint16 span, uint16 t_span, uint16 baseYear_, uint8 baseMonth_ ) external onlyOwner whenNotInitialized { } /// @dev Owner can add an address that can provide backup CPI data to the contract function addDataProvider(address newProvider) external onlyOwner { } /// @dev Owner can remove the address that provides backup CPI data to the contract function removeDataProvider() external onlyOwner { } /// @dev Owner can set the API connectors function setAPIConnectors(address _releaseAPI, address _observationAPI) external onlyOwner { } /// @dev Owner can set the UTC time of the CPI data release function setNewReleaseTime(uint8 hour, uint8 minute) public onlyOwner { } /// @notice Makes an API call through Chainlink node to retrieve CPI data. /// This function can be called by anyone who paid the LINK fees to the API /// consumer contracts. function requestData(string memory apk) external whenInitialized { require(releaseAPI.hasPaidFee(msg.sender)); require(<FILL_ME>) string memory releaseURL = _makeReleaseUrl(apk); string memory observationURL = _makeObservationUrl(apk); releaseAPI.makeMultipleRequest(releaseURL); observationAPI.makeMultipleRequest(observationURL); } /// @notice Triggers the update of the smart contract. This is the main access point to use this contract. /// @dev Does not require(updatePending) in case the request has been already made by someone else. /// getLastReleaseDate() and getLastObservation() can revert if their values are not updated. /// Observation retrieved from API has 18 decimals. We need to remove 15 decimals since we use just 3. function fetchData() external whenInitialized { } /// @notice allows to provide data manually in case oracle does not work. Alternative to fetchData. /// @param yearRel Year of the next release of CPI data /// @param monthRel Number of the month of the next release of CPI data [1,12] /// @param dayRel Day of the month of the next release of CPI data [1,31] /// @param yearObs Year of the CPI observation provided /// @param monthObs Number of the month of the CPI observation provided [1,12]. The month of the /// observation is the previous month of the release. /// @param cpiValue Value of the CPI observation with 3 decimal digits (*1e3). function provideData( uint16 yearRel, uint8 monthRel, uint8 dayRel, uint16 yearObs, uint8 monthObs, uint32 cpiValue ) external onlyValidProvider whenInitialized { } /// @notice Shows if the target values provided by the contract can be used /// or are outdated. /// @dev It counts the backup (2 step ahead prediction) values as valid /// values, so if it is queried just before it updates the new API value /// it still works. function isUpdated() public view returns(bool) { } /// @notice Returns the last value of the CPI prediction. If the last prediction has expired /// it returns the backup value, a 2-step-ahead prediction. /// @dev Reverts if values are not initialized or updated function getTargetValue() public view whenInitialized whenNotOutdated returns(uint64) { } /// @notice Returns the timestamp of the date of the next release of the CPI data. /// @dev Reverts if values are not initialized or updated function getTargetTimestamp() public view whenInitialized whenNotOutdated returns(uint64) { } /// @dev Get trend value relative to smooth value. function getRelativeTrend() public view whenInitialized whenNotOutdated returns(uint32) { } /// @dev Updates time series of observations with the next value. It allows providing outdated /// values, but the status of the isUpdated() method won't change. This is the expected behavior /// to allow the contract recovery in case it gets outdated. In this situation, all the missing /// observations must be provided in order until the time series are fully updated. function _updateData(releaseDate memory release, CPIobservation memory observation) private { } /// @dev Updates the prediction of the new target value of the series and the backup values. function _updateTarget() private { } /// @dev Make the URL of the GET request for the next-release-of-CPI-data API call function _makeReleaseUrl(string memory apk) private view returns(string memory) { } /// @dev Make the URL of the GET request for the CPI-observations API call function _makeObservationUrl(string memory apk) private view returns(string memory) { } /// @dev Apply exponential smoothing with additive trend with parameters /// alpha, gamma to a time series Y and returns the last value of the /// smoothed and trend series. /// @param Y Time series. 3 decimals (*1e3) /// @param _alpha Exponential smoothing parameter. 3 decimals (*1e3) /// @param _gamma Trend exponential smoothing parameter. 3 decimals (*1e3) function _applyESAT(uint32[] memory Y, uint16 _alpha, uint16 _gamma) private pure returns(uint32, uint32) { } /// @dev Performs one step of exponential smoothing with additive trend /// and returns the next values for smoothing and trend. /// @param y Last observation of the time series. 3 decimals (*1e3) /// @param sPrev Previous value of the smoothing. 3 decimals (*1e3) /// @param tPrev Previous value of the trend. 3 decimals (*1e3) /// @param _alpha Exponential smoothing parameter. 3 decimals (*1e3) /// @param _gamma Trend exponential smoothing parameter. 3 decimals (*1e3) /// @return s Smoothed value of the time series. 3 decimals (*1e3) /// @return t Smoothed value of the trend. 3 decimals (*1e3) function _updateESAT( int64 y, int64 sPrev, int64 tPrev, int16 _alpha, int16 _gamma ) private pure returns (uint32, uint32) { } /// @dev n-steps ahead forecast of the time series /// @param S last value of the smoothed time series. 3 decimals (*1e3) /// @param T last value of the trend. 3 decimals (*1e3) /// @param periods number of the time step ahead to predict. Integer without decimals. function _predict(uint32 S, uint32 T, uint8 periods) private pure returns(uint32) { } /// @dev Transform a timestamp (seconds since 01-01-1970) to a string with format year-month-day function _timestampToStrDate(uint256 timestamp) private pure returns (string memory date) { } /// @dev safe casting of integer to avoid overflow function _toUint32(uint256 value) private pure returns (uint32) { } /// @dev safe casting of integer to avoid overflow function _toUint64(uint256 value) private pure returns (uint64) { } /// @dev safe casting of integer to avoid overflow function _toInt32(int256 value) private pure returns (int32 downcasted) { } }
observationAPI.hasPaidFee(msg.sender)
427,799
observationAPI.hasPaidFee(msg.sender)
"trading is already open"
/** OMNIBOTX Socials: Website: https://www.omnibotx.io/ Twitter: https://twitter.com/OmniBotX Telegram: https://t.me/omnibotxsecurity Telegram Bot: https://t.me/omnibotx_bot Whitepaper: https://whitepaper.omnibotx.io/info/ */ pragma solidity 0.8.23; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 OMNIXToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; address payable private _taxWallet; uint256 public _buyTax=25; uint256 public _sellTax=25; uint256 public _buyTaxFirstBlock=80; uint256 public _sellTaxFirstBlock=80; uint256 private _preventSwapBefore=20; uint256 private _buyCount=0; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 100_000_000 * 10 **_decimals; string private constant _name = unicode"Omnibot X"; string private constant _symbol = unicode"OMNIX"; uint256 public _maxWalletSize = _tTotal / 50; uint256 public _taxSwapThreshold = _tTotal / 1000; uint256 public _maxTaxSwap = _tTotal / 300; IUniswapV2Router02 public uniswapV2Router; address private uniswapV2Pair; bool private inSwap = false; bool private swapEnabled = false; uint public launchBlock; modifier lockTheSwap { } bool private tradingOpened; 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 _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { } function min(uint256 a, uint256 b) private pure returns (uint256){ } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { } function setFee(uint buy, uint sell) external onlyOwner { } function removeLimits() external onlyOwner{ } function sendETHToFee(uint256 amount) private { } function manualSend() external { } function setTaxWallet(address payable newWallet) external onlyOwner { } function manualSwap() external{ } function start() external onlyOwner() { require(<FILL_ME>) swapEnabled = true; tradingOpened = true; launchBlock = block.number; } function excludeFromFees(address account, bool status) external onlyOwner { } receive() external payable {} }
!tradingOpened,"trading is already open"
427,813
!tradingOpened
"MAX_SUPPLY_FOR_CHAIN"
//SPDX-License-Identifier: MIT pragma solidity 0.8.7; contract OmniBotzChain1 is ERC721Enumerable, NonblockingReceiver, ILayerZeroUserApplicationConfig { using Strings for uint256; string public baseTokenURI; uint256 nextTokenId; uint256 public immutable maxMint; uint256 public immutable maxPerTx = 2; mapping(address => uint256) public whitelistedMints; bytes32 private whitelistRoot; bool paused = false; bool whiteListingSale = false; constructor( string memory _baseTokenURI, address _layerZeroEndpoint, uint256 _startToken, uint256 _maxMint ) ERC721("OmniBots", "OMBTZ") { } // Verify that a given leaf is in the tree. function _verify( bytes32 _leafNode, bytes32[] memory proof ) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } /// @notice Mint your OmnichainNonFungibleToken function mint(uint256 quantity) external { require(!paused); require(!whiteListingSale, "CANT_MINT_ON_WL_SALE"); require(quantity <= maxPerTx && balanceOf(msg.sender) < maxPerTx, "ONLY_2_PER_WALLET"); require(<FILL_ME>) unchecked { for(uint256 i = 0; i < quantity; i++) { _safeMint(msg.sender, ++nextTokenId); } } } /// @notice Whitelist Mint your OmnichainNonFungibleToken function mintWl(uint256 quantity, bytes32[] calldata proof) external { } function reserveBots(uint256 quantity) public onlyOwner { } function traverseChains( uint16 _chainId, uint256 tokenId ) public payable { } function getEstimatedFees(uint16 _chainId, uint256 tokenId) public view returns (uint) { } /// @notice Set the baseTokenURI /// @param _baseTokenURI to set function setBaseURI(string memory _baseTokenURI) public onlyOwner { } /// @notice Get the base URI function _baseURI() override internal view returns (string memory) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _LzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal override { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external override onlyOwner { } function setSendVersion(uint16 _version) external override onlyOwner { } function setReceiveVersion(uint16 _version) external override onlyOwner { } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } }
nextTokenId+quantity<=maxMint,"MAX_SUPPLY_FOR_CHAIN"
428,143
nextTokenId+quantity<=maxMint
"Exceeds Max Mint amount"
//SPDX-License-Identifier: MIT pragma solidity 0.8.7; contract OmniBotzChain1 is ERC721Enumerable, NonblockingReceiver, ILayerZeroUserApplicationConfig { using Strings for uint256; string public baseTokenURI; uint256 nextTokenId; uint256 public immutable maxMint; uint256 public immutable maxPerTx = 2; mapping(address => uint256) public whitelistedMints; bytes32 private whitelistRoot; bool paused = false; bool whiteListingSale = false; constructor( string memory _baseTokenURI, address _layerZeroEndpoint, uint256 _startToken, uint256 _maxMint ) ERC721("OmniBots", "OMBTZ") { } // Verify that a given leaf is in the tree. function _verify( bytes32 _leafNode, bytes32[] memory proof ) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } /// @notice Mint your OmnichainNonFungibleToken function mint(uint256 quantity) external { } /// @notice Whitelist Mint your OmnichainNonFungibleToken function mintWl(uint256 quantity, bytes32[] calldata proof) external { require(!paused); require(whiteListingSale, "Whitelisting not enabled"); require( _verify(_leaf(msg.sender), proof), "Invalid proof" ); require(<FILL_ME>) require(nextTokenId + quantity <= maxMint, "MAX_SUPPLY_FOR_CHAIN"); unchecked { whitelistedMints[msg.sender] = whitelistedMints[msg.sender] + quantity; for(uint256 i = 0; i < quantity; i++) { _safeMint(msg.sender, ++nextTokenId); } } } function reserveBots(uint256 quantity) public onlyOwner { } function traverseChains( uint16 _chainId, uint256 tokenId ) public payable { } function getEstimatedFees(uint16 _chainId, uint256 tokenId) public view returns (uint) { } /// @notice Set the baseTokenURI /// @param _baseTokenURI to set function setBaseURI(string memory _baseTokenURI) public onlyOwner { } /// @notice Get the base URI function _baseURI() override internal view returns (string memory) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _LzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal override { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external override onlyOwner { } function setSendVersion(uint16 _version) external override onlyOwner { } function setReceiveVersion(uint16 _version) external override onlyOwner { } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } }
(whitelistedMints[msg.sender]+quantity)<=maxPerTx,"Exceeds Max Mint amount"
428,143
(whitelistedMints[msg.sender]+quantity)<=maxPerTx
"This chain is not a trusted source source."
//SPDX-License-Identifier: MIT pragma solidity 0.8.7; contract OmniBotzChain1 is ERC721Enumerable, NonblockingReceiver, ILayerZeroUserApplicationConfig { using Strings for uint256; string public baseTokenURI; uint256 nextTokenId; uint256 public immutable maxMint; uint256 public immutable maxPerTx = 2; mapping(address => uint256) public whitelistedMints; bytes32 private whitelistRoot; bool paused = false; bool whiteListingSale = false; constructor( string memory _baseTokenURI, address _layerZeroEndpoint, uint256 _startToken, uint256 _maxMint ) ERC721("OmniBots", "OMBTZ") { } // Verify that a given leaf is in the tree. function _verify( bytes32 _leafNode, bytes32[] memory proof ) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } /// @notice Mint your OmnichainNonFungibleToken function mint(uint256 quantity) external { } /// @notice Whitelist Mint your OmnichainNonFungibleToken function mintWl(uint256 quantity, bytes32[] calldata proof) external { } function reserveBots(uint256 quantity) public onlyOwner { } function traverseChains( uint16 _chainId, uint256 tokenId ) public payable { require(msg.sender == ownerOf(tokenId), "Message sender must own the OmnichainNFT."); require(<FILL_ME>) // burn ONFT on source chain _burn(tokenId); // encode payload w/ sender address and ONFT token id bytes memory payload = abi.encode(msg.sender, tokenId); // encode adapterParams w/ extra gas for destination chain // This example uses 500,000 gas. Your implementation may need more. uint16 version = 1; uint gas = 350000; bytes memory adapterParams = abi.encodePacked(version, gas); // use LayerZero estimateFees for cross chain delivery (uint quotedLayerZeroFee, ) = endpoint.estimateFees(_chainId, address(this), payload, false, adapterParams); require(msg.value >= quotedLayerZeroFee, "Not enough gas to cover cross chain transfer."); endpoint.send{value:msg.value}( _chainId, // destination chainId trustedSourceLookup[_chainId], // destination address of OmnichainNFT payload, // abi.encode()'ed bytes payable(msg.sender), // refund address address(0x0), // future parameter adapterParams // adapterParams ); } function getEstimatedFees(uint16 _chainId, uint256 tokenId) public view returns (uint) { } /// @notice Set the baseTokenURI /// @param _baseTokenURI to set function setBaseURI(string memory _baseTokenURI) public onlyOwner { } /// @notice Get the base URI function _baseURI() override internal view returns (string memory) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _LzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal override { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external override onlyOwner { } function setSendVersion(uint16 _version) external override onlyOwner { } function setReceiveVersion(uint16 _version) external override onlyOwner { } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } }
trustedSourceLookup[_chainId].length!=0,"This chain is not a trusted source source."
428,143
trustedSourceLookup[_chainId].length!=0
"Edition doesn't exist"
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.10; import "./interfaces/IERC721Editions.sol"; import "./ERC721Base.sol"; import "../utils/Ownable.sol"; import "../metadata/interfaces/IMetadataRenderer.sol"; import "../metadata/interfaces/IEditionsMetadataRenderer.sol"; import "./interfaces/IEditionCollection.sol"; import "../tokenManager/interfaces/IPostTransfer.sol"; import "../utils/ERC721/ERC721Upgradeable.sol"; import "./interfaces/IERC721EditionMint.sol"; /** * @title ERC721 Editions * @author [email protected], [email protected] * @dev Multiple Editions Per Collection */ contract ERC721Editions is IEditionCollection, IERC721Editions, IERC721EditionMint, ERC721Base, ERC721Upgradeable { using EnumerableSet for EnumerableSet.AddressSet; /** * @dev Contract metadata */ string public contractURI; /** * @dev Keeps track of next token ID */ uint256 private _nextTokenId; /** * @dev Generates metadata for contract and token */ address private _metadataRendererAddress; /** * @dev Tracks current supply of each edition, edition indexed */ uint256[] public editionCurrentSupply; /** * @dev Tracks size of each edition, edition indexed */ uint256[] public editionMaxSupply; /** * @dev Tracks start token id each edition, edition indexed */ uint256[] public editionStartId; /** * @dev Emitted when edition is created * @param size Edition size * @param editionTokenManager Token manager for edition */ event EditionCreated(uint256 indexed size, address indexed editionTokenManager); /** * @param creator Creator/owner of contract * @param defaultRoyalty Default royalty object for contract (optional) * @param _defaultTokenManager Default token manager for contract (optional) * @param _contractURI Contract metadata * @param _name Name of token edition * @param _symbol Symbol of the token edition * @param metadataRendererAddress Contract returning metadata for each edition * @param trustedForwarder Trusted minimal forwarder * @param initialMinter Initial minter to register */ function initialize( address creator, IRoyaltyManager.Royalty memory defaultRoyalty, address _defaultTokenManager, string memory _contractURI, string memory _name, string memory _symbol, address metadataRendererAddress, address trustedForwarder, address initialMinter ) external initializer nonReentrant { } /** * @param _editionInfo Info of the Edition * @param _editionSize Size of the Edition * @param _editionTokenManager Edition's token manager * @dev Used to create a new Edition within the Collection */ function createEdition( bytes memory _editionInfo, uint256 _editionSize, address _editionTokenManager ) external onlyOwner nonReentrant returns (uint256) { } /** * @dev See {IERC721EditionMint-mintOneToRecipient} */ function mintOneToRecipient(uint256 editionId, address recipient) external onlyMinter nonReentrant returns (uint256) { require(_mintFrozen == 0, "Mint frozen"); require(<FILL_ME>) return _mintEditionsToOne(editionId, recipient, 1); } /** * @dev See {IERC721EditionMint-mintAmountToRecipient} */ function mintAmountToRecipient( uint256 editionId, address recipient, uint256 amount ) external onlyMinter nonReentrant returns (uint256) { } /** * @dev See {IERC721EditionMint-mintOneToRecipients} */ function mintOneToRecipients(uint256 editionId, address[] memory recipients) external onlyMinter nonReentrant returns (uint256) { } /** * @dev See {IERC721EditionMint-mintAmountToRecipients} */ function mintAmountToRecipients( uint256 editionId, address[] memory recipients, uint256 amount ) external onlyMinter nonReentrant returns (uint256) { } /** * @dev See {IEditionCollection-getEditionDetails} */ function getEditionDetails(uint256 editionId) external view returns (EditionDetails memory) { } /** * @dev See {IEditionCollection-getEditionsDetailsAndUri} */ function getEditionsDetailsAndUri(uint256[] calldata editionIds) external view returns (EditionDetails[] memory, string[] memory) { } /** * @dev See {IEditionCollection-getEditionStartIds} */ function getEditionStartIds() external view returns (uint256[] memory) { } /** * @dev See {IERC721-transferFrom}. Overrides default behaviour to check associated tokenManager. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override nonReentrant { } /** * @dev See {IERC721-safeTransferFrom}. Overrides default behaviour to check associated tokenManager. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override nonReentrant { } /** * @dev Conforms to ERC-2981. * @param _tokenId Token id * @param _salePrice Sale price of token */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address receiver, uint256 royaltyAmount) { } /** * @dev See {IEditionCollection-getEditionId} */ function getEditionId(uint256 tokenId) public view returns (uint256) { } /** * @dev Used to get token manager of token id * @param tokenId ID of the token */ function tokenManagerByTokenId(uint256 tokenId) public view returns (address) { } /** * @dev Get URI for given edition id * @param editionId edition id to get uri for * @return base64-encoded json metadata object */ function editionURI(uint256 editionId) public view returns (string memory) { } /** * @dev Get URI for given token id * @param tokenId token id to get uri for * @return base64-encoded json metadata object */ function tokenURI(uint256 tokenId) public view override returns (string memory) { } /** * @dev See {IERC721Upgradeable-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { } /** * @dev Private function to mint without any access checks. Called by the public edition minting functions. * @param editionId Edition being minted on * @param recipients Recipients of newly minted tokens * @param _amount Amount minted to each recipient */ function _mintEditions( uint256 editionId, address[] memory recipients, uint256 _amount ) internal returns (uint256) { } /** * @dev Private function to mint without any access checks. Called by the public edition minting functions. * @param editionId Edition being minted on * @param recipient Recipient of newly minted token * @param _amount Amount minted to recipient */ function _mintEditionsToOne( uint256 editionId, address recipient, uint256 _amount ) internal returns (uint256) { } /** * @dev Returns whether `editionId` exists. * @param editionId Id of edition being checked */ function _editionExists(uint256 editionId) internal view returns (bool) { } /** * @dev Used for meta-transactions */ function _msgSender() internal view override(ERC721Base, ContextUpgradeable) returns (address sender) { } /** * @dev Used for meta-transactions */ function _msgData() internal view override(ERC721Base, ContextUpgradeable) returns (bytes calldata) { } /** * @dev Get edition details * @param editionId Id of edition to get details for */ function _getEditionDetails(uint256 editionId) private view returns (EditionDetails memory) { } }
_editionExists(editionId),"Edition doesn't exist"
428,268
_editionExists(editionId)
"Already added"
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./interfaces/IPermissionsRegistry.sol"; import "../utils/ERC165/ERC165.sol"; import "../utils/Ownable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title Highlight permissions registry * @author [email protected], [email protected] * @dev Allows for O(1) swapping of the platform executor. */ contract PermissionsRegistry is IPermissionsRegistry, Ownable, ERC165 { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /** * @dev Whitelisted currencies for system */ EnumerableSetUpgradeable.AddressSet internal _whitelistedCurrencies; /** * @dev Platform transaction executors */ EnumerableSetUpgradeable.AddressSet internal _platformExecutors; /** * @notice Initialize the registry with an initial platform executor and the platform vault */ constructor(address _initialExecutor, address _initialOwner) { } /** * @dev Add platform executor. Expected to be protected by a smart contract wallet. */ function addPlatformExecutor(address _executor) external onlyOwner { require(_executor != address(0), "Cannot set to null address"); require(<FILL_ME>) emit PlatformExecutorAdded(_executor); } /** * @dev Deprecate the platform executor. */ function deprecatePlatformExecutor(address _executor) external onlyOwner { } /** * @dev Whitelists a currency */ function whitelistCurrency(address _currency) external onlyOwner { } /** * @dev Unwhitelists a currency */ function unwhitelistCurrency(address _currency) external onlyOwner { } /** * @dev Returns true if executor is a platform executor */ function isPlatformExecutor(address _executor) external view returns (bool) { } /** * @dev Returns platform executors */ function platformExecutors() external view returns (address[] memory) { } /** * @dev Returns true if a currency is whitelisted */ function isCurrencyWhitelisted(address _currency) external view returns (bool) { } /** * @dev Returns whitelisted currencies */ function whitelistedCurrencies() external view returns (address[] memory) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) { } }
_platformExecutors.add(_executor),"Already added"
428,276
_platformExecutors.add(_executor)
"Not deprecated"
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./interfaces/IPermissionsRegistry.sol"; import "../utils/ERC165/ERC165.sol"; import "../utils/Ownable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title Highlight permissions registry * @author [email protected], [email protected] * @dev Allows for O(1) swapping of the platform executor. */ contract PermissionsRegistry is IPermissionsRegistry, Ownable, ERC165 { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /** * @dev Whitelisted currencies for system */ EnumerableSetUpgradeable.AddressSet internal _whitelistedCurrencies; /** * @dev Platform transaction executors */ EnumerableSetUpgradeable.AddressSet internal _platformExecutors; /** * @notice Initialize the registry with an initial platform executor and the platform vault */ constructor(address _initialExecutor, address _initialOwner) { } /** * @dev Add platform executor. Expected to be protected by a smart contract wallet. */ function addPlatformExecutor(address _executor) external onlyOwner { } /** * @dev Deprecate the platform executor. */ function deprecatePlatformExecutor(address _executor) external onlyOwner { require(<FILL_ME>) emit PlatformExecutorDeprecated(_executor); } /** * @dev Whitelists a currency */ function whitelistCurrency(address _currency) external onlyOwner { } /** * @dev Unwhitelists a currency */ function unwhitelistCurrency(address _currency) external onlyOwner { } /** * @dev Returns true if executor is a platform executor */ function isPlatformExecutor(address _executor) external view returns (bool) { } /** * @dev Returns platform executors */ function platformExecutors() external view returns (address[] memory) { } /** * @dev Returns true if a currency is whitelisted */ function isCurrencyWhitelisted(address _currency) external view returns (bool) { } /** * @dev Returns whitelisted currencies */ function whitelistedCurrencies() external view returns (address[] memory) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) { } }
_platformExecutors.remove(_executor),"Not deprecated"
428,276
_platformExecutors.remove(_executor)
"Already whitelisted"
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./interfaces/IPermissionsRegistry.sol"; import "../utils/ERC165/ERC165.sol"; import "../utils/Ownable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title Highlight permissions registry * @author [email protected], [email protected] * @dev Allows for O(1) swapping of the platform executor. */ contract PermissionsRegistry is IPermissionsRegistry, Ownable, ERC165 { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /** * @dev Whitelisted currencies for system */ EnumerableSetUpgradeable.AddressSet internal _whitelistedCurrencies; /** * @dev Platform transaction executors */ EnumerableSetUpgradeable.AddressSet internal _platformExecutors; /** * @notice Initialize the registry with an initial platform executor and the platform vault */ constructor(address _initialExecutor, address _initialOwner) { } /** * @dev Add platform executor. Expected to be protected by a smart contract wallet. */ function addPlatformExecutor(address _executor) external onlyOwner { } /** * @dev Deprecate the platform executor. */ function deprecatePlatformExecutor(address _executor) external onlyOwner { } /** * @dev Whitelists a currency */ function whitelistCurrency(address _currency) external onlyOwner { require(<FILL_ME>) emit CurrencyWhitelisted(_currency); } /** * @dev Unwhitelists a currency */ function unwhitelistCurrency(address _currency) external onlyOwner { } /** * @dev Returns true if executor is a platform executor */ function isPlatformExecutor(address _executor) external view returns (bool) { } /** * @dev Returns platform executors */ function platformExecutors() external view returns (address[] memory) { } /** * @dev Returns true if a currency is whitelisted */ function isCurrencyWhitelisted(address _currency) external view returns (bool) { } /** * @dev Returns whitelisted currencies */ function whitelistedCurrencies() external view returns (address[] memory) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) { } }
_whitelistedCurrencies.add(_currency),"Already whitelisted"
428,276
_whitelistedCurrencies.add(_currency)
"Not whitelisted"
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./interfaces/IPermissionsRegistry.sol"; import "../utils/ERC165/ERC165.sol"; import "../utils/Ownable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title Highlight permissions registry * @author [email protected], [email protected] * @dev Allows for O(1) swapping of the platform executor. */ contract PermissionsRegistry is IPermissionsRegistry, Ownable, ERC165 { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; /** * @dev Whitelisted currencies for system */ EnumerableSetUpgradeable.AddressSet internal _whitelistedCurrencies; /** * @dev Platform transaction executors */ EnumerableSetUpgradeable.AddressSet internal _platformExecutors; /** * @notice Initialize the registry with an initial platform executor and the platform vault */ constructor(address _initialExecutor, address _initialOwner) { } /** * @dev Add platform executor. Expected to be protected by a smart contract wallet. */ function addPlatformExecutor(address _executor) external onlyOwner { } /** * @dev Deprecate the platform executor. */ function deprecatePlatformExecutor(address _executor) external onlyOwner { } /** * @dev Whitelists a currency */ function whitelistCurrency(address _currency) external onlyOwner { } /** * @dev Unwhitelists a currency */ function unwhitelistCurrency(address _currency) external onlyOwner { require(<FILL_ME>) emit CurrencyUnwhitelisted(_currency); } /** * @dev Returns true if executor is a platform executor */ function isPlatformExecutor(address _executor) external view returns (bool) { } /** * @dev Returns platform executors */ function platformExecutors() external view returns (address[] memory) { } /** * @dev Returns true if a currency is whitelisted */ function isCurrencyWhitelisted(address _currency) external view returns (bool) { } /** * @dev Returns whitelisted currencies */ function whitelistedCurrencies() external view returns (address[] memory) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165) returns (bool) { } }
_whitelistedCurrencies.remove(_currency),"Not whitelisted"
428,276
_whitelistedCurrencies.remove(_currency)
"paused"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { Params memory params_ = versionParams[version]; require(<FILL_ME>) require(msg.value >= params_.prices.sale * _number, "price"); require(params_.supplies.sale + _number <= params_.maxSupplies.sale, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); params_.supplies.sale += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
!isPaused[List.sale][params_.version],"paused"
428,345
!isPaused[List.sale][params_.version]
"supplies"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.sale][params_.version], "paused"); require(msg.value >= params_.prices.sale * _number, "price"); require(<FILL_ME>) require(params_.supply + _number <= params_.maxSupply, "supply"); params_.supplies.sale += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
params_.supplies.sale+_number<=params_.maxSupplies.sale,"supplies"
428,345
params_.supplies.sale+_number<=params_.maxSupplies.sale
"supply"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.sale][params_.version], "paused"); require(msg.value >= params_.prices.sale * _number, "price"); require(params_.supplies.sale + _number <= params_.maxSupplies.sale, "supplies"); require(<FILL_ME>) params_.supplies.sale += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
params_.supply+_number<=params_.maxSupply,"supply"
428,345
params_.supply+_number<=params_.maxSupply
"paused"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { require(version == 1, "v"); Params memory params_ = versionParams[version]; require(<FILL_ME>) require(msg.value >= params_.prices.friends * _number, "price"); require(claimed[params_.version][List.friends][msg.sender] + _number <= params_.mintable.friends, "claimed"); require(params_.supplies.friends + _number <= params_.maxSupplies.friends, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); params_.supplies.friends += _number; params_.supply += _number; claimed[version][List.friends][msg.sender] += _number; versionParams[version] = params_; _allocateFriends(msg.value); _safeMint(msg.sender, _number); } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
!isPaused[List.friends][params_.version],"paused"
428,345
!isPaused[List.friends][params_.version]
"claimed"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { require(version == 1, "v"); Params memory params_ = versionParams[version]; require(!isPaused[List.friends][params_.version], "paused"); require(msg.value >= params_.prices.friends * _number, "price"); require(<FILL_ME>) require(params_.supplies.friends + _number <= params_.maxSupplies.friends, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); params_.supplies.friends += _number; params_.supply += _number; claimed[version][List.friends][msg.sender] += _number; versionParams[version] = params_; _allocateFriends(msg.value); _safeMint(msg.sender, _number); } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
claimed[params_.version][List.friends][msg.sender]+_number<=params_.mintable.friends,"claimed"
428,345
claimed[params_.version][List.friends][msg.sender]+_number<=params_.mintable.friends
"supplies"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { require(version == 1, "v"); Params memory params_ = versionParams[version]; require(!isPaused[List.friends][params_.version], "paused"); require(msg.value >= params_.prices.friends * _number, "price"); require(claimed[params_.version][List.friends][msg.sender] + _number <= params_.mintable.friends, "claimed"); require(<FILL_ME>) require(params_.supply + _number <= params_.maxSupply, "supply"); params_.supplies.friends += _number; params_.supply += _number; claimed[version][List.friends][msg.sender] += _number; versionParams[version] = params_; _allocateFriends(msg.value); _safeMint(msg.sender, _number); } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
params_.supplies.friends+_number<=params_.maxSupplies.friends,"supplies"
428,345
params_.supplies.friends+_number<=params_.maxSupplies.friends
"paused"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(<FILL_ME>) bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isWhitelist(_proof, leaf_), "list"); require(msg.value >= params_.prices.whitelist * _number, "price"); require(claimed[params_.version][List.whitelist][msg.sender] + _number <= params_.mintable.whitelist, "claimed"); require(params_.supplies.whitelist + _number <= params_.maxSupplies.whitelist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.whitelist][msg.sender] += _number; params_.supplies.whitelist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
!isPaused[List.whitelist][params_.version],"paused"
428,345
!isPaused[List.whitelist][params_.version]
"list"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.whitelist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) require(msg.value >= params_.prices.whitelist * _number, "price"); require(claimed[params_.version][List.whitelist][msg.sender] + _number <= params_.mintable.whitelist, "claimed"); require(params_.supplies.whitelist + _number <= params_.maxSupplies.whitelist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.whitelist][msg.sender] += _number; params_.supplies.whitelist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
isWhitelist(_proof,leaf_),"list"
428,345
isWhitelist(_proof,leaf_)
"claimed"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.whitelist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isWhitelist(_proof, leaf_), "list"); require(msg.value >= params_.prices.whitelist * _number, "price"); require(<FILL_ME>) require(params_.supplies.whitelist + _number <= params_.maxSupplies.whitelist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.whitelist][msg.sender] += _number; params_.supplies.whitelist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
claimed[params_.version][List.whitelist][msg.sender]+_number<=params_.mintable.whitelist,"claimed"
428,345
claimed[params_.version][List.whitelist][msg.sender]+_number<=params_.mintable.whitelist
"supplies"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.whitelist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isWhitelist(_proof, leaf_), "list"); require(msg.value >= params_.prices.whitelist * _number, "price"); require(claimed[params_.version][List.whitelist][msg.sender] + _number <= params_.mintable.whitelist, "claimed"); require(<FILL_ME>) require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.whitelist][msg.sender] += _number; params_.supplies.whitelist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } function mintViplist(uint _number, bytes32[] memory _proof) external payable { } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
params_.supplies.whitelist+_number<=params_.maxSupplies.whitelist,"supplies"
428,345
params_.supplies.whitelist+_number<=params_.maxSupplies.whitelist
"paused"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(<FILL_ME>) bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isViplist(_proof, leaf_), "list"); require(msg.value >= params_.prices.viplist * _number, "price"); require(claimed[params_.version][List.viplist][msg.sender] + _number <= params_.mintable.viplist, "claimed"); require(params_.supplies.viplist + _number <= params_.maxSupplies.viplist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.viplist][msg.sender] += _number; params_.supplies.viplist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
!isPaused[List.viplist][params_.version],"paused"
428,345
!isPaused[List.viplist][params_.version]
"list"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.viplist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) require(msg.value >= params_.prices.viplist * _number, "price"); require(claimed[params_.version][List.viplist][msg.sender] + _number <= params_.mintable.viplist, "claimed"); require(params_.supplies.viplist + _number <= params_.maxSupplies.viplist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.viplist][msg.sender] += _number; params_.supplies.viplist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
isViplist(_proof,leaf_),"list"
428,345
isViplist(_proof,leaf_)
"claimed"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.viplist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isViplist(_proof, leaf_), "list"); require(msg.value >= params_.prices.viplist * _number, "price"); require(<FILL_ME>) require(params_.supplies.viplist + _number <= params_.maxSupplies.viplist, "supplies"); require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.viplist][msg.sender] += _number; params_.supplies.viplist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
claimed[params_.version][List.viplist][msg.sender]+_number<=params_.mintable.viplist,"claimed"
428,345
claimed[params_.version][List.viplist][msg.sender]+_number<=params_.mintable.viplist
"supplies"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; // pause mints at deployment // set contract/base uris // set params // setVersion import {IJustWin} from "./interfaces/IJustWin.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol"; contract JustWin is IJustWin, ERC721A, ERC2981, Ownable { // State uint public version; uint public constant maxSupply = 30000; string private baseURI; mapping(uint => Params) public versionParams; mapping(uint => mapping(List => mapping(address => uint))) public claimed; // version to list to addy to number minted mapping(List => mapping(uint => bool)) public isPaused; // Royalties uint96 royaltyFeesInBips; address royaltyReceiver; string public contractURI; // Lottery address public lottery; constructor( uint96 _royaltyFeesInbips ) ERC721A("JustWin", "JW") { } // ***** VIEW ***** function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, ERC2981) returns (bool) { } // ***** MERKLE TREE ***** function isWhitelist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } function isViplist(bytes32[] memory proof, bytes32 _leaf) internal view returns (bool) { } // ***** MINT ***** function mintPublic(uint _number) external payable { } function mintFriends(uint _number) external payable { } function mintWhitelist(uint _number, bytes32[] memory _proof) external payable { } function mintViplist(uint _number, bytes32[] memory _proof) external payable { Params memory params_ = versionParams[version]; require(!isPaused[List.viplist][params_.version], "paused"); bytes32 leaf_ = keccak256(abi.encodePacked(msg.sender)); require(isViplist(_proof, leaf_), "list"); require(msg.value >= params_.prices.viplist * _number, "price"); require(claimed[params_.version][List.viplist][msg.sender] + _number <= params_.mintable.viplist, "claimed"); require(<FILL_ME>) require(params_.supply + _number <= params_.maxSupply, "supply"); claimed[version][List.viplist][msg.sender] += _number; params_.supplies.viplist += _number; params_.supply += _number; versionParams[version] = params_; _allocate(msg.value); _safeMint(msg.sender, _number); } // ***** ADMIN ***** function setParamsVersion(uint _version) external onlyOwner { } function setMaxSupply(uint _version, uint _maxSupply) external onlyOwner { } function setMaxSupplies(uint _version, MaxSupplies memory _maxSupplies) external onlyOwner { } function setMintable(uint _version, Mintable memory _mintable) external onlyOwner { } function setPrices(uint _version, Prices memory _prices) external onlyOwner { } function setRoots(uint _version, Roots memory _roots) external onlyOwner { } function setLotteryAddress(address _lottery) external onlyOwner { } function setPause(List _list, uint _version, bool _state) public onlyOwner { } function _initPause() internal { } function setBaseURI(string memory baseURI_) external onlyOwner { } function setContractURI(string memory _contractURI) external onlyOwner { } // Team/Growth uint256 public totalAllo; uint public totalRoyalties; address[] public members; address[] public royaltiesMembers; mapping(address => uint) public memberAllo; mapping(address => uint) public memberRoyalty; address public marketing = 0x9667427550044ffB24859e15C8c06DBfF1286Aa9; address public asso = 0x6d6ea83390005C73860131AD8c4C4f909fA16044; uint public reserved; function reserveTicket(address _to, uint _number) external onlyOwner { } function _allocate(uint _value) internal { } function _allocateFriends(uint _value) internal { } function distributeRoyalties() external onlyOwner { } function distributeAllo() external onlyOwner { } function distributeERC20(address _token) external { } function _setRoyaltiesDistInfo() internal { } function _setMembersAlloInfo() internal { } receive() external payable { } }
params_.supplies.viplist+_number<=params_.maxSupplies.viplist,"supplies"
428,345
params_.supplies.viplist+_number<=params_.maxSupplies.viplist
"Burn claim is not live yet"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { // Check claim contract is set require(claimContract != address(0), "Contract has not been set"); BurnInterface kdaoContract = BurnInterface(claimContract); // Check if claim is live require(<FILL_ME>) // Check if the user own one of the ERC-721 require(ownerOf(id) == msg.sender, "Doesn't own the token"); // Burn one Niveous1 ERC-721 token burn(id); // Receive kdao kdaoContract.burnToClaim(id,msg.sender); } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { } function foundationMint(uint256 quantity) public { } function artistMint(uint256 quantity) public { } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
kdaoContract.isClaimLive()==true,"Burn claim is not live yet"
428,382
kdaoContract.isClaimLive()==true
"You do not own komicpass"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { // Check claim contract is set require(komicpassAddress != address(0), "KOMICPASS contract has not been set"); //Check Claim has started require(publicSale, "claim has not started"); uint256 amount = tokenIds.length; require(amount > 0, "You have to claim atleast 1 allocation"); for(uint256 i = 0; i < tokenIds.length; i++) { komicpass = ERC721Enumerable(komicpassAddress); // Verify token ownership and if already redeemed require(<FILL_ME>) require(checkIfRedeemed(komicpassAddress, tokenIds[i]) == false, "tokenId already redeemed"); // Token is claimed claimedToken[komicpassAddress][tokenIds[i]] = true; } // Send tokens to pass holder _safeMint(msg.sender, amount); } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { } function foundationMint(uint256 quantity) public { } function artistMint(uint256 quantity) public { } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
komicpass.ownerOf(tokenIds[i])==msg.sender,"You do not own komicpass"
428,382
komicpass.ownerOf(tokenIds[i])==msg.sender
"tokenId already redeemed"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { // Check claim contract is set require(komicpassAddress != address(0), "KOMICPASS contract has not been set"); //Check Claim has started require(publicSale, "claim has not started"); uint256 amount = tokenIds.length; require(amount > 0, "You have to claim atleast 1 allocation"); for(uint256 i = 0; i < tokenIds.length; i++) { komicpass = ERC721Enumerable(komicpassAddress); // Verify token ownership and if already redeemed require(komicpass.ownerOf(tokenIds[i]) == msg.sender, "You do not own komicpass"); require(<FILL_ME>) // Token is claimed claimedToken[komicpassAddress][tokenIds[i]] = true; } // Send tokens to pass holder _safeMint(msg.sender, amount); } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { } function foundationMint(uint256 quantity) public { } function artistMint(uint256 quantity) public { } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
checkIfRedeemed(komicpassAddress,tokenIds[i])==false,"tokenId already redeemed"
428,382
checkIfRedeemed(komicpassAddress,tokenIds[i])==false
"soldout"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { require(publicSale, "public sale is offline"); require(contractLocked == false, "Contract has been locked"); require(quantity <= maxMint,"can not mint this many"); require(<FILL_ME>) require(msg.value >= salePrice * quantity, "insufficient funds"); _safeMint(msg.sender, quantity); } function foundationMint(uint256 quantity) public { } function artistMint(uint256 quantity) public { } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
totalSupply()+reserved+quantity<=issues,"soldout"
428,382
totalSupply()+reserved+quantity<=issues
"cannot mint more than 100"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { } function foundationMint(uint256 quantity) public { require(publicSale, "public sale is offline"); require(contractLocked == false, "Contract has been locked"); require(msg.sender == 0xE51f79Cde0dA2561460A4Ca4DAE74daC990fbB99, "not authorized"); require(<FILL_ME>) //KOMICPASS ID 0 will be claimed by the DAO so we need 101 _safeMint(msg.sender, quantity); // Mint token } function artistMint(uint256 quantity) public { } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
quantity+_numberMinted(msg.sender)<=101,"cannot mint more than 100"
428,382
quantity+_numberMinted(msg.sender)<=101
"cannot mint more than 100"
// SPDX-License-Identifier: MIT /* β–„β–ˆβ–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„ β–„β–ˆβ–„ β–„β–ˆβ–ˆβ–Œ β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆ β–„β–€β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–„ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–„β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆ β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„ β–β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–€ β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆ β–€β–€ β–€β–€ β–„β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„ β–„β–„ β–„β–ˆβ–ˆβ–€ ▐▀ β–ˆβ–ˆβ–€β–„β–„β–ˆβ–ˆβ–„β–ˆβ–ˆβ–β–ˆ β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–Œ β–β–ˆβ–ˆβ–„β–„β–„β–„β–€β–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–ˆ β–€ β–ˆ β–ˆ β–ˆβ–ˆβ–„β–„β–€β–„β–ˆβ–€β–€ Presents β–ˆβ–ˆβ–ˆβ–„ β–ˆ β–ˆβ–ˆβ–“ β–ˆβ–ˆβ–’ β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–€β–ˆ β–ˆ β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–‘ β–ˆβ–’β–“β–ˆ β–€ β–’β–ˆβ–ˆβ–’ β–ˆβ–ˆβ–’ β–ˆβ–ˆ β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆ β–’ β–“β–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’ β–“β–ˆβ–ˆ β–ˆβ–’β–‘β–’β–ˆβ–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘ β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ β–’β–ˆβ–ˆβ–‘β–‘ β–“β–ˆβ–ˆβ–„ β–“β–ˆβ–ˆβ–’ β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘ β–’β–ˆβ–ˆ β–ˆβ–‘β–‘β–’β–“β–ˆ β–„ β–’β–ˆβ–ˆ β–ˆβ–ˆβ–‘β–“β–“β–ˆ β–‘β–ˆβ–ˆβ–‘ β–’ β–ˆβ–ˆβ–’ β–’β–ˆβ–ˆβ–‘ β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘ β–’β–€β–ˆβ–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘ β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ β–‘ β–’β–‘ β–’ β–’ β–‘β–“ β–‘ ▐░ β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–‘β–’β–‘β–’β–‘ β–‘β–’β–“β–’ β–’ β–’ β–’ β–’β–“β–’ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–’β–‘ β–’ β–‘ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–’β–‘ β–‘β–‘β–’β–‘ β–‘ β–‘ β–‘ β–‘β–’ β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘ β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–’ β–‘β–‘β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ β–‘ Niveous ISSUE 1 Total Supply:11,111 Price: 0.03 eth Public Supply:9800 20 max per tx Reserved 1111 for KOMICPASS holders 100 for Cycrone 100 for Kuro Comics Dao KDAO TOKEN CONTRACT ADDRESS: 0xE0703247AC5A9cBda3647713cA810Fb9c7025123 KOMICPASS:0xfd4c08F58DCFc22C54ceA240eB3Ad04320A08d99 https://kurocomics.com all rights reserved KDAO */ pragma solidity ^0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./ERC721A.sol"; import "./IERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; abstract contract BurnInterface { function burnToClaim(uint256 tokenId, address tokenOwner ) public virtual; function isClaimLive() public virtual returns(bool); } /** @title Niveous Issue 1 genesis @author kurofoundation.eth @notice Use this contract to mint and claim Niveous */ contract Niveous is ERC721A,IERC721ABurnable,ERC721AQueryable,Ownable,ERC2981 { // Base uri string private uri; // Provenance string public NIVEOUS_PROVENANCE = ""; // Lock metadata bool public metadataLocked = false; bool public contractLocked = false; // Toggle Sale bool public publicSale = false; // Approved claim contract address claimContract; // Approved splitter contract address splitContract; // Approved KOMICPASS contract ERC721Enumerable public komicpass; address komicpassAddress; // KOMICPASS token mapping for claim mapping (address => mapping (uint256 => bool)) claimedToken; // Sale Price uint256 public immutable salePrice = 30000000000000000; // Total Issues uint256 public immutable issues = 11111; // Reserved 1,111 for komicpass holders , 100 for Ralph Del Mundo and 100 for Kuro Comics DAO uint256 public immutable reserved = 1311; uint256 public immutable maxMint = 20; constructor() ERC721A("Niveous: ISSUE 1", "Niveous1") {} /** * @notice Burn Niveous1 token `id` to claim kdao * @param id Token Id that will be burnt */ function burnDao(uint256 id) public { } /** * @notice Redeem KOMICPASS's for Niveous1 , all ids must be valid * @param tokenIds An array of token ids to redeem */ function claimNiveous(uint256[] calldata tokenIds) public { } /** * @notice Mint `quantity` Niveous1 * @param quantity Amount of Niveous1 tokens to mint */ function mintNiveous(uint256 quantity) public payable { } function foundationMint(uint256 quantity) public { } function artistMint(uint256 quantity) public { require(publicSale, "public sale is offline"); require(contractLocked == false, "Contract has been locked"); require(msg.sender == 0xb37728ddb6796BA53212361C2F9B8B20eBf20C0D, "not authorized"); require(quantity <= maxMint,"can not mint this many"); require(<FILL_ME>) _safeMint(msg.sender, quantity); // Mint token } // Set provenance hash function setProvenanceHash(string memory provenanceHash) public onlyOwner { } // Change the claim contract function setClaimContract(address newAddress) public onlyOwner { } // Change the splitter contract function setSplitContract(address newAddress) public onlyOwner { } // Change the komicpass contract function setPassContract(address newAddress) public onlyOwner { } function lockContract() public onlyOwner { } function lockMetadata() public onlyOwner { } // Set base uri. OnlyOwner can call it. function setBaseURI(string calldata _value) public onlyOwner { } // Check if the mintpass has been used to claim function checkIfRedeemed(address _contractAddress, uint256 _tokenId) view public returns(bool) { } // Toggle public sales function togglePublicSales() public onlyOwner { } // Check if public sale is live function isPublicSaleLive() view public returns(bool) { } // Set Royalties function setRoyalties(address recipient, uint96 value) public onlyOwner { } function numberMinted(address owner) public view returns (uint256) { } //backup withraw function withdraw() external onlyOwner { } function withdrawSplit() external onlyOwner { } // Overrides // // Returns base uri function _baseURI() internal view virtual override returns (string memory) { } // Start tokenid at 1 function _startTokenId() internal view virtual override returns (uint256) { } // Burn override function burn(uint256 tokenId) public virtual override { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A,ERC721A, ERC2981) returns (bool) { } }
quantity+_numberMinted(msg.sender)<=100,"cannot mint more than 100"
428,382
quantity+_numberMinted(msg.sender)<=100
"All whitelist NFTs are sold out!"
pragma solidity ^0.8.0; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error UnableDetermineTokenOwner(); error URIQueryForNonexistentToken(); contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal _currentIndex; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract Hacktivists is ERC721A, Ownable{ uint256 public constant MAX_SUPPLY = 444; uint256 public constant MAX_WHITELIST_TOTAL_SUPPLY = 420; uint256 public constant MAX_TEAM_TOTAL_SUPPLY = 24; //Max allowed mints uint256 public constant MAX_MINT = 1; //Prices uint256 public constant PUBLIC_SALE_PRICE = .1 ether; uint256 public constant WHITELIST_SALE_PRICE = .1 ether; //Whitelist uint256 public curTeamTotalSupply = 0; uint256 public curWhitelistTotalSupply = 0; string public baseTokenUri; //Stop / Start sales bool public publicSale; bool public whiteListSale; bool public teamSale; bytes32 private merkleRoot; bytes32 private merkleRootWL; mapping(address => uint256) public totalWhitelistMint; mapping(address => uint256) public totalTeamMint; constructor() ERC721A("Hacktivists Genesis", "USB"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ } function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ require(whiteListSale, "Whitelist Minting is not active"); require((totalSupply() + _quantity) <= MAX_SUPPLY, "NFTs are sold out!"); require((totalWhitelistMint[msg.sender] + _quantity) <= MAX_MINT, "Only 1 mint per whitelist allowed!"); require(msg.value >= (WHITELIST_SALE_PRICE * _quantity), "You need to spend more ETH!"); require(<FILL_ME>) //Check Merkle Proof bytes32 sender = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, merkleRootWL, sender), "You are not whitelisted!"); totalWhitelistMint[msg.sender] += _quantity; curWhitelistTotalSupply = curWhitelistTotalSupply + _quantity; _safeMint(msg.sender, _quantity); } function teamMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setTokenUri(string memory _baseTokenUri) external onlyOwner{ } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner{ } function setMerkleRootWL(bytes32 _merkleRoot) external onlyOwner{ } function getMerkleRoot() external view returns (bytes32){ } function getMerkleRootWL() external view returns (bytes32){ } function toggleTeamSale() external onlyOwner{ } function toggleWhiteListSale() external onlyOwner{ } function togglePublicSale() external onlyOwner{ } function withdraw() external onlyOwner{ } }
curWhitelistTotalSupply+_quantity<=MAX_WHITELIST_TOTAL_SUPPLY,"All whitelist NFTs are sold out!"
428,395
curWhitelistTotalSupply+_quantity<=MAX_WHITELIST_TOTAL_SUPPLY
"You are not whitelisted!"
pragma solidity ^0.8.0; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error UnableDetermineTokenOwner(); error URIQueryForNonexistentToken(); contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal _currentIndex; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract Hacktivists is ERC721A, Ownable{ uint256 public constant MAX_SUPPLY = 444; uint256 public constant MAX_WHITELIST_TOTAL_SUPPLY = 420; uint256 public constant MAX_TEAM_TOTAL_SUPPLY = 24; //Max allowed mints uint256 public constant MAX_MINT = 1; //Prices uint256 public constant PUBLIC_SALE_PRICE = .1 ether; uint256 public constant WHITELIST_SALE_PRICE = .1 ether; //Whitelist uint256 public curTeamTotalSupply = 0; uint256 public curWhitelistTotalSupply = 0; string public baseTokenUri; //Stop / Start sales bool public publicSale; bool public whiteListSale; bool public teamSale; bytes32 private merkleRoot; bytes32 private merkleRootWL; mapping(address => uint256) public totalWhitelistMint; mapping(address => uint256) public totalTeamMint; constructor() ERC721A("Hacktivists Genesis", "USB"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ } function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ require(whiteListSale, "Whitelist Minting is not active"); require((totalSupply() + _quantity) <= MAX_SUPPLY, "NFTs are sold out!"); require((totalWhitelistMint[msg.sender] + _quantity) <= MAX_MINT, "Only 1 mint per whitelist allowed!"); require(msg.value >= (WHITELIST_SALE_PRICE * _quantity), "You need to spend more ETH!"); require(curWhitelistTotalSupply + _quantity <= MAX_WHITELIST_TOTAL_SUPPLY, "All whitelist NFTs are sold out!"); //Check Merkle Proof bytes32 sender = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) totalWhitelistMint[msg.sender] += _quantity; curWhitelistTotalSupply = curWhitelistTotalSupply + _quantity; _safeMint(msg.sender, _quantity); } function teamMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setTokenUri(string memory _baseTokenUri) external onlyOwner{ } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner{ } function setMerkleRootWL(bytes32 _merkleRoot) external onlyOwner{ } function getMerkleRoot() external view returns (bytes32){ } function getMerkleRootWL() external view returns (bytes32){ } function toggleTeamSale() external onlyOwner{ } function toggleWhiteListSale() external onlyOwner{ } function togglePublicSale() external onlyOwner{ } function withdraw() external onlyOwner{ } }
MerkleProof.verify(_merkleProof,merkleRootWL,sender),"You are not whitelisted!"
428,395
MerkleProof.verify(_merkleProof,merkleRootWL,sender)
"Only 1 mint per team member allowed!"
pragma solidity ^0.8.0; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error UnableDetermineTokenOwner(); error URIQueryForNonexistentToken(); contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal _currentIndex; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract Hacktivists is ERC721A, Ownable{ uint256 public constant MAX_SUPPLY = 444; uint256 public constant MAX_WHITELIST_TOTAL_SUPPLY = 420; uint256 public constant MAX_TEAM_TOTAL_SUPPLY = 24; //Max allowed mints uint256 public constant MAX_MINT = 1; //Prices uint256 public constant PUBLIC_SALE_PRICE = .1 ether; uint256 public constant WHITELIST_SALE_PRICE = .1 ether; //Whitelist uint256 public curTeamTotalSupply = 0; uint256 public curWhitelistTotalSupply = 0; string public baseTokenUri; //Stop / Start sales bool public publicSale; bool public whiteListSale; bool public teamSale; bytes32 private merkleRoot; bytes32 private merkleRootWL; mapping(address => uint256) public totalWhitelistMint; mapping(address => uint256) public totalTeamMint; constructor() ERC721A("Hacktivists Genesis", "USB"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ } function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ } function teamMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ require(teamSale, "Team Minting is not active!"); require((totalSupply() + _quantity) <= MAX_SUPPLY, "NFTs are sold out!"); require(<FILL_ME>) require(curTeamTotalSupply + _quantity <= MAX_TEAM_TOTAL_SUPPLY, "All team NFTs are sold out!"); //Check Merkle Proof bytes32 sender = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, merkleRoot, sender), "You are not a member of the team!"); totalTeamMint[msg.sender] += _quantity; curTeamTotalSupply = curTeamTotalSupply + _quantity; _safeMint(msg.sender, _quantity); } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setTokenUri(string memory _baseTokenUri) external onlyOwner{ } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner{ } function setMerkleRootWL(bytes32 _merkleRoot) external onlyOwner{ } function getMerkleRoot() external view returns (bytes32){ } function getMerkleRootWL() external view returns (bytes32){ } function toggleTeamSale() external onlyOwner{ } function toggleWhiteListSale() external onlyOwner{ } function togglePublicSale() external onlyOwner{ } function withdraw() external onlyOwner{ } }
(totalTeamMint[msg.sender]+_quantity)<=MAX_MINT,"Only 1 mint per team member allowed!"
428,395
(totalTeamMint[msg.sender]+_quantity)<=MAX_MINT
"All team NFTs are sold out!"
pragma solidity ^0.8.0; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error UnableDetermineTokenOwner(); error URIQueryForNonexistentToken(); contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal _currentIndex; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } contract Hacktivists is ERC721A, Ownable{ uint256 public constant MAX_SUPPLY = 444; uint256 public constant MAX_WHITELIST_TOTAL_SUPPLY = 420; uint256 public constant MAX_TEAM_TOTAL_SUPPLY = 24; //Max allowed mints uint256 public constant MAX_MINT = 1; //Prices uint256 public constant PUBLIC_SALE_PRICE = .1 ether; uint256 public constant WHITELIST_SALE_PRICE = .1 ether; //Whitelist uint256 public curTeamTotalSupply = 0; uint256 public curWhitelistTotalSupply = 0; string public baseTokenUri; //Stop / Start sales bool public publicSale; bool public whiteListSale; bool public teamSale; bytes32 private merkleRoot; bytes32 private merkleRootWL; mapping(address => uint256) public totalWhitelistMint; mapping(address => uint256) public totalTeamMint; constructor() ERC721A("Hacktivists Genesis", "USB"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ } function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ } function teamMint(bytes32[] memory _merkleProof, uint256 _quantity) external payable callerIsUser{ require(teamSale, "Team Minting is not active!"); require((totalSupply() + _quantity) <= MAX_SUPPLY, "NFTs are sold out!"); require((totalTeamMint[msg.sender] + _quantity) <= MAX_MINT , "Only 1 mint per team member allowed!"); require(<FILL_ME>) //Check Merkle Proof bytes32 sender = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, merkleRoot, sender), "You are not a member of the team!"); totalTeamMint[msg.sender] += _quantity; curTeamTotalSupply = curTeamTotalSupply + _quantity; _safeMint(msg.sender, _quantity); } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setTokenUri(string memory _baseTokenUri) external onlyOwner{ } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner{ } function setMerkleRootWL(bytes32 _merkleRoot) external onlyOwner{ } function getMerkleRoot() external view returns (bytes32){ } function getMerkleRootWL() external view returns (bytes32){ } function toggleTeamSale() external onlyOwner{ } function toggleWhiteListSale() external onlyOwner{ } function togglePublicSale() external onlyOwner{ } function withdraw() external onlyOwner{ } }
curTeamTotalSupply+_quantity<=MAX_TEAM_TOTAL_SUPPLY,"All team NFTs are sold out!"
428,395
curTeamTotalSupply+_quantity<=MAX_TEAM_TOTAL_SUPPLY
"That is not your Gemesis NFT"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9 <0.9.0; import "erc721a/contracts/ERC721A.sol"; import "erc721a/contracts/IERC721A.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract GemPunks is ERC721AQueryable, Ownable, ReentrancyGuard, DefaultOperatorFilterer { using Strings for uint256; uint256 public maxSupply = 4423; uint256 public publicPrice = 0.005 ether; uint256 public maxPerWallet = 10; bool public isPublicMint = false; bool public isFreeClaim = false; bool public isMetadataFinal; string public _baseURL = ""; string public prerevealURL = ""; address public _gemesis = 0xbe9371326F91345777b04394448c23E2BFEaa826; IERC721A gemesisContract = IERC721A(_gemesis); mapping(uint256 => bool) private _claimedGemesis; mapping(address => uint256) private _walletMintedCount; constructor() ERC721A("Gem Punks", "GEMPUNK") {} function mintedCount(address owner) external view returns (uint256) { } function _baseURI() internal view override returns (string memory) { } function _startTokenId() internal pure override returns (uint256) { } function contractURI() public pure returns (string memory) { } function finalizeMetadata() external onlyOwner { } function reveal(string memory url) external onlyOwner { } function withdraw() public onlyOwner nonReentrant { } function teamMint(address to, uint256 count) external onlyOwner { } function tokenURI(uint256 tokenId) public view override(ERC721A, IERC721A) returns (string memory) { } /* "SET VARIABLE" FUNCTIONS */ function setPublicPrice(uint256 _price) external onlyOwner { } function togglePublicState() external onlyOwner { } function toggleFreeClaim() external onlyOwner { } function setMaxSupply(uint256 newMaxSupply) external onlyOwner { } function setMaxPerWallet(uint256 newMax) external onlyOwner { } /* MINT FUNCTIONS */ function gemesisClaim(uint256[] memory tokens) external { uint256 count = tokens.length; require(isFreeClaim, "Free claiming has not started"); require(_totalMinted() + count <= maxSupply, "Exceeds max supply"); for (uint256 i = 0; i < count; i++) { require(<FILL_ME>) require( _claimedGemesis[tokens[i]] == false, "Your Gemesis has already claimed" ); _claimedGemesis[tokens[i]] = true; } _walletMintedCount[msg.sender] += count; _safeMint(msg.sender, count); } function mint(uint256 count) external payable { } /* OPENSEA OPERATOR OVERRIDES (ROYALTIES) */ function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) { } }
gemesisContract.ownerOf(tokens[i])==msg.sender,"That is not your Gemesis NFT"
428,701
gemesisContract.ownerOf(tokens[i])==msg.sender