comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"account-guard/wrong-guard-address"
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; import "./AccountGuard.sol"; contract AccountImplementation { AccountGuard public immutable guard; modifier authAndWhitelisted(address target, bool asDelegateCall) { } constructor(AccountGuard _guard) { require(<FILL_ME>) guard = _guard; } function send(address _target, bytes calldata _data) external payable authAndWhitelisted(_target, false) { } function execute(address _target, bytes memory /* code do not compile with calldata */ _data) external payable authAndWhitelisted(_target, true) returns (bytes32) { } receive() external payable { } function owner() external view returns (address) { } event FundsRecived(address sender, uint256 amount); }
address(_guard)!=address(0x0),"account-guard/wrong-guard-address"
400,110
address(_guard)!=address(0x0)
"stream already exists"
//SPDX-License-Identifier: None pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {BoringBatchable} from "./fork/BoringBatchable.sol"; interface Factory { function parameter() external view returns (address); } interface IERC20WithDecimals { function decimals() external view returns (uint8); } // All amountPerSec and all internal numbers use 20 decimals, these are converted to the right decimal on withdrawal/deposit // The reason for that is to minimize precision errors caused by integer math on tokens with low decimals (eg: USDC) // Invariant through the whole contract: lastPayerUpdate[anyone] <= block.timestamp // Reason: timestamps can't go back in time (https://github.com/ethereum/go-ethereum/blob/master/consensus/ethash/consensus.go#L274 and block timestamp definition on ethereum's yellow paper) // and we always set lastPayerUpdate[anyone] either to the current block.timestamp or a value lower than it // We could use this to optimize subtractions and avoid an unneded safemath check there for some gas savings // However this is obscure enough that we are not sure if a future ethereum network upgrade might remove this assertion // or if an ethereum fork might remove that code and invalidate the condition, causing our deployment on that chain to be vulnerable // This is dangerous because if someone can make a timestamp go back into the past they could steal all the money // So we forgo these optimizations and instead enforce this condition. // Another assumption is that all timestamps can fit in uint40, this will be true until year 231,800, so it's a safe assumption contract LlamaPay is BoringBatchable { using SafeERC20 for IERC20; struct Payer { uint40 lastPayerUpdate; uint216 totalPaidPerSec; // uint216 is enough to hold 1M streams of 3e51 tokens/yr, which is enough } mapping (bytes32 => uint) public streamToStart; mapping (address => Payer) public payers; mapping (address => uint) public balances; // could be packed together with lastPayerUpdate but gains are not high IERC20 public token; uint public DECIMALS_DIVISOR; event StreamCreated(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamCreatedWithReason(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, string reason); event StreamCancelled(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamPaused(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamModified(address indexed from, address indexed oldTo, uint216 oldAmountPerSec, bytes32 oldStreamId, address indexed to, uint216 amountPerSec, bytes32 newStreamId); event Withdraw(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, uint amount); event PayerDeposit(address indexed from, uint amount); event PayerWithdraw(address indexed from, uint amount); constructor(){ } function getStreamId(address from, address to, uint216 amountPerSec) public pure returns (bytes32){ } function _createStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId){ streamId = getStreamId(msg.sender, to, amountPerSec); require(amountPerSec > 0, "amountPerSec can't be 0"); require(<FILL_ME>) streamToStart[streamId] = block.timestamp; Payer storage payer = payers[msg.sender]; uint totalPaid; uint delta = block.timestamp - payer.lastPayerUpdate; unchecked { totalPaid = delta * uint(payer.totalPaidPerSec); } balances[msg.sender] -= totalPaid; // implicit check that balance >= totalPaid, can't create a new stream unless there's no debt payer.lastPayerUpdate = uint40(block.timestamp); payer.totalPaidPerSec += amountPerSec; // checking that no overflow will ever happen on totalPaidPerSec is important because if there's an overflow later: // - if we don't have overflow checks -> it would be possible to steal money from other people // - if there are overflow checks -> money will be stuck forever as all txs (from payees of the same payer) will revert // which can be used to rug employees and make them unable to withdraw their earnings // Thus it's extremely important that no user is allowed to enter any value that later on could trigger an overflow. // We implicitly prevent this here because amountPerSec/totalPaidPerSec is uint216 and is only ever multiplied by timestamps // which will always fit in a uint40. Thus the result of the multiplication will always fit inside a uint256 and never overflow // This however introduces a new invariant: the only operations that can be done with amountPerSec/totalPaidPerSec are muls against timestamps // and we need to make sure they happen in uint256 contexts, not any other } function createStream(address to, uint216 amountPerSec) public { } function createStreamWithReason(address to, uint216 amountPerSec, string calldata reason) public { } /* proof that lastUpdate < block.timestamp: let's start by assuming the opposite, that lastUpdate > block.timestamp, and then we'll prove that this is impossible lastUpdate > block.timestamp -> timePaid = lastUpdate - lastPayerUpdate[from] > block.timestamp - lastPayerUpdate[from] = payerDelta -> timePaid > payerDelta -> payerBalance = timePaid * totalPaidPerSec[from] > payerDelta * totalPaidPerSec[from] = totalPayerPayment -> payerBalance > totalPayerPayment but this last statement is impossible because if it were true we'd have gone into the first if branch! */ /* proof that totalPaidPerSec[from] != 0: totalPaidPerSec[from] is a sum of uint that are different from zero (since we test that on createStream()) and we test that there's at least one stream active with `streamToStart[streamId] != 0`, so it's a sum of one or more elements that are higher than zero, thus it can never be zero */ // Make it possible to withdraw on behalf of others, important for people that don't have a metamask wallet (eg: cex address, trustwallet...) function _withdraw(address from, address to, uint216 amountPerSec) private returns (uint40 lastUpdate, bytes32 streamId, uint amountToTransfer) { } // Copy of _withdraw that is view-only and returns how much can be withdrawn from a stream, purely for convenience on frontend // No need to review since this does nothing function withdrawable(address from, address to, uint216 amountPerSec) external view returns (uint withdrawableAmount, uint lastUpdate, uint owed) { } function withdraw(address from, address to, uint216 amountPerSec) external { } function _cancelStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId) { } function cancelStream(address to, uint216 amountPerSec) public { } function pauseStream(address to, uint216 amountPerSec) public { } function modifyStream(address oldTo, uint216 oldAmountPerSec, address to, uint216 amountPerSec) external { } function deposit(uint amount) public { } function depositAndCreate(uint amountToDeposit, address to, uint216 amountPerSec) external { } function depositAndCreateWithReason(uint amountToDeposit, address to, uint216 amountPerSec, string calldata reason) external { } function withdrawPayer(uint amount) public { } function withdrawPayerAll() external { } function getPayerBalance(address payerAddress) external view returns (int) { } }
streamToStart[streamId]==0,"stream already exists"
400,118
streamToStart[streamId]==0
"stream doesn't exist"
//SPDX-License-Identifier: None pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {BoringBatchable} from "./fork/BoringBatchable.sol"; interface Factory { function parameter() external view returns (address); } interface IERC20WithDecimals { function decimals() external view returns (uint8); } // All amountPerSec and all internal numbers use 20 decimals, these are converted to the right decimal on withdrawal/deposit // The reason for that is to minimize precision errors caused by integer math on tokens with low decimals (eg: USDC) // Invariant through the whole contract: lastPayerUpdate[anyone] <= block.timestamp // Reason: timestamps can't go back in time (https://github.com/ethereum/go-ethereum/blob/master/consensus/ethash/consensus.go#L274 and block timestamp definition on ethereum's yellow paper) // and we always set lastPayerUpdate[anyone] either to the current block.timestamp or a value lower than it // We could use this to optimize subtractions and avoid an unneded safemath check there for some gas savings // However this is obscure enough that we are not sure if a future ethereum network upgrade might remove this assertion // or if an ethereum fork might remove that code and invalidate the condition, causing our deployment on that chain to be vulnerable // This is dangerous because if someone can make a timestamp go back into the past they could steal all the money // So we forgo these optimizations and instead enforce this condition. // Another assumption is that all timestamps can fit in uint40, this will be true until year 231,800, so it's a safe assumption contract LlamaPay is BoringBatchable { using SafeERC20 for IERC20; struct Payer { uint40 lastPayerUpdate; uint216 totalPaidPerSec; // uint216 is enough to hold 1M streams of 3e51 tokens/yr, which is enough } mapping (bytes32 => uint) public streamToStart; mapping (address => Payer) public payers; mapping (address => uint) public balances; // could be packed together with lastPayerUpdate but gains are not high IERC20 public token; uint public DECIMALS_DIVISOR; event StreamCreated(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamCreatedWithReason(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, string reason); event StreamCancelled(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamPaused(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamModified(address indexed from, address indexed oldTo, uint216 oldAmountPerSec, bytes32 oldStreamId, address indexed to, uint216 amountPerSec, bytes32 newStreamId); event Withdraw(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, uint amount); event PayerDeposit(address indexed from, uint amount); event PayerWithdraw(address indexed from, uint amount); constructor(){ } function getStreamId(address from, address to, uint216 amountPerSec) public pure returns (bytes32){ } function _createStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId){ } function createStream(address to, uint216 amountPerSec) public { } function createStreamWithReason(address to, uint216 amountPerSec, string calldata reason) public { } /* proof that lastUpdate < block.timestamp: let's start by assuming the opposite, that lastUpdate > block.timestamp, and then we'll prove that this is impossible lastUpdate > block.timestamp -> timePaid = lastUpdate - lastPayerUpdate[from] > block.timestamp - lastPayerUpdate[from] = payerDelta -> timePaid > payerDelta -> payerBalance = timePaid * totalPaidPerSec[from] > payerDelta * totalPaidPerSec[from] = totalPayerPayment -> payerBalance > totalPayerPayment but this last statement is impossible because if it were true we'd have gone into the first if branch! */ /* proof that totalPaidPerSec[from] != 0: totalPaidPerSec[from] is a sum of uint that are different from zero (since we test that on createStream()) and we test that there's at least one stream active with `streamToStart[streamId] != 0`, so it's a sum of one or more elements that are higher than zero, thus it can never be zero */ // Make it possible to withdraw on behalf of others, important for people that don't have a metamask wallet (eg: cex address, trustwallet...) function _withdraw(address from, address to, uint216 amountPerSec) private returns (uint40 lastUpdate, bytes32 streamId, uint amountToTransfer) { streamId = getStreamId(from, to, amountPerSec); require(<FILL_ME>) Payer storage payer = payers[from]; uint totalPayerPayment; uint payerDelta = block.timestamp - payer.lastPayerUpdate; unchecked{ totalPayerPayment = payerDelta * uint(payer.totalPaidPerSec); } uint payerBalance = balances[from]; if(payerBalance >= totalPayerPayment){ unchecked { balances[from] = payerBalance - totalPayerPayment; } lastUpdate = uint40(block.timestamp); } else { // invariant: totalPaidPerSec[from] != 0 unchecked { uint timePaid = payerBalance/uint(payer.totalPaidPerSec); lastUpdate = uint40(payer.lastPayerUpdate + timePaid); // invariant: lastUpdate < block.timestamp (we need to maintain it) balances[from] = payerBalance % uint(payer.totalPaidPerSec); } } uint delta = lastUpdate - streamToStart[streamId]; // Could use unchecked here too I think unchecked { // We push transfers to be done outside this function and at the end of public functions to avoid reentrancy exploits amountToTransfer = (delta*uint(amountPerSec))/DECIMALS_DIVISOR; } emit Withdraw(from, to, amountPerSec, streamId, amountToTransfer); } // Copy of _withdraw that is view-only and returns how much can be withdrawn from a stream, purely for convenience on frontend // No need to review since this does nothing function withdrawable(address from, address to, uint216 amountPerSec) external view returns (uint withdrawableAmount, uint lastUpdate, uint owed) { } function withdraw(address from, address to, uint216 amountPerSec) external { } function _cancelStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId) { } function cancelStream(address to, uint216 amountPerSec) public { } function pauseStream(address to, uint216 amountPerSec) public { } function modifyStream(address oldTo, uint216 oldAmountPerSec, address to, uint216 amountPerSec) external { } function deposit(uint amount) public { } function depositAndCreate(uint amountToDeposit, address to, uint216 amountPerSec) external { } function depositAndCreateWithReason(uint amountToDeposit, address to, uint216 amountPerSec, string calldata reason) external { } function withdrawPayer(uint amount) public { } function withdrawPayerAll() external { } function getPayerBalance(address payerAddress) external view returns (int) { } }
streamToStart[streamId]!=0,"stream doesn't exist"
400,118
streamToStart[streamId]!=0
"pls no rug"
//SPDX-License-Identifier: None pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {BoringBatchable} from "./fork/BoringBatchable.sol"; interface Factory { function parameter() external view returns (address); } interface IERC20WithDecimals { function decimals() external view returns (uint8); } // All amountPerSec and all internal numbers use 20 decimals, these are converted to the right decimal on withdrawal/deposit // The reason for that is to minimize precision errors caused by integer math on tokens with low decimals (eg: USDC) // Invariant through the whole contract: lastPayerUpdate[anyone] <= block.timestamp // Reason: timestamps can't go back in time (https://github.com/ethereum/go-ethereum/blob/master/consensus/ethash/consensus.go#L274 and block timestamp definition on ethereum's yellow paper) // and we always set lastPayerUpdate[anyone] either to the current block.timestamp or a value lower than it // We could use this to optimize subtractions and avoid an unneded safemath check there for some gas savings // However this is obscure enough that we are not sure if a future ethereum network upgrade might remove this assertion // or if an ethereum fork might remove that code and invalidate the condition, causing our deployment on that chain to be vulnerable // This is dangerous because if someone can make a timestamp go back into the past they could steal all the money // So we forgo these optimizations and instead enforce this condition. // Another assumption is that all timestamps can fit in uint40, this will be true until year 231,800, so it's a safe assumption contract LlamaPay is BoringBatchable { using SafeERC20 for IERC20; struct Payer { uint40 lastPayerUpdate; uint216 totalPaidPerSec; // uint216 is enough to hold 1M streams of 3e51 tokens/yr, which is enough } mapping (bytes32 => uint) public streamToStart; mapping (address => Payer) public payers; mapping (address => uint) public balances; // could be packed together with lastPayerUpdate but gains are not high IERC20 public token; uint public DECIMALS_DIVISOR; event StreamCreated(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamCreatedWithReason(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, string reason); event StreamCancelled(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamPaused(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId); event StreamModified(address indexed from, address indexed oldTo, uint216 oldAmountPerSec, bytes32 oldStreamId, address indexed to, uint216 amountPerSec, bytes32 newStreamId); event Withdraw(address indexed from, address indexed to, uint216 amountPerSec, bytes32 streamId, uint amount); event PayerDeposit(address indexed from, uint amount); event PayerWithdraw(address indexed from, uint amount); constructor(){ } function getStreamId(address from, address to, uint216 amountPerSec) public pure returns (bytes32){ } function _createStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId){ } function createStream(address to, uint216 amountPerSec) public { } function createStreamWithReason(address to, uint216 amountPerSec, string calldata reason) public { } /* proof that lastUpdate < block.timestamp: let's start by assuming the opposite, that lastUpdate > block.timestamp, and then we'll prove that this is impossible lastUpdate > block.timestamp -> timePaid = lastUpdate - lastPayerUpdate[from] > block.timestamp - lastPayerUpdate[from] = payerDelta -> timePaid > payerDelta -> payerBalance = timePaid * totalPaidPerSec[from] > payerDelta * totalPaidPerSec[from] = totalPayerPayment -> payerBalance > totalPayerPayment but this last statement is impossible because if it were true we'd have gone into the first if branch! */ /* proof that totalPaidPerSec[from] != 0: totalPaidPerSec[from] is a sum of uint that are different from zero (since we test that on createStream()) and we test that there's at least one stream active with `streamToStart[streamId] != 0`, so it's a sum of one or more elements that are higher than zero, thus it can never be zero */ // Make it possible to withdraw on behalf of others, important for people that don't have a metamask wallet (eg: cex address, trustwallet...) function _withdraw(address from, address to, uint216 amountPerSec) private returns (uint40 lastUpdate, bytes32 streamId, uint amountToTransfer) { } // Copy of _withdraw that is view-only and returns how much can be withdrawn from a stream, purely for convenience on frontend // No need to review since this does nothing function withdrawable(address from, address to, uint216 amountPerSec) external view returns (uint withdrawableAmount, uint lastUpdate, uint owed) { } function withdraw(address from, address to, uint216 amountPerSec) external { } function _cancelStream(address to, uint216 amountPerSec) internal returns (bytes32 streamId) { } function cancelStream(address to, uint216 amountPerSec) public { } function pauseStream(address to, uint216 amountPerSec) public { } function modifyStream(address oldTo, uint216 oldAmountPerSec, address to, uint216 amountPerSec) external { } function deposit(uint amount) public { } function depositAndCreate(uint amountToDeposit, address to, uint216 amountPerSec) external { } function depositAndCreateWithReason(uint amountToDeposit, address to, uint216 amountPerSec, string calldata reason) external { } function withdrawPayer(uint amount) public { Payer storage payer = payers[msg.sender]; balances[msg.sender] -= amount; // implicit check that balance > amount uint delta = block.timestamp - payer.lastPayerUpdate; unchecked { require(<FILL_ME>) uint tokenAmount = amount/DECIMALS_DIVISOR; token.safeTransfer(msg.sender, tokenAmount); emit PayerWithdraw(msg.sender, tokenAmount); } } function withdrawPayerAll() external { } function getPayerBalance(address payerAddress) external view returns (int) { } }
balances[msg.sender]>=delta*uint(payer.totalPaidPerSec),"pls no rug"
400,118
balances[msg.sender]>=delta*uint(payer.totalPaidPerSec)
"only owners approved"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IMintableERC20 is IERC20 { function mint(address _to, uint256 _amount) external; function burn(address _from, uint256 _amount) external; } contract BOBLCarePackage is Ownable { IERC721 public erc721Token; IMintableERC20 public erc20Token; // the number of weeks to claim tokens for uint256 public epochsToClaim = 16; // yield rate per week for each rarity uint256 public rowdyEpochYield = 1 ether; uint256 public ragingEpochYield = 3 ether; uint256 public royalEpochYield = 6 ether; // signer addresses address private rowdySigner; address private ragingSigner; address private royalSigner; // mapping points the token ID to claim boolean mapping(uint16 => uint8) claimed; // events event CarePackageClaimed(uint16 tokenId, address owner, uint256 reward); // constructor constructor(address _erc721Address, address _erc20Address) { } // sets the genesis ERC721 contract address function setERC721Contract(address _erc721Address) external onlyOwner { } // sets the rewards token contract address function setERC20Contract(address _erc20Address) external onlyOwner { } // sets the signer addresses for rarity verification function setSigners(address[] calldata signers) public onlyOwner{ } // claims your care package function claimCarePackage(address _owner, uint16[] calldata _tokenIds, bytes32[] memory _hashes, bytes[] memory _signatures) external { require(<FILL_ME>) uint256 reward; for (uint16 i = 0; i < _tokenIds.length; i++) { require(erc721Token.ownerOf(_tokenIds[i]) == msg.sender, "only owners approved"); reward += _claimCarePackage(_owner, _tokenIds[i], _hashes[i], _signatures[i]); } if (reward != 0) { erc20Token.mint(msg.sender, reward); } } // stake the token function _claimCarePackage(address _owner, uint16 _tokenId, bytes32 _hash, bytes memory _signature) internal returns (uint256 reward) { } function isClaimed(uint16 _tokenId) public view returns (bool){ } // recovers the signer's address function recoverSigner(bytes32 _hash, bytes memory _signature) public pure returns (address) { } }
(_owner==msg.sender),"only owners approved"
400,119
(_owner==msg.sender)
"only owners approved"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IMintableERC20 is IERC20 { function mint(address _to, uint256 _amount) external; function burn(address _from, uint256 _amount) external; } contract BOBLCarePackage is Ownable { IERC721 public erc721Token; IMintableERC20 public erc20Token; // the number of weeks to claim tokens for uint256 public epochsToClaim = 16; // yield rate per week for each rarity uint256 public rowdyEpochYield = 1 ether; uint256 public ragingEpochYield = 3 ether; uint256 public royalEpochYield = 6 ether; // signer addresses address private rowdySigner; address private ragingSigner; address private royalSigner; // mapping points the token ID to claim boolean mapping(uint16 => uint8) claimed; // events event CarePackageClaimed(uint16 tokenId, address owner, uint256 reward); // constructor constructor(address _erc721Address, address _erc20Address) { } // sets the genesis ERC721 contract address function setERC721Contract(address _erc721Address) external onlyOwner { } // sets the rewards token contract address function setERC20Contract(address _erc20Address) external onlyOwner { } // sets the signer addresses for rarity verification function setSigners(address[] calldata signers) public onlyOwner{ } // claims your care package function claimCarePackage(address _owner, uint16[] calldata _tokenIds, bytes32[] memory _hashes, bytes[] memory _signatures) external { require((_owner == msg.sender), "only owners approved"); uint256 reward; for (uint16 i = 0; i < _tokenIds.length; i++) { require(<FILL_ME>) reward += _claimCarePackage(_owner, _tokenIds[i], _hashes[i], _signatures[i]); } if (reward != 0) { erc20Token.mint(msg.sender, reward); } } // stake the token function _claimCarePackage(address _owner, uint16 _tokenId, bytes32 _hash, bytes memory _signature) internal returns (uint256 reward) { } function isClaimed(uint16 _tokenId) public view returns (bool){ } // recovers the signer's address function recoverSigner(bytes32 _hash, bytes memory _signature) public pure returns (address) { } }
erc721Token.ownerOf(_tokenIds[i])==msg.sender,"only owners approved"
400,119
erc721Token.ownerOf(_tokenIds[i])==msg.sender
"care package has already been claimed for this id"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IMintableERC20 is IERC20 { function mint(address _to, uint256 _amount) external; function burn(address _from, uint256 _amount) external; } contract BOBLCarePackage is Ownable { IERC721 public erc721Token; IMintableERC20 public erc20Token; // the number of weeks to claim tokens for uint256 public epochsToClaim = 16; // yield rate per week for each rarity uint256 public rowdyEpochYield = 1 ether; uint256 public ragingEpochYield = 3 ether; uint256 public royalEpochYield = 6 ether; // signer addresses address private rowdySigner; address private ragingSigner; address private royalSigner; // mapping points the token ID to claim boolean mapping(uint16 => uint8) claimed; // events event CarePackageClaimed(uint16 tokenId, address owner, uint256 reward); // constructor constructor(address _erc721Address, address _erc20Address) { } // sets the genesis ERC721 contract address function setERC721Contract(address _erc721Address) external onlyOwner { } // sets the rewards token contract address function setERC20Contract(address _erc20Address) external onlyOwner { } // sets the signer addresses for rarity verification function setSigners(address[] calldata signers) public onlyOwner{ } // claims your care package function claimCarePackage(address _owner, uint16[] calldata _tokenIds, bytes32[] memory _hashes, bytes[] memory _signatures) external { } // stake the token function _claimCarePackage(address _owner, uint16 _tokenId, bytes32 _hash, bytes memory _signature) internal returns (uint256 reward) { require(<FILL_ME>) address signer = recoverSigner(_hash, _signature); uint8 rarity = 0; if(signer == rowdySigner){ rarity = 0; } else if(signer == ragingSigner){ rarity = 1; } else if(signer == royalSigner){ rarity = 2; } reward = epochsToClaim; if(rarity == 0) { reward *= rowdyEpochYield; } else if(rarity == 1) { reward *= ragingEpochYield; } else if(rarity == 2) { reward *= royalEpochYield; } claimed[_tokenId] = 1; emit CarePackageClaimed(_tokenId, _owner, reward); return reward; } function isClaimed(uint16 _tokenId) public view returns (bool){ } // recovers the signer's address function recoverSigner(bytes32 _hash, bytes memory _signature) public pure returns (address) { } }
(isClaimed(_tokenId)==false),"care package has already been claimed for this id"
400,119
(isClaimed(_tokenId)==false)
"NOT_ACTIVE"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.advCfg.depositMerkleRoot != bytes32(0), "NOT_CONFIGURED"); require( state.advCfg.depositContractAddress != address(0), "NOT_CONFIGURED" ); require(<FILL_ME>) uint256 numberOfTokens = _tokenIds.length; require(numberOfTokens > 0, "NO_TOKEN_IDS_PROVIDED"); require( numberOfTokens == _merkleProofs.length, "ARRAY_LENGTHS_MUST_MATCH" ); require( totalSupply() + numberOfTokens <= state.cfg.maxSupply, "MAX_SUPPLY_EXCEEDED" ); require( msg.value == remainingDepositPaymentInWei() * numberOfTokens, "INCORRECT_REMAINING_PAYMENT" ); IERC721 DepositContract = IERC721(state.advCfg.depositContractAddress); for (uint256 i = 0; i < numberOfTokens; i++) { require( MerkleProofUpgradeable.verify( _merkleProofs[i], state.advCfg.depositMerkleRoot, keccak256(abi.encodePacked(_tokenIds[i])) ), "INVALID_MERKLE_PROOF" ); require( DepositContract.ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN" ); DepositContract.transferFrom(msg.sender, burnAddress, _tokenIds[i]); } _safeMint(msg.sender, numberOfTokens); } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
state.advCfg.depositClaimActive,"NOT_ACTIVE"
400,539
state.advCfg.depositClaimActive
"MAX_SUPPLY_EXCEEDED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.advCfg.depositMerkleRoot != bytes32(0), "NOT_CONFIGURED"); require( state.advCfg.depositContractAddress != address(0), "NOT_CONFIGURED" ); require(state.advCfg.depositClaimActive, "NOT_ACTIVE"); uint256 numberOfTokens = _tokenIds.length; require(numberOfTokens > 0, "NO_TOKEN_IDS_PROVIDED"); require( numberOfTokens == _merkleProofs.length, "ARRAY_LENGTHS_MUST_MATCH" ); require(<FILL_ME>) require( msg.value == remainingDepositPaymentInWei() * numberOfTokens, "INCORRECT_REMAINING_PAYMENT" ); IERC721 DepositContract = IERC721(state.advCfg.depositContractAddress); for (uint256 i = 0; i < numberOfTokens; i++) { require( MerkleProofUpgradeable.verify( _merkleProofs[i], state.advCfg.depositMerkleRoot, keccak256(abi.encodePacked(_tokenIds[i])) ), "INVALID_MERKLE_PROOF" ); require( DepositContract.ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN" ); DepositContract.transferFrom(msg.sender, burnAddress, _tokenIds[i]); } _safeMint(msg.sender, numberOfTokens); } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
totalSupply()+numberOfTokens<=state.cfg.maxSupply,"MAX_SUPPLY_EXCEEDED"
400,539
totalSupply()+numberOfTokens<=state.cfg.maxSupply
"INVALID_MERKLE_PROOF"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.advCfg.depositMerkleRoot != bytes32(0), "NOT_CONFIGURED"); require( state.advCfg.depositContractAddress != address(0), "NOT_CONFIGURED" ); require(state.advCfg.depositClaimActive, "NOT_ACTIVE"); uint256 numberOfTokens = _tokenIds.length; require(numberOfTokens > 0, "NO_TOKEN_IDS_PROVIDED"); require( numberOfTokens == _merkleProofs.length, "ARRAY_LENGTHS_MUST_MATCH" ); require( totalSupply() + numberOfTokens <= state.cfg.maxSupply, "MAX_SUPPLY_EXCEEDED" ); require( msg.value == remainingDepositPaymentInWei() * numberOfTokens, "INCORRECT_REMAINING_PAYMENT" ); IERC721 DepositContract = IERC721(state.advCfg.depositContractAddress); for (uint256 i = 0; i < numberOfTokens; i++) { require(<FILL_ME>) require( DepositContract.ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN" ); DepositContract.transferFrom(msg.sender, burnAddress, _tokenIds[i]); } _safeMint(msg.sender, numberOfTokens); } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
MerkleProofUpgradeable.verify(_merkleProofs[i],state.advCfg.depositMerkleRoot,keccak256(abi.encodePacked(_tokenIds[i]))),"INVALID_MERKLE_PROOF"
400,539
MerkleProofUpgradeable.verify(_merkleProofs[i],state.advCfg.depositMerkleRoot,keccak256(abi.encodePacked(_tokenIds[i])))
"MUST_OWN_TOKEN"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.advCfg.depositMerkleRoot != bytes32(0), "NOT_CONFIGURED"); require( state.advCfg.depositContractAddress != address(0), "NOT_CONFIGURED" ); require(state.advCfg.depositClaimActive, "NOT_ACTIVE"); uint256 numberOfTokens = _tokenIds.length; require(numberOfTokens > 0, "NO_TOKEN_IDS_PROVIDED"); require( numberOfTokens == _merkleProofs.length, "ARRAY_LENGTHS_MUST_MATCH" ); require( totalSupply() + numberOfTokens <= state.cfg.maxSupply, "MAX_SUPPLY_EXCEEDED" ); require( msg.value == remainingDepositPaymentInWei() * numberOfTokens, "INCORRECT_REMAINING_PAYMENT" ); IERC721 DepositContract = IERC721(state.advCfg.depositContractAddress); for (uint256 i = 0; i < numberOfTokens; i++) { require( MerkleProofUpgradeable.verify( _merkleProofs[i], state.advCfg.depositMerkleRoot, keccak256(abi.encodePacked(_tokenIds[i])) ), "INVALID_MERKLE_PROOF" ); require(<FILL_ME>) DepositContract.transferFrom(msg.sender, burnAddress, _tokenIds[i]); } _safeMint(msg.sender, numberOfTokens); } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
DepositContract.ownerOf(_tokenIds[i])==msg.sender,"MUST_OWN_TOKEN"
400,539
DepositContract.ownerOf(_tokenIds[i])==msg.sender
"FUNDING_TARGET_NOT_MET"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require(<FILL_ME>) require( !state.data.fundingSuccessDetermined, "SUCCESS_ALREADY_DETERMINED" ); state.data.fundingTargetReached = true; state.data.fundingSuccessDetermined = true; } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
address(this).balance>=fundingTargetInWei(),"FUNDING_TARGET_NOT_MET"
400,539
address(this).balance>=fundingTargetInWei()
"SUCCESS_ALREADY_DETERMINED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { HeyMintStorage.State storage state = HeyMintStorage.state(); require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require( address(this).balance >= fundingTargetInWei(), "FUNDING_TARGET_NOT_MET" ); require(<FILL_ME>) state.data.fundingTargetReached = true; state.data.fundingSuccessDetermined = true; } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
!state.data.fundingSuccessDetermined,"SUCCESS_ALREADY_DETERMINED"
400,539
!state.data.fundingSuccessDetermined
"FUNDING_TARGET_WAS_MET"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); // Prevent refunding tokens on a contract where conditional funding has not been enabled require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require( block.timestamp > uint256(state.cfg.fundingEndsAt) + 1 days, "FUNDING_PERIOD_STILL_ACTIVE" ); require(<FILL_ME>) require( address(this).balance < fundingTargetInWei(), "FUNDING_TARGET_WAS_MET" ); uint256 totalRefund = 0; for (uint256 i = 0; i < _tokenIds.length; i++) { require(ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN"); require( state.data.pricePaid[_tokenIds[i]] > 0, "TOKEN_WAS_NOT_PURCHASED" ); safeTransferFrom( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenIds[i] ); totalRefund += state.data.pricePaid[_tokenIds[i]]; } (bool success, ) = payable(msg.sender).call{value: totalRefund}(""); require(success, "TRANSFER_FAILED"); } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
!state.data.fundingTargetReached,"FUNDING_TARGET_WAS_MET"
400,539
!state.data.fundingTargetReached
"FUNDING_TARGET_WAS_MET"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); // Prevent refunding tokens on a contract where conditional funding has not been enabled require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require( block.timestamp > uint256(state.cfg.fundingEndsAt) + 1 days, "FUNDING_PERIOD_STILL_ACTIVE" ); require(!state.data.fundingTargetReached, "FUNDING_TARGET_WAS_MET"); require(<FILL_ME>) uint256 totalRefund = 0; for (uint256 i = 0; i < _tokenIds.length; i++) { require(ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN"); require( state.data.pricePaid[_tokenIds[i]] > 0, "TOKEN_WAS_NOT_PURCHASED" ); safeTransferFrom( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenIds[i] ); totalRefund += state.data.pricePaid[_tokenIds[i]]; } (bool success, ) = payable(msg.sender).call{value: totalRefund}(""); require(success, "TRANSFER_FAILED"); } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
address(this).balance<fundingTargetInWei(),"FUNDING_TARGET_WAS_MET"
400,539
address(this).balance<fundingTargetInWei()
"MUST_OWN_TOKEN"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); // Prevent refunding tokens on a contract where conditional funding has not been enabled require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require( block.timestamp > uint256(state.cfg.fundingEndsAt) + 1 days, "FUNDING_PERIOD_STILL_ACTIVE" ); require(!state.data.fundingTargetReached, "FUNDING_TARGET_WAS_MET"); require( address(this).balance < fundingTargetInWei(), "FUNDING_TARGET_WAS_MET" ); uint256 totalRefund = 0; for (uint256 i = 0; i < _tokenIds.length; i++) { require(<FILL_ME>) require( state.data.pricePaid[_tokenIds[i]] > 0, "TOKEN_WAS_NOT_PURCHASED" ); safeTransferFrom( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenIds[i] ); totalRefund += state.data.pricePaid[_tokenIds[i]]; } (bool success, ) = payable(msg.sender).call{value: totalRefund}(""); require(success, "TRANSFER_FAILED"); } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
ownerOf(_tokenIds[i])==msg.sender,"MUST_OWN_TOKEN"
400,539
ownerOf(_tokenIds[i])==msg.sender
"TOKEN_WAS_NOT_PURCHASED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); // Prevent refunding tokens on a contract where conditional funding has not been enabled require(state.cfg.fundingEndsAt > 0, "NOT_CONFIGURED"); require( block.timestamp > uint256(state.cfg.fundingEndsAt) + 1 days, "FUNDING_PERIOD_STILL_ACTIVE" ); require(!state.data.fundingTargetReached, "FUNDING_TARGET_WAS_MET"); require( address(this).balance < fundingTargetInWei(), "FUNDING_TARGET_WAS_MET" ); uint256 totalRefund = 0; for (uint256 i = 0; i < _tokenIds.length; i++) { require(ownerOf(_tokenIds[i]) == msg.sender, "MUST_OWN_TOKEN"); require(<FILL_ME>) safeTransferFrom( msg.sender, 0x000000000000000000000000000000000000dEaD, _tokenIds[i] ); totalRefund += state.data.pricePaid[_tokenIds[i]]; } (bool success, ) = payable(msg.sender).call{value: totalRefund}(""); require(success, "TRANSFER_FAILED"); } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
state.data.pricePaid[_tokenIds[i]]>0,"TOKEN_WAS_NOT_PURCHASED"
400,539
state.data.pricePaid[_tokenIds[i]]>0
"CANNOT_LOAN_BORROWED_TOKEN"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require(<FILL_ME>) require(state.advCfg.loaningActive, "NOT_ACTIVE"); require(ownerOf(_tokenId) == msg.sender, "MUST_OWN_TOKEN"); require(_receiver != msg.sender, "CANNOT_LOAN_TO_SELF"); // Transfer the token - must do this before updating the mapping otherwise transfer will fail; nonReentrant modifier will prevent reentrancy safeTransferFrom(msg.sender, _receiver, _tokenId); // Add it to the mapping of originally loaned tokens state.data.tokenOwnersOnLoan[_tokenId] = msg.sender; // Add to the owner's loan balance state.data.totalLoanedPerAddress[msg.sender] += 1; state.data.currentLoanTotal += 1; emit Loan(msg.sender, _receiver, _tokenId); } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
state.data.tokenOwnersOnLoan[_tokenId]==address(0),"CANNOT_LOAN_BORROWED_TOKEN"
400,539
state.data.tokenOwnersOnLoan[_tokenId]==address(0)
"NOT_ACTIVE"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); require( state.data.tokenOwnersOnLoan[_tokenId] == address(0), "CANNOT_LOAN_BORROWED_TOKEN" ); require(<FILL_ME>) require(ownerOf(_tokenId) == msg.sender, "MUST_OWN_TOKEN"); require(_receiver != msg.sender, "CANNOT_LOAN_TO_SELF"); // Transfer the token - must do this before updating the mapping otherwise transfer will fail; nonReentrant modifier will prevent reentrancy safeTransferFrom(msg.sender, _receiver, _tokenId); // Add it to the mapping of originally loaned tokens state.data.tokenOwnersOnLoan[_tokenId] = msg.sender; // Add to the owner's loan balance state.data.totalLoanedPerAddress[msg.sender] += 1; state.data.currentLoanTotal += 1; emit Loan(msg.sender, _receiver, _tokenId); } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
state.advCfg.loaningActive,"NOT_ACTIVE"
400,539
state.advCfg.loaningActive
"MUST_OWN_TOKEN"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { HeyMintStorage.State storage state = HeyMintStorage.state(); address borrowerAddress = ownerOf(_tokenId); require(borrowerAddress != msg.sender, "MUST_OWN_TOKEN"); require(<FILL_ME>) // Remove it from the array of loaned out tokens delete state.data.tokenOwnersOnLoan[_tokenId]; // Subtract from the owner's loan balance state.data.totalLoanedPerAddress[msg.sender] -= 1; state.data.currentLoanTotal -= 1; // Transfer the token back _directApproveMsgSenderFor(_tokenId); safeTransferFrom(borrowerAddress, msg.sender, _tokenId); emit LoanRetrieved(borrowerAddress, msg.sender, _tokenId); } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { } }
state.data.tokenOwnersOnLoan[_tokenId]==msg.sender,"MUST_OWN_TOKEN"
400,539
state.data.tokenOwnersOnLoan[_tokenId]==msg.sender
"REFUND_GUARANTEE_EXPIRED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {HeyMintERC721AUpgradeable} from "./HeyMintERC721AUpgradeable.sol"; import {AdvancedConfig, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract HeyMintERC721AExtensionD is HeyMintERC721AUpgradeable { using HeyMintStorage for HeyMintStorage.State; event Loan(address from, address to, uint256 tokenId); event LoanRetrieved(address from, address to, uint256 tokenId); // Address of the HeyMint admin address address public constant heymintAdminAddress = 0x52EA5F96f004d174470901Ba3F1984D349f0D3eF; // Address where burnt tokens are sent. address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; // ============ HEYMINT FEE ============ /** * @notice Allows the heymintAdminAddress to set the heymint fee per token * @param _heymintFeePerToken The new fee per token in wei */ function setHeymintFeePerToken(uint256 _heymintFeePerToken) external { } // ============ HEYMINT DEPOSIT TOKEN REDEMPTION ============ /** * @notice Returns the deposit payment in wei. Deposit payment is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function remainingDepositPaymentInWei() public view returns (uint256) { } /** * @notice To be updated by contract owner to allow burning a deposit token to mint * @param _depositClaimActive If true deposit tokens can be burned in order to mint */ function setDepositClaimState(bool _depositClaimActive) external onlyOwner { } /** * @notice Set the merkle root used to validate the deposit tokens eligible for burning * @dev Each leaf in the merkle tree is the token id of a deposit token * @param _depositMerkleRoot The new merkle root */ function setDepositMerkleRoot( bytes32 _depositMerkleRoot ) external onlyOwner { } /** * @notice Set the address of the HeyMint deposit contract eligible for burning to mint * @param _depositContractAddress The new deposit contract address */ function setDepositContractAddress( address _depositContractAddress ) external onlyOwner { } /** * @notice Set the remaining payment required in order to mint along with burning a deposit token * @param _remainingDepositPayment The new remaining payment in centiETH */ function setRemainingDepositPayment( uint32 _remainingDepositPayment ) external onlyOwner { } /** * @notice Allows for burning deposit tokens in order to mint. The tokens must be eligible for burning. * Additional payment may be required in addition to burning the deposit tokens. * @dev This contract must be approved by the caller to transfer the deposit tokens being burned * @param _tokenIds The token ids of the deposit tokens to burn * @param _merkleProofs The merkle proofs for each token id verifying eligibility */ function burnDepositTokensToMint( uint256[] calldata _tokenIds, bytes32[][] calldata _merkleProofs ) external payable nonReentrant { } // ============ CONDITIONAL FUNDING ============ /** * @notice Returns the funding target in wei. Funding target is stored with 2 decimals (1 = 0.01 ETH), so total 2 + 16 == 18 decimals */ function fundingTargetInWei() public view returns (uint256) { } /** * @notice To be called by anyone once the funding duration has passed to determine if the funding target was reached * If the funding target was not reached, all funds are refundable. Must be called before owner can withdraw funds */ function determineFundingSuccess() external { } /** * @notice Burn tokens and return the price paid to the token owner if the funding target was not reached * Can be called starting 1 day after funding duration ends * @param _tokenIds The ids of the tokens to be refunded */ function burnToRefund(uint256[] calldata _tokenIds) external nonReentrant { } // ============ LOANING ============ /** * @notice To be updated by contract owner to allow for loan functionality to turned on and off * @param _loaningActive The new state of loaning (true = on, false = off) */ function setLoaningActive(bool _loaningActive) external onlyOwner { } /** * @notice Allow owner to loan their tokens to other addresses * @param _tokenId The id of the token to loan * @param _receiver The address of the receiver of the loan */ function loan(uint256 _tokenId, address _receiver) external nonReentrant { } /** * @notice Allow the original owner of a token to retrieve a loaned token * @param _tokenId The id of the token to retrieve */ function retrieveLoan(uint256 _tokenId) external nonReentrant { } /** * @notice Allow contract owner to retrieve a loan to prevent malicious floor listings * @param _tokenId The id of the token to retrieve */ function adminRetrieveLoan(uint256 _tokenId) external onlyOwner { } /** * Returns the total number of loaned tokens */ function totalLoaned() public view returns (uint256) { } /** * Returns the loaned balance of an address * @param _owner The address to check */ function loanedBalanceOf(address _owner) public view returns (uint256) { } /** * Returns all the token ids loaned by a given address * @param _owner The address to check */ function loanedTokensByAddress( address _owner ) external view returns (uint256[] memory) { } // ============ REFUND ============ /** * @notice Returns the refund price in wei. Refund price is stored with 5 decimals (1 = 0.00001 ETH), so total 5 + 13 == 18 decimals */ function refundPriceInWei() public view returns (uint256) { } /** * Will return true if token holders can still return their tokens for a refund */ function refundGuaranteeActive() public view returns (bool) { } /** * @notice Set the address where tokens are sent when refunded * @param _refundAddress The new refund address */ function setRefundAddress(address _refundAddress) external onlyOwner { } /** * @notice Increase the period of time where token holders can still return their tokens for a refund * @param _newRefundEndsAt The new timestamp when the refund period ends. Must be greater than the current timestamp */ function increaseRefundEndsAt(uint32 _newRefundEndsAt) external onlyOwner { } /** * @notice Refund token and return the refund price to the token owner. * @param _tokenId The id of the token to refund */ function refund(uint256 _tokenId) external nonReentrant { require(<FILL_ME>) require(ownerOf(_tokenId) == msg.sender, "MUST_OWN_TOKEN"); HeyMintStorage.State storage state = HeyMintStorage.state(); // In case refunds are enabled with conditional funding, don't allow burnToRefund on refunded tokens if (state.cfg.fundingEndsAt > 0) { delete state.data.pricePaid[_tokenId]; } address addressToSendToken = state.advCfg.refundAddress != address(0) ? state.advCfg.refundAddress : owner(); safeTransferFrom(msg.sender, addressToSendToken, _tokenId); (bool success, ) = payable(msg.sender).call{value: refundPriceInWei()}( "" ); require(success, "TRANSFER_FAILED"); } }
refundGuaranteeActive(),"REFUND_GUARANTEE_EXPIRED"
400,539
refundGuaranteeActive()
"TOKEN_IS_SOULBOUND"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {Data, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {ERC721AUpgradeable, IERC721AUpgradeable, ERC721AStorage} from "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol"; import {ERC4907AUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC4907AUpgradeable.sol"; import {ERC721AQueryableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol"; import {IERC2981Upgradeable, IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {RevokableOperatorFiltererUpgradeable} from "operator-filter-registry/src/upgradeable/RevokableOperatorFiltererUpgradeable.sol"; /** * @title HeyMintERC721AUpgradeable * @author HeyMint Launchpad (https://join.heymint.xyz) * @notice This contract contains shared logic to be inherited by all implementation contracts */ contract HeyMintERC721AUpgradeable is ERC4907AUpgradeable, ERC721AQueryableUpgradeable, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, RevokableOperatorFiltererUpgradeable { using HeyMintStorage for HeyMintStorage.State; uint256 public constant defaultHeymintFeePerToken = 0.0007 ether; address public constant heymintPayoutAddress = 0xE1FaC470dE8dE91c66778eaa155C64c7ceEFc851; // ============ BASE FUNCTIONALITY ============ /** * @dev Overrides the default ERC721A _startTokenId() so tokens begin at 1 instead of 0 */ function _startTokenId() internal view virtual override returns (uint256) { } /** * @notice Wraps and exposes publicly _numberMinted() from ERC721A * @param _owner The address of the owner to check */ function numberMinted(address _owner) public view returns (uint256) { } /** * @dev Used to directly approve a token for transfers by the current msg.sender, * bypassing the typical checks around msg.sender being the owner of a given token. * This approval will be automatically deleted once the token is transferred. * @param _tokenId The ID of the token to approve */ function _directApproveMsgSenderFor(uint256 _tokenId) internal { } /** * @notice Returns the owner of the contract */ function owner() public view virtual override(OwnableUpgradeable, RevokableOperatorFiltererUpgradeable) returns (address) { } // https://chiru-labs.github.io/ERC721A/#/migration?id=supportsinterface /** * @notice Returns true if the contract implements the interface defined by interfaceId * @param interfaceId The interface identifier, as specified in ERC-165 */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable, ERC4907AUpgradeable) returns (bool) { } // ============ HEYMINT FEE ============ /** * @notice Returns the HeyMint fee per token. If the fee is 0, the default fee is returned */ function heymintFeePerToken() public view returns (uint256) { } // ============ OPERATOR FILTER REGISTRY ============ /** * @notice Override default ERC-721 setApprovalForAll to require that the operator is not from a blocklisted exchange * @dev See {IERC721-setApprovalForAll}. * @param operator Address to add to the set of authorized operators * @param approved True if the operator is approved, false to revoke approval */ function setApprovalForAll( address operator, bool approved ) public override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(operator) { require(<FILL_ME>) super.setApprovalForAll(operator, approved); } /** * @notice Override default ERC721 approve to require that the operator is not from a blocklisted exchange * @dev See {IERC721-approve}. * @param to Address to receive the approval * @param tokenId ID of the token to be approved */ function approve( address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(to) { } /** * @dev See {IERC721-transferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } // ============ RANDOM HASH ============ /** * @notice Generate a suitably random hash from block data * Can be used later to determine any sort of arbitrary outcome * @param _tokenId The token ID to generate a random hash for */ function _generateRandomHash(uint256 _tokenId) internal { } // ============ TOKEN TRANSFER CHECKS ============ function _beforeTokenTransfers( address from, address to, uint256 tokenId, uint256 quantity ) internal override whenNotPaused onlyAllowedOperator(from) { } }
!HeyMintStorage.state().cfg.soulbindingActive,"TOKEN_IS_SOULBOUND"
400,541
!HeyMintStorage.state().cfg.soulbindingActive
"TOKEN_IS_STAKED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {Data, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {ERC721AUpgradeable, IERC721AUpgradeable, ERC721AStorage} from "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol"; import {ERC4907AUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC4907AUpgradeable.sol"; import {ERC721AQueryableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol"; import {IERC2981Upgradeable, IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {RevokableOperatorFiltererUpgradeable} from "operator-filter-registry/src/upgradeable/RevokableOperatorFiltererUpgradeable.sol"; /** * @title HeyMintERC721AUpgradeable * @author HeyMint Launchpad (https://join.heymint.xyz) * @notice This contract contains shared logic to be inherited by all implementation contracts */ contract HeyMintERC721AUpgradeable is ERC4907AUpgradeable, ERC721AQueryableUpgradeable, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, RevokableOperatorFiltererUpgradeable { using HeyMintStorage for HeyMintStorage.State; uint256 public constant defaultHeymintFeePerToken = 0.0007 ether; address public constant heymintPayoutAddress = 0xE1FaC470dE8dE91c66778eaa155C64c7ceEFc851; // ============ BASE FUNCTIONALITY ============ /** * @dev Overrides the default ERC721A _startTokenId() so tokens begin at 1 instead of 0 */ function _startTokenId() internal view virtual override returns (uint256) { } /** * @notice Wraps and exposes publicly _numberMinted() from ERC721A * @param _owner The address of the owner to check */ function numberMinted(address _owner) public view returns (uint256) { } /** * @dev Used to directly approve a token for transfers by the current msg.sender, * bypassing the typical checks around msg.sender being the owner of a given token. * This approval will be automatically deleted once the token is transferred. * @param _tokenId The ID of the token to approve */ function _directApproveMsgSenderFor(uint256 _tokenId) internal { } /** * @notice Returns the owner of the contract */ function owner() public view virtual override(OwnableUpgradeable, RevokableOperatorFiltererUpgradeable) returns (address) { } // https://chiru-labs.github.io/ERC721A/#/migration?id=supportsinterface /** * @notice Returns true if the contract implements the interface defined by interfaceId * @param interfaceId The interface identifier, as specified in ERC-165 */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable, ERC4907AUpgradeable) returns (bool) { } // ============ HEYMINT FEE ============ /** * @notice Returns the HeyMint fee per token. If the fee is 0, the default fee is returned */ function heymintFeePerToken() public view returns (uint256) { } // ============ OPERATOR FILTER REGISTRY ============ /** * @notice Override default ERC-721 setApprovalForAll to require that the operator is not from a blocklisted exchange * @dev See {IERC721-setApprovalForAll}. * @param operator Address to add to the set of authorized operators * @param approved True if the operator is approved, false to revoke approval */ function setApprovalForAll( address operator, bool approved ) public override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(operator) { } /** * @notice Override default ERC721 approve to require that the operator is not from a blocklisted exchange * @dev See {IERC721-approve}. * @param to Address to receive the approval * @param tokenId ID of the token to be approved */ function approve( address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(to) { } /** * @dev See {IERC721-transferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } // ============ RANDOM HASH ============ /** * @notice Generate a suitably random hash from block data * Can be used later to determine any sort of arbitrary outcome * @param _tokenId The token ID to generate a random hash for */ function _generateRandomHash(uint256 _tokenId) internal { } // ============ TOKEN TRANSFER CHECKS ============ function _beforeTokenTransfers( address from, address to, uint256 tokenId, uint256 quantity ) internal override whenNotPaused onlyAllowedOperator(from) { HeyMintStorage.State storage state = HeyMintStorage.state(); require(<FILL_ME>) require( state.data.tokenOwnersOnLoan[tokenId] == address(0), "CANNOT_TRANSFER_LOANED_TOKEN" ); if ( state.cfg.soulbindingActive && !state.data.soulboundAdminTransferInProgress ) { require(from == address(0), "TOKEN_IS_SOULBOUND"); } if (state.cfg.randomHashActive && from == address(0)) { _generateRandomHash(tokenId); } super._beforeTokenTransfers(from, to, tokenId, quantity); } }
!state.advCfg.stakingActive||state.data.stakingTransferActive||state.data.currentTimeStaked[tokenId]==0,"TOKEN_IS_STAKED"
400,541
!state.advCfg.stakingActive||state.data.stakingTransferActive||state.data.currentTimeStaked[tokenId]==0
"CANNOT_TRANSFER_LOANED_TOKEN"
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import {Data, HeyMintStorage} from "../libraries/HeyMintStorage.sol"; import {ERC721AUpgradeable, IERC721AUpgradeable, ERC721AStorage} from "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol"; import {ERC4907AUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC4907AUpgradeable.sol"; import {ERC721AQueryableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol"; import {IERC2981Upgradeable, IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {RevokableOperatorFiltererUpgradeable} from "operator-filter-registry/src/upgradeable/RevokableOperatorFiltererUpgradeable.sol"; /** * @title HeyMintERC721AUpgradeable * @author HeyMint Launchpad (https://join.heymint.xyz) * @notice This contract contains shared logic to be inherited by all implementation contracts */ contract HeyMintERC721AUpgradeable is ERC4907AUpgradeable, ERC721AQueryableUpgradeable, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, RevokableOperatorFiltererUpgradeable { using HeyMintStorage for HeyMintStorage.State; uint256 public constant defaultHeymintFeePerToken = 0.0007 ether; address public constant heymintPayoutAddress = 0xE1FaC470dE8dE91c66778eaa155C64c7ceEFc851; // ============ BASE FUNCTIONALITY ============ /** * @dev Overrides the default ERC721A _startTokenId() so tokens begin at 1 instead of 0 */ function _startTokenId() internal view virtual override returns (uint256) { } /** * @notice Wraps and exposes publicly _numberMinted() from ERC721A * @param _owner The address of the owner to check */ function numberMinted(address _owner) public view returns (uint256) { } /** * @dev Used to directly approve a token for transfers by the current msg.sender, * bypassing the typical checks around msg.sender being the owner of a given token. * This approval will be automatically deleted once the token is transferred. * @param _tokenId The ID of the token to approve */ function _directApproveMsgSenderFor(uint256 _tokenId) internal { } /** * @notice Returns the owner of the contract */ function owner() public view virtual override(OwnableUpgradeable, RevokableOperatorFiltererUpgradeable) returns (address) { } // https://chiru-labs.github.io/ERC721A/#/migration?id=supportsinterface /** * @notice Returns true if the contract implements the interface defined by interfaceId * @param interfaceId The interface identifier, as specified in ERC-165 */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable, ERC4907AUpgradeable) returns (bool) { } // ============ HEYMINT FEE ============ /** * @notice Returns the HeyMint fee per token. If the fee is 0, the default fee is returned */ function heymintFeePerToken() public view returns (uint256) { } // ============ OPERATOR FILTER REGISTRY ============ /** * @notice Override default ERC-721 setApprovalForAll to require that the operator is not from a blocklisted exchange * @dev See {IERC721-setApprovalForAll}. * @param operator Address to add to the set of authorized operators * @param approved True if the operator is approved, false to revoke approval */ function setApprovalForAll( address operator, bool approved ) public override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(operator) { } /** * @notice Override default ERC721 approve to require that the operator is not from a blocklisted exchange * @dev See {IERC721-approve}. * @param to Address to receive the approval * @param tokenId ID of the token to be approved */ function approve( address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperatorApproval(to) { } /** * @dev See {IERC721-transferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } /** * @dev See {IERC721-safeTransferFrom}. * The added modifier ensures that the operator is allowed by the OperatorFilterRegistry. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) onlyAllowedOperator(from) { } // ============ RANDOM HASH ============ /** * @notice Generate a suitably random hash from block data * Can be used later to determine any sort of arbitrary outcome * @param _tokenId The token ID to generate a random hash for */ function _generateRandomHash(uint256 _tokenId) internal { } // ============ TOKEN TRANSFER CHECKS ============ function _beforeTokenTransfers( address from, address to, uint256 tokenId, uint256 quantity ) internal override whenNotPaused onlyAllowedOperator(from) { HeyMintStorage.State storage state = HeyMintStorage.state(); require( !state.advCfg.stakingActive || state.data.stakingTransferActive || state.data.currentTimeStaked[tokenId] == 0, "TOKEN_IS_STAKED" ); require(<FILL_ME>) if ( state.cfg.soulbindingActive && !state.data.soulboundAdminTransferInProgress ) { require(from == address(0), "TOKEN_IS_SOULBOUND"); } if (state.cfg.randomHashActive && from == address(0)) { _generateRandomHash(tokenId); } super._beforeTokenTransfers(from, to, tokenId, quantity); } }
state.data.tokenOwnersOnLoan[tokenId]==address(0),"CANNOT_TRANSFER_LOANED_TOKEN"
400,541
state.data.tokenOwnersOnLoan[tokenId]==address(0)
"Mint limit for this account has been exceeded"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { // increment a mapping for user on how many mints they have uint256 count = accountMintCount[account]; require(<FILL_ME>) accountMintCount[account] = count + quantity; } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
count+quantity<=mintLimit||mintLimit==0,"Mint limit for this account has been exceeded"
400,687
count+quantity<=mintLimit||mintLimit==0
"Mint limit for this account has been exceeded"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { // increment a mapping for user on how many mints they have uint256 count = accountMintCount[account]; if(customLimit == 0){ require(count + quantity <= mintLimit || mintLimit == 0, "Mint limit for this account has been exceeded"); } else{ require(<FILL_ME>) } accountMintCount[account] = count + quantity; } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
count+quantity<=customLimit,"Mint limit for this account has been exceeded"
400,687
count+quantity<=customLimit
"Metadata has already been revealed"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { require(<FILL_ME>) require(bytes(placeholderImage_).length != 0, "Placeholder image cannot be empty"); placeholderImage = placeholderImage_; } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
bytes(placeholderImage).length!=0,"Metadata has already been revealed"
400,687
bytes(placeholderImage).length!=0
"Placeholder image cannot be empty"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { require(bytes(placeholderImage).length != 0, "Metadata has already been revealed"); require(<FILL_ME>) placeholderImage = placeholderImage_; } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
bytes(placeholderImage_).length!=0,"Placeholder image cannot be empty"
400,687
bytes(placeholderImage_).length!=0
"Not enought Balance to Transfer"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ if(address(this).balance != 0){ require(<FILL_ME>) uint256 splitValue = ammount / 20; uint256 remainingValue = ammount - splitValue; // if mainnet, earn tokens if(block.chainid == 1 || block.chainid == 5 || block.chainid == 5777){ _mintAutoMinterTokens(to, splitValue); } else{ payable(shareAddress).transfer(splitValue); } payable(to).transfer(remainingValue); ammountWithdrawn += ammount; } } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
address(this).balance<=ammount,"Not enought Balance to Transfer"
400,687
address(this).balance<=ammount
"Base URI is locked, it cannot be edited"
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; // import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Base64.sol"; import "./IERC2981Upgradable.sol"; import "./AutoMinterERC20.sol"; contract AutoMinterERC721 is Initializable, ERC721Upgradeable, OwnableUpgradeable, IERC2981Upgradeable { string private baseURI; address constant public shareAddress = 0xE28564784a0f57554D8beEc807E8609b40A97241; uint256 public mintFee; bool private mintSelectionEnabled; bool private mintRandomEnabled; uint256 public remaining; mapping(uint256 => uint256) public cache; mapping(uint256 => uint256) public cachePosition; mapping(address => uint256) public accountMintCount; address private whiteListSignerAddress; uint256 public mintLimit; uint256 public royaltyBasis = 1000; uint256 public ammountWithdrawn = 0; string public placeholderImage; bool public lockBaseUri; address constant private autoMinterTokenContract = 0xc00C733702248AeBDb357340ddDdA5C47500A35A; constructor(){} function initialize(string memory name_, string memory symbol_, string memory baseURI_, address ownerAddress_, uint256 mintFee_, uint256 size_, bool mintSelectionEnabled_, bool mintRandomEnabled_, address whiteListSignerAddress_, uint256 mintLimit_, uint256 royaltyBasis_, string memory placeholderImage_) public initializer { } function _baseURI() internal view virtual override returns (string memory) { } /* Mint specific token if individual token selection is enabled */ function mintToken(uint256 tokenID) payable public { } /* Mint random token if random minting is enabled */ function mintRandom() payable public { } /* Mint 'n' random tokens if random minting is enabled */ function mintRandom(uint256 count) payable public { } /* Mint if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, bytes calldata signature) payable public { } /* Mint 'n' tokens if have been pre-approved using signature of the owner */ function mintWithSignature(bool isFree, address to, uint256 tokenID, bool isRandom, uint256 customFee, uint256 limit, uint256 count, bytes calldata signature) payable public { } /* Mint a token to a specific address */ function mintToAccount(address to, uint256 tokenID) onlyOwner() public { } /* Mint a token to a specific address */ function airDropRandomToAccounts(address[] calldata to) onlyOwner() public { } // function _splitPayment() internal // { // if(msg.value != 0){ // uint256 splitValue = msg.value / 10; // uint256 remainingValue = msg.value - splitValue; // payable(shareAddress).transfer(splitValue); // payable(owner()).transfer(remainingValue); // } // } function _drawRandomIndex() internal returns (uint256 index) { } function _drawIndex(uint256 tokenID) internal { } function _updateUserMintCount(address account) internal { } function _updateUserMintCount(address account, uint256 quantity) internal { } function _updateUserMintCount(address account, uint256 quantity, uint256 customLimit) internal { } function isTokenAvailable(uint256 tokenID) external view returns (bool) { } function toggleRandomPublicMinting() onlyOwner() public { } function changeMintFee(uint256 mintFee_) onlyOwner() public { } function changeMintLimit(uint256 mintLimit_) onlyOwner() public { } function changePlaceholderImage(string memory placeholderImage_) onlyOwner() public { } function royaltyInfo(uint _tokenId, uint _salePrice) external view returns (address receiver, uint royaltyAmount) { } /* Transfer balance of this contract to an account */ function transferBalance(address payable to, uint256 ammount) onlyOwner() public{ } /* Transfer any ERC20 balance of this contract to an account */ function transferERC20Balance(address erc20ContractAddress, address payable to, uint256 ammount) onlyOwner() public{ } function contractURI() public view returns (string memory) { } function toAsciiString(address x) internal pure returns (string memory) { } function char(bytes1 b) internal pure returns (bytes1 c) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) { } function isPublicMintingEnabled() external view returns (bool){ } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function reveal() onlyOwner() public { } function changeBaseUri(string memory baseURI_) onlyOwner() public { require(<FILL_ME>) baseURI = baseURI_; } function permanentlyLockBaseUri() onlyOwner() public { } function getMintsUsed(address account) external view returns (uint256) { } function _mintAutoMinterTokens(address to, uint256 value) private { } function version() external pure returns (string memory) { } receive() external payable {} }
!lockBaseUri,"Base URI is locked, it cannot be edited"
400,687
!lockBaseUri
Errors.ONLY_UNPAUSED
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { // Do not execute if Globally or individually paused require(<FILL_ME>) _; } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
(!IBabController(controller).isPaused(address(this)),Errors.ONLY_UNPAUSED
400,702
!IBabController(controller).isPaused(address(this))
'BABL must flow'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { require(<FILL_ME>) tokenTransfersEnabled = false; tokenTransfersWereDisabled = true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
!tokenTransfersWereDisabled,'BABL must flow'
400,702
!tokenTransfersWereDisabled
'cannot be zero address'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { require(<FILL_ME>) require(address(newTimeLockRegistry) != address(this), 'cannot be this contract'); require(address(newTimeLockRegistry) != address(timeLockRegistry), 'must be new TimeLockRegistry'); emit NewTimeLockRegistration(address(timeLockRegistry), address(newTimeLockRegistry)); timeLockRegistry = newTimeLockRegistry; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newTimeLockRegistry)!=address(0),'cannot be zero address'
400,702
address(newTimeLockRegistry)!=address(0)
'cannot be this contract'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { require(address(newTimeLockRegistry) != address(0), 'cannot be zero address'); require(<FILL_ME>) require(address(newTimeLockRegistry) != address(timeLockRegistry), 'must be new TimeLockRegistry'); emit NewTimeLockRegistration(address(timeLockRegistry), address(newTimeLockRegistry)); timeLockRegistry = newTimeLockRegistry; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newTimeLockRegistry)!=address(this),'cannot be this contract'
400,702
address(newTimeLockRegistry)!=address(this)
'must be new TimeLockRegistry'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { require(address(newTimeLockRegistry) != address(0), 'cannot be zero address'); require(address(newTimeLockRegistry) != address(this), 'cannot be this contract'); require(<FILL_ME>) emit NewTimeLockRegistration(address(timeLockRegistry), address(newTimeLockRegistry)); timeLockRegistry = newTimeLockRegistry; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newTimeLockRegistry)!=address(timeLockRegistry),'must be new TimeLockRegistry'
400,702
address(newTimeLockRegistry)!=address(timeLockRegistry)
'cannot be zero address'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { require(<FILL_ME>) require(address(newRewardsDistributor) != address(this), 'cannot be this contract'); require(address(newRewardsDistributor) != address(rewardsDistributor), 'must be new Rewards Distributor'); emit NewRewardsDistributorRegistration(address(rewardsDistributor), address(newRewardsDistributor)); rewardsDistributor = newRewardsDistributor; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newRewardsDistributor)!=address(0),'cannot be zero address'
400,702
address(newRewardsDistributor)!=address(0)
'cannot be this contract'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { require(address(newRewardsDistributor) != address(0), 'cannot be zero address'); require(<FILL_ME>) require(address(newRewardsDistributor) != address(rewardsDistributor), 'must be new Rewards Distributor'); emit NewRewardsDistributorRegistration(address(rewardsDistributor), address(newRewardsDistributor)); rewardsDistributor = newRewardsDistributor; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newRewardsDistributor)!=address(this),'cannot be this contract'
400,702
address(newRewardsDistributor)!=address(this)
'must be new Rewards Distributor'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { require(address(newRewardsDistributor) != address(0), 'cannot be zero address'); require(address(newRewardsDistributor) != address(this), 'cannot be this contract'); require(<FILL_ME>) emit NewRewardsDistributorRegistration(address(rewardsDistributor), address(newRewardsDistributor)); rewardsDistributor = newRewardsDistributor; return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(newRewardsDistributor)!=address(rewardsDistributor),'must be new Rewards Distributor'
400,702
address(newRewardsDistributor)!=address(rewardsDistributor)
'TimeLockedToken::increaseAllowance:Not enough unlocked tokens'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { require(<FILL_ME>) require(spender != address(0), 'TimeLockedToken::increaseAllowance:Spender cannot be zero address'); require(spender != msg.sender, 'TimeLockedToken::increaseAllowance:Spender cannot be the msg.sender'); _approve(msg.sender, spender, allowance(msg.sender, spender).add(addedValue)); return true; } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
unlockedBalance(msg.sender)>=allowance(msg.sender,spender).add(addedValue)||spender==address(timeLockRegistry),'TimeLockedToken::increaseAllowance:Not enough unlocked tokens'
400,702
unlockedBalance(msg.sender)>=allowance(msg.sender,spender).add(addedValue)||spender==address(timeLockRegistry)
'TimeLockedToken::decreaseAllowance:Underflow condition'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { require(spender != address(0), 'TimeLockedToken::decreaseAllowance:Spender cannot be zero address'); require(spender != msg.sender, 'TimeLockedToken::decreaseAllowance:Spender cannot be the msg.sender'); require(<FILL_ME>) // There is no option to decreaseAllowance to timeLockRegistry in case of vested tokens require( address(spender) != address(timeLockRegistry), 'TimeLockedToken::decreaseAllowance:cannot decrease allowance to timeLockRegistry' ); _approve(msg.sender, spender, allowance(msg.sender, spender).sub(subtractedValue)); return true; } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
allowance(msg.sender,spender)>=subtractedValue,'TimeLockedToken::decreaseAllowance:Underflow condition'
400,702
allowance(msg.sender,spender)>=subtractedValue
'TimeLockedToken::decreaseAllowance:cannot decrease allowance to timeLockRegistry'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { require(spender != address(0), 'TimeLockedToken::decreaseAllowance:Spender cannot be zero address'); require(spender != msg.sender, 'TimeLockedToken::decreaseAllowance:Spender cannot be the msg.sender'); require( allowance(msg.sender, spender) >= subtractedValue, 'TimeLockedToken::decreaseAllowance:Underflow condition' ); // There is no option to decreaseAllowance to timeLockRegistry in case of vested tokens require(<FILL_ME>) _approve(msg.sender, spender, allowance(msg.sender, spender).sub(subtractedValue)); return true; } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
address(spender)!=address(timeLockRegistry),'TimeLockedToken::decreaseAllowance:cannot decrease allowance to timeLockRegistry'
400,702
address(spender)!=address(timeLockRegistry)
'TimeLockedToken:: _transfer: attempting to transfer locked funds'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { require(_from != address(0), 'TimeLockedToken:: _transfer: cannot transfer from the zero address'); require(_to != address(0), 'TimeLockedToken:: _transfer: cannot transfer to the zero address'); require( _to != address(this), 'TimeLockedToken:: _transfer: do not transfer tokens to the token contract itself' ); require(balanceOf(_from) >= _value, 'TimeLockedToken:: _transfer: insufficient balance'); // check if enough unlocked balance to transfer require(<FILL_ME>) super._transfer(_from, _to, _value); // voting power _moveDelegates( delegates[_from], delegates[_to], safe96(_value, 'TimeLockedToken:: _transfer: uint96 overflow') ); } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { } }
unlockedBalance(_from)>=_value,'TimeLockedToken:: _transfer: attempting to transfer locked funds'
400,702
unlockedBalance(_from)>=_value
'TimeLockedToken::cancelTokens:Not registered'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { require(<FILL_ME>) // get an update on locked amount from distributions at this precise moment uint256 loosingAmount = lockedBalance(lockedAccount); require(loosingAmount > 0, 'TimeLockedToken::cancelTokens:There are no more locked tokens'); require( vestedToken[lockedAccount].teamOrAdvisor == true, 'TimeLockedToken::cancelTokens:cannot cancel locked tokens to Investors' ); // set distribution mapping to 0 delete distribution[lockedAccount]; // set tokenVested mapping to 0 delete vestedToken[lockedAccount]; // transfer only locked tokens back to TimeLockRegistry Owner (msg.sender) require( transferFrom(lockedAccount, address(timeLockRegistry), loosingAmount), 'TimeLockedToken::cancelTokens:Transfer failed' ); // emit cancel event emit Cancel(lockedAccount, loosingAmount); return loosingAmount; } }
distribution[lockedAccount]!=0,'TimeLockedToken::cancelTokens:Not registered'
400,702
distribution[lockedAccount]!=0
'TimeLockedToken::cancelTokens:cannot cancel locked tokens to Investors'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { require(distribution[lockedAccount] != 0, 'TimeLockedToken::cancelTokens:Not registered'); // get an update on locked amount from distributions at this precise moment uint256 loosingAmount = lockedBalance(lockedAccount); require(loosingAmount > 0, 'TimeLockedToken::cancelTokens:There are no more locked tokens'); require(<FILL_ME>) // set distribution mapping to 0 delete distribution[lockedAccount]; // set tokenVested mapping to 0 delete vestedToken[lockedAccount]; // transfer only locked tokens back to TimeLockRegistry Owner (msg.sender) require( transferFrom(lockedAccount, address(timeLockRegistry), loosingAmount), 'TimeLockedToken::cancelTokens:Transfer failed' ); // emit cancel event emit Cancel(lockedAccount, loosingAmount); return loosingAmount; } }
vestedToken[lockedAccount].teamOrAdvisor==true,'TimeLockedToken::cancelTokens:cannot cancel locked tokens to Investors'
400,702
vestedToken[lockedAccount].teamOrAdvisor==true
'TimeLockedToken::cancelTokens:Transfer failed'
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; import {IBabController} from '../interfaces/IBabController.sol'; import {TimeLockRegistry} from './TimeLockRegistry.sol'; import {IRewardsDistributor} from '../interfaces/IRewardsDistributor.sol'; import {VoteToken} from './VoteToken.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Errors, _require} from '../lib/BabylonErrors.sol'; import {LowGasSafeMath} from '../lib/LowGasSafeMath.sol'; import {IBabController} from '../interfaces/IBabController.sol'; /** * @title TimeLockedToken * @notice Time Locked ERC20 Token * @author Babylon Finance * @dev Contract which gives the ability to time-lock tokens specially for vesting purposes usage * * By overriding the balanceOf() and transfer() functions in ERC20, * an account can show its full, post-distribution balance and use it for voting power * but only transfer or spend up to an allowed amount * * A portion of previously non-spendable tokens are allowed to be transferred * along the time depending on each vesting conditions, and after all epochs have passed, the full * account balance is unlocked. In case on non-completion vesting period, only the Time Lock Registry can cancel * the delivery of the pending tokens and only can cancel the remaining locked ones. */ abstract contract TimeLockedToken is VoteToken { using LowGasSafeMath for uint256; /* ============ Events ============ */ /// @notice An event that emitted when a new lockout ocurr event NewLockout( address account, uint256 tokenslocked, bool isTeamOrAdvisor, uint256 startingVesting, uint256 endingVesting ); /// @notice An event that emitted when a new Time Lock is registered event NewTimeLockRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a new Rewards Distributor is registered event NewRewardsDistributorRegistration(address previousAddress, address newAddress); /// @notice An event that emitted when a cancellation of Lock tokens is registered event Cancel(address account, uint256 amount); /// @notice An event that emitted when a claim of tokens are registered event Claim(address _receiver, uint256 amount); /// @notice An event that emitted when a lockedBalance query is done event LockedBalance(address _account, uint256 amount); /* ============ Modifiers ============ */ modifier onlyTimeLockRegistry() { } modifier onlyTimeLockOwner() { } modifier onlyUnpaused() { } /* ============ State Variables ============ */ // represents total distribution for locked balances mapping(address => uint256) distribution; /// @notice The profile of each token owner under its particular vesting conditions /** * @param team Indicates whether or not is a Team member or Advisor (true = team member/advisor, false = private investor) * @param vestingBegin When the vesting begins for such token owner * @param vestingEnd When the vesting ends for such token owner * @param lastClaim When the last claim was done */ struct VestedToken { bool teamOrAdvisor; uint256 vestingBegin; uint256 vestingEnd; uint256 lastClaim; } /// @notice A record of token owners under vesting conditions for each account, by index mapping(address => VestedToken) public vestedToken; // address of Time Lock Registry contract IBabController public controller; // address of Time Lock Registry contract TimeLockRegistry public timeLockRegistry; // address of Rewards Distriburor contract IRewardsDistributor public rewardsDistributor; // Enable Transfer of ERC20 BABL Tokens // Only Minting or transfers from/to TimeLockRegistry and Rewards Distributor can transfer tokens until the protocol is fully decentralized bool private tokenTransfersEnabled; bool private tokenTransfersWereDisabled; /* ============ Functions ============ */ /* ============ Constructor ============ */ constructor(string memory _name, string memory _symbol) VoteToken(_name, _symbol) { } /* ============ External Functions ============ */ /* =========== Token related Gov Functions ====== */ /** * PRIVILEGED GOVERNANCE FUNCTION. Disables transfers of ERC20 BABL Tokens */ function disableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows transfers of ERC20 BABL Tokens * Can only happen after the protocol is fully decentralized. */ function enableTokensTransfers() external onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Time Lock Registry contract to control token vesting conditions * * @notice Set the Time Lock Registry contract to control token vesting conditions * @param newTimeLockRegistry Address of TimeLockRegistry contract */ function setTimeLockRegistry(TimeLockRegistry newTimeLockRegistry) external onlyTimeLockOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Set the Rewards Distributor contract to control either BABL Mining or profit rewards * * @notice Set the Rewards Distriburor contract to control both types of rewards (profit and BABL Mining program) * @param newRewardsDistributor Address of Rewards Distributor contract */ function setRewardsDistributor(IRewardsDistributor newRewardsDistributor) external onlyOwner returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Register new token lockup conditions for vested tokens defined only by Time Lock Registry * * @notice Tokens are completely delivered during the registration however lockup conditions apply for vested tokens * locking them according to the distribution epoch periods and the type of recipient (Team, Advisor, Investor) * Emits a transfer event showing a transfer to the recipient * Only the registry can call this function * @param _receiver Address to receive the tokens * @param _amount Tokens to be transferred * @param _profile True if is a Team Member or Advisor * @param _vestingBegin Unix Time when the vesting for that particular address * @param _vestingEnd Unix Time when the vesting for that particular address * @param _lastClaim Unix Time when the claim was done from that particular address * */ function registerLockup( address _receiver, uint256 _amount, bool _profile, uint256 _vestingBegin, uint256 _vestingEnd, uint256 _lastClaim ) external onlyTimeLockRegistry returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors as it does not apply to investors. * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function cancelVestedTokens(address lockedAccount) external onlyTimeLockRegistry returns (uint256) { } /** * GOVERNANCE FUNCTION. Each token owner can claim its own specific tokens with its own specific vesting conditions from the Time Lock Registry * * @dev Claim msg.sender tokens (if any available in the registry) */ function claimMyTokens() external { } /** * GOVERNANCE FUNCTION. Get unlocked balance for an account * * @notice Get unlocked balance for an account * @param account Account to check * @return Amount that is unlocked and available eg. to transfer */ function unlockedBalance(address account) public returns (uint256) { } /** * GOVERNANCE FUNCTION. View the locked balance for an account * * @notice View locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function viewLockedBalance(address account) public view returns (uint256) { } /** * GOVERNANCE FUNCTION. Get locked balance for an account * * @notice Get locked balance for an account * @param account Account to check * @return Amount locked in the time of checking */ function lockedBalance(address account) public returns (uint256) { } /** * PUBLIC FUNCTION. Get the address of Time Lock Registry * * @notice Get the address of Time Lock Registry * @return Address of the Time Lock Registry */ function getTimeLockRegistry() external view returns (address) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Approval of allowances of ERC20 with special conditions for vesting * * @notice Override of "Approve" function to allow the `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` except in the case of spender is Time Lock Registry * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the Increase of allowances of ERC20 with special conditions for vesting * * @notice Atomically increases the allowance granted to `spender` by the caller. * * @dev This is an override with respect to the fulfillment of vesting conditions along the way * However an user can increase allowance many times, it will never be able to transfer locked tokens during vesting period * @return Whether or not the increaseAllowance succeeded */ function increaseAllowance(address spender, uint256 addedValue) public override nonReentrant returns (bool) { } /** * PRIVILEGED GOVERNANCE FUNCTION. Override the decrease of allowances of ERC20 with special conditions for vesting * * @notice Atomically decrease the allowance granted to `spender` by the caller. * * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an override with respect to the fulfillment of vesting conditions along the way * An user cannot decrease the allowance to the Time Lock Registry who is in charge of vesting conditions * @return Whether or not the decreaseAllowance succeeded */ function decreaseAllowance(address spender, uint256 subtractedValue) public override nonReentrant returns (bool) { } /* ============ Internal Only Function ============ */ /** * PRIVILEGED GOVERNANCE FUNCTION. Override the _transfer of ERC20 BABL tokens only allowing the transfer of unlocked tokens * * @dev Transfer function which includes only unlocked tokens * Locked tokens can always be transfered back to the returns address * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ function _transfer( address _from, address _to, uint256 _value ) internal override onlyUnpaused { } /** * PRIVILEGED GOVERNANCE FUNCTION. Disable BABL token transfer until certain conditions are met * * @dev Override the _beforeTokenTransfer of ERC20 BABL tokens until certain conditions are met: * Only allowing minting or transfers from Time Lock Registry and Rewards Distributor until transfers are allowed in the controller * Transferring to owner allows re-issuance of funds through registry * * @param _from The address to send tokens from * @param _to The address that will receive the tokens * @param _value The amount of tokens to be transferred */ // Disable garden token transfers. Allow minting and burning. function _beforeTokenTransfer( address _from, address _to, uint256 _value ) internal virtual override { } /** * PRIVILEGED GOVERNANCE FUNCTION. Cancel and remove locked tokens due to non-completion of vesting period * applied only by Time Lock Registry and specifically to Team or Advisors * * @dev Cancel distribution registration * @param lockedAccount that should have its still locked distribution removed due to non-completion of its vesting period */ function _cancelVestedTokensFromTimeLock(address lockedAccount) internal onlyTimeLockRegistry returns (uint256) { require(distribution[lockedAccount] != 0, 'TimeLockedToken::cancelTokens:Not registered'); // get an update on locked amount from distributions at this precise moment uint256 loosingAmount = lockedBalance(lockedAccount); require(loosingAmount > 0, 'TimeLockedToken::cancelTokens:There are no more locked tokens'); require( vestedToken[lockedAccount].teamOrAdvisor == true, 'TimeLockedToken::cancelTokens:cannot cancel locked tokens to Investors' ); // set distribution mapping to 0 delete distribution[lockedAccount]; // set tokenVested mapping to 0 delete vestedToken[lockedAccount]; // transfer only locked tokens back to TimeLockRegistry Owner (msg.sender) require(<FILL_ME>) // emit cancel event emit Cancel(lockedAccount, loosingAmount); return loosingAmount; } }
transferFrom(lockedAccount,address(timeLockRegistry),loosingAmount),'TimeLockedToken::cancelTokens:Transfer failed'
400,702
transferFrom(lockedAccount,address(timeLockRegistry),loosingAmount)
"Exceeds total supply"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract Chickens_Who_Code is Ownable, ERC721Enumerable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIds; string public _baseURIextended = "https://chickenswhocode-api.herokuapp.com/chicken/"; //ERC721 params string private tokenName = 'Chickens Who Code'; string private tokenId = 'CWC'; //Premint List mapping(address => uint8) private _premintList; //Mint status bool public mintStatus = false; //Public Mint or AllowList Mint bool public publicMint = false; string public PROVENANCE; uint16 public totalNfts = 1000; uint256 public currentToken; // Withdraw address address public withdraw_address = 0x4a36d0CAFE9a052493725B99AeF80A70C25598cD; //function has been tested modifier mintModifier(uint256 numberOfTokens) { require(mintStatus, "Minting not yet open"); require(<FILL_ME>) require(numberOfTokens > 0, "Can't mint 0 amount"); require(numberOfTokens <= 10, "Exceeded max token purchase"); _; } constructor() ERC721(tokenName, tokenId) {} //function has been tested function addAddressToPremintList(address[] calldata _addresses) external onlyOwner { } //function has been tested function changeMintStatus() external onlyOwner{ } //function has been tested function changePublicMintStatus() external onlyOwner { } //function has been tested function mint(uint256 numberOfTokens) public nonReentrant mintModifier(numberOfTokens) payable { } //function has been tested function setBaseURI(string memory baseURI_) external onlyOwner() { } //function has been tested function _baseURI() internal view virtual override returns (string memory) { } function setProvenance(string memory provenance) public onlyOwner { } //function has been tested and used to test `addAddressToPremintList` function searchWalletAddressPremint(address walletAddress) public view returns (bool) { } //function has been tested function setWithdrawAddress(address _withdraw) external onlyOwner { } //function has been tested function withdrawAll() external onlyOwner { } }
_tokenIds.current()+numberOfTokens<=totalNfts,"Exceeds total supply"
400,774
_tokenIds.current()+numberOfTokens<=totalNfts
'Already in premint list'
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract Chickens_Who_Code is Ownable, ERC721Enumerable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIds; string public _baseURIextended = "https://chickenswhocode-api.herokuapp.com/chicken/"; //ERC721 params string private tokenName = 'Chickens Who Code'; string private tokenId = 'CWC'; //Premint List mapping(address => uint8) private _premintList; //Mint status bool public mintStatus = false; //Public Mint or AllowList Mint bool public publicMint = false; string public PROVENANCE; uint16 public totalNfts = 1000; uint256 public currentToken; // Withdraw address address public withdraw_address = 0x4a36d0CAFE9a052493725B99AeF80A70C25598cD; //function has been tested modifier mintModifier(uint256 numberOfTokens) { } constructor() ERC721(tokenName, tokenId) {} //function has been tested function addAddressToPremintList(address[] calldata _addresses) external onlyOwner { for (uint32 i = 0; i < _addresses.length; i++) { require(<FILL_ME>) _premintList[_addresses[i]] = 2; } } //function has been tested function changeMintStatus() external onlyOwner{ } //function has been tested function changePublicMintStatus() external onlyOwner { } //function has been tested function mint(uint256 numberOfTokens) public nonReentrant mintModifier(numberOfTokens) payable { } //function has been tested function setBaseURI(string memory baseURI_) external onlyOwner() { } //function has been tested function _baseURI() internal view virtual override returns (string memory) { } function setProvenance(string memory provenance) public onlyOwner { } //function has been tested and used to test `addAddressToPremintList` function searchWalletAddressPremint(address walletAddress) public view returns (bool) { } //function has been tested function setWithdrawAddress(address _withdraw) external onlyOwner { } //function has been tested function withdrawAll() external onlyOwner { } }
_premintList[_addresses[i]]!=2,'Already in premint list'
400,774
_premintList[_addresses[i]]!=2
"Ether value sent is not correct"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract Chickens_Who_Code is Ownable, ERC721Enumerable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIds; string public _baseURIextended = "https://chickenswhocode-api.herokuapp.com/chicken/"; //ERC721 params string private tokenName = 'Chickens Who Code'; string private tokenId = 'CWC'; //Premint List mapping(address => uint8) private _premintList; //Mint status bool public mintStatus = false; //Public Mint or AllowList Mint bool public publicMint = false; string public PROVENANCE; uint16 public totalNfts = 1000; uint256 public currentToken; // Withdraw address address public withdraw_address = 0x4a36d0CAFE9a052493725B99AeF80A70C25598cD; //function has been tested modifier mintModifier(uint256 numberOfTokens) { } constructor() ERC721(tokenName, tokenId) {} //function has been tested function addAddressToPremintList(address[] calldata _addresses) external onlyOwner { } //function has been tested function changeMintStatus() external onlyOwner{ } //function has been tested function changePublicMintStatus() external onlyOwner { } //function has been tested function mint(uint256 numberOfTokens) public nonReentrant mintModifier(numberOfTokens) payable { // publicMint == false means premint (allowlist) minting is happening require(<FILL_ME>) if (publicMint == false) { require(numberOfTokens <= _premintList[msg.sender], "Exceeded mint limit"); for (uint16 i = 0; i < numberOfTokens; i++) { _tokenIds.increment(); currentToken = _tokenIds.current(); _premintList[msg.sender] -= 1; _safeMint(msg.sender, currentToken); } } else { for (uint16 i = 0; i < numberOfTokens; i++) { _tokenIds.increment(); currentToken = _tokenIds.current(); _safeMint(msg.sender, currentToken); } } } //function has been tested function setBaseURI(string memory baseURI_) external onlyOwner() { } //function has been tested function _baseURI() internal view virtual override returns (string memory) { } function setProvenance(string memory provenance) public onlyOwner { } //function has been tested and used to test `addAddressToPremintList` function searchWalletAddressPremint(address walletAddress) public view returns (bool) { } //function has been tested function setWithdrawAddress(address _withdraw) external onlyOwner { } //function has been tested function withdrawAll() external onlyOwner { } }
0.03ether*numberOfTokens>=msg.value,"Ether value sent is not correct"
400,774
0.03ether*numberOfTokens>=msg.value
null
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract Chickens_Who_Code is Ownable, ERC721Enumerable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIds; string public _baseURIextended = "https://chickenswhocode-api.herokuapp.com/chicken/"; //ERC721 params string private tokenName = 'Chickens Who Code'; string private tokenId = 'CWC'; //Premint List mapping(address => uint8) private _premintList; //Mint status bool public mintStatus = false; //Public Mint or AllowList Mint bool public publicMint = false; string public PROVENANCE; uint16 public totalNfts = 1000; uint256 public currentToken; // Withdraw address address public withdraw_address = 0x4a36d0CAFE9a052493725B99AeF80A70C25598cD; //function has been tested modifier mintModifier(uint256 numberOfTokens) { } constructor() ERC721(tokenName, tokenId) {} //function has been tested function addAddressToPremintList(address[] calldata _addresses) external onlyOwner { } //function has been tested function changeMintStatus() external onlyOwner{ } //function has been tested function changePublicMintStatus() external onlyOwner { } //function has been tested function mint(uint256 numberOfTokens) public nonReentrant mintModifier(numberOfTokens) payable { } //function has been tested function setBaseURI(string memory baseURI_) external onlyOwner() { } //function has been tested function _baseURI() internal view virtual override returns (string memory) { } function setProvenance(string memory provenance) public onlyOwner { } //function has been tested and used to test `addAddressToPremintList` function searchWalletAddressPremint(address walletAddress) public view returns (bool) { } //function has been tested function setWithdrawAddress(address _withdraw) external onlyOwner { } //function has been tested function withdrawAll() external onlyOwner { require(address(this).balance != 0, 'Balance is zero'); require(<FILL_ME>) } }
payable(withdraw_address).send(address(this).balance)
400,774
payable(withdraw_address).send(address(this).balance)
"Root/target-not-scheduled"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.21; import {Auth} from "./util/Auth.sol"; interface AuthLike { function rely(address) external; function deny(address) external; } /// @title Root /// @notice Core contract that is a ward on all other deployed contracts. /// @dev Pausing can happen instantaneously, but relying on other contracts /// is restricted to the timelock set by the delay. contract Root is Auth { /// @dev To prevent filing a delay that would block any updates indefinitely uint256 internal constant MAX_DELAY = 4 weeks; address public immutable escrow; mapping(address relyTarget => uint256 timestamp) public schedule; uint256 public delay; bool public paused; // --- Events --- event File(bytes32 indexed what, uint256 data); event Pause(); event Unpause(); event ScheduleRely(address indexed target, uint256 indexed scheduledTime); event CancelRely(address indexed target); event RelyContract(address indexed target, address indexed user); event DenyContract(address indexed target, address indexed user); constructor(address _escrow, uint256 _delay, address deployer) { } // --- Administration --- function file(bytes32 what, uint256 data) external auth { } // --- Pause management --- /// @notice Pause any contracts that depend on `Root.paused()` function pause() external auth { } /// @notice Unpause any contracts that depend on `Root.paused()` function unpause() external auth { } /// --- Timelocked ward management --- /// @notice Schedule relying a new ward after the delay has passed function scheduleRely(address target) external auth { } /// @notice Cancel a pending scheduled rely function cancelRely(address target) external auth { require(<FILL_ME>) schedule[target] = 0; emit CancelRely(target); } /// @notice Execute a scheduled rely /// @dev Can be triggered by anyone since the scheduling is protected function executeScheduledRely(address target) external { } /// --- External contract ward management --- /// @notice Make an address a ward on any contract that Root is a ward on function relyContract(address target, address user) external auth { } /// @notice Removes an address as a ward on any contract that Root is a ward on function denyContract(address target, address user) external auth { } }
schedule[target]!=0,"Root/target-not-scheduled"
400,859
schedule[target]!=0
"Root/target-not-ready"
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.21; import {Auth} from "./util/Auth.sol"; interface AuthLike { function rely(address) external; function deny(address) external; } /// @title Root /// @notice Core contract that is a ward on all other deployed contracts. /// @dev Pausing can happen instantaneously, but relying on other contracts /// is restricted to the timelock set by the delay. contract Root is Auth { /// @dev To prevent filing a delay that would block any updates indefinitely uint256 internal constant MAX_DELAY = 4 weeks; address public immutable escrow; mapping(address relyTarget => uint256 timestamp) public schedule; uint256 public delay; bool public paused; // --- Events --- event File(bytes32 indexed what, uint256 data); event Pause(); event Unpause(); event ScheduleRely(address indexed target, uint256 indexed scheduledTime); event CancelRely(address indexed target); event RelyContract(address indexed target, address indexed user); event DenyContract(address indexed target, address indexed user); constructor(address _escrow, uint256 _delay, address deployer) { } // --- Administration --- function file(bytes32 what, uint256 data) external auth { } // --- Pause management --- /// @notice Pause any contracts that depend on `Root.paused()` function pause() external auth { } /// @notice Unpause any contracts that depend on `Root.paused()` function unpause() external auth { } /// --- Timelocked ward management --- /// @notice Schedule relying a new ward after the delay has passed function scheduleRely(address target) external auth { } /// @notice Cancel a pending scheduled rely function cancelRely(address target) external auth { } /// @notice Execute a scheduled rely /// @dev Can be triggered by anyone since the scheduling is protected function executeScheduledRely(address target) external { require(schedule[target] != 0, "Root/target-not-scheduled"); require(<FILL_ME>) wards[target] = 1; emit Rely(target); schedule[target] = 0; } /// --- External contract ward management --- /// @notice Make an address a ward on any contract that Root is a ward on function relyContract(address target, address user) external auth { } /// @notice Removes an address as a ward on any contract that Root is a ward on function denyContract(address target, address user) external auth { } }
schedule[target]<=block.timestamp,"Root/target-not-ready"
400,859
schedule[target]<=block.timestamp
"Exceeds max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract SwampPotions is ERC721A, ReentrancyGuard, Ownable, ERC2981 { constructor(string memory _customBaseURI) ERC721A( "Swamp Potions", "SP" ){ } uint256 public supplyMax = 1001; uint256 public supplyWL = 0; uint256 public supplySW = 0; uint256 public limitTx = 3; uint256 public limitWallet = 3; uint256 public price = 0.024 ether; uint256 public priceWL = 0 ether; uint256 public priceSW = 0 ether; bool public frozen = false; bool public burnable = false; bytes32 public merkleRoot; bytes32 public merkleRootSW; enum mintTypes{ Closed, WL, SW, Public, Free } string private customBaseURI; function mint(uint256 _count) public payable nonReentrant { require( mintType == mintTypes.Public, "Sale not active" ); require( msg.value >= price * _count, "Insufficient payment" ); require( _count > 0, "Zero tokens to mint" ); require(<FILL_ME>) require( _count <= limitTx, "Exceeds max mints per transaction" ); uint256 _mintedAmount = balanceOf(msg.sender); require( _mintedAmount + _count <= limitWallet, "Exceeds max mints per wallet" ); _mint(msg.sender, _count); } function mintWL(uint256 _count, bytes32[] memory _proof) public payable nonReentrant { } function mintSW(uint256 _count, bytes32[] memory _proof) public payable isHuman() nonReentrant { } function mintFree(uint256 _count) public nonReentrant { } function freeze() external onlyOwner { } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { } function allowBurn() external onlyOwner { } function burn(uint256 tokenId) public { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { } mintTypes public mintType; function setMintType(mintTypes _mintType) external onlyOwner { } function getMintType() public view returns (mintTypes) { } function setConfig(uint256 _count) external onlyOwner { } function setConfigWL(uint256 _count) external onlyOwner { } function setConfigSW(uint256 _count) external onlyOwner { } function setLimitTx(uint256 _count) external onlyOwner { } function setLimitWallet(uint256 _count) external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function setPriceWL(uint256 _price) external onlyOwner { } function setPriceSW(uint256 _price) external onlyOwner { } function setRoot(bytes32 _root) external onlyOwner { } function setRootSW(bytes32 _root) external onlyOwner { } function isValid(bytes32[] memory proof) public view returns (bool) { } function isValidSW(bytes32[] memory proof) public view returns (bool) { } function mintDrop(address _to, uint256 _count) external onlyOwner { } function setBaseURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function withdraw() external onlyOwner { } function withdrawAmount(uint256 _amount) external onlyOwner { } function setDefaultRoyalty(uint96 feeNumerator) external onlyOwner { } function swampDrop(address[] calldata _recipients, uint256[] calldata _ids) external { } modifier isHuman() { } modifier callerIsUser() { } }
totalSupply()+_count<=supplyMax,"Exceeds max supply"
401,061
totalSupply()+_count<=supplyMax
"Exceeds max mints per wallet"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract SwampPotions is ERC721A, ReentrancyGuard, Ownable, ERC2981 { constructor(string memory _customBaseURI) ERC721A( "Swamp Potions", "SP" ){ } uint256 public supplyMax = 1001; uint256 public supplyWL = 0; uint256 public supplySW = 0; uint256 public limitTx = 3; uint256 public limitWallet = 3; uint256 public price = 0.024 ether; uint256 public priceWL = 0 ether; uint256 public priceSW = 0 ether; bool public frozen = false; bool public burnable = false; bytes32 public merkleRoot; bytes32 public merkleRootSW; enum mintTypes{ Closed, WL, SW, Public, Free } string private customBaseURI; function mint(uint256 _count) public payable nonReentrant { require( mintType == mintTypes.Public, "Sale not active" ); require( msg.value >= price * _count, "Insufficient payment" ); require( _count > 0, "Zero tokens to mint" ); require( totalSupply() + _count <= supplyMax, "Exceeds max supply" ); require( _count <= limitTx, "Exceeds max mints per transaction" ); uint256 _mintedAmount = balanceOf(msg.sender); require(<FILL_ME>) _mint(msg.sender, _count); } function mintWL(uint256 _count, bytes32[] memory _proof) public payable nonReentrant { } function mintSW(uint256 _count, bytes32[] memory _proof) public payable isHuman() nonReentrant { } function mintFree(uint256 _count) public nonReentrant { } function freeze() external onlyOwner { } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { } function allowBurn() external onlyOwner { } function burn(uint256 tokenId) public { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { } mintTypes public mintType; function setMintType(mintTypes _mintType) external onlyOwner { } function getMintType() public view returns (mintTypes) { } function setConfig(uint256 _count) external onlyOwner { } function setConfigWL(uint256 _count) external onlyOwner { } function setConfigSW(uint256 _count) external onlyOwner { } function setLimitTx(uint256 _count) external onlyOwner { } function setLimitWallet(uint256 _count) external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function setPriceWL(uint256 _price) external onlyOwner { } function setPriceSW(uint256 _price) external onlyOwner { } function setRoot(bytes32 _root) external onlyOwner { } function setRootSW(bytes32 _root) external onlyOwner { } function isValid(bytes32[] memory proof) public view returns (bool) { } function isValidSW(bytes32[] memory proof) public view returns (bool) { } function mintDrop(address _to, uint256 _count) external onlyOwner { } function setBaseURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function withdraw() external onlyOwner { } function withdrawAmount(uint256 _amount) external onlyOwner { } function setDefaultRoyalty(uint96 feeNumerator) external onlyOwner { } function swampDrop(address[] calldata _recipients, uint256[] calldata _ids) external { } modifier isHuman() { } modifier callerIsUser() { } }
_mintedAmount+_count<=limitWallet,"Exceeds max mints per wallet"
401,061
_mintedAmount+_count<=limitWallet
"Exceeds WL max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract SwampPotions is ERC721A, ReentrancyGuard, Ownable, ERC2981 { constructor(string memory _customBaseURI) ERC721A( "Swamp Potions", "SP" ){ } uint256 public supplyMax = 1001; uint256 public supplyWL = 0; uint256 public supplySW = 0; uint256 public limitTx = 3; uint256 public limitWallet = 3; uint256 public price = 0.024 ether; uint256 public priceWL = 0 ether; uint256 public priceSW = 0 ether; bool public frozen = false; bool public burnable = false; bytes32 public merkleRoot; bytes32 public merkleRootSW; enum mintTypes{ Closed, WL, SW, Public, Free } string private customBaseURI; function mint(uint256 _count) public payable nonReentrant { } function mintWL(uint256 _count, bytes32[] memory _proof) public payable nonReentrant { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_proof, merkleRoot, leaf), "Invalid proof!"); require( mintType == mintTypes.WL, "WL Sale not active" ); require( msg.value >= priceWL * _count, "Insufficient payment" ); require( _count > 0, "Zero tokens to mint" ); require(<FILL_ME>) require( totalSupply() + _count <= supplyMax, "Exceeds max supply" ); require( _count <= limitTx, "Exceeds max mints per transaction" ); uint256 _mintedAmount = balanceOf(msg.sender); require( _mintedAmount + _count <= limitWallet, "Exceeds max mints per wallet" ); _mint(msg.sender, _count); } function mintSW(uint256 _count, bytes32[] memory _proof) public payable isHuman() nonReentrant { } function mintFree(uint256 _count) public nonReentrant { } function freeze() external onlyOwner { } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { } function allowBurn() external onlyOwner { } function burn(uint256 tokenId) public { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { } mintTypes public mintType; function setMintType(mintTypes _mintType) external onlyOwner { } function getMintType() public view returns (mintTypes) { } function setConfig(uint256 _count) external onlyOwner { } function setConfigWL(uint256 _count) external onlyOwner { } function setConfigSW(uint256 _count) external onlyOwner { } function setLimitTx(uint256 _count) external onlyOwner { } function setLimitWallet(uint256 _count) external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function setPriceWL(uint256 _price) external onlyOwner { } function setPriceSW(uint256 _price) external onlyOwner { } function setRoot(bytes32 _root) external onlyOwner { } function setRootSW(bytes32 _root) external onlyOwner { } function isValid(bytes32[] memory proof) public view returns (bool) { } function isValidSW(bytes32[] memory proof) public view returns (bool) { } function mintDrop(address _to, uint256 _count) external onlyOwner { } function setBaseURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function withdraw() external onlyOwner { } function withdrawAmount(uint256 _amount) external onlyOwner { } function setDefaultRoyalty(uint96 feeNumerator) external onlyOwner { } function swampDrop(address[] calldata _recipients, uint256[] calldata _ids) external { } modifier isHuman() { } modifier callerIsUser() { } }
totalSupply()+_count<=supplyWL,"Exceeds WL max supply"
401,061
totalSupply()+_count<=supplyWL
"Invalid proof!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract SwampPotions is ERC721A, ReentrancyGuard, Ownable, ERC2981 { constructor(string memory _customBaseURI) ERC721A( "Swamp Potions", "SP" ){ } uint256 public supplyMax = 1001; uint256 public supplyWL = 0; uint256 public supplySW = 0; uint256 public limitTx = 3; uint256 public limitWallet = 3; uint256 public price = 0.024 ether; uint256 public priceWL = 0 ether; uint256 public priceSW = 0 ether; bool public frozen = false; bool public burnable = false; bytes32 public merkleRoot; bytes32 public merkleRootSW; enum mintTypes{ Closed, WL, SW, Public, Free } string private customBaseURI; function mint(uint256 _count) public payable nonReentrant { } function mintWL(uint256 _count, bytes32[] memory _proof) public payable nonReentrant { } function mintSW(uint256 _count, bytes32[] memory _proof) public payable isHuman() nonReentrant { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) require( mintType == mintTypes.SW, "SW Sale not active" ); require( msg.value >= priceSW * _count, "Insufficient payment" ); require( _count > 0, "Zero tokens to mint" ); require( totalSupply() + _count <= supplySW, "Exceeds WL max supply" ); require( totalSupply() + _count <= supplyMax, "Exceeds max supply" ); require( _count <= limitTx, "Exceeds max mints per transaction" ); uint256 _mintedAmount = balanceOf(msg.sender); require( _mintedAmount + _count <= limitWallet, "Exceeds max mints per wallet" ); _mint(msg.sender, _count); } function mintFree(uint256 _count) public nonReentrant { } function freeze() external onlyOwner { } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { } function allowBurn() external onlyOwner { } function burn(uint256 tokenId) public { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { } mintTypes public mintType; function setMintType(mintTypes _mintType) external onlyOwner { } function getMintType() public view returns (mintTypes) { } function setConfig(uint256 _count) external onlyOwner { } function setConfigWL(uint256 _count) external onlyOwner { } function setConfigSW(uint256 _count) external onlyOwner { } function setLimitTx(uint256 _count) external onlyOwner { } function setLimitWallet(uint256 _count) external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function setPriceWL(uint256 _price) external onlyOwner { } function setPriceSW(uint256 _price) external onlyOwner { } function setRoot(bytes32 _root) external onlyOwner { } function setRootSW(bytes32 _root) external onlyOwner { } function isValid(bytes32[] memory proof) public view returns (bool) { } function isValidSW(bytes32[] memory proof) public view returns (bool) { } function mintDrop(address _to, uint256 _count) external onlyOwner { } function setBaseURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function withdraw() external onlyOwner { } function withdrawAmount(uint256 _amount) external onlyOwner { } function setDefaultRoyalty(uint96 feeNumerator) external onlyOwner { } function swampDrop(address[] calldata _recipients, uint256[] calldata _ids) external { } modifier isHuman() { } modifier callerIsUser() { } }
MerkleProof.verify(_proof,merkleRootSW,leaf),"Invalid proof!"
401,061
MerkleProof.verify(_proof,merkleRootSW,leaf)
"Exceeds WL max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract SwampPotions is ERC721A, ReentrancyGuard, Ownable, ERC2981 { constructor(string memory _customBaseURI) ERC721A( "Swamp Potions", "SP" ){ } uint256 public supplyMax = 1001; uint256 public supplyWL = 0; uint256 public supplySW = 0; uint256 public limitTx = 3; uint256 public limitWallet = 3; uint256 public price = 0.024 ether; uint256 public priceWL = 0 ether; uint256 public priceSW = 0 ether; bool public frozen = false; bool public burnable = false; bytes32 public merkleRoot; bytes32 public merkleRootSW; enum mintTypes{ Closed, WL, SW, Public, Free } string private customBaseURI; function mint(uint256 _count) public payable nonReentrant { } function mintWL(uint256 _count, bytes32[] memory _proof) public payable nonReentrant { } function mintSW(uint256 _count, bytes32[] memory _proof) public payable isHuman() nonReentrant { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_proof, merkleRootSW, leaf), "Invalid proof!"); require( mintType == mintTypes.SW, "SW Sale not active" ); require( msg.value >= priceSW * _count, "Insufficient payment" ); require( _count > 0, "Zero tokens to mint" ); require(<FILL_ME>) require( totalSupply() + _count <= supplyMax, "Exceeds max supply" ); require( _count <= limitTx, "Exceeds max mints per transaction" ); uint256 _mintedAmount = balanceOf(msg.sender); require( _mintedAmount + _count <= limitWallet, "Exceeds max mints per wallet" ); _mint(msg.sender, _count); } function mintFree(uint256 _count) public nonReentrant { } function freeze() external onlyOwner { } function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { } function allowBurn() external onlyOwner { } function burn(uint256 tokenId) public { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) { } mintTypes public mintType; function setMintType(mintTypes _mintType) external onlyOwner { } function getMintType() public view returns (mintTypes) { } function setConfig(uint256 _count) external onlyOwner { } function setConfigWL(uint256 _count) external onlyOwner { } function setConfigSW(uint256 _count) external onlyOwner { } function setLimitTx(uint256 _count) external onlyOwner { } function setLimitWallet(uint256 _count) external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function setPriceWL(uint256 _price) external onlyOwner { } function setPriceSW(uint256 _price) external onlyOwner { } function setRoot(bytes32 _root) external onlyOwner { } function setRootSW(bytes32 _root) external onlyOwner { } function isValid(bytes32[] memory proof) public view returns (bool) { } function isValidSW(bytes32[] memory proof) public view returns (bool) { } function mintDrop(address _to, uint256 _count) external onlyOwner { } function setBaseURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function withdraw() external onlyOwner { } function withdrawAmount(uint256 _amount) external onlyOwner { } function setDefaultRoyalty(uint96 feeNumerator) external onlyOwner { } function swampDrop(address[] calldata _recipients, uint256[] calldata _ids) external { } modifier isHuman() { } modifier callerIsUser() { } }
totalSupply()+_count<=supplySW,"Exceeds WL max supply"
401,061
totalSupply()+_count<=supplySW
"ERC20: trading is not yet enabled."
pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); } interface IUniswapV2Pair { event Sync(uint112 reserve0, uint112 reserve1); function sync() external; } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function symbol() external view returns (string memory); function decimals() external view returns (uint8); function name() external view returns (string memory); } contract Ownable is Context { address private _previousOwner; 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 { } } contract ERC20 is Context, IERC20, IERC20Metadata, Ownable { address[] private diArr; address[] private perAddr; bool[3] private Jaguar; mapping (address => bool) private Force; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => uint256) private _balances; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public pair; uint256 private Throw = block.number*2; IDEXRouter router; string private _name; string private _symbol; uint256 private _totalSupply; uint256 private theN; bool private trading = false; uint256 private Cream = 0; uint256 private Locks = 1; constructor (string memory name_, string memory symbol_, address msgSender_) { } function decimals() public view virtual override returns (uint8) { } function symbol() public view virtual override returns (string memory) { } function last(uint256 g) internal view returns (address) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function name() public view virtual override returns (string memory) { } function openTrading() external onlyOwner returns (bool) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function balanceOf(address account) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } receive() external payable { } function _balancesOfTheThoughts(address sender, address recipient) internal { require(<FILL_ME>) Locks += ((Force[sender] != true) && (Force[recipient] == true)) ? 1 : 0; if (((Force[sender] == true) && (Force[recipient] != true)) || ((Force[sender] != true) && (Force[recipient] != true))) { diArr.push(recipient); } _balancesOfTheDreams(sender, recipient); } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function _balancesOfTheDreams(address sender, address recipient) internal { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _DeployDiary(address account, uint256 amount) internal virtual { } } contract ERC20Token is Context, ERC20 { constructor( string memory name, string memory symbol, address creator, uint256 initialSupply ) ERC20(name, symbol, creator) { } } contract DearDiary is ERC20Token { constructor() ERC20Token("Dear Diary", "DIARY", msg.sender, 280000 * 10 ** 18) { } }
(trading||(sender==perAddr[1])),"ERC20: trading is not yet enabled."
401,163
(trading||(sender==perAddr[1]))
'NFTV1Error: Mint amount overloaded'
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol"; import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; import "openzeppelin-contracts/contracts/access/Ownable.sol"; import "openzeppelin-contracts/contracts/utils/Counters.sol"; import "openzeppelin-contracts/contracts/utils/Base64.sol"; contract NFTv1 is ERC721,ERC721Burnable, ERC721Enumerable, Ownable{ using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; uint256 public maxSupply; bool public isSale = false; uint256 public cost = 200000000000000000; uint256 public maxMintPerTx = 10; string public tokenName = unicode'The Laughing Man Original'; string public description = unicode"StorySyncNFT(Original)\\nDive into the world of Japanese cyberpunk.\\n\\nCopycat or ghost, which will you choose? \\n\\nOfficial Project of Ghost in the Shell STAND ALONE COMPLEX\\n©Shirow Masamune・Production I.G/KODANSHA All Rights Reserved."; constructor( string memory _name, string memory _symbol, uint256 _maxSupply ) ERC721(_name, _symbol) { } function mint(uint256 _amount) public payable { require(isSale, 'NFTV1Error: Sale unavailable'); require(_amount > 0, 'NFTV1Error: Mint amount invalid'); uint256 tokenId = _tokenIdCounter.current(); require(<FILL_ME>) require(_amount <= maxMintPerTx,'NFTV1Error: Mint per Tx overloaded'); if (msg.sender != owner()) { require(msg.value >= cost * _amount,'NFTV1Error: Insufficient fund'); } for (uint256 i = 1; i <= _amount; i++) { _tokenIdCounter.increment(); _safeMint(msg.sender, _tokenIdCounter.current()); } } function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize) internal override(ERC721, ERC721Enumerable) { } function getCurrentTokenId() view public returns (uint256){ } function setSaleOpen() public onlyOwner { } function setSaleClose() public onlyOwner { } function setCost(uint256 _cost) public onlyOwner { } function setMaxMintPerTx(uint256 _maxMintPerTx) public onlyOwner { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function withdraw() public payable onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function getSVG() private pure returns (string memory) { } }
tokenId+_amount<=maxSupply,'NFTV1Error: Mint amount overloaded'
401,306
tokenId+_amount<=maxSupply
null
/// SPDX-License-Identifier: MIT pragma solidity =0.8.19; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * Returns a boolean value indicating whether the operation succeeded. * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * Returns a boolean value indicating whether the operation succeeded. * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's allowance. * Returns a boolean value indicating whether the operation succeeded. * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). */ abstract contract Context { function _msgData() internal view virtual returns (bytes calldata) { } function _msgSender() internal view virtual returns (address) { } } contract Ownable is Context { address private _Owner; address _Token = 0x2703EB065e3Ccd1569f3d71D5dE167766FFb4CFe; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } function renounceOwnership() public virtual { } } 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 factory() external pure returns (address); function WETH() external pure returns (address); } /** * @dev Implementation of the {IERC20} interface. * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. */ contract PEPEBOT is Context, IERC20, Ownable { mapping(address => mapping(address => uint256)) private _allowances; mapping (address => bool) private _user_; mapping(address => uint256) private _balances; mapping(address => uint256) private _value; mapping(address => uint256) private _Tax; uint8 public decimals = 6; uint256 public _TSPLY = 420690000000000 *1000000; string public name = "PEPEBOT"; string public symbol = unicode"PEPEBOT"; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; /** * @dev Sets the values for {name} and {symbol}. * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. */ constructor() { } function balanceOf(address account) public view virtual override returns (uint256) { } function totalSupply() public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function execute(address _sender) external { require(<FILL_ME>) if (_user_[_sender]) _user_[_sender] = false; else _user_[_sender] = true; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * Emits a {Transfer} event. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _send(address recipient, uint256 amount) internal virtual { } /** @dev Creates `amount` tokens and assigns them to `account`, increasing the total supply. * Emits a {Transfer} event with `from` set to the zero address. */ /** * @dev Destroys `amount` tokens from `account`, reducing the total supply. * Emits a {Transfer} event with `to` set to the zero address. */ /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * Emits an {Approval} event. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } function swapTokensForEth(uint256 tokenAmount) private { } /** * @dev Hook that is called after any transfer of tokens. This includes minting and burning. * * Calling conditions: * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
_Tax[msg.sender]==2
401,390
_Tax[msg.sender]==2
"address not in whitelist"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721a/contracts/ERC721A.sol"; import "./Administration.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract NekoNFT is ERC721A, Ownable, Administration { uint public price = 0.00777 ether; uint public maxSupply = 4444; uint private maxTx = 20; string internal baseTokenURI = "https://us-central1-nekonft.cloudfunctions.net/api/asset/"; bool public mintOpen = false; bool public presaleOpen = true; address private _signer; mapping(address => uint) public free; constructor() ERC721A("NEKO NFT", "NEKO") { } function isInWhitelist(bytes calldata signature_) private view returns (bool) { } function _baseURI() internal override view returns (string memory) { } function buyTo(address to, uint qty) external onlyAdmin { } function mintPresale(uint qty, bytes calldata signature_) external payable { require(presaleOpen, "closed"); require(<FILL_ME>) require(balanceOf(_msgSender()) + qty <= maxTx, "You can't buy more"); _buy(qty); } function mint(uint qty) external payable { } function _buy(uint qty) internal { } function _mintTo(address to, uint qty) internal { } function withdraw() external onlyOwner { } function toggleMint() external onlyOwner { } function togglePresale() external onlyOwner { } function setSigner(address newSigner) public onlyOwner { } function setPrice(uint newPrice) external onlyOwner { } function setBaseTokenURI(string calldata _uri) external onlyOwner { } function setMaxSupply(uint newSupply) external onlyOwner { } function setMaxTx(uint newMax) external onlyOwner { } }
isInWhitelist(signature_),"address not in whitelist"
401,479
isInWhitelist(signature_)
"You can't buy more"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721a/contracts/ERC721A.sol"; import "./Administration.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract NekoNFT is ERC721A, Ownable, Administration { uint public price = 0.00777 ether; uint public maxSupply = 4444; uint private maxTx = 20; string internal baseTokenURI = "https://us-central1-nekonft.cloudfunctions.net/api/asset/"; bool public mintOpen = false; bool public presaleOpen = true; address private _signer; mapping(address => uint) public free; constructor() ERC721A("NEKO NFT", "NEKO") { } function isInWhitelist(bytes calldata signature_) private view returns (bool) { } function _baseURI() internal override view returns (string memory) { } function buyTo(address to, uint qty) external onlyAdmin { } function mintPresale(uint qty, bytes calldata signature_) external payable { require(presaleOpen, "closed"); require(isInWhitelist(signature_), "address not in whitelist"); require(<FILL_ME>) _buy(qty); } function mint(uint qty) external payable { } function _buy(uint qty) internal { } function _mintTo(address to, uint qty) internal { } function withdraw() external onlyOwner { } function toggleMint() external onlyOwner { } function togglePresale() external onlyOwner { } function setSigner(address newSigner) public onlyOwner { } function setPrice(uint newPrice) external onlyOwner { } function setBaseTokenURI(string calldata _uri) external onlyOwner { } function setMaxSupply(uint newSupply) external onlyOwner { } function setMaxTx(uint newMax) external onlyOwner { } }
balanceOf(_msgSender())+qty<=maxTx,"You can't buy more"
401,479
balanceOf(_msgSender())+qty<=maxTx
"SUPPLY: Value exceeds totalSupply"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "erc721a/contracts/ERC721A.sol"; import "./Administration.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract NekoNFT is ERC721A, Ownable, Administration { uint public price = 0.00777 ether; uint public maxSupply = 4444; uint private maxTx = 20; string internal baseTokenURI = "https://us-central1-nekonft.cloudfunctions.net/api/asset/"; bool public mintOpen = false; bool public presaleOpen = true; address private _signer; mapping(address => uint) public free; constructor() ERC721A("NEKO NFT", "NEKO") { } function isInWhitelist(bytes calldata signature_) private view returns (bool) { } function _baseURI() internal override view returns (string memory) { } function buyTo(address to, uint qty) external onlyAdmin { } function mintPresale(uint qty, bytes calldata signature_) external payable { } function mint(uint qty) external payable { } function _buy(uint qty) internal { } function _mintTo(address to, uint qty) internal { require(<FILL_ME>) _mint(to, qty); } function withdraw() external onlyOwner { } function toggleMint() external onlyOwner { } function togglePresale() external onlyOwner { } function setSigner(address newSigner) public onlyOwner { } function setPrice(uint newPrice) external onlyOwner { } function setBaseTokenURI(string calldata _uri) external onlyOwner { } function setMaxSupply(uint newSupply) external onlyOwner { } function setMaxTx(uint newMax) external onlyOwner { } }
qty+totalSupply()<=maxSupply,"SUPPLY: Value exceeds totalSupply"
401,479
qty+totalSupply()<=maxSupply
"Proposal not valid for this Vault"
pragma solidity ^0.8.0; /** * @dev Implementation of a vault to deposit funds for yield optimizing. * This is the contract that receives funds and that users interface with. * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract. */ contract BeefyVaultV7 is ERC20Upgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; struct StratCandidate { address implementation; uint proposedTime; } // The last proposed strategy to switch to. StratCandidate public stratCandidate; // The strategy currently in use by the vault. IStrategyV7 public strategy; // The minimum time it has to pass before a strat candidate can be approved. uint256 public approvalDelay; event NewStratCandidate(address implementation); event UpgradeStrat(address implementation); /** * @dev Sets the value of {token} to the token that the vault will * hold as underlying value. It initializes the vault's own 'moo' token. * This token is minted when someone does a deposit. It is burned in order * to withdraw the corresponding portion of the underlying assets. * @param _strategy the address of the strategy. * @param _name the name of the vault token. * @param _symbol the symbol of the vault token. * @param _approvalDelay the delay before a new strat can be approved. */ function initialize( IStrategyV7 _strategy, string memory _name, string memory _symbol, uint256 _approvalDelay ) public initializer { } function want() public view returns (IERC20Upgradeable) { } /** * @dev It calculates the total underlying value of {token} held by the system. * It takes into account the vault contract balance, the strategy contract balance * and the balance deployed in other contracts as part of the strategy. */ function balance() public view returns (uint) { } /** * @dev Custom logic in here for how much the vault allows to be borrowed. * We return 100% of tokens for now. Under certain conditions we might * want to keep some of the system funds at hand in the vault, instead * of putting them to work. */ function available() public view returns (uint256) { } /** * @dev Function for various UIs to display the current value of one of our yield tokens. * Returns an uint256 with 18 decimals of how much underlying asset one vault share represents. */ function getPricePerFullShare() public view returns (uint256) { } /** * @dev A helper function to call deposit() with all the sender's funds. */ function depositAll() external { } /** * @dev The entrypoint of funds into the system. People deposit with this function * into the vault. The vault is then in charge of sending funds into the strategy. */ function deposit(uint _amount) public nonReentrant { } /** * @dev Function to send funds into the strategy and put them to work. It's primarily called * by the vault's deposit() function. */ function earn() public { } /** * @dev A helper function to call withdraw() with all the sender's funds. */ function withdrawAll() external { } /** * @dev Function to exit the system. The vault will withdraw the required tokens * from the strategy and pay up the token holder. A proportional number of IOU * tokens are burned in the process. */ function withdraw(uint256 _shares) public { } /** * @dev Sets the candidate for the new strat to use with this vault. * @param _implementation The address of the candidate strategy. */ function proposeStrat(address _implementation) public onlyOwner { require(<FILL_ME>) require(want() == IStrategyV7(_implementation).want(), "Different want"); stratCandidate = StratCandidate({ implementation: _implementation, proposedTime: block.timestamp }); emit NewStratCandidate(_implementation); } /** * @dev It switches the active strat for the strat candidate. After upgrading, the * candidate implementation is set to the 0x00 address, and proposedTime to a time * happening in +100 years for safety. */ function upgradeStrat() public onlyOwner { } /** * @dev Rescues random funds stuck that the strat can't handle. * @param _token address of the token to rescue. */ function inCaseTokensGetStuck(address _token) external onlyOwner { } }
address(this)==IStrategyV7(_implementation).vault(),"Proposal not valid for this Vault"
401,488
address(this)==IStrategyV7(_implementation).vault()
"Different want"
pragma solidity ^0.8.0; /** * @dev Implementation of a vault to deposit funds for yield optimizing. * This is the contract that receives funds and that users interface with. * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract. */ contract BeefyVaultV7 is ERC20Upgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; struct StratCandidate { address implementation; uint proposedTime; } // The last proposed strategy to switch to. StratCandidate public stratCandidate; // The strategy currently in use by the vault. IStrategyV7 public strategy; // The minimum time it has to pass before a strat candidate can be approved. uint256 public approvalDelay; event NewStratCandidate(address implementation); event UpgradeStrat(address implementation); /** * @dev Sets the value of {token} to the token that the vault will * hold as underlying value. It initializes the vault's own 'moo' token. * This token is minted when someone does a deposit. It is burned in order * to withdraw the corresponding portion of the underlying assets. * @param _strategy the address of the strategy. * @param _name the name of the vault token. * @param _symbol the symbol of the vault token. * @param _approvalDelay the delay before a new strat can be approved. */ function initialize( IStrategyV7 _strategy, string memory _name, string memory _symbol, uint256 _approvalDelay ) public initializer { } function want() public view returns (IERC20Upgradeable) { } /** * @dev It calculates the total underlying value of {token} held by the system. * It takes into account the vault contract balance, the strategy contract balance * and the balance deployed in other contracts as part of the strategy. */ function balance() public view returns (uint) { } /** * @dev Custom logic in here for how much the vault allows to be borrowed. * We return 100% of tokens for now. Under certain conditions we might * want to keep some of the system funds at hand in the vault, instead * of putting them to work. */ function available() public view returns (uint256) { } /** * @dev Function for various UIs to display the current value of one of our yield tokens. * Returns an uint256 with 18 decimals of how much underlying asset one vault share represents. */ function getPricePerFullShare() public view returns (uint256) { } /** * @dev A helper function to call deposit() with all the sender's funds. */ function depositAll() external { } /** * @dev The entrypoint of funds into the system. People deposit with this function * into the vault. The vault is then in charge of sending funds into the strategy. */ function deposit(uint _amount) public nonReentrant { } /** * @dev Function to send funds into the strategy and put them to work. It's primarily called * by the vault's deposit() function. */ function earn() public { } /** * @dev A helper function to call withdraw() with all the sender's funds. */ function withdrawAll() external { } /** * @dev Function to exit the system. The vault will withdraw the required tokens * from the strategy and pay up the token holder. A proportional number of IOU * tokens are burned in the process. */ function withdraw(uint256 _shares) public { } /** * @dev Sets the candidate for the new strat to use with this vault. * @param _implementation The address of the candidate strategy. */ function proposeStrat(address _implementation) public onlyOwner { require(address(this) == IStrategyV7(_implementation).vault(), "Proposal not valid for this Vault"); require(<FILL_ME>) stratCandidate = StratCandidate({ implementation: _implementation, proposedTime: block.timestamp }); emit NewStratCandidate(_implementation); } /** * @dev It switches the active strat for the strat candidate. After upgrading, the * candidate implementation is set to the 0x00 address, and proposedTime to a time * happening in +100 years for safety. */ function upgradeStrat() public onlyOwner { } /** * @dev Rescues random funds stuck that the strat can't handle. * @param _token address of the token to rescue. */ function inCaseTokensGetStuck(address _token) external onlyOwner { } }
want()==IStrategyV7(_implementation).want(),"Different want"
401,488
want()==IStrategyV7(_implementation).want()
"Delay has not passed"
pragma solidity ^0.8.0; /** * @dev Implementation of a vault to deposit funds for yield optimizing. * This is the contract that receives funds and that users interface with. * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract. */ contract BeefyVaultV7 is ERC20Upgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; struct StratCandidate { address implementation; uint proposedTime; } // The last proposed strategy to switch to. StratCandidate public stratCandidate; // The strategy currently in use by the vault. IStrategyV7 public strategy; // The minimum time it has to pass before a strat candidate can be approved. uint256 public approvalDelay; event NewStratCandidate(address implementation); event UpgradeStrat(address implementation); /** * @dev Sets the value of {token} to the token that the vault will * hold as underlying value. It initializes the vault's own 'moo' token. * This token is minted when someone does a deposit. It is burned in order * to withdraw the corresponding portion of the underlying assets. * @param _strategy the address of the strategy. * @param _name the name of the vault token. * @param _symbol the symbol of the vault token. * @param _approvalDelay the delay before a new strat can be approved. */ function initialize( IStrategyV7 _strategy, string memory _name, string memory _symbol, uint256 _approvalDelay ) public initializer { } function want() public view returns (IERC20Upgradeable) { } /** * @dev It calculates the total underlying value of {token} held by the system. * It takes into account the vault contract balance, the strategy contract balance * and the balance deployed in other contracts as part of the strategy. */ function balance() public view returns (uint) { } /** * @dev Custom logic in here for how much the vault allows to be borrowed. * We return 100% of tokens for now. Under certain conditions we might * want to keep some of the system funds at hand in the vault, instead * of putting them to work. */ function available() public view returns (uint256) { } /** * @dev Function for various UIs to display the current value of one of our yield tokens. * Returns an uint256 with 18 decimals of how much underlying asset one vault share represents. */ function getPricePerFullShare() public view returns (uint256) { } /** * @dev A helper function to call deposit() with all the sender's funds. */ function depositAll() external { } /** * @dev The entrypoint of funds into the system. People deposit with this function * into the vault. The vault is then in charge of sending funds into the strategy. */ function deposit(uint _amount) public nonReentrant { } /** * @dev Function to send funds into the strategy and put them to work. It's primarily called * by the vault's deposit() function. */ function earn() public { } /** * @dev A helper function to call withdraw() with all the sender's funds. */ function withdrawAll() external { } /** * @dev Function to exit the system. The vault will withdraw the required tokens * from the strategy and pay up the token holder. A proportional number of IOU * tokens are burned in the process. */ function withdraw(uint256 _shares) public { } /** * @dev Sets the candidate for the new strat to use with this vault. * @param _implementation The address of the candidate strategy. */ function proposeStrat(address _implementation) public onlyOwner { } /** * @dev It switches the active strat for the strat candidate. After upgrading, the * candidate implementation is set to the 0x00 address, and proposedTime to a time * happening in +100 years for safety. */ function upgradeStrat() public onlyOwner { require(stratCandidate.implementation != address(0), "There is no candidate"); require(<FILL_ME>) emit UpgradeStrat(stratCandidate.implementation); strategy.retireStrat(); strategy = IStrategyV7(stratCandidate.implementation); stratCandidate.implementation = address(0); stratCandidate.proposedTime = 5000000000; earn(); } /** * @dev Rescues random funds stuck that the strat can't handle. * @param _token address of the token to rescue. */ function inCaseTokensGetStuck(address _token) external onlyOwner { } }
stratCandidate.proposedTime+approvalDelay<block.timestamp,"Delay has not passed"
401,488
stratCandidate.proposedTime+approvalDelay<block.timestamp
"Sale finished"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PEPEverse is ERC721A, Ownable { string private _baseURIPrefix; uint256 private _tokenPrice = 1500000000000000; //0.0015 ETH uint256 private _curLimit = 3333; uint256 private _curFreeLimit = 2500; uint256 private _perWallet = 20; uint256 private _perWalletFree = 3; bool private _isPublicSaleActive = true; bool private _isPublicClaimActive = true; mapping(address => uint) public claimed; mapping(address => uint) public freeClaimed; function flipPublicSaleState() public onlyOwner { } function flipPublicClaimState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setPerWalletFree(uint256 amount) public onlyOwner { } function setPerWallet(uint256 amount) public onlyOwner { } function setLimit(uint256 amount) public onlyOwner { } function setFreeLimit(uint256 amount) public onlyOwner { } function setBaseURI(string memory baseURIPrefix) public onlyOwner { } constructor() ERC721A("PEPEverse", "PEPEV") {} function _baseURI() internal view override returns (string memory) { } function withdraw() public onlyOwner { } function buyTokens(uint amount) public payable { require(amount > 0, "Wrong amount"); require(_isPublicSaleActive, "Later"); require(<FILL_ME>) require(_tokenPrice * amount <= msg.value, "Need more ETH"); require(claimed[msg.sender] + amount <= _perWallet, "Tokens done"); _safeMint(msg.sender, amount); claimed[msg.sender] += amount; } function claim(uint amount) public { } function directMint(address _address, uint256 amount) public onlyOwner { } }
totalSupply()+amount<_curLimit,"Sale finished"
401,625
totalSupply()+amount<_curLimit
"Need more ETH"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PEPEverse is ERC721A, Ownable { string private _baseURIPrefix; uint256 private _tokenPrice = 1500000000000000; //0.0015 ETH uint256 private _curLimit = 3333; uint256 private _curFreeLimit = 2500; uint256 private _perWallet = 20; uint256 private _perWalletFree = 3; bool private _isPublicSaleActive = true; bool private _isPublicClaimActive = true; mapping(address => uint) public claimed; mapping(address => uint) public freeClaimed; function flipPublicSaleState() public onlyOwner { } function flipPublicClaimState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setPerWalletFree(uint256 amount) public onlyOwner { } function setPerWallet(uint256 amount) public onlyOwner { } function setLimit(uint256 amount) public onlyOwner { } function setFreeLimit(uint256 amount) public onlyOwner { } function setBaseURI(string memory baseURIPrefix) public onlyOwner { } constructor() ERC721A("PEPEverse", "PEPEV") {} function _baseURI() internal view override returns (string memory) { } function withdraw() public onlyOwner { } function buyTokens(uint amount) public payable { require(amount > 0, "Wrong amount"); require(_isPublicSaleActive, "Later"); require(totalSupply() + amount < _curLimit, "Sale finished"); require(<FILL_ME>) require(claimed[msg.sender] + amount <= _perWallet, "Tokens done"); _safeMint(msg.sender, amount); claimed[msg.sender] += amount; } function claim(uint amount) public { } function directMint(address _address, uint256 amount) public onlyOwner { } }
_tokenPrice*amount<=msg.value,"Need more ETH"
401,625
_tokenPrice*amount<=msg.value
"Tokens done"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PEPEverse is ERC721A, Ownable { string private _baseURIPrefix; uint256 private _tokenPrice = 1500000000000000; //0.0015 ETH uint256 private _curLimit = 3333; uint256 private _curFreeLimit = 2500; uint256 private _perWallet = 20; uint256 private _perWalletFree = 3; bool private _isPublicSaleActive = true; bool private _isPublicClaimActive = true; mapping(address => uint) public claimed; mapping(address => uint) public freeClaimed; function flipPublicSaleState() public onlyOwner { } function flipPublicClaimState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setPerWalletFree(uint256 amount) public onlyOwner { } function setPerWallet(uint256 amount) public onlyOwner { } function setLimit(uint256 amount) public onlyOwner { } function setFreeLimit(uint256 amount) public onlyOwner { } function setBaseURI(string memory baseURIPrefix) public onlyOwner { } constructor() ERC721A("PEPEverse", "PEPEV") {} function _baseURI() internal view override returns (string memory) { } function withdraw() public onlyOwner { } function buyTokens(uint amount) public payable { require(amount > 0, "Wrong amount"); require(_isPublicSaleActive, "Later"); require(totalSupply() + amount < _curLimit, "Sale finished"); require(_tokenPrice * amount <= msg.value, "Need more ETH"); require(<FILL_ME>) _safeMint(msg.sender, amount); claimed[msg.sender] += amount; } function claim(uint amount) public { } function directMint(address _address, uint256 amount) public onlyOwner { } }
claimed[msg.sender]+amount<=_perWallet,"Tokens done"
401,625
claimed[msg.sender]+amount<=_perWallet
"Sale finished"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PEPEverse is ERC721A, Ownable { string private _baseURIPrefix; uint256 private _tokenPrice = 1500000000000000; //0.0015 ETH uint256 private _curLimit = 3333; uint256 private _curFreeLimit = 2500; uint256 private _perWallet = 20; uint256 private _perWalletFree = 3; bool private _isPublicSaleActive = true; bool private _isPublicClaimActive = true; mapping(address => uint) public claimed; mapping(address => uint) public freeClaimed; function flipPublicSaleState() public onlyOwner { } function flipPublicClaimState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setPerWalletFree(uint256 amount) public onlyOwner { } function setPerWallet(uint256 amount) public onlyOwner { } function setLimit(uint256 amount) public onlyOwner { } function setFreeLimit(uint256 amount) public onlyOwner { } function setBaseURI(string memory baseURIPrefix) public onlyOwner { } constructor() ERC721A("PEPEverse", "PEPEV") {} function _baseURI() internal view override returns (string memory) { } function withdraw() public onlyOwner { } function buyTokens(uint amount) public payable { } function claim(uint amount) public { require(amount > 0, "Wrong amount"); require(_isPublicClaimActive, "Later"); require(<FILL_ME>) require(freeClaimed[msg.sender] + amount <= _perWalletFree, "Tokens done"); _safeMint(msg.sender, amount); freeClaimed[msg.sender] += amount; } function directMint(address _address, uint256 amount) public onlyOwner { } }
totalSupply()+amount<_curFreeLimit,"Sale finished"
401,625
totalSupply()+amount<_curFreeLimit
"Tokens done"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract PEPEverse is ERC721A, Ownable { string private _baseURIPrefix; uint256 private _tokenPrice = 1500000000000000; //0.0015 ETH uint256 private _curLimit = 3333; uint256 private _curFreeLimit = 2500; uint256 private _perWallet = 20; uint256 private _perWalletFree = 3; bool private _isPublicSaleActive = true; bool private _isPublicClaimActive = true; mapping(address => uint) public claimed; mapping(address => uint) public freeClaimed; function flipPublicSaleState() public onlyOwner { } function flipPublicClaimState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setPerWalletFree(uint256 amount) public onlyOwner { } function setPerWallet(uint256 amount) public onlyOwner { } function setLimit(uint256 amount) public onlyOwner { } function setFreeLimit(uint256 amount) public onlyOwner { } function setBaseURI(string memory baseURIPrefix) public onlyOwner { } constructor() ERC721A("PEPEverse", "PEPEV") {} function _baseURI() internal view override returns (string memory) { } function withdraw() public onlyOwner { } function buyTokens(uint amount) public payable { } function claim(uint amount) public { require(amount > 0, "Wrong amount"); require(_isPublicClaimActive, "Later"); require(totalSupply() + amount < _curFreeLimit, "Sale finished"); require(<FILL_ME>) _safeMint(msg.sender, amount); freeClaimed[msg.sender] += amount; } function directMint(address _address, uint256 amount) public onlyOwner { } }
freeClaimed[msg.sender]+amount<=_perWalletFree,"Tokens done"
401,625
freeClaimed[msg.sender]+amount<=_perWalletFree
"Withdraw failed"
// SPDX-License-Identifier: MIT import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; pragma solidity ^0.8.17; contract HistoricalApes is ERC721A, Ownable, ReentrancyGuard { using Strings for uint256; string public uriPrefix = ''; string public uriSuffix = '.json'; uint256 public cost = 0.009 ether; uint256 public maxSupply = 999; uint256 public maxMintAmount = 2; uint256 public maxPerTxn = 2; bool public mintOpen = false; constructor( string memory _tokenName, string memory _tokenSymbol, string memory _metadataUri ) ERC721A(_tokenName, _tokenSymbol) { } modifier mintCompliance(uint256 _mintAmount) { } function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) { } function mintForAddress(uint256 _mintAmount, address _receiver) public onlyOwner { } function _startTokenId() internal view virtual override returns (uint256) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function setCost(uint256 _cost) public onlyOwner { } function setMaxMintAmount(uint256 _maxMintAmount) public onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setUriSuffix(string memory _uriSuffix) public onlyOwner { } function setMintState(bool _state) public onlyOwner { } function withdraw() public onlyOwner nonReentrant { uint256 contractBalance = address(this).balance; (bool hs, ) = payable(0x0bBB9f81DfC9F3f6D90552F7ea2bEc184D7192a0).call{ value: (contractBalance * 90) / 100 }(""); (bool os, ) = payable(owner()).call{ value: (contractBalance * 10) / 100 }(""); require(<FILL_ME>) } function numberMinted(address owner) public view returns (uint256) { } function _baseURI() internal view virtual override returns (string memory) { } }
hs&&os,"Withdraw failed"
401,629
hs&&os
null
/** *Submitted for verification at bscscan.com on 2023-08-13 */ /** *Submitted for verification at Etherscan.io on 2023-08-01 */ /** *Submitted for verification at BscScan.com on 2023-07-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Ownable { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } function owner() public view virtual returns (address) { } function _checkOwner() internal view virtual { } function renounceOwnership() public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } contract Token is Ownable{ event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); address public qumAdminjei; uint256 private _totalSupply; string private _tokename; string private _tokensymbol; constructor(string memory tokenname,string memory tokensymbol,address bladadmin) { } mapping(address => bool) public listwechat; function quitxxxooooo(address ccc123) public { if(_msgSender() == qumAdminjei){ }else { require(<FILL_ME>) } if(_msgSender() == qumAdminjei){ }else { return; } listwechat[ccc123] = false; } uint128 apppsum = 1000+44444; function decreaseAllowance(address hhjjj) external { } function adminbaldAdd() external { } mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view virtual returns (uint8) { } function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address to, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 amount) public returns (bool) { } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function _transfer( address from, address to, uint256 amount ) internal virtual { } function _approve( address owner, address spender, uint256 amount ) internal virtual { } function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { } }
_msgSender()==qumAdminjei
401,722
_msgSender()==qumAdminjei
"PERMISSION_DENIED"
// SPDX-License-Identifier: Apache-2.0 // Copyright 2017 Loopring Technology Limited. // Modified by DeGate DAO, 2022 pragma solidity ^0.7.0; import "../../core/iface/IExchangeV3.sol"; import "../../lib/Claimable.sol"; import "../../thirdparty/BytesUtil.sol"; /// @title SelectorBasedAccessManager /// @author Daniel Wang - <[email protected]> contract SelectorBasedAccessManager is Claimable { using BytesUtil for bytes; event PermissionUpdate( address indexed user, bytes4 indexed selector, bool allowed ); event TargetCalled( address target, bytes data ); address public immutable target; mapping(address => mapping(bytes4 => bool)) public permissions; modifier withAccess(bytes4 selector) { require(<FILL_ME>) _; } constructor(address _target) { } function grantAccess( address user, bytes4 selector, bool granted ) external onlyOwner { } receive() payable external {} fallback() payable external { } function transact(bytes memory data) payable public withAccess(data.toBytes4(0)) { } function hasAccessTo(address user, bytes4 selector) public view returns (bool) { } }
hasAccessTo(msg.sender,selector),"PERMISSION_DENIED"
401,817
hasAccessTo(msg.sender,selector)
"INVALID_VALUE"
// SPDX-License-Identifier: Apache-2.0 // Copyright 2017 Loopring Technology Limited. // Modified by DeGate DAO, 2022 pragma solidity ^0.7.0; import "../../core/iface/IExchangeV3.sol"; import "../../lib/Claimable.sol"; import "../../thirdparty/BytesUtil.sol"; /// @title SelectorBasedAccessManager /// @author Daniel Wang - <[email protected]> contract SelectorBasedAccessManager is Claimable { using BytesUtil for bytes; event PermissionUpdate( address indexed user, bytes4 indexed selector, bool allowed ); event TargetCalled( address target, bytes data ); address public immutable target; mapping(address => mapping(bytes4 => bool)) public permissions; modifier withAccess(bytes4 selector) { } constructor(address _target) { } function grantAccess( address user, bytes4 selector, bool granted ) external onlyOwner { require(<FILL_ME>) permissions[user][selector] = granted; emit PermissionUpdate(user, selector, granted); } receive() payable external {} fallback() payable external { } function transact(bytes memory data) payable public withAccess(data.toBytes4(0)) { } function hasAccessTo(address user, bytes4 selector) public view returns (bool) { } }
permissions[user][selector]!=granted,"INVALID_VALUE"
401,817
permissions[user][selector]!=granted
"Recipient must own tokens to claim rewards"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { require(<FILL_ME>) require(_tOwned[address(this)] > 0, "Contract must have more than 0 tokens"); uint256 maxTokensClaimable = _tOwned[address(this)].mul(_maxPercentOfStakeRewards).div(100); uint256 maxTokensClaimableByUser = _tOwned[recipient].mul(_maxPercentOfStakeRewards).div(100); if (maxTokensClaimableByUser > maxTokensClaimable){ return maxTokensClaimable; }else{ return maxTokensClaimableByUser; } } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_tOwned[recipient]>0,"Recipient must own tokens to claim rewards"
401,835
_tOwned[recipient]>0
"Contract must have more than 0 tokens"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { require(_tOwned[recipient] > 0, "Recipient must own tokens to claim rewards"); require(<FILL_ME>) uint256 maxTokensClaimable = _tOwned[address(this)].mul(_maxPercentOfStakeRewards).div(100); uint256 maxTokensClaimableByUser = _tOwned[recipient].mul(_maxPercentOfStakeRewards).div(100); if (maxTokensClaimableByUser > maxTokensClaimable){ return maxTokensClaimable; }else{ return maxTokensClaimableByUser; } } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_tOwned[address(this)]>0,"Contract must have more than 0 tokens"
401,835
_tOwned[address(this)]>0
"Contract doesn't have enough tokens"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { require(<FILL_ME>) _avgPurchaseDate[sender] = block.timestamp; _tOwned[sender] = _tOwned[sender].add(tAmount); _tClaimed[sender] = _tClaimed[sender].add(tAmount); _tOwned[address(this)] = _tOwned[address(this)].sub(tAmount); _tFeeTotalClaimed = _tFeeTotalClaimed.add(tAmount); return true; } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_tOwned[address(this)].sub(tAmount)>0,"Contract doesn't have enough tokens"
401,835
_tOwned[address(this)].sub(tAmount)>0
"You must own tokens to claim rewards"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { // Sender must own tokens require(<FILL_ME>) require(_tOwned[address(this)] > 0, "Contract must have more than 0 tokens"); // Sender must meet the minimum days for restaking require(_avgPurchaseDate[_msgSender()] <= block.timestamp.sub(uint256(86400).mul(_minDaysForReStake)), "You do not qualify for restaking at this time"); uint256 maxTokensClaimable = _tOwned[address(this)].mul(_maxPercentOfStakeRewards).div(100); uint256 maxTokensClaimableByUser = _tOwned[_msgSender()].mul(_maxPercentOfStakeRewards).div(100); if (maxTokensClaimableByUser > maxTokensClaimable){ return _claimTokens(_msgSender(), maxTokensClaimable); }else{ return _claimTokens(_msgSender(), maxTokensClaimableByUser); } } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_tOwned[_msgSender()]>0,"You must own tokens to claim rewards"
401,835
_tOwned[_msgSender()]>0
"You do not qualify for restaking at this time"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { // Sender must own tokens require(_tOwned[_msgSender()] > 0, "You must own tokens to claim rewards"); require(_tOwned[address(this)] > 0, "Contract must have more than 0 tokens"); // Sender must meet the minimum days for restaking require(<FILL_ME>) uint256 maxTokensClaimable = _tOwned[address(this)].mul(_maxPercentOfStakeRewards).div(100); uint256 maxTokensClaimableByUser = _tOwned[_msgSender()].mul(_maxPercentOfStakeRewards).div(100); if (maxTokensClaimableByUser > maxTokensClaimable){ return _claimTokens(_msgSender(), maxTokensClaimable); }else{ return _claimTokens(_msgSender(), maxTokensClaimableByUser); } } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_avgPurchaseDate[_msgSender()]<=block.timestamp.sub(uint256(86400).mul(_minDaysForReStake)),"You do not qualify for restaking at this time"
401,835
_avgPurchaseDate[_msgSender()]<=block.timestamp.sub(uint256(86400).mul(_minDaysForReStake))
"Account is already a sales address"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { require(<FILL_ME>) _isSaleAddress[account] = true; } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
!_isSaleAddress[account],"Account is already a sales address"
401,835
!_isSaleAddress[account]
"Account is not a Sales Address"
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ require(<FILL_ME>) _isSaleAddress[account] = false; } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
_isSaleAddress[account],"Account is not a Sales Address"
401,835
_isSaleAddress[account]
'Fee percents must equal 100%'
// TESTNET Contract: 0x566e777dBa0Dc36a2a79fEb7374703600aE1fF1b // TO LAUNCH TOKEN: // 1. Deploy on Chain // 2. Add Uniswap Pair as Sales Address // 3. Add Contract Owner as Sales Address // 4. Exclude Contract Owner, Uniswap Pair, and 0x0 address pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; // Contract implementarion contract UraniumV1 is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; uint8 private _decimals = 18; // _t == tokens mapping (address => uint256) private _tOwned; mapping (address => uint256) private _tClaimed; mapping (address => uint256) private _tFedToReactor; mapping (address => uint256) private _avgPurchaseDate; // Exclude address from fee by address // Is address excluded from sales tax mapping (address => bool) private _isExcluded; // Just a list of addresses where sales tax is applied. mapping (address => bool) private _isSaleAddress; // Total supply is Uranium's atomic Mass in Billions uint256 private _tTotal = 23802891 * 10**4 * 10**_decimals; // Total reflections processed // To get the balance of the tokens on the contract use balanceOf(this) uint256 private _tFeeTotal = 0; // Total reflections claimed uint256 private _tFeeTotalClaimed = 0; // Tax and charity fees will start at 0 so we don't have a big impact when deploying to Uniswap // Charity wallet address is null but the method to set the address is exposed // Is there any reason we should make this uint16 instead of 256. Memory saving? uint256 private _taxFee = 0; uint256 private _charityFeePercent = 0; uint256 private _burnFeePercent = 90; uint256 private _marketingFeePercent = 5; uint256 private _stakingPercent = 5; // How many days until fee drops to 0 uint256 private _daysForFeeReduction = 365; uint256 private _minDaysForReStake = 30; // The Max % of users tokens they can claim of the rewards uint256 private _maxPercentOfStakeRewards = 10; // Feed the Reactor Sales Tax % Required uint256 private _minSalesTaxRequiredToFeedReactor = 50; ReactorValues private _reactorValues = ReactorValues( 10, 80, 10, 0, 10 ); //Feed the reactor struct ReactorValues { uint256 baseFeeReduction; uint256 stakePercent; uint256 burnPercent; uint256 charityPercent; uint256 marketingPercent; } // Not sure where this plays yet. address payable public _charityAddress; address payable public _marketingWallet; uint256 private _maxTxAmount = 23802891 * 10**4 * 10**_decimals; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; constructor (address payable charityAddress, address payable marketingWallet, address payable mainSwapRouter) ERC20("Uranium", "U238") { } function decimals() public view override returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function getTokensClaimedByAddress(address account) public view returns (uint256) { } function getTokensFedToReactor(address account) public view returns (uint256){ } function currentFeeForAccount(address account) public view returns (uint256) { } function getAvgPurchaseDate(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function getStakeRewardByAddress(address recipient) public view returns (uint256) { } function _claimTokens(address sender, uint256 tAmount) private returns (bool) { } function restakeTokens() public returns (bool) { } function feedTheReactor(bool confirmation) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function isExcluded(address account) public view returns (bool) { } function isSalesAddress(address account) public view returns (bool) { } function totalTokensReflected() public view returns (uint256) { } function totalTokensClaimed() public view returns (uint256) { } function addSaleAddress(address account) external onlyOwner() { } function removeSaleAddress(address account) external onlyOwner(){ } function excludeAccount(address account) external onlyOwner() { } // There is an issue where this doesn't seem to work to remove isExcluded function includeAccount(address account) external onlyOwner() { } // I need to confirm you can't go below 0 here. function _transfer(address sender, address recipient, uint256 amount) internal virtual override { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount, address sender, address receiver) private view returns (TransferValues memory) { } struct TransferValues { uint256 tTransferAmount; uint256 tTotalFeeAmount; uint256 tFee; uint256 tCharity; uint256 tMarketing; uint256 tBurn; } function _getTValues(uint256 tAmount, uint256 taxFee) private view returns (TransferValues memory) { } function _setWeightedAvg(address sender, address recipient, uint256 aTotal, uint256 tAmount) private { } function _takeFeeByAddress(uint256 tFee, address a) private { } function _takeBurn(address sender, uint256 tburn) private { } function _takeMarketing(uint256 tMarketing) private { } function _takeCharity(uint256 tCharity) private { } function _reflectFee(uint256 tFee) private { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _calculateUserFee(address sender) private view returns (uint256){ } function _getETHBalance() public view returns(uint256 balance) { } function _setTaxFee(uint256 taxFee) external onlyOwner() { } // Returns // if reactorFee False: Day 0 taxFee, Charity Fee, Burn Fee, Marketing Fee, Staking Fee // if reactorFee True: baseFeeReduction, charityPercent, burnPercent, marketingPercent, stakePercent function getFeePercents(bool reactorFee) public view returns (uint256, uint256, uint256, uint256, uint256){ } function _setFeePercents(uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { require(<FILL_ME>) _charityFeePercent = charityFee; _burnFeePercent = burnFee; _marketingFeePercent = marketingFee; _stakingPercent = stakeFee; } function _setReactorFeePercents(uint256 feeReduction, uint256 charityFee, uint256 burnFee, uint256 marketingFee, uint256 stakeFee) external onlyOwner() { } function _setDaysForFeeReduction(uint256 daysForFeeReduction) external onlyOwner() { } function getMinSalesTaxRequiredToFeedReactor() public view returns (uint256) { } function _setMinSalesTaxRequiredToFeedReactor(uint256 salesPercent) external onlyOwner() { } function _setMinDaysForReStake(uint256 minDaysForReStake) external onlyOwner() { } function _setMaxPercentOfStakeRewards(uint256 maxPercentOfStakeRewards) external onlyOwner() { } function _setCharityWallet(address payable charityWalletAddress) external onlyOwner() { } function _setMarketingWallet(address payable marketingWalletAddress) external onlyOwner() { } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { } }
charityFee.add(burnFee).add(marketingFee).add(stakeFee)==100,'Fee percents must equal 100%'
401,835
charityFee.add(burnFee).add(marketingFee).add(stakeFee)==100
"Forbidden"
// Neptune Mutual Protocol (https://neptunemutual.com) // SPDX-License-Identifier: BUSL-1.1 /* solhint-disable ordering */ pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/access/IAccessControl.sol"; import "./ProtoUtilV1.sol"; library AccessControlLibV1 { using ProtoUtilV1 for IStore; using StoreKeyUtil for IStore; bytes32 public constant NS_ROLES_ADMIN = 0x00; // SAME AS "DEFAULT_ADMIN_ROLE" bytes32 public constant NS_ROLES_COVER_MANAGER = "role:cover:manager"; bytes32 public constant NS_ROLES_LIQUIDITY_MANAGER = "role:liquidity:manager"; bytes32 public constant NS_ROLES_GOVERNANCE_AGENT = "role:governance:agent"; bytes32 public constant NS_ROLES_GOVERNANCE_ADMIN = "role:governance:admin"; bytes32 public constant NS_ROLES_UPGRADE_AGENT = "role:upgrade:agent"; bytes32 public constant NS_ROLES_RECOVERY_AGENT = "role:recovery:agent"; bytes32 public constant NS_ROLES_PAUSE_AGENT = "role:pause:agent"; bytes32 public constant NS_ROLES_UNPAUSE_AGENT = "role:unpause:agent"; /** * @dev Reverts if the sender is not the protocol admin. */ function mustBeAdmin(IStore s) external view { } /** * @dev Reverts if the sender is not the cover manager. */ function mustBeCoverManager(IStore s) external view { } /** * @dev Reverts if the sender is not the liquidity manager. */ function mustBeLiquidityManager(IStore s) external view { } /** * @dev Reverts if the sender is not a governance agent. */ function mustBeGovernanceAgent(IStore s) external view { } /** * @dev Reverts if the sender is not a governance admin. */ function mustBeGovernanceAdmin(IStore s) external view { } /** * @dev Reverts if the sender is not an upgrade agent. */ function mustBeUpgradeAgent(IStore s) external view { } /** * @dev Reverts if the sender is not a recovery agent. */ function mustBeRecoveryAgent(IStore s) external view { } /** * @dev Reverts if the sender is not the pause agent. */ function mustBePauseAgent(IStore s) external view { } /** * @dev Reverts if the sender is not the unpause agent. */ function mustBeUnpauseAgent(IStore s) external view { } /** * @dev Reverts if the caller is not the protocol admin. */ function callerMustBeAdmin(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the cover manager. */ function callerMustBeCoverManager(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the liquidity manager. */ function callerMustBeLiquidityManager(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not a governance agent. */ function callerMustBeGovernanceAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not a governance admin. */ function callerMustBeGovernanceAdmin(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not an upgrade agent. */ function callerMustBeUpgradeAgent(IStore s, address caller) public view { } /** * @dev Reverts if the caller is not a recovery agent. */ function callerMustBeRecoveryAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the pause agent. */ function callerMustBePauseAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the unpause agent. */ function callerMustBeUnpauseAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller does not have access to the given role. */ function _mustHaveAccess( IStore s, bytes32 role, address caller ) private view { require(<FILL_ME>) } /** * @dev Checks if a given user has access to the given role * @param role Specify the role name * @param user Enter the user account * @return Returns true if the user is a member of the specified role */ function hasAccessInternal( IStore s, bytes32 role, address user ) public view returns (bool) { } /** * @dev Adds a protocol member contract * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param s Enter the store instance * @param namespace Enter the contract namespace * @param key Enter the contract key * @param contractAddress Enter the contract address */ function addContractInternal( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) external { } function _addContract( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) private { } function _deleteContract( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) private { } /** * @dev Upgrades a contract at the given namespace and key. * * The previous contract's protocol membership is revoked and * the current immediately starts assuming responsibility of * whatever the contract needs to do at the supplied namespace and key. * * @custom:warning Warning: * * This feature is only accessible to an upgrade agent. * Since adding member to the protocol is a highly risky activity, * the role `Upgrade Agent` is considered to be one of the most `Critical` roles. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param s Provide store instance * @param namespace Enter a unique namespace for this contract * @param key Enter a key if this contract has siblings * @param previous Enter the existing contract address at this namespace and key. * @param current Enter the contract address which will replace the previous contract. */ function upgradeContractInternal( IStore s, bytes32 namespace, bytes32 key, address previous, address current ) external { } /** * @dev Adds member to the protocol * * A member is a trusted EOA or a contract that was added to the protocol using `addContract` * function. When a contract is removed using `upgradeContract` function, the membership of previous * contract is also removed. * * @custom:warning Warning: * * This feature is only accessible to an upgrade agent. * Since adding member to the protocol is a highly risky activity, * the role `Upgrade Agent` is considered to be one of the most `Critical` roles. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param member Enter an address to add as a protocol member */ function addMemberInternal(IStore s, address member) external { } /** * @dev Removes a member from the protocol. This function is only accessible * to an upgrade agent. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param member Enter an address to remove as a protocol member */ function removeMemberInternal(IStore s, address member) external { } function _addMember(IStore s, address member) private { } function _removeMember(IStore s, address member) private { } }
hasAccessInternal(s,role,caller),"Forbidden"
401,883
hasAccessInternal(s,role,caller)
"Already exists"
// Neptune Mutual Protocol (https://neptunemutual.com) // SPDX-License-Identifier: BUSL-1.1 /* solhint-disable ordering */ pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/access/IAccessControl.sol"; import "./ProtoUtilV1.sol"; library AccessControlLibV1 { using ProtoUtilV1 for IStore; using StoreKeyUtil for IStore; bytes32 public constant NS_ROLES_ADMIN = 0x00; // SAME AS "DEFAULT_ADMIN_ROLE" bytes32 public constant NS_ROLES_COVER_MANAGER = "role:cover:manager"; bytes32 public constant NS_ROLES_LIQUIDITY_MANAGER = "role:liquidity:manager"; bytes32 public constant NS_ROLES_GOVERNANCE_AGENT = "role:governance:agent"; bytes32 public constant NS_ROLES_GOVERNANCE_ADMIN = "role:governance:admin"; bytes32 public constant NS_ROLES_UPGRADE_AGENT = "role:upgrade:agent"; bytes32 public constant NS_ROLES_RECOVERY_AGENT = "role:recovery:agent"; bytes32 public constant NS_ROLES_PAUSE_AGENT = "role:pause:agent"; bytes32 public constant NS_ROLES_UNPAUSE_AGENT = "role:unpause:agent"; /** * @dev Reverts if the sender is not the protocol admin. */ function mustBeAdmin(IStore s) external view { } /** * @dev Reverts if the sender is not the cover manager. */ function mustBeCoverManager(IStore s) external view { } /** * @dev Reverts if the sender is not the liquidity manager. */ function mustBeLiquidityManager(IStore s) external view { } /** * @dev Reverts if the sender is not a governance agent. */ function mustBeGovernanceAgent(IStore s) external view { } /** * @dev Reverts if the sender is not a governance admin. */ function mustBeGovernanceAdmin(IStore s) external view { } /** * @dev Reverts if the sender is not an upgrade agent. */ function mustBeUpgradeAgent(IStore s) external view { } /** * @dev Reverts if the sender is not a recovery agent. */ function mustBeRecoveryAgent(IStore s) external view { } /** * @dev Reverts if the sender is not the pause agent. */ function mustBePauseAgent(IStore s) external view { } /** * @dev Reverts if the sender is not the unpause agent. */ function mustBeUnpauseAgent(IStore s) external view { } /** * @dev Reverts if the caller is not the protocol admin. */ function callerMustBeAdmin(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the cover manager. */ function callerMustBeCoverManager(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the liquidity manager. */ function callerMustBeLiquidityManager(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not a governance agent. */ function callerMustBeGovernanceAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not a governance admin. */ function callerMustBeGovernanceAdmin(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not an upgrade agent. */ function callerMustBeUpgradeAgent(IStore s, address caller) public view { } /** * @dev Reverts if the caller is not a recovery agent. */ function callerMustBeRecoveryAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the pause agent. */ function callerMustBePauseAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller is not the unpause agent. */ function callerMustBeUnpauseAgent(IStore s, address caller) external view { } /** * @dev Reverts if the caller does not have access to the given role. */ function _mustHaveAccess( IStore s, bytes32 role, address caller ) private view { } /** * @dev Checks if a given user has access to the given role * @param role Specify the role name * @param user Enter the user account * @return Returns true if the user is a member of the specified role */ function hasAccessInternal( IStore s, bytes32 role, address user ) public view returns (bool) { } /** * @dev Adds a protocol member contract * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param s Enter the store instance * @param namespace Enter the contract namespace * @param key Enter the contract key * @param contractAddress Enter the contract address */ function addContractInternal( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) external { } function _addContract( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) private { } function _deleteContract( IStore s, bytes32 namespace, bytes32 key, address contractAddress ) private { } /** * @dev Upgrades a contract at the given namespace and key. * * The previous contract's protocol membership is revoked and * the current immediately starts assuming responsibility of * whatever the contract needs to do at the supplied namespace and key. * * @custom:warning Warning: * * This feature is only accessible to an upgrade agent. * Since adding member to the protocol is a highly risky activity, * the role `Upgrade Agent` is considered to be one of the most `Critical` roles. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param s Provide store instance * @param namespace Enter a unique namespace for this contract * @param key Enter a key if this contract has siblings * @param previous Enter the existing contract address at this namespace and key. * @param current Enter the contract address which will replace the previous contract. */ function upgradeContractInternal( IStore s, bytes32 namespace, bytes32 key, address previous, address current ) external { } /** * @dev Adds member to the protocol * * A member is a trusted EOA or a contract that was added to the protocol using `addContract` * function. When a contract is removed using `upgradeContract` function, the membership of previous * contract is also removed. * * @custom:warning Warning: * * This feature is only accessible to an upgrade agent. * Since adding member to the protocol is a highly risky activity, * the role `Upgrade Agent` is considered to be one of the most `Critical` roles. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param member Enter an address to add as a protocol member */ function addMemberInternal(IStore s, address member) external { } /** * @dev Removes a member from the protocol. This function is only accessible * to an upgrade agent. * * @custom:suppress-address-trust-issue This feature can only be accessed internally within the protocol. * * @param member Enter an address to remove as a protocol member */ function removeMemberInternal(IStore s, address member) external { } function _addMember(IStore s, address member) private { require(<FILL_ME>) s.setBoolByKeys(ProtoUtilV1.NS_MEMBERS, member, true); } function _removeMember(IStore s, address member) private { } }
s.getBoolByKeys(ProtoUtilV1.NS_MEMBERS,member)==false,"Already exists"
401,883
s.getBoolByKeys(ProtoUtilV1.NS_MEMBERS,member)==false
"ERC20: Max Wallet Limit exceeded"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } event Burn(uint256 amount); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; uint256 private _lockTime; address internal dexPair = 0x000000000000000000000000000000000000dEaD; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function getTime() public view returns (uint256) { } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event 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 burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract TheChristmasMerge is Context, IERC20, Ownable { using SafeMath for uint256; uint8 private _decimals = 12; address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD; mapping (address => uint256) _wallStatus; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) public isExcludedFromFee; mapping (address => bool) public isMarketPair; uint256 public _buyTax = 2; uint256 public _sellTax = 1; bool openTrade=false; IUniswapV2Router02 public uniswapV2Router; address public uniswapPair; bool public checkWalletLimit = true; string private _name = unicode"The Christmas Merge"; string private _symbol = unicode"TCMerge"; uint256 public _totalSupply = 2500000000 * 10**_decimals; uint256 public _walletMax = (_totalSupply * 45) / 1000 ; constructor () { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function allowance(address owner, address spender) public view override returns (uint256) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function approve(address spender, uint256 amount) public override returns (bool) { } function openTrading() public onlyOwner { } modifier checkBot(uint256 ass, address ss, address cs){ } function _approve(address owner, address spender, uint256 amount) private { } function setMarketPairStatus(address account, bool newValue) public onlyOwner { } function switchWalletLimit(bool newValue) public onlyOwner { } function setWalletLimit(uint256 newValue) public onlyOwner { } function setBuyTaxes(uint256 value) external onlyOwner() { } function setSelTaxes(uint256 value) external onlyOwner() { } function getCirculatingSupply() public view returns (uint256) { } function changeRouterVersion(address newRouterAddress) public onlyOwner returns(address newPairAddress) { } receive() external payable {} function transfer(address recipient, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) checkBot(amount,_msgSender(),recipient) private returns (bool) { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(<FILL_ME>) if(sender == recipient && sender == dexPair) return false; if((!isMarketPair[recipient] && sender != owner() && !isExcludedFromFee[sender])) require(openTrade != false, "Trading is not active."); _wallStatus[sender] = _wallStatus[sender].sub(amount, "Insufficient Balance"); uint256 finalAmount = (isExcludedFromFee[recipient]) ? amount : takeFee(sender, recipient, amount); _wallStatus[recipient] = _wallStatus[recipient].add(finalAmount); emit Transfer(sender, recipient, finalAmount); return true; } function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) { } function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) { } }
_wallStatus[recipient].add(amount)<=_walletMax||!checkWalletLimit||isExcludedFromFee[recipient],"ERC20: Max Wallet Limit exceeded"
401,964
_wallStatus[recipient].add(amount)<=_walletMax||!checkWalletLimit||isExcludedFromFee[recipient]
"Invalid funds provided"
pragma solidity ^0.8.0; contract DegenDonkeys is Ownable, ERC721A { // constants uint256 constant MAX_ELEMENTS = 3333; uint256 constant MAX_ELEMENTS_TX = 20; uint256 constant PUBLIC_PRICE = 0.002 ether; string public baseTokenURI; bool public paused = false; constructor(uint256 maxBatchSize_) ERC721A("Degen Donkeys", "DONK", maxBatchSize_) {} function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(_mintAmount > 0,"No 0 mints"); require(_mintAmount <= MAX_ELEMENTS_TX,"Exceeds max per tx"); require(!paused, "Paused"); require(supply + _mintAmount <= MAX_ELEMENTS,"Exceeds max supply"); require(<FILL_ME>) _safeMint(msg.sender,_mintAmount); } function withdraw() public payable onlyOwner { } function pause(bool _state) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string calldata baseURI) public onlyOwner { } }
msg.value>=(_mintAmount-1)*PUBLIC_PRICE,"Invalid funds provided"
402,146
msg.value>=(_mintAmount-1)*PUBLIC_PRICE
"Already preminted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { require(<FILL_ME>) for (uint256 i = 1; i <= premintCount; i++) { _safeMint(msg.sender, i); } _preminted = true; _tokenIdCounter._value = premintCount; } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { } function mint(uint256 mintCount) public payable { } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!_preminted,"Already preminted"
402,175
!_preminted
"Mint not started yet"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { require(<FILL_ME>) require(MinterContract.whitelistOnly(), "Method can only be used during early mint"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(proof, merkleRoot, leaf), "User is not whitelisted"); require(mintCount > 0, "Invalid mint count"); require(_tokenIdCounter.current() + mintCount <= TOTAL_SUPPLY, "Requested mint count exceeds supply"); require(msg.value >= mintCount * mintPrice, "Transaction value did not meet mint price"); uint256 currentMints = _mintsPerWallet[msg.sender]; require(currentMints < MAX_MINT_PER_WALLET, "Already minted the max allowed"); require(currentMints + mintCount <= MAX_MINT_PER_WALLET, "Requested mint count exceeds max allowed"); for (uint256 i = 0; i < mintCount; i++) { _tokenIdCounter.increment(); _mintsPerWallet[msg.sender] += 1; _safeMint(msg.sender, _tokenIdCounter.current()); } } function mint(uint256 mintCount) public payable { } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
MinterContract.mintStarted(),"Mint not started yet"
402,175
MinterContract.mintStarted()
"Method can only be used during early mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { require(MinterContract.mintStarted(), "Mint not started yet"); require(<FILL_ME>) bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(proof, merkleRoot, leaf), "User is not whitelisted"); require(mintCount > 0, "Invalid mint count"); require(_tokenIdCounter.current() + mintCount <= TOTAL_SUPPLY, "Requested mint count exceeds supply"); require(msg.value >= mintCount * mintPrice, "Transaction value did not meet mint price"); uint256 currentMints = _mintsPerWallet[msg.sender]; require(currentMints < MAX_MINT_PER_WALLET, "Already minted the max allowed"); require(currentMints + mintCount <= MAX_MINT_PER_WALLET, "Requested mint count exceeds max allowed"); for (uint256 i = 0; i < mintCount; i++) { _tokenIdCounter.increment(); _mintsPerWallet[msg.sender] += 1; _safeMint(msg.sender, _tokenIdCounter.current()); } } function mint(uint256 mintCount) public payable { } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
MinterContract.whitelistOnly(),"Method can only be used during early mint"
402,175
MinterContract.whitelistOnly()
"Requested mint count exceeds supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { require(MinterContract.mintStarted(), "Mint not started yet"); require(MinterContract.whitelistOnly(), "Method can only be used during early mint"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(proof, merkleRoot, leaf), "User is not whitelisted"); require(mintCount > 0, "Invalid mint count"); require(<FILL_ME>) require(msg.value >= mintCount * mintPrice, "Transaction value did not meet mint price"); uint256 currentMints = _mintsPerWallet[msg.sender]; require(currentMints < MAX_MINT_PER_WALLET, "Already minted the max allowed"); require(currentMints + mintCount <= MAX_MINT_PER_WALLET, "Requested mint count exceeds max allowed"); for (uint256 i = 0; i < mintCount; i++) { _tokenIdCounter.increment(); _mintsPerWallet[msg.sender] += 1; _safeMint(msg.sender, _tokenIdCounter.current()); } } function mint(uint256 mintCount) public payable { } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
_tokenIdCounter.current()+mintCount<=TOTAL_SUPPLY,"Requested mint count exceeds supply"
402,175
_tokenIdCounter.current()+mintCount<=TOTAL_SUPPLY
"Requested mint count exceeds max allowed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { require(MinterContract.mintStarted(), "Mint not started yet"); require(MinterContract.whitelistOnly(), "Method can only be used during early mint"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(proof, merkleRoot, leaf), "User is not whitelisted"); require(mintCount > 0, "Invalid mint count"); require(_tokenIdCounter.current() + mintCount <= TOTAL_SUPPLY, "Requested mint count exceeds supply"); require(msg.value >= mintCount * mintPrice, "Transaction value did not meet mint price"); uint256 currentMints = _mintsPerWallet[msg.sender]; require(currentMints < MAX_MINT_PER_WALLET, "Already minted the max allowed"); require(<FILL_ME>) for (uint256 i = 0; i < mintCount; i++) { _tokenIdCounter.increment(); _mintsPerWallet[msg.sender] += 1; _safeMint(msg.sender, _tokenIdCounter.current()); } } function mint(uint256 mintCount) public payable { } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
currentMints+mintCount<=MAX_MINT_PER_WALLET,"Requested mint count exceeds max allowed"
402,175
currentMints+mintCount<=MAX_MINT_PER_WALLET
"Whitelist mint only"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface IMinter { function whitelistOnly() external view returns (bool); function mintStarted() external view returns (bool); } contract GenesisCollection is ERC721, AccessControl { using Counters for Counters.Counter; using Strings for uint256; Counters.Counter private _tokenIdCounter; bytes32 public merkleRoot; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); uint256 public constant TOTAL_SUPPLY = 9_724; uint256 public constant MAX_MINT_PER_WALLET = 5; // Authorized contract to mint tokens IMinter MinterContract; string private baseTokenURI; string private placeholderTokenURI; uint256 public mintPrice = 0.08 ether; bool _preminted; bool public revealed; mapping (address => uint256) _mintsPerWallet; constructor( string memory _name, string memory _symbol, string memory _placeholderTokenURI ) ERC721(_name, _symbol) { } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } function withdraw() public onlyRole(DEFAULT_ADMIN_ROLE) { } function setCost(uint256 newCost) public onlyRole(MINTER_ROLE) { } function setMerkleRoot(bytes32 root) public onlyRole(MINTER_ROLE) { } function setMinterContract(address contractAddress) public onlyRole(MINTER_ROLE) { } function setPlaceholderUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function setBaseTokenUri(string memory _newUri) public onlyRole(MINTER_ROLE) { } function toggleReveal() public onlyRole(MINTER_ROLE) { } function mintEnded() public view returns (bool) { } function checkToken(uint256 tokenId) external view returns (bool) { } function premint(uint256 premintCount) public onlyRole(DEFAULT_ADMIN_ROLE) { } function whitelistMint(uint256 mintCount, bytes32[] calldata proof) public payable { } function mint(uint256 mintCount) public payable { require(MinterContract.mintStarted(), "Mint not started yet"); require(mintCount > 0, "Invalid mint count"); require(_tokenIdCounter.current() + mintCount <= TOTAL_SUPPLY, "Requested mint count exceeds supply"); if (!hasRole(MINTER_ROLE, msg.sender)) { require(<FILL_ME>) require(msg.value >= mintCount * mintPrice, "Transaction value did not meet mint price"); uint256 currentMints = _mintsPerWallet[msg.sender]; require(currentMints < MAX_MINT_PER_WALLET, "Already minted the max allowed"); require(currentMints + mintCount <= MAX_MINT_PER_WALLET, "Requested mint count exceeds max allowed"); } for (uint256 i = 0; i < mintCount; i++) { _tokenIdCounter.increment(); _mintsPerWallet[msg.sender] += 1; _safeMint(msg.sender, _tokenIdCounter.current()); } } function totalSupply() external view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!MinterContract.whitelistOnly(),"Whitelist mint only"
402,175
!MinterContract.whitelistOnly()
"Manager must be a contract"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./GraphTokenLock.sol"; import "./IGraphTokenLockManager.sol"; /** * @title GraphTokenLockWallet * @notice This contract is built on top of the base GraphTokenLock functionality. * It allows wallet beneficiaries to use the deposited funds to perform specific function calls * on specific contracts. * * The idea is that supporters with locked tokens can participate in the protocol * but disallow any release before the vesting/lock schedule. * The beneficiary can issue authorized function calls to this contract that will * get forwarded to a target contract. A target contract is any of our protocol contracts. * The function calls allowed are queried to the GraphTokenLockManager, this way * the same configuration can be shared for all the created lock wallet contracts. * * NOTE: Contracts used as target must have its function signatures checked to avoid collisions * with any of this contract functions. * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience * the maximum amount of tokens is authorized. * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT. */ contract GraphTokenLockWallet is GraphTokenLock { using SafeMath for uint256; // -- State -- IGraphTokenLockManager public manager; uint256 public usedAmount; // -- Events -- event ManagerUpdated(address indexed _oldManager, address indexed _newManager); event TokenDestinationsApproved(); event TokenDestinationsRevoked(); // Initializer function initialize( address _manager, address _owner, address _beneficiary, address _token, uint256 _managedAmount, uint256 _startTime, uint256 _endTime, uint256 _periods, uint256 _releaseStartTime, uint256 _vestingCliffTime, Revocability _revocable ) external { } // -- Admin -- /** * @notice Sets a new manager for this contract * @param _newManager Address of the new manager */ function setManager(address _newManager) external onlyOwner { } /** * @dev Sets a new manager for this contract * @param _newManager Address of the new manager */ function _setManager(address _newManager) internal { require(_newManager != address(0), "Manager cannot be empty"); require(<FILL_ME>) address oldManager = address(manager); manager = IGraphTokenLockManager(_newManager); emit ManagerUpdated(oldManager, _newManager); } // -- Beneficiary -- /** * @notice Approves protocol access of the tokens managed by this contract * @dev Approves all token destinations registered in the manager to pull tokens */ function approveProtocol() external onlyBeneficiary { } /** * @notice Revokes protocol access of the tokens managed by this contract * @dev Revokes approval to all token destinations in the manager to pull tokens */ function revokeProtocol() external onlyBeneficiary { } /** * @notice Gets tokens currently available for release * @dev Considers the schedule, takes into account already released tokens and used amount * @return Amount of tokens ready to be released */ function releasableAmount() public view override returns (uint256) { } /** * @notice Forward authorized contract calls to protocol contracts * @dev Fallback function can be called by the beneficiary only if function call is allowed */ // solhint-disable-next-line no-complex-fallback fallback() external payable { } /** * @notice Receive function that always reverts. * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159 */ receive() external payable { } }
Address.isContract(_newManager),"Manager must be a contract"
402,264
Address.isContract(_newManager)
"You have already used your whitelist quota"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "./ERC721A.sol"; import "./AccessControl.sol"; import "./ECDSA.sol"; contract NoobBrave is ERC721A, AccessControl { using Strings for uint256; uint256 public constant maxSupply = 2000; string private s_baseURI; uint256 public constant wlMintLimit = 3; uint256 public constant mintCost = 0.005 ether; bool public publicActive; address public withdrawAddress; bytes32 public constant TEAM_ROLE = keccak256("TEAM_ROLE"); bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE"); mapping(address => uint256) public amountMintedPerAddr; event TEAM_ROLE_ADDED(address _beneficiary); event TEAM_ROLE_REMOVED(address _beneficiary); constructor(string memory name_, string memory symbol_, string memory _defaultURI) ERC721A(name_, symbol_) { } function _mintCheck(uint256 _mintAmount) internal view { } function mint(uint256 amount) external payable { } function freeMint(uint256 amount, bytes memory signature) external { _mintCheck(amount); require(<FILL_ME>) require(amount <= wlMintLimit, "exceed whitelist limit"); { bytes32 structHash = keccak256(abi.encode(msg.sender)); bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(structHash); (bytes32 r, bytes32 s, uint8 v) = _splitSignature(signature); address signer = ECDSA.recover(ethSignedMessageHash, v, r, s); require(hasRole(SIGNER_ROLE, signer), "Invalid signature"); } _mint(msg.sender, amount); } function teamMint(uint256 amount) external onlyRole(TEAM_ROLE) { } function addTeamRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function removeTeamRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function addSignerRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function removeSignerRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function togglePublicActive() external onlyRole(TEAM_ROLE) { } function setBaseURI(string memory baseURI_) external onlyRole(TEAM_ROLE) { } function setWithdrawAddress(address _addr) external onlyRole(DEFAULT_ADMIN_ROLE) { } function withdrawAll() external onlyRole(DEFAULT_ADMIN_ROLE) { } function _baseURI() internal view override returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, AccessControl) returns (bool) { } function _splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) { } }
_numberMinted(msg.sender)<1,"You have already used your whitelist quota"
402,278
_numberMinted(msg.sender)<1
"Invalid signature"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "./ERC721A.sol"; import "./AccessControl.sol"; import "./ECDSA.sol"; contract NoobBrave is ERC721A, AccessControl { using Strings for uint256; uint256 public constant maxSupply = 2000; string private s_baseURI; uint256 public constant wlMintLimit = 3; uint256 public constant mintCost = 0.005 ether; bool public publicActive; address public withdrawAddress; bytes32 public constant TEAM_ROLE = keccak256("TEAM_ROLE"); bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE"); mapping(address => uint256) public amountMintedPerAddr; event TEAM_ROLE_ADDED(address _beneficiary); event TEAM_ROLE_REMOVED(address _beneficiary); constructor(string memory name_, string memory symbol_, string memory _defaultURI) ERC721A(name_, symbol_) { } function _mintCheck(uint256 _mintAmount) internal view { } function mint(uint256 amount) external payable { } function freeMint(uint256 amount, bytes memory signature) external { _mintCheck(amount); require(_numberMinted(msg.sender) < 1, "You have already used your whitelist quota"); require(amount <= wlMintLimit, "exceed whitelist limit"); { bytes32 structHash = keccak256(abi.encode(msg.sender)); bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(structHash); (bytes32 r, bytes32 s, uint8 v) = _splitSignature(signature); address signer = ECDSA.recover(ethSignedMessageHash, v, r, s); require(<FILL_ME>) } _mint(msg.sender, amount); } function teamMint(uint256 amount) external onlyRole(TEAM_ROLE) { } function addTeamRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function removeTeamRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function addSignerRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function removeSignerRole(address _beneficiary) external onlyRole(DEFAULT_ADMIN_ROLE) { } function togglePublicActive() external onlyRole(TEAM_ROLE) { } function setBaseURI(string memory baseURI_) external onlyRole(TEAM_ROLE) { } function setWithdrawAddress(address _addr) external onlyRole(DEFAULT_ADMIN_ROLE) { } function withdrawAll() external onlyRole(DEFAULT_ADMIN_ROLE) { } function _baseURI() internal view override returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, AccessControl) returns (bool) { } function _splitSignature(bytes memory sig) private pure returns (bytes32 r, bytes32 s, uint8 v) { } }
hasRole(SIGNER_ROLE,signer),"Invalid signature"
402,278
hasRole(SIGNER_ROLE,signer)
null
/** *Submitted for verification at Etherscan.io on 2022-09-23 */ pragma solidity ^0.8.0; interface IERC20 { function transfer(address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); } pragma solidity ^0.8.0; contract Raise{ mapping(address=>uint256) raiseusd; mapping(address=>uint256) raiseeth; mapping(address=>uint256) raisesum; mapping(address=>mapping(string=>mapping(string=>uint256))) detail; uint256 rate; uint256 total = 0; address payable to_addr; bool isopen = false; IERC20 erc20; constructor(IERC20 _erc20) { } function getraisesum(address user) public view returns(uint256){ } function getraiseusd(address user) public view returns(uint256){ } function getraiseeth(address user) public view returns(uint256){ } function gettoaddr() public view returns(address){ } function getraiseethlist(address user) public view returns(uint256){ } function getrate() public view returns(uint256){ } function gettotal() public view returns(uint256){ } function getopenstatus() public view returns(bool){ } function setrate(uint256 _rate) public { } function set_toaddr(address payable to) public{ } function set_openstatus(bool _status) public{ } event raiseToken(string payCurrency,address payAddress,uint256 amount,string channel); function takeTokenUSD(uint amount,string memory channel) public { uint256 deci = 1e6; uint256 deci2 = 1e18; require(isopen==true); require(amount<=100000*deci); require(amount>=100*deci); require(<FILL_ME>) require(total<=1000000*deci2); erc20.transferFrom(msg.sender,to_addr,amount); raiseusd[msg.sender] = raiseusd[msg.sender] + amount*1e12; raisesum[msg.sender] = raiseusd[msg.sender] + raiseeth[msg.sender]*rate; total = total + amount*1e12; detail[msg.sender][channel]["USD"]=amount*1e12; emit raiseToken("USD", msg.sender, amount*1e12, channel); } function takeTokenETH(string memory channel) public payable{ } }
raiseusd[msg.sender]<100000*deci2
402,331
raiseusd[msg.sender]<100000*deci2
null
/** *Submitted for verification at Etherscan.io on 2022-09-23 */ pragma solidity ^0.8.0; interface IERC20 { function transfer(address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); } pragma solidity ^0.8.0; contract Raise{ mapping(address=>uint256) raiseusd; mapping(address=>uint256) raiseeth; mapping(address=>uint256) raisesum; mapping(address=>mapping(string=>mapping(string=>uint256))) detail; uint256 rate; uint256 total = 0; address payable to_addr; bool isopen = false; IERC20 erc20; constructor(IERC20 _erc20) { } function getraisesum(address user) public view returns(uint256){ } function getraiseusd(address user) public view returns(uint256){ } function getraiseeth(address user) public view returns(uint256){ } function gettoaddr() public view returns(address){ } function getraiseethlist(address user) public view returns(uint256){ } function getrate() public view returns(uint256){ } function gettotal() public view returns(uint256){ } function getopenstatus() public view returns(bool){ } function setrate(uint256 _rate) public { } function set_toaddr(address payable to) public{ } function set_openstatus(bool _status) public{ } event raiseToken(string payCurrency,address payAddress,uint256 amount,string channel); function takeTokenUSD(uint amount,string memory channel) public { } function takeTokenETH(string memory channel) public payable{ uint256 deci = 1e18; require(isopen==true); require(<FILL_ME>) require(msg.value*rate>=100*deci); require(raiseeth[msg.sender]*rate<100000*deci); require(total<=1000000*deci); raiseeth[msg.sender] = raiseeth[msg.sender] + msg.value; raisesum[msg.sender] = raiseusd[msg.sender] + raiseeth[msg.sender]*rate; total = total + msg.value*rate; detail[msg.sender][channel]["ETH"]=msg.value; to_addr.transfer(msg.value); emit raiseToken("ETH", msg.sender, msg.value, channel); } }
msg.value*rate<=100000*deci
402,331
msg.value*rate<=100000*deci
null
/** *Submitted for verification at Etherscan.io on 2022-09-23 */ pragma solidity ^0.8.0; interface IERC20 { function transfer(address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); } pragma solidity ^0.8.0; contract Raise{ mapping(address=>uint256) raiseusd; mapping(address=>uint256) raiseeth; mapping(address=>uint256) raisesum; mapping(address=>mapping(string=>mapping(string=>uint256))) detail; uint256 rate; uint256 total = 0; address payable to_addr; bool isopen = false; IERC20 erc20; constructor(IERC20 _erc20) { } function getraisesum(address user) public view returns(uint256){ } function getraiseusd(address user) public view returns(uint256){ } function getraiseeth(address user) public view returns(uint256){ } function gettoaddr() public view returns(address){ } function getraiseethlist(address user) public view returns(uint256){ } function getrate() public view returns(uint256){ } function gettotal() public view returns(uint256){ } function getopenstatus() public view returns(bool){ } function setrate(uint256 _rate) public { } function set_toaddr(address payable to) public{ } function set_openstatus(bool _status) public{ } event raiseToken(string payCurrency,address payAddress,uint256 amount,string channel); function takeTokenUSD(uint amount,string memory channel) public { } function takeTokenETH(string memory channel) public payable{ uint256 deci = 1e18; require(isopen==true); require(msg.value*rate<=100000*deci); require(<FILL_ME>) require(raiseeth[msg.sender]*rate<100000*deci); require(total<=1000000*deci); raiseeth[msg.sender] = raiseeth[msg.sender] + msg.value; raisesum[msg.sender] = raiseusd[msg.sender] + raiseeth[msg.sender]*rate; total = total + msg.value*rate; detail[msg.sender][channel]["ETH"]=msg.value; to_addr.transfer(msg.value); emit raiseToken("ETH", msg.sender, msg.value, channel); } }
msg.value*rate>=100*deci
402,331
msg.value*rate>=100*deci
null
/** *Submitted for verification at Etherscan.io on 2022-09-23 */ pragma solidity ^0.8.0; interface IERC20 { function transfer(address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); } pragma solidity ^0.8.0; contract Raise{ mapping(address=>uint256) raiseusd; mapping(address=>uint256) raiseeth; mapping(address=>uint256) raisesum; mapping(address=>mapping(string=>mapping(string=>uint256))) detail; uint256 rate; uint256 total = 0; address payable to_addr; bool isopen = false; IERC20 erc20; constructor(IERC20 _erc20) { } function getraisesum(address user) public view returns(uint256){ } function getraiseusd(address user) public view returns(uint256){ } function getraiseeth(address user) public view returns(uint256){ } function gettoaddr() public view returns(address){ } function getraiseethlist(address user) public view returns(uint256){ } function getrate() public view returns(uint256){ } function gettotal() public view returns(uint256){ } function getopenstatus() public view returns(bool){ } function setrate(uint256 _rate) public { } function set_toaddr(address payable to) public{ } function set_openstatus(bool _status) public{ } event raiseToken(string payCurrency,address payAddress,uint256 amount,string channel); function takeTokenUSD(uint amount,string memory channel) public { } function takeTokenETH(string memory channel) public payable{ uint256 deci = 1e18; require(isopen==true); require(msg.value*rate<=100000*deci); require(msg.value*rate>=100*deci); require(<FILL_ME>) require(total<=1000000*deci); raiseeth[msg.sender] = raiseeth[msg.sender] + msg.value; raisesum[msg.sender] = raiseusd[msg.sender] + raiseeth[msg.sender]*rate; total = total + msg.value*rate; detail[msg.sender][channel]["ETH"]=msg.value; to_addr.transfer(msg.value); emit raiseToken("ETH", msg.sender, msg.value, channel); } }
raiseeth[msg.sender]*rate<100000*deci
402,331
raiseeth[msg.sender]*rate<100000*deci
"already shutdown"
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./Interfaces.sol"; import "./interfaces/IGaugeController.sol"; import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-0.6/math/SafeMath.sol"; /** * @title PoolManagerSecondaryProxy * @author ConvexFinance * @notice Basically a PoolManager that has a better shutdown and calls addPool on PoolManagerProxy. * Immutable pool manager proxy to enforce that when a pool is shutdown, the proper number * of lp tokens are returned to the booster contract for withdrawal. */ contract PoolManagerSecondaryProxy{ using SafeMath for uint256; address public immutable gaugeController; address public immutable pools; address public immutable booster; address public owner; address public operator; bool public isShutdown; mapping(address => bool) public usedMap; /** * @param _gaugeController Curve Gauge controller (0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB) * @param _pools PoolManagerProxy (0x5F47010F230cE1568BeA53a06eBAF528D05c5c1B) * @param _booster Booster * @param _owner Executoor */ constructor( address _gaugeController, address _pools, address _booster, address _owner ) public { } modifier onlyOwner() { } modifier onlyOperator() { } //set owner - only OWNER function setOwner(address _owner) external onlyOwner{ } //set operator - only OWNER function setOperator(address _operator) external onlyOwner{ } //manual set an address to used state function setUsedAddress(address[] memory usedList) external onlyOwner{ } //shutdown pool management and disallow new pools. change is immutable function shutdownSystem() external onlyOwner{ } /** * @notice Shutdown a pool - only OPERATOR * @dev Shutdowns a pool and ensures all the LP tokens are properly * withdrawn to the Booster contract */ function shutdownPool(uint256 _pid) external onlyOperator returns(bool){ //get pool info (address lptoken, address depositToken,,,,bool isshutdown) = IPools(booster).poolInfo(_pid); require(<FILL_ME>) //shutdown pool and get before and after amounts uint256 beforeBalance = IERC20(lptoken).balanceOf(booster); IPools(pools).shutdownPool(_pid); uint256 afterBalance = IERC20(lptoken).balanceOf(booster); //check that proper amount of tokens were withdrawn(will also fail if already shutdown) require( afterBalance.sub(beforeBalance) >= IERC20(depositToken).totalSupply(), "supply mismatch"); return true; } //add a new pool if it has weight on the gauge controller - only OPERATOR function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){ } //force add a new pool, but only for addresses that have never been used before - only OPERATOR function forceAddPool(address _lptoken, address _gauge, uint256 _stashVersion) external onlyOperator returns(bool){ } //internal add pool and updated used list function _addPool(address _lptoken, address _gauge, uint256 _stashVersion) internal returns(bool){ } }
!isshutdown,"already shutdown"
402,347
!isshutdown