comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Strike not whitelisted."
pragma solidity 0.5.10; import "./oToken.sol"; import "./lib/StringComparator.sol"; import "./packages/Ownable.sol"; import "./packages/IERC20.sol"; contract OptionsFactory is Ownable { using StringComparator for string; mapping(address => bool) public whitelisted; address[] public optionsContracts; // The contract which interfaces with the exchange OptionsExchange public optionsExchange; address public oracleAddress; event OptionsContractCreated(address addr); event AssetWhitelisted(address indexed asset); /** * @param _optionsExchangeAddr: The contract which interfaces with the exchange * @param _oracleAddress Address of the oracle */ constructor(OptionsExchange _optionsExchangeAddr, address _oracleAddress) public { } /** * @notice creates a new Option Contract * @param _collateral The collateral asset. Eg. "ETH" * @param _underlying The underlying asset. Eg. "DAI" * @param _oTokenExchangeExp Units of underlying that 1 oToken protects * @param _strikePrice The amount of strike asset that will be paid out * @param _strikeExp The precision of the strike Price * @param _strike The asset in which the insurance is calculated * @param _expiry The time at which the insurance expires * @param _windowSize UNIX time. Exercise window is from `expiry - _windowSize` to `expiry`. * @dev this condition must hold for the oToken to be safe: abs(oTokenExchangeExp - underlyingExp) < 19 * @dev this condition must hold for the oToken to be safe: max(abs(strikeExp + liqIncentiveExp - collateralExp), abs(strikeExp - collateralExp)) <= 9 */ function createOptionsContract( address _collateral, address _underlying, address _strike, int32 _oTokenExchangeExp, uint256 _strikePrice, int32 _strikeExp, uint256 _expiry, uint256 _windowSize, string calldata _name, string calldata _symbol ) external returns (address) { require(whitelisted[_collateral], "Collateral not whitelisted."); require(whitelisted[_underlying], "Underlying not whitelisted."); require(<FILL_ME>) require(_expiry > block.timestamp, "Cannot create an expired option"); require(_windowSize <= _expiry, "Invalid _windowSize"); oToken otoken = new oToken( _collateral, _underlying, _strike, _oTokenExchangeExp, _strikePrice, _strikeExp, _expiry, _windowSize, optionsExchange, oracleAddress ); otoken.setDetails(_name, _symbol); optionsContracts.push(address(otoken)); emit OptionsContractCreated(address(otoken)); // Set the owner for the options contract to the person who created the options contract otoken.transferOwnership(msg.sender); return address(otoken); } /** * @notice The number of Option Contracts that the Factory contract has stored */ function getNumberOfOptionsContracts() external view returns (uint256) { } /** * @notice The owner of the Factory Contract can update an asset's address, by adding it, changing the address or removing the asset * @param _asset The address for the asset */ function whitelistAsset(address _asset) external onlyOwner { } }
whitelisted[_strike],"Strike not whitelisted."
313,771
whitelisted[_strike]
"1"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface Ownable { function owner() external returns (address); } contract Royalty { struct Royaltydef { address receiver; uint32 amount; bool permanent; } mapping (address => Royaltydef) public royalty; function set(address collection, Royaltydef calldata def) external { require(<FILL_ME>) require(def.amount <= 1000000, "2"); require(royalty[collection].permanent == false, "3"); royalty[collection] = def; } function get(address collection, uint tokenId, uint value) external view returns (address, uint) { } }
Ownable(collection).owner()==msg.sender,"1"
313,785
Ownable(collection).owner()==msg.sender
"3"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface Ownable { function owner() external returns (address); } contract Royalty { struct Royaltydef { address receiver; uint32 amount; bool permanent; } mapping (address => Royaltydef) public royalty; function set(address collection, Royaltydef calldata def) external { require(Ownable(collection).owner() == msg.sender, "1"); require(def.amount <= 1000000, "2"); require(<FILL_ME>) royalty[collection] = def; } function get(address collection, uint tokenId, uint value) external view returns (address, uint) { } }
royalty[collection].permanent==false,"3"
313,785
royalty[collection].permanent==false
"Exceeds reserve supply."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol"; import {Accountable} from "./Accountable.sol"; import {IGovernance} from "./interfaces/IGovernance.sol"; import {IRandomNumberConsumer} from "./interfaces/IRandomNumberConsumer.sol"; import {IWhitelistedContract} from "./interfaces/IWhitelistedContract.sol"; contract CAMP is ERC721Enumerable, Ownable, ERC721Holder, KeeperCompatibleInterface, Accountable { using Strings for uint256; string public baseURL; IGovernance public governance; bool startedGiveaway; enum GIVEAWAY_STATE { OPEN, CLOSED, FINDING } GIVEAWAY_STATE public giveawayState; uint public startingTimeStamp; uint256 public GIVEAWAY_CONCLUSION = 1635555600; // Oct. 29 @ 9PM EST uint256 public constant GIVEAWAY_WINNERS = 5; uint256 public constant MAX_SUPPLY = 10001; uint256 public constant RESERVE_SUPPLY = 11; uint256 public constant MAX_PER_TX = 21; uint256 public constant PRICE = 8 * 10 ** 16; address[] public whitelistedContracts; DepositedPrize[] public depositedPrizes; struct DepositedPrize { address contractAddress; string ipfsURL; uint256 tokenId; bool awarded; } uint public winners; mapping(uint256 => uint) tokenIdToWinnerId; event WinnerPicked(uint256 tokenId, address winnerAddress); constructor(string memory _baseURL, address[] memory _splits, uint256[] memory _splitWeights, address _governance, address[] memory _whitelistedContracts) ERC721("CAMP", "CAMP") Accountable(_splits, _splitWeights) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function deposit(address contractAddress, string memory ipfsURL, uint256 tokenId) external onlyOwner { } function flipSaleState() external onlyOwner { } function mintReserves(address[] calldata addresses) external onlyOwner { uint256 totalSupply = totalSupply(); uint256 count = addresses.length; require(<FILL_ME>) uint256 tokenId; for(uint256 i; i < count; i++) { tokenId = totalSupply + i; _safeMint(addresses[i], tokenId); } } function mint(uint256 count) external payable { } function checkUpkeep(bytes calldata) external view override returns (bool upkeepNeeded, bytes memory) { } function performUpkeep(bytes calldata) external override { } function processPickedWinner(uint winnerId, uint256 randomness) external { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
totalSupply+count<RESERVE_SUPPLY,"Exceeds reserve supply."
313,804
totalSupply+count<RESERVE_SUPPLY
"Exceeds max supply."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol"; import {Accountable} from "./Accountable.sol"; import {IGovernance} from "./interfaces/IGovernance.sol"; import {IRandomNumberConsumer} from "./interfaces/IRandomNumberConsumer.sol"; import {IWhitelistedContract} from "./interfaces/IWhitelistedContract.sol"; contract CAMP is ERC721Enumerable, Ownable, ERC721Holder, KeeperCompatibleInterface, Accountable { using Strings for uint256; string public baseURL; IGovernance public governance; bool startedGiveaway; enum GIVEAWAY_STATE { OPEN, CLOSED, FINDING } GIVEAWAY_STATE public giveawayState; uint public startingTimeStamp; uint256 public GIVEAWAY_CONCLUSION = 1635555600; // Oct. 29 @ 9PM EST uint256 public constant GIVEAWAY_WINNERS = 5; uint256 public constant MAX_SUPPLY = 10001; uint256 public constant RESERVE_SUPPLY = 11; uint256 public constant MAX_PER_TX = 21; uint256 public constant PRICE = 8 * 10 ** 16; address[] public whitelistedContracts; DepositedPrize[] public depositedPrizes; struct DepositedPrize { address contractAddress; string ipfsURL; uint256 tokenId; bool awarded; } uint public winners; mapping(uint256 => uint) tokenIdToWinnerId; event WinnerPicked(uint256 tokenId, address winnerAddress); constructor(string memory _baseURL, address[] memory _splits, uint256[] memory _splitWeights, address _governance, address[] memory _whitelistedContracts) ERC721("CAMP", "CAMP") Accountable(_splits, _splitWeights) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function deposit(address contractAddress, string memory ipfsURL, uint256 tokenId) external onlyOwner { } function flipSaleState() external onlyOwner { } function mintReserves(address[] calldata addresses) external onlyOwner { } function mint(uint256 count) external payable { require(startingTimeStamp > 0, "Sale is not active."); require(count < MAX_PER_TX, "Exceeds max per tx."); uint256 totalSupply = totalSupply(); require(<FILL_ME>) require(msg.value == PRICE * count, "Wrong amount of money."); for(uint256 i; i < count; i++) { uint256 tokenId = totalSupply + i; _safeMint(msg.sender, tokenId); } tallySplits(); } function checkUpkeep(bytes calldata) external view override returns (bool upkeepNeeded, bytes memory) { } function performUpkeep(bytes calldata) external override { } function processPickedWinner(uint winnerId, uint256 randomness) external { } function walletOfOwner(address _owner) external view returns (uint256[] memory) { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
totalSupply+count<MAX_SUPPLY,"Exceeds max supply."
313,804
totalSupply+count<MAX_SUPPLY
"Not a controller"
pragma solidity 0.5.16; contract Controllable is Governable { constructor(address _storage) Governable(_storage) public { } modifier onlyController() { require(<FILL_ME>) _; } modifier onlyControllerOrGovernance(){ } function controller() public view returns (address) { } }
store.isController(msg.sender),"Not a controller"
313,840
store.isController(msg.sender)
"The caller must be controller or governance"
pragma solidity 0.5.16; contract Controllable is Governable { constructor(address _storage) Governable(_storage) public { } modifier onlyController() { } modifier onlyControllerOrGovernance(){ require(<FILL_ME>) _; } function controller() public view returns (address) { } }
(store.isController(msg.sender)||store.isGovernance(msg.sender)),"The caller must be controller or governance"
313,840
(store.isController(msg.sender)||store.isGovernance(msg.sender))
"Send failed"
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { } } /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } // solhint-disable no-empty-blocks, avoid-low-level-calls contract EthDistribute is Ownable { using SafeMath for uint256; address payable private _marketingWallet; address payable private _devWallet; address payable private _treasuryWallet; uint256 private _marketingShare = 40; uint256 private _devShare = 10; uint256 private _treasuryShare = 50; constructor( address payable marketingWallet_, address payable devWallet_, address payable treasuryWallet_ ) { } fallback() external payable {} receive() external payable {} function claim() external { uint256 startingBalance = address(this).balance; (bool marketingSent, ) = _marketingWallet.call{value: startingBalance.mul(_marketingShare).div(100)}(""); (bool devSent, ) = _devWallet.call{value: startingBalance.mul(_devShare).div(100)}(""); (bool treasurySent, ) = _treasuryWallet.call{value: startingBalance.mul(_treasuryShare).div(100)}(""); require(<FILL_ME>) } function setMarketingWallet(address payable account) external onlyOwner { } function setDevWallet(address payable account) external onlyOwner { } function setTreasuryWallet(address payable account) external onlyOwner { } function setNewShares(uint256 marketingShare, uint256 devShare, uint256 treasuryShare) external onlyOwner { } function getWallets() external view returns (address, address, address) { } function getShare() external view returns (uint256, uint256, uint256) { } }
marketingSent&&devSent&&treasurySent,"Send failed"
313,959
marketingSent&&devSent&&treasurySent
"Does not add up to 100"
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { } } /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } // solhint-disable no-empty-blocks, avoid-low-level-calls contract EthDistribute is Ownable { using SafeMath for uint256; address payable private _marketingWallet; address payable private _devWallet; address payable private _treasuryWallet; uint256 private _marketingShare = 40; uint256 private _devShare = 10; uint256 private _treasuryShare = 50; constructor( address payable marketingWallet_, address payable devWallet_, address payable treasuryWallet_ ) { } fallback() external payable {} receive() external payable {} function claim() external { } function setMarketingWallet(address payable account) external onlyOwner { } function setDevWallet(address payable account) external onlyOwner { } function setTreasuryWallet(address payable account) external onlyOwner { } function setNewShares(uint256 marketingShare, uint256 devShare, uint256 treasuryShare) external onlyOwner { require(<FILL_ME>) _marketingShare = marketingShare; _devShare = devShare; _treasuryShare = treasuryShare; } function getWallets() external view returns (address, address, address) { } function getShare() external view returns (uint256, uint256, uint256) { } }
marketingShare.add(devShare).add(treasuryShare)==100,"Does not add up to 100"
313,959
marketingShare.add(devShare).add(treasuryShare)==100
"SCRedeem: Trait not found"
/* ___ _ _ ___ _ ( _`\ ( ) _ (_ ) | _`\ ( ) | |_) )| |__ _ _ ___ (_) ___ _ _ | | | (_) ) __ _| | __ __ ___ ___ | ,__/'| _ `\( ) ( )/',__)| | /'___) /'_` ) | | | , / /'__`\ /'_` | /'__`\ /'__`\/' _ ` _ `\ | | | | | || (_) |\__, \| |( (___ ( (_| | | | | |\ \ ( ___/( (_| |( ___/( ___/| ( ) ( ) | (_) (_) (_)`\__, |(____/(_)`\____)`\__,_)(___) (_) (_)`\____)`\__,_)`\____)`\____)(_) (_) (_) ( )_| | `\___/' */ // SPDX-License-Identifier: LGPL-3.0+ 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"; import "./TraitRegistry/ITraitRegistry.sol"; pragma solidity ^0.8.0; contract PhysicalRedeem is Ownable { // Card related uint256 public claimCount = 0; IERC721 public dr_contract_address; //= IERC721(0x922A6ac0F4438Bf84B816987a6bBfee82Aa02073); ITraitRegistry public traitRegistry; // 0x4E6ed01C6d4C906aD5428223855865EF75261338 // Events event setClaimStatus(uint256 __tokenID, bool _status); constructor(address _dr_contract_address, address _tr) { } // Set Card Property function getHash( bytes16 md5hash, uint64 rowID, uint64 timeLimit ) internal pure returns (bytes32) { } function isInitialized() external view returns (bool) { } /* function resultReturn( // Can delete. testing only. bytes16 md5hash, // 128 bits. uint64 rowID, //64 bits uint64 timeLimit, // 64bits uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { bytes32 hash = keccak256(abi.encodePacked(md5hash, rowID, timeLimit)); hash = ECDSA.toEthSignedMessageHash(hash); address signer = ECDSA.recover(hash, v, r, s); return signer; } */ function claimRedeemable( uint256 _tokenId, bytes16 md5hash, uint64 rowID, uint64 timeLimit, uint8 v, bytes32 r, bytes32 s ) public { require(<FILL_ME>) if (timeLimit < block.timestamp) { revert("Signature Expired"); } // Validate. bytes32 hash = getHash(md5hash, rowID, timeLimit); hash = ECDSA.toEthSignedMessageHash(hash); address signer = ECDSA.recover(hash, v, r, s); require(signer != address(0) && signer == msg.sender, "Invalid signature"); require(dr_contract_address.ownerOf(_tokenId) == msg.sender, "Not Token ID owner."); // remove trait from token traitRegistry.setTrait(2, uint16(_tokenId), false); emit setClaimStatus(_tokenId, true); claimCount++; } function getArtRedeemStatus(uint256 _tokenID) public view returns (bool) { } // Admin Ops receive() external payable { } function drain(IERC20 _token) external onlyOwner { } function retrieve721(address _tracker, uint256 _id) external onlyOwner { } }
traitRegistry.hasTrait(2,uint16(_tokenId)),"SCRedeem: Trait not found"
314,081
traitRegistry.hasTrait(2,uint16(_tokenId))
"Not Token ID owner."
/* ___ _ _ ___ _ ( _`\ ( ) _ (_ ) | _`\ ( ) | |_) )| |__ _ _ ___ (_) ___ _ _ | | | (_) ) __ _| | __ __ ___ ___ | ,__/'| _ `\( ) ( )/',__)| | /'___) /'_` ) | | | , / /'__`\ /'_` | /'__`\ /'__`\/' _ ` _ `\ | | | | | || (_) |\__, \| |( (___ ( (_| | | | | |\ \ ( ___/( (_| |( ___/( ___/| ( ) ( ) | (_) (_) (_)`\__, |(____/(_)`\____)`\__,_)(___) (_) (_)`\____)`\__,_)`\____)`\____)(_) (_) (_) ( )_| | `\___/' */ // SPDX-License-Identifier: LGPL-3.0+ 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"; import "./TraitRegistry/ITraitRegistry.sol"; pragma solidity ^0.8.0; contract PhysicalRedeem is Ownable { // Card related uint256 public claimCount = 0; IERC721 public dr_contract_address; //= IERC721(0x922A6ac0F4438Bf84B816987a6bBfee82Aa02073); ITraitRegistry public traitRegistry; // 0x4E6ed01C6d4C906aD5428223855865EF75261338 // Events event setClaimStatus(uint256 __tokenID, bool _status); constructor(address _dr_contract_address, address _tr) { } // Set Card Property function getHash( bytes16 md5hash, uint64 rowID, uint64 timeLimit ) internal pure returns (bytes32) { } function isInitialized() external view returns (bool) { } /* function resultReturn( // Can delete. testing only. bytes16 md5hash, // 128 bits. uint64 rowID, //64 bits uint64 timeLimit, // 64bits uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { bytes32 hash = keccak256(abi.encodePacked(md5hash, rowID, timeLimit)); hash = ECDSA.toEthSignedMessageHash(hash); address signer = ECDSA.recover(hash, v, r, s); return signer; } */ function claimRedeemable( uint256 _tokenId, bytes16 md5hash, uint64 rowID, uint64 timeLimit, uint8 v, bytes32 r, bytes32 s ) public { require(traitRegistry.hasTrait(2, uint16(_tokenId)), "SCRedeem: Trait not found"); if (timeLimit < block.timestamp) { revert("Signature Expired"); } // Validate. bytes32 hash = getHash(md5hash, rowID, timeLimit); hash = ECDSA.toEthSignedMessageHash(hash); address signer = ECDSA.recover(hash, v, r, s); require(signer != address(0) && signer == msg.sender, "Invalid signature"); require(<FILL_ME>) // remove trait from token traitRegistry.setTrait(2, uint16(_tokenId), false); emit setClaimStatus(_tokenId, true); claimCount++; } function getArtRedeemStatus(uint256 _tokenID) public view returns (bool) { } // Admin Ops receive() external payable { } function drain(IERC20 _token) external onlyOwner { } function retrieve721(address _tracker, uint256 _id) external onlyOwner { } }
dr_contract_address.ownerOf(_tokenId)==msg.sender,"Not Token ID owner."
314,081
dr_contract_address.ownerOf(_tokenId)==msg.sender
"Not found."
// SPDX-License-Identifier: MIT // https://secretnftsociety.com // It was all a meme. // // Cool S points have no inherent utility // or value. They can be exchanged / renamed // for other types of meaningless "cool points." // // V2 adds token verification + exchange burn. pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./BokkyPooBahsRedBlackTreeLibrary.sol"; contract CoolSToken is ERC20 { address private _minter; event NewToken(address indexed _address, string indexed _name, string indexed _symbol); constructor( string memory _name, string memory _symbol, address __minter ) ERC20(_name, _symbol) { } /* Increment tokens. */ function mint(address _to, uint256 _amount) public virtual { } /* Decrement tokens. */ function burn(address _to, uint256 _amount) public { } } contract CoolSV2 is CoolSToken { using BokkyPooBahsRedBlackTreeLibrary for BokkyPooBahsRedBlackTreeLibrary.Tree; BokkyPooBahsRedBlackTreeLibrary.Tree tree; address private _minter; address[] _tokens; mapping(uint => uint[]) _values; mapping(address => uint) _keys; mapping(uint => uint) _keyIndices; constructor( string memory _name, string memory _symbol, address __minter ) CoolSToken(_name, _symbol, __minter) { } /* Get total tokens created. */ function totalTokens() public view returns (uint) { } /* Get token address at index. */ function getToken(uint _idx) public view returns (address) { } /* BST queries */ function top() public view returns (uint) { } function next(uint _idx) public view returns (uint) { } function prev(uint _idx) public view returns (uint) { } // Gets the number of tokens at a supply level. function totalTokensWithSupply(uint _totalSupply) public view returns (uint) { } // Gets the token at the total supply index. function getTokenAtSupplyIndex(uint _totalSupply, uint _idx) public view returns (uint) { require(<FILL_ME>) return _values[_totalSupply][_idx] - 1; } /* Create a new Cool S backed ERC20 token. */ function newToken(string memory _name, string memory _symbol) public returns (address) { } /* Sort top tokens in BST. */ function _updateValues(uint _supplyBefore, uint _supplyAfter, uint _key) private { } /* Mint Cool S for artwork's "cool points" score. */ function mint(address _to, uint256 _amount) public override { } /* Exchange Cool S for another type of "cool points" (burns 0.5%.) */ function mintToken(address _to, address _token, uint _amount) public { } /* Return points back to standard Cool S points (burns 0.5%). */ function returnToken(address _to, address _token, uint _amount) public { } }
_values[_totalSupply].length>_idx&&_values[_totalSupply][_idx]>0,"Not found."
314,089
_values[_totalSupply].length>_idx&&_values[_totalSupply][_idx]>0
"Unsupported token."
// SPDX-License-Identifier: MIT // https://secretnftsociety.com // It was all a meme. // // Cool S points have no inherent utility // or value. They can be exchanged / renamed // for other types of meaningless "cool points." // // V2 adds token verification + exchange burn. pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./BokkyPooBahsRedBlackTreeLibrary.sol"; contract CoolSToken is ERC20 { address private _minter; event NewToken(address indexed _address, string indexed _name, string indexed _symbol); constructor( string memory _name, string memory _symbol, address __minter ) ERC20(_name, _symbol) { } /* Increment tokens. */ function mint(address _to, uint256 _amount) public virtual { } /* Decrement tokens. */ function burn(address _to, uint256 _amount) public { } } contract CoolSV2 is CoolSToken { using BokkyPooBahsRedBlackTreeLibrary for BokkyPooBahsRedBlackTreeLibrary.Tree; BokkyPooBahsRedBlackTreeLibrary.Tree tree; address private _minter; address[] _tokens; mapping(uint => uint[]) _values; mapping(address => uint) _keys; mapping(uint => uint) _keyIndices; constructor( string memory _name, string memory _symbol, address __minter ) CoolSToken(_name, _symbol, __minter) { } /* Get total tokens created. */ function totalTokens() public view returns (uint) { } /* Get token address at index. */ function getToken(uint _idx) public view returns (address) { } /* BST queries */ function top() public view returns (uint) { } function next(uint _idx) public view returns (uint) { } function prev(uint _idx) public view returns (uint) { } // Gets the number of tokens at a supply level. function totalTokensWithSupply(uint _totalSupply) public view returns (uint) { } // Gets the token at the total supply index. function getTokenAtSupplyIndex(uint _totalSupply, uint _idx) public view returns (uint) { } /* Create a new Cool S backed ERC20 token. */ function newToken(string memory _name, string memory _symbol) public returns (address) { } /* Sort top tokens in BST. */ function _updateValues(uint _supplyBefore, uint _supplyAfter, uint _key) private { } /* Mint Cool S for artwork's "cool points" score. */ function mint(address _to, uint256 _amount) public override { } /* Exchange Cool S for another type of "cool points" (burns 0.5%.) */ function mintToken(address _to, address _token, uint _amount) public { require(<FILL_ME>) CoolSToken t = CoolSToken(_token); uint supplyCoolSBefore = totalSupply(); uint supplyCoolSAfter = supplyCoolSBefore - _amount; uint keyCoolS = _keys[address(this)]; _burn(msg.sender, _amount); _updateValues(supplyCoolSBefore, supplyCoolSAfter, keyCoolS); uint supplyTokenBefore = t.totalSupply(); uint supplyTokenAfter = supplyTokenBefore + _amount; uint keyToken = _keys[_token]; uint burnAmt = _amount / 2000; t.mint(_to, _amount - burnAmt); _updateValues(supplyTokenBefore, supplyTokenAfter, keyToken); } /* Return points back to standard Cool S points (burns 0.5%). */ function returnToken(address _to, address _token, uint _amount) public { } }
_keys[_token]>0,"Unsupported token."
314,089
_keys[_token]>0
"JITU: caller is not a whitelisted keeper"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { require(<FILL_ME>) _; } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
adapterLimits[msg.sender]!=0,"JITU: caller is not a whitelisted keeper"
314,150
adapterLimits[msg.sender]!=0
"Underlying asset should not have been registered"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { require(<FILL_ME>) require(!registeredKTokens[address(_kToken)], "kToken should not have been registered"); kTokens[_kToken.underlying()] = _kToken; registeredKTokens[address(_kToken)] = true; registeredTokens.push(address(_kToken.underlying())); blacklistRecoverableToken(_kToken.underlying()); } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
address(kTokens[_kToken.underlying()])==address(0x0),"Underlying asset should not have been registered"
314,150
address(kTokens[_kToken.underlying()])==address(0x0)
"kToken should not have been registered"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { require(address(kTokens[_kToken.underlying()]) == address(0x0), "Underlying asset should not have been registered"); require(<FILL_ME>) kTokens[_kToken.underlying()] = _kToken; registeredKTokens[address(_kToken)] = true; registeredTokens.push(address(_kToken.underlying())); blacklistRecoverableToken(_kToken.underlying()); } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
!registeredKTokens[address(_kToken)],"kToken should not have been registered"
314,150
!registeredKTokens[address(_kToken)]
"Token is not registered"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { IKToken kTok = kTokens[_token]; require(<FILL_ME>) require(_amount > 0, "Deposit amount should be greater than 0"); _transferIn(_token, _amount); uint256 mintAmount = calculateMintAmount(kTok, _token, _amount); require(kTok.mint(_msgSender(), mintAmount), "Failed to mint kTokens"); emit Deposited(_msgSender(), _token, _amount, mintAmount); return mintAmount; } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
address(kTok)!=address(0x0),"Token is not registered"
314,150
address(kTok)!=address(0x0)
"Failed to mint kTokens"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { IKToken kTok = kTokens[_token]; require(address(kTok) != address(0x0), "Token is not registered"); require(_amount > 0, "Deposit amount should be greater than 0"); _transferIn(_token, _amount); uint256 mintAmount = calculateMintAmount(kTok, _token, _amount); require(<FILL_ME>) emit Deposited(_msgSender(), _token, _amount, mintAmount); return mintAmount; } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
kTok.mint(_msgSender(),mintAmount),"Failed to mint kTokens"
314,150
kTok.mint(_msgSender(),mintAmount)
"kToken is not registered"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { require(<FILL_ME>) require(_kTokenAmount > 0, "Withdraw amount should be greater than 0"); address token = _kToken.underlying(); uint256 amount = calculateWithdrawAmount(_kToken, token, _kTokenAmount); _kToken.burnFrom(_msgSender(), _kTokenAmount); _transferOut(_to, token, amount); emit Withdrew(_to, _msgSender(), token, amount, _kTokenAmount); } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
registeredKTokens[address(_kToken)],"kToken is not registered"
314,150
registeredKTokens[address(_kToken)]
"Token is not registered"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { require(<FILL_ME>) uint256 initialBalance = borrowableBalance(_token); _transferOut(_msgSender(), _token, _amount); borrower.lend(_msgSender(), _data); uint256 finalBalance = borrowableBalance(_token); require(finalBalance >= initialBalance, "Borrower failed to return the borrowed funds"); uint256 fee = finalBalance - initialBalance; uint256 poolFee = calculateFee(poolFeeInBips, fee); emit Borrowed(_msgSender(), _token, _amount, fee); _transferOut(feePool, _token, poolFee); } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
address(kTokens[_token])!=address(0x0),"Token is not registered"
314,150
address(kTokens[_token])!=address(0x0)
"Exceeds the credit limit"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.8.6; import "./Interf.sol"; import "./CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolStorageV1 { mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; mapping (address=>mapping (address=>uint256)) public adapterLoanedAmount; mapping (address=>uint256) public adapterLimits; uint256 public depositFeeInBips; uint256 public poolFeeInBips; address[] public registeredTokens; address payable feePool; BorrowerProxy public borrower; } contract LiquidityPoolV4 is LiquidityPoolStorageV1, ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; uint256 public constant BIPS_BASE = 10000; address public constant ETHEREUM = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); event AdapterLimitChanged(address indexed _adapter, uint256 _from, uint256 _to); event AdapterBorrowed(address indexed _adapter, address indexed _token, uint256 _amount); event AdapterRepaid(address indexed _adapter, address indexed _token, uint256 _amount); modifier onlyWhitelistedAdapter() { } receive () external override payable { } constructor() { } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= BIPS_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { } /// @notice change the credit limit for the given adapter. /// @param _adapter the address of the keeper /// @param _limitInBips the spending limit of the adapter function updateAdapterLimit(address _adapter, uint256 _limitInBips) external onlyOperator { } /// @notice pauses this contract. function pause() external onlyOperator { } /// @notice unpauses this contract. function unpause() external onlyOperator { } /// @notice Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { } /// @notice returns the total value locked in the LiquidityPool for the /// given token /// @param _token the address of the token function totalValueLocked(address _token) public view returns (uint256) { } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { } /// @notice adapterBorrow allows supported KeeperDAO adapters to lend /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function adapterBorrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant onlyWhitelistedAdapter whenNotPaused { } /// @notice repay allows supported KeeperDAO adapters to repay /// assets intra block. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. function adapterRepay(address _adapter, address _token, uint256 _amount) external payable nonReentrant whenNotPaused { } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { } /// @notice checks credit limit of the adapter function _checkCreditLimit(address _adapter) internal view { } /// @notice checks credit limit of the adapter for the given token function _checkTokenCreditLimit(address _adapter, address _token) internal view { uint256 adapterLimit = (adapterLimits[_adapter] * totalValueLocked(_token)) / BIPS_BASE; require(<FILL_ME>) } /// @notice transfers funds into the contract function _transferIn(address _token, uint256 _amount) internal { } /// @notice transfers funds out of the contract function _transferOut(address _to, address _token, uint256 _amount) internal { } }
adapterLoanedAmount[_adapter][_token]<=adapterLimit,"Exceeds the credit limit"
314,150
adapterLoanedAmount[_adapter][_token]<=adapterLimit
null
pragma solidity ^0.4.24; contract AraniumToken { using SafeMath for uint; using SafeERC20 for AraniumToken; string public name = "Aranium"; string public constant symbol = "ARA"; uint8 public constant decimals = 18; uint public constant decimalsFactor = 10 ** uint(decimals); uint public cap = 3800000000 * decimalsFactor; address public owner; mapping (address => bool) public companions; address[] public companionsList; bool public paused = false; mapping(address => uint256) balances; uint256 totalSupply_; mapping (address => mapping (address => uint256)) internal allowed; bool public mintingFinished = false; modifier onlyOwner() { require(<FILL_ME>) _; } modifier whenNotPaused() { } modifier whenPaused() { } modifier canMint() { } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event CompanionAdded(address indexed _companion); event CompanionRemoved(address indexed _companion); event Pause(); event Unpause(); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); event MintFinishedChanged(); event NameChanged(); event CapChanged(uint256 oldVal, uint256 newVal); constructor() public { } function setName(string _name) onlyOwner public { } function setCap(uint256 _cap) onlyOwner public { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256) { } function allowance(address _owner, address _spender) public view returns (uint256) { } function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) { } function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) { } function increaseApproval(address _spender, uint _addedValue) whenNotPaused public returns (bool) { } function decreaseApproval(address _spender, uint _subtractedValue) whenNotPaused public returns (bool) { } function pause() onlyOwner whenNotPaused public { } function unpause() onlyOwner whenPaused public { } function transferOwnership(address newOwner) onlyOwner public { } function addCompanion(address _companion) onlyOwner public { } function removeCompanion(address _companion) onlyOwner public { } // -- onlyOwner: returns 0 in MEW. function companionsListCount() onlyOwner public view returns (uint256) { } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } function finishMinting() onlyOwner canMint public returns (bool) { } function setMintingFinish(bool m) onlyOwner public returns (bool) { } function reclaimToken(AraniumToken token) onlyOwner external { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(AraniumToken token, address to, uint256 value) internal { } function safeTransferFrom(AraniumToken token, address from, address to, uint256 value) internal { } function safeApprove(AraniumToken token, address spender, uint256 value) internal { } }
(msg.sender==owner)||(companions[msg.sender])
314,205
(msg.sender==owner)||(companions[msg.sender])
null
pragma solidity ^0.4.24; contract AraniumToken { using SafeMath for uint; using SafeERC20 for AraniumToken; string public name = "Aranium"; string public constant symbol = "ARA"; uint8 public constant decimals = 18; uint public constant decimalsFactor = 10 ** uint(decimals); uint public cap = 3800000000 * decimalsFactor; address public owner; mapping (address => bool) public companions; address[] public companionsList; bool public paused = false; mapping(address => uint256) balances; uint256 totalSupply_; mapping (address => mapping (address => uint256)) internal allowed; bool public mintingFinished = false; modifier onlyOwner() { } modifier whenNotPaused() { } modifier whenPaused() { } modifier canMint() { } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event CompanionAdded(address indexed _companion); event CompanionRemoved(address indexed _companion); event Pause(); event Unpause(); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); event MintFinishedChanged(); event NameChanged(); event CapChanged(uint256 oldVal, uint256 newVal); constructor() public { } function setName(string _name) onlyOwner public { require(<FILL_ME>) name = _name; emit NameChanged(); } function setCap(uint256 _cap) onlyOwner public { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256) { } function allowance(address _owner, address _spender) public view returns (uint256) { } function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) { } function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) { } function increaseApproval(address _spender, uint _addedValue) whenNotPaused public returns (bool) { } function decreaseApproval(address _spender, uint _subtractedValue) whenNotPaused public returns (bool) { } function pause() onlyOwner whenNotPaused public { } function unpause() onlyOwner whenPaused public { } function transferOwnership(address newOwner) onlyOwner public { } function addCompanion(address _companion) onlyOwner public { } function removeCompanion(address _companion) onlyOwner public { } // -- onlyOwner: returns 0 in MEW. function companionsListCount() onlyOwner public view returns (uint256) { } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } function finishMinting() onlyOwner canMint public returns (bool) { } function setMintingFinish(bool m) onlyOwner public returns (bool) { } function reclaimToken(AraniumToken token) onlyOwner external { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(AraniumToken token, address to, uint256 value) internal { } function safeTransferFrom(AraniumToken token, address from, address to, uint256 value) internal { } function safeApprove(AraniumToken token, address spender, uint256 value) internal { } }
bytes(_name).length!=0
314,205
bytes(_name).length!=0
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { // parse inputs uint32 time = uint32(_b >> 224); address beneficiary = address(_a); uint256 oobpa = uint64(_b >> 160); address affiliate = address(_b); // verify inputs require(<FILL_ME>) if (oobpa == 0) { oobpa = msg.value; } bytes4 orderID = bytes4(uint32(_a >> 160)); /* solium-disable-next-line arg-overflow */ require(ecrecover(keccak256(abi.encodePacked(uint8(0), uint248(_a), _b)), uint8(_a >> 248), _r, _s) == signer); require(beneficiary != address(0)); // calculate token amount to be created uint256 rate = getRateAt(now); // solium-disable-line security/no-block-members // at the time of signing the receipt the rate should have been the same as now require(rate == getRateAt(time)); // multiply rate with Gwei of investment uint256 tokens = rate.mul(oobpa).div(1000000000); // check that msg.value > 0 require(tokens > 0); // pocket Ether if (msg.value > 0) { wallet.transfer(oobpa); } // do token transfer ERC20(token).transferFrom(wallet, beneficiary, tokens); emit TokenPurchase(beneficiary, affiliate, oobpa, tokens, orderID); } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
uint56(_a>>192)==uint56(this)
314,221
uint56(_a>>192)==uint56(this)
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { // parse inputs uint32 time = uint32(_b >> 224); address beneficiary = address(_a); uint256 oobpa = uint64(_b >> 160); address affiliate = address(_b); // verify inputs require(uint56(_a >> 192) == uint56(this)); if (oobpa == 0) { oobpa = msg.value; } bytes4 orderID = bytes4(uint32(_a >> 160)); /* solium-disable-next-line arg-overflow */ require(<FILL_ME>) require(beneficiary != address(0)); // calculate token amount to be created uint256 rate = getRateAt(now); // solium-disable-line security/no-block-members // at the time of signing the receipt the rate should have been the same as now require(rate == getRateAt(time)); // multiply rate with Gwei of investment uint256 tokens = rate.mul(oobpa).div(1000000000); // check that msg.value > 0 require(tokens > 0); // pocket Ether if (msg.value > 0) { wallet.transfer(oobpa); } // do token transfer ERC20(token).transferFrom(wallet, beneficiary, tokens); emit TokenPurchase(beneficiary, affiliate, oobpa, tokens, orderID); } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
ecrecover(keccak256(abi.encodePacked(uint8(0),uint248(_a),_b)),uint8(_a>>248),_r,_s)==signer
314,221
ecrecover(keccak256(abi.encodePacked(uint8(0),uint248(_a),_b)),uint8(_a>>248),_r,_s)==signer
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { // check odd amount of array elements, tuples of rate and time + saleEndTime require(<FILL_ME>) // check that at least 1 stage provided require(_timesAndRates.length >= 3); for (uint256 i = 0; i < _timesAndRates.length / 2; i++) { stages.push(Stage(uint32(_timesAndRates[i * 2]), uint64(_timesAndRates[(i * 2) + 1]))); if (i > 0) { // check that each time higher than previous time require(stages[i-1].time < stages[i].time); // check that each rate is lower than previous rate require(stages[i-1].rate > stages[i].rate); } } // check that opening time in the future require(stages[0].time > now); // solium-disable-line security/no-block-members // check final rate > 0 require(stages[stages.length - 1].rate > 0); } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
_timesAndRates.length%2==1
314,221
_timesAndRates.length%2==1
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { // check odd amount of array elements, tuples of rate and time + saleEndTime require(_timesAndRates.length % 2 == 1); // check that at least 1 stage provided require(_timesAndRates.length >= 3); for (uint256 i = 0; i < _timesAndRates.length / 2; i++) { stages.push(Stage(uint32(_timesAndRates[i * 2]), uint64(_timesAndRates[(i * 2) + 1]))); if (i > 0) { // check that each time higher than previous time require(<FILL_ME>) // check that each rate is lower than previous rate require(stages[i-1].rate > stages[i].rate); } } // check that opening time in the future require(stages[0].time > now); // solium-disable-line security/no-block-members // check final rate > 0 require(stages[stages.length - 1].rate > 0); } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
stages[i-1].time<stages[i].time
314,221
stages[i-1].time<stages[i].time
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { // check odd amount of array elements, tuples of rate and time + saleEndTime require(_timesAndRates.length % 2 == 1); // check that at least 1 stage provided require(_timesAndRates.length >= 3); for (uint256 i = 0; i < _timesAndRates.length / 2; i++) { stages.push(Stage(uint32(_timesAndRates[i * 2]), uint64(_timesAndRates[(i * 2) + 1]))); if (i > 0) { // check that each time higher than previous time require(stages[i-1].time < stages[i].time); // check that each rate is lower than previous rate require(<FILL_ME>) } } // check that opening time in the future require(stages[0].time > now); // solium-disable-line security/no-block-members // check final rate > 0 require(stages[stages.length - 1].rate > 0); } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
stages[i-1].rate>stages[i].rate
314,221
stages[i-1].rate>stages[i].rate
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { // check odd amount of array elements, tuples of rate and time + saleEndTime require(_timesAndRates.length % 2 == 1); // check that at least 1 stage provided require(_timesAndRates.length >= 3); for (uint256 i = 0; i < _timesAndRates.length / 2; i++) { stages.push(Stage(uint32(_timesAndRates[i * 2]), uint64(_timesAndRates[(i * 2) + 1]))); if (i > 0) { // check that each time higher than previous time require(stages[i-1].time < stages[i].time); // check that each rate is lower than previous rate require(stages[i-1].rate > stages[i].rate); } } // check that opening time in the future require(<FILL_ME>) // solium-disable-line security/no-block-members // check final rate > 0 require(stages[stages.length - 1].rate > 0); } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
stages[0].time>now
314,221
stages[0].time>now
null
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract MultistageCrowdsale { using SafeMath for uint256; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param affiliate address, if any * @param value weis paid for purchase * @param amount amount of tokens purchased * @param orderID to be used with fiat payments */ event TokenPurchase(address indexed purchaser, address indexed affiliate, uint256 value, uint256 amount, bytes4 indexed orderID); struct Stage { uint32 time; uint64 rate; } Stage[] stages; address wallet; address token; address signer; uint32 saleEndTime; /** * @dev The constructor that takes all parameters * @param _timesAndRates An array that defines the stages of the contract. the first entry being the start time of the sale, followed by pairs of rates ond close times of consequitive stages. * Example 1: [10000, 99, 12000] * A single stage sale that starts at unix time 10000 and ends 2000 seconds later. * This sale gives 99 tokens for each Gwei invested. * Example 2: [10000, 99, 12000, 88, 14000] * A 2 stage sale that starts at unix time 10000 and ends 4000 seconds later. * The sale reduces the rate at mid time * This sale gives 99 tokens for each Gwei invested in first stage. * The sale gives 88 tokens for each Gwei invested in second stage. * @param _wallet The address of the wallet where invested Ether will be send to * @param _token The tokens that the investor will receive * @param _signer The address of the key that whitelists investor (operator key) */ constructor( uint256[] _timesAndRates, address _wallet, address _token, address _signer ) public { } /** * @dev called by investors to purchase tokens * @param _r part of receipt signature * @param _s part of receipt signature * @param _a first payload of signed receipt. * @param _b second payload of signed receipt. * The receipt commits to the follwing inputs: * 56 bits - sale contract address, to prevent replay of receipt * 32 bits - orderID for fiat payments * 160 bits - beneficiary address - address whitelisted to receive tokens * 32 bits - time - when receipt was signed * 64 bits - oobpa - out of band payment amount, for fiat investments * 160 bits - affiliate address */ function invest(bytes32 _r, bytes32 _s, bytes32 _a, bytes32 _b) public payable { } function getParams() view public returns (uint256[] _times, uint256[] _rates, address _wallet, address _token, address _signer) { } function storeStages(uint256[] _timesAndRates) internal { // check odd amount of array elements, tuples of rate and time + saleEndTime require(_timesAndRates.length % 2 == 1); // check that at least 1 stage provided require(_timesAndRates.length >= 3); for (uint256 i = 0; i < _timesAndRates.length / 2; i++) { stages.push(Stage(uint32(_timesAndRates[i * 2]), uint64(_timesAndRates[(i * 2) + 1]))); if (i > 0) { // check that each time higher than previous time require(stages[i-1].time < stages[i].time); // check that each rate is lower than previous rate require(stages[i-1].rate > stages[i].rate); } } // check that opening time in the future require(stages[0].time > now); // solium-disable-line security/no-block-members // check final rate > 0 require(<FILL_ME>) } function getRateAt(uint256 _now) view internal returns (uint256 rate) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } }
stages[stages.length-1].rate>0
314,221
stages[stages.length-1].rate>0
null
pragma solidity ^0.4.25; contract ETHDIAMOND { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { } // only people with profits modifier onlyStronghands() { } modifier checkExchangeOpen(uint256 _amountOfEthereum){ if( exchangeClosed ){ require(<FILL_ME>) isInHelloDiamond_[msg.sender] = false; helloCount = SafeMath.sub(helloCount,1); if(helloCount == 0){ exchangeClosed = false; } } _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Diamond Token"; string public symbol = "Diamond"; uint8 constant public decimals = 18; uint8 constant internal buyFee_ = 30;//30% uint8 constant internal sellFee_ = 15;//15% uint8 constant internal transferFee_ = 10; uint8 constant internal devFee_ = 20; // 5% uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2**64; uint256 private devPool = 0; uint256 internal tokenSupply_ = 0; uint256 internal helloCount = 0; uint256 internal profitPerShare_; uint256 public stakingRequirement = 50 ether; uint256 public playerCount_; uint256 public totalInvested = 0; uint256 public totalDividends = 0; uint256 public checkinCount = 0; address internal devAddress_; /*================================ = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; mapping(address => bool) internal isInHelloDiamond_; mapping(address => bool) public players_; mapping(address => uint256) public totalDeposit_; mapping(address => uint256) public totalWithdraw_; bool public exchangeClosed = true; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /* * -- APPLICATION ENTRY POINTS -- */ constructor() public { } function dailyCheckin() public { } /** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */ function buy(address _referredBy) public payable returns(uint256) { } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { } /** * Converts all of caller's dividends to tokens. */ function reinvest() onlyStronghands() public { } /** * Alias of sell() and withdraw(). */ function exit() public { } /** * Withdraws all of the callers earnings. */ function withdraw() onlyStronghands() public { } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { } /** * Transfer tokens from the caller to a new holder. * Remember, there's a 10% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { } /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ function disableInitialStage() public { } function setStakingRequirement(uint256 _amountOfTokens) public { } function helloDiamond(address _address, bool _status,uint8 _count) public { } function withdrawDevFee() public { } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function getContractData() public view returns(uint256, uint256, uint256,uint256, uint256){ } function getPlayerData() public view returns(uint256, uint256, uint256,uint256, uint256){ } function checkDevPool () public view returns(uint) { } function totalEthereumBalance() public view returns(uint) { } function isOwner() public view returns(bool) { } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) checkExchangeOpen(_incomingEthereum) internal returns(uint256) { } /** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { } /** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
isInHelloDiamond_[msg.sender]
314,300
isInHelloDiamond_[msg.sender]
"CC:AlreadyIssued"
// // CollectCode v1.0 // CHROMA Collection, 2021 // https://collect-code.com/ // https://twitter.com/CollectCoder // // TOKEN PERSISTENCY // Every artwork generated by this contract will live forever on the blockchain // It will always be available for viewing at collect-code.com and marketplace websites // In case of adversity, this is how you can see your token... // // 1. Get the metadata url by executing this contract's tokenURI(tokenId) method // 2. Open a p5js Editor, like this one here: https://editor.p5js.org/ // If this editor vanishes, here's the source: https://github.com/processing-js/processing-js // 3. Paste the script below in the editor // 4. Copy the full metadata url to the script's metadataUrl // 6. Uncomment the last line if you want to export as a PNG file // 5. Run! // /*----------------------------------------------- let metadataUrl = "paste_full_metadata_url_here"; let resolution = 600; function setup() { createCanvas(resolution, resolution); let pg = createGraphics(resolution, resolution); pg.background(0); pg.noStroke(); const pixels = metadataUrl.split("pixels=")[1]; const gridSize = sqrt(pixels.length / 6); const dx = width / gridSize; const dy = height / gridSize; for( let y = 0 ; y < gridSize ; y++) { const yp = y * gridSize * 6; for( let x = 0 ; x < gridSize ; x++) { const xp = x * 6; const r = unhex(pixels.substr([yp+xp+0],2)); const g = unhex(pixels.substr([yp+xp+2],2)); const b = unhex(pixels.substr([yp+xp+4],2)); const c = color(r,g,b); pg.fill(c); pg.rect(x*dx,y*dy,dx,dy); } } image(pg,0,0); //saveCanvas(pg, 'CollectCode', 'png'); } -----------------------------------------------*/ // SPDX-License-Identifier: MIT // Same version as openzeppelin 3.4 pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Utils.sol"; abstract contract CollectCode is ERC721, Ownable { using SafeMath for uint256; struct Config { string seriesCode; uint256 initialSupply; uint256 maxSupply; uint256 initialPrice; uint8 gridSize; } Config internal config_; struct State { bool isReleased; // Token Zero was minted uint256 mintedCount; // (ignores Token Zero) uint256 builtCount; // (ignores Token Zero) uint256 notBuiltCount; // (ignores Token Zero) uint256 currentSupply; // permitted to mint uint256 availableSupply; // not minted uint256 maxBuyout; // not minted bool isAvailable; // availableSupply > 0 } State internal state_; struct TokenInfo { address owner; bool youOwnIt; bool isBuilt; address builder; uint256 sequenceNumber; uint256[] sequenceTokens; } mapping (uint256 => bytes) internal _colors; mapping (uint256 => uint256) internal _sequenceNumber; mapping (uint256 => address) internal _builder; constructor() { } // // public actions function giftCode(address to) onlyOwner public returns (uint256) { require(<FILL_ME>) require(to == owner(), "CC:NotOwner"); //require(isOwner(), "CC:NotOwner"); // Ownable takes care return mintCode_( to, 1, true ); } function buyCode(address to, uint256 quantity, bool build) public payable returns (uint256) { } function buildCode(uint256 tokenId) public { } function withdraw() onlyOwner public { } // // public getters function getConfig() public view returns (Config memory) { } function getState() public view returns (State memory) { } function getTokenInfo(address from, uint256 tokenId) public view returns (TokenInfo memory) { } function calculatePriceForQuantity(uint256 quantity) public view returns (uint256) { } function getPrices() public view returns (uint256[] memory) { } function getOwnedTokens(address from) public view returns (uint256[] memory) { } // // Privates // function mintCode_(address to, uint256 quantity, bool build) internal returns (uint256) { } function buildCode_(address to, uint256 tokenId, uint256 sequenceNumber) internal { } function calculateSupply_() internal { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!state_.isReleased,"CC:AlreadyIssued"
314,315
!state_.isReleased
"CC: Unreleased"
// // CollectCode v1.0 // CHROMA Collection, 2021 // https://collect-code.com/ // https://twitter.com/CollectCoder // // TOKEN PERSISTENCY // Every artwork generated by this contract will live forever on the blockchain // It will always be available for viewing at collect-code.com and marketplace websites // In case of adversity, this is how you can see your token... // // 1. Get the metadata url by executing this contract's tokenURI(tokenId) method // 2. Open a p5js Editor, like this one here: https://editor.p5js.org/ // If this editor vanishes, here's the source: https://github.com/processing-js/processing-js // 3. Paste the script below in the editor // 4. Copy the full metadata url to the script's metadataUrl // 6. Uncomment the last line if you want to export as a PNG file // 5. Run! // /*----------------------------------------------- let metadataUrl = "paste_full_metadata_url_here"; let resolution = 600; function setup() { createCanvas(resolution, resolution); let pg = createGraphics(resolution, resolution); pg.background(0); pg.noStroke(); const pixels = metadataUrl.split("pixels=")[1]; const gridSize = sqrt(pixels.length / 6); const dx = width / gridSize; const dy = height / gridSize; for( let y = 0 ; y < gridSize ; y++) { const yp = y * gridSize * 6; for( let x = 0 ; x < gridSize ; x++) { const xp = x * 6; const r = unhex(pixels.substr([yp+xp+0],2)); const g = unhex(pixels.substr([yp+xp+2],2)); const b = unhex(pixels.substr([yp+xp+4],2)); const c = color(r,g,b); pg.fill(c); pg.rect(x*dx,y*dy,dx,dy); } } image(pg,0,0); //saveCanvas(pg, 'CollectCode', 'png'); } -----------------------------------------------*/ // SPDX-License-Identifier: MIT // Same version as openzeppelin 3.4 pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Utils.sol"; abstract contract CollectCode is ERC721, Ownable { using SafeMath for uint256; struct Config { string seriesCode; uint256 initialSupply; uint256 maxSupply; uint256 initialPrice; uint8 gridSize; } Config internal config_; struct State { bool isReleased; // Token Zero was minted uint256 mintedCount; // (ignores Token Zero) uint256 builtCount; // (ignores Token Zero) uint256 notBuiltCount; // (ignores Token Zero) uint256 currentSupply; // permitted to mint uint256 availableSupply; // not minted uint256 maxBuyout; // not minted bool isAvailable; // availableSupply > 0 } State internal state_; struct TokenInfo { address owner; bool youOwnIt; bool isBuilt; address builder; uint256 sequenceNumber; uint256[] sequenceTokens; } mapping (uint256 => bytes) internal _colors; mapping (uint256 => uint256) internal _sequenceNumber; mapping (uint256 => address) internal _builder; constructor() { } // // public actions function giftCode(address to) onlyOwner public returns (uint256) { } function buyCode(address to, uint256 quantity, bool build) public payable returns (uint256) { require(<FILL_ME>) require(msg.value == calculatePriceForQuantity(quantity), "CC:BadValue"); return mintCode_( to, quantity, build ); } function buildCode(uint256 tokenId) public { } function withdraw() onlyOwner public { } // // public getters function getConfig() public view returns (Config memory) { } function getState() public view returns (State memory) { } function getTokenInfo(address from, uint256 tokenId) public view returns (TokenInfo memory) { } function calculatePriceForQuantity(uint256 quantity) public view returns (uint256) { } function getPrices() public view returns (uint256[] memory) { } function getOwnedTokens(address from) public view returns (uint256[] memory) { } // // Privates // function mintCode_(address to, uint256 quantity, bool build) internal returns (uint256) { } function buildCode_(address to, uint256 tokenId, uint256 sequenceNumber) internal { } function calculateSupply_() internal { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
state_.isReleased,"CC: Unreleased"
314,315
state_.isReleased
"CC:AlreadyBuilt"
// // CollectCode v1.0 // CHROMA Collection, 2021 // https://collect-code.com/ // https://twitter.com/CollectCoder // // TOKEN PERSISTENCY // Every artwork generated by this contract will live forever on the blockchain // It will always be available for viewing at collect-code.com and marketplace websites // In case of adversity, this is how you can see your token... // // 1. Get the metadata url by executing this contract's tokenURI(tokenId) method // 2. Open a p5js Editor, like this one here: https://editor.p5js.org/ // If this editor vanishes, here's the source: https://github.com/processing-js/processing-js // 3. Paste the script below in the editor // 4. Copy the full metadata url to the script's metadataUrl // 6. Uncomment the last line if you want to export as a PNG file // 5. Run! // /*----------------------------------------------- let metadataUrl = "paste_full_metadata_url_here"; let resolution = 600; function setup() { createCanvas(resolution, resolution); let pg = createGraphics(resolution, resolution); pg.background(0); pg.noStroke(); const pixels = metadataUrl.split("pixels=")[1]; const gridSize = sqrt(pixels.length / 6); const dx = width / gridSize; const dy = height / gridSize; for( let y = 0 ; y < gridSize ; y++) { const yp = y * gridSize * 6; for( let x = 0 ; x < gridSize ; x++) { const xp = x * 6; const r = unhex(pixels.substr([yp+xp+0],2)); const g = unhex(pixels.substr([yp+xp+2],2)); const b = unhex(pixels.substr([yp+xp+4],2)); const c = color(r,g,b); pg.fill(c); pg.rect(x*dx,y*dy,dx,dy); } } image(pg,0,0); //saveCanvas(pg, 'CollectCode', 'png'); } -----------------------------------------------*/ // SPDX-License-Identifier: MIT // Same version as openzeppelin 3.4 pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Utils.sol"; abstract contract CollectCode is ERC721, Ownable { using SafeMath for uint256; struct Config { string seriesCode; uint256 initialSupply; uint256 maxSupply; uint256 initialPrice; uint8 gridSize; } Config internal config_; struct State { bool isReleased; // Token Zero was minted uint256 mintedCount; // (ignores Token Zero) uint256 builtCount; // (ignores Token Zero) uint256 notBuiltCount; // (ignores Token Zero) uint256 currentSupply; // permitted to mint uint256 availableSupply; // not minted uint256 maxBuyout; // not minted bool isAvailable; // availableSupply > 0 } State internal state_; struct TokenInfo { address owner; bool youOwnIt; bool isBuilt; address builder; uint256 sequenceNumber; uint256[] sequenceTokens; } mapping (uint256 => bytes) internal _colors; mapping (uint256 => uint256) internal _sequenceNumber; mapping (uint256 => address) internal _builder; constructor() { } // // public actions function giftCode(address to) onlyOwner public returns (uint256) { } function buyCode(address to, uint256 quantity, bool build) public payable returns (uint256) { } function buildCode(uint256 tokenId) public { require(_exists(tokenId), "CC:BadTokenId"); require(<FILL_ME>) require(msg.sender == ownerOf(tokenId), "CC:NotOwner"); buildCode_( msg.sender, tokenId, 0 ); } function withdraw() onlyOwner public { } // // public getters function getConfig() public view returns (Config memory) { } function getState() public view returns (State memory) { } function getTokenInfo(address from, uint256 tokenId) public view returns (TokenInfo memory) { } function calculatePriceForQuantity(uint256 quantity) public view returns (uint256) { } function getPrices() public view returns (uint256[] memory) { } function getOwnedTokens(address from) public view returns (uint256[] memory) { } // // Privates // function mintCode_(address to, uint256 quantity, bool build) internal returns (uint256) { } function buildCode_(address to, uint256 tokenId, uint256 sequenceNumber) internal { } function calculateSupply_() internal { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
_colors[tokenId].length==0,"CC:AlreadyBuilt"
314,315
_colors[tokenId].length==0
"CC:TooMany"
// // CollectCode v1.0 // CHROMA Collection, 2021 // https://collect-code.com/ // https://twitter.com/CollectCoder // // TOKEN PERSISTENCY // Every artwork generated by this contract will live forever on the blockchain // It will always be available for viewing at collect-code.com and marketplace websites // In case of adversity, this is how you can see your token... // // 1. Get the metadata url by executing this contract's tokenURI(tokenId) method // 2. Open a p5js Editor, like this one here: https://editor.p5js.org/ // If this editor vanishes, here's the source: https://github.com/processing-js/processing-js // 3. Paste the script below in the editor // 4. Copy the full metadata url to the script's metadataUrl // 6. Uncomment the last line if you want to export as a PNG file // 5. Run! // /*----------------------------------------------- let metadataUrl = "paste_full_metadata_url_here"; let resolution = 600; function setup() { createCanvas(resolution, resolution); let pg = createGraphics(resolution, resolution); pg.background(0); pg.noStroke(); const pixels = metadataUrl.split("pixels=")[1]; const gridSize = sqrt(pixels.length / 6); const dx = width / gridSize; const dy = height / gridSize; for( let y = 0 ; y < gridSize ; y++) { const yp = y * gridSize * 6; for( let x = 0 ; x < gridSize ; x++) { const xp = x * 6; const r = unhex(pixels.substr([yp+xp+0],2)); const g = unhex(pixels.substr([yp+xp+2],2)); const b = unhex(pixels.substr([yp+xp+4],2)); const c = color(r,g,b); pg.fill(c); pg.rect(x*dx,y*dy,dx,dy); } } image(pg,0,0); //saveCanvas(pg, 'CollectCode', 'png'); } -----------------------------------------------*/ // SPDX-License-Identifier: MIT // Same version as openzeppelin 3.4 pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Utils.sol"; abstract contract CollectCode is ERC721, Ownable { using SafeMath for uint256; struct Config { string seriesCode; uint256 initialSupply; uint256 maxSupply; uint256 initialPrice; uint8 gridSize; } Config internal config_; struct State { bool isReleased; // Token Zero was minted uint256 mintedCount; // (ignores Token Zero) uint256 builtCount; // (ignores Token Zero) uint256 notBuiltCount; // (ignores Token Zero) uint256 currentSupply; // permitted to mint uint256 availableSupply; // not minted uint256 maxBuyout; // not minted bool isAvailable; // availableSupply > 0 } State internal state_; struct TokenInfo { address owner; bool youOwnIt; bool isBuilt; address builder; uint256 sequenceNumber; uint256[] sequenceTokens; } mapping (uint256 => bytes) internal _colors; mapping (uint256 => uint256) internal _sequenceNumber; mapping (uint256 => address) internal _builder; constructor() { } // // public actions function giftCode(address to) onlyOwner public returns (uint256) { } function buyCode(address to, uint256 quantity, bool build) public payable returns (uint256) { } function buildCode(uint256 tokenId) public { } function withdraw() onlyOwner public { } // // public getters function getConfig() public view returns (Config memory) { } function getState() public view returns (State memory) { } function getTokenInfo(address from, uint256 tokenId) public view returns (TokenInfo memory) { } function calculatePriceForQuantity(uint256 quantity) public view returns (uint256) { } function getPrices() public view returns (uint256[] memory) { } function getOwnedTokens(address from) public view returns (uint256[] memory) { } // // Privates // function mintCode_(address to, uint256 quantity, bool build) internal returns (uint256) { require(quantity > 0, "CC:BadQuantity"); if( state_.isReleased ) { require(state_.mintedCount < config_.maxSupply, "CC:SoldOut"); require(state_.mintedCount < state_.currentSupply, "CC:Unavailable"); require(<FILL_ME>) require(quantity <= state_.maxBuyout, "CC:TooMany"); } for(uint256 i = 0 ; i < quantity ; i++) { uint256 newTokenId = !state_.isReleased ? 0 : state_.mintedCount.add(1); _mint( to, newTokenId ); // update contract state state_.isReleased = true; state_.mintedCount = newTokenId; if(newTokenId > 0) { state_.notBuiltCount++; } if( build ) { buildCode_(to, newTokenId, quantity == 1 ? 0 : (i+1)); } else { calculateSupply_(); } } return quantity; } function buildCode_(address to, uint256 tokenId, uint256 sequenceNumber) internal { } function calculateSupply_() internal { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
state_.mintedCount.add(quantity)<=state_.currentSupply,"CC:TooMany"
314,315
state_.mintedCount.add(quantity)<=state_.currentSupply
"RwaConduit/no-gov"
// Copyright (C) 2020, 2021 Lev Livnev <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.5.12; // https://github.com/dapphub/ds-token/blob/master/src/token.sol interface DSTokenAbstract { function name() external view returns (bytes32); function symbol() external view returns (bytes32); function decimals() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function transfer(address, uint256) external returns (bool); function allowance(address, address) external view returns (uint256); function approve(address, uint256) external returns (bool); function approve(address) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function push(address, uint256) external; function pull(address, uint256) external; function move(address, address, uint256) external; function mint(uint256) external; function mint(address,uint) external; function burn(uint256) external; function burn(address,uint) external; function setName(bytes32) external; function authority() external view returns (address); function owner() external view returns (address); function setOwner(address) external; function setAuthority(address) external; } contract RwaInputConduit { DSTokenAbstract public gov; DSTokenAbstract public dai; address public to; event Push(address indexed to, uint256 wad); constructor(address _gov, address _dai, address _to) public { } function push() external { require(<FILL_ME>) uint256 balance = dai.balanceOf(address(this)); emit Push(to, balance); dai.transfer(to, balance); } }
gov.balanceOf(msg.sender)>0,"RwaConduit/no-gov"
314,344
gov.balanceOf(msg.sender)>0
"Not accepted"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IOwnable { function policy() external view returns (address); function renounceManagement() external; function pushManagement( address newOwner_ ) external; function pullManagement() external; } contract Ownable is IOwnable { address internal _owner; address internal _newOwner; event OwnershipPushed(address indexed previousOwner, address indexed newOwner); event OwnershipPulled(address indexed previousOwner, address indexed newOwner); constructor () { } function policy() public view override returns (address) { } modifier onlyPolicy() { } function renounceManagement() public virtual override onlyPolicy() { } function pushManagement( address newOwner_ ) public virtual override onlyPolicy() { } function pullManagement() public virtual override { } } interface IERC20 { function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function totalSupply() external view returns (uint256); 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 SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { } } interface IOHMERC20 { function burnFrom(address account_, uint256 amount_) external; } interface IBondCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract MockTreasury is Ownable { using SafeERC20 for IERC20; using SafeMath for uint; event Deposit( address indexed token, uint amount, uint value, uint send ); event Withdrawal( address indexed token, uint amount, uint value ); address public immutable OHM; mapping( address => bool ) public isReserveToken; mapping( address => bool ) public isReserveDepositor; mapping( address => bool ) public isReserveSpender; mapping( address => bool ) public isReserveManager; mapping( address => bool ) public isLiquidityToken; mapping( address => bool ) public isLiquidityDepositor; mapping( address => bool ) public isLiquidityManager; mapping( address => address ) public bondCalculator; // bond calculator for liquidity token uint public totalReserves; // Risk-free value of all assets constructor( address _ohm ) { } function deposit( uint _amount, address _token, uint _profit ) external returns ( uint send_ ) { require(<FILL_ME>) IERC20( _token ).safeTransferFrom( msg.sender, address(this), _amount ); if ( isReserveToken[ _token ] ) { require( isReserveDepositor[ msg.sender ], "Not approved" ); } else { require( isLiquidityDepositor[ msg.sender ], "Not approved" ); } uint value = valueOf( _token, _amount ); send_ = value.sub( _profit ); totalReserves = totalReserves.add( value ); emit Deposit( _token, _amount, value, send_ ); } function withdraw( uint _amount, address _token ) external { } function manage( address _token, uint _amount ) external { } function valueOf( address _token, uint _amount ) public view returns ( uint value_ ) { } enum MANAGING { RESERVEDEPOSITOR, RESERVESPENDER, RESERVETOKEN, RESERVEMANAGER, LIQUIDITYDEPOSITOR, LIQUIDITYTOKEN, LIQUIDITYMANAGER } function toggle( MANAGING _managing, address _address, address _calculator ) external onlyPolicy() { } }
isReserveToken[_token]||isLiquidityToken[_token],"Not accepted"
314,385
isReserveToken[_token]||isLiquidityToken[_token]
"Not approved"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IOwnable { function policy() external view returns (address); function renounceManagement() external; function pushManagement( address newOwner_ ) external; function pullManagement() external; } contract Ownable is IOwnable { address internal _owner; address internal _newOwner; event OwnershipPushed(address indexed previousOwner, address indexed newOwner); event OwnershipPulled(address indexed previousOwner, address indexed newOwner); constructor () { } function policy() public view override returns (address) { } modifier onlyPolicy() { } function renounceManagement() public virtual override onlyPolicy() { } function pushManagement( address newOwner_ ) public virtual override onlyPolicy() { } function pullManagement() public virtual override { } } interface IERC20 { function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function totalSupply() external view returns (uint256); 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 SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { } } interface IOHMERC20 { function burnFrom(address account_, uint256 amount_) external; } interface IBondCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract MockTreasury is Ownable { using SafeERC20 for IERC20; using SafeMath for uint; event Deposit( address indexed token, uint amount, uint value, uint send ); event Withdrawal( address indexed token, uint amount, uint value ); address public immutable OHM; mapping( address => bool ) public isReserveToken; mapping( address => bool ) public isReserveDepositor; mapping( address => bool ) public isReserveSpender; mapping( address => bool ) public isReserveManager; mapping( address => bool ) public isLiquidityToken; mapping( address => bool ) public isLiquidityDepositor; mapping( address => bool ) public isLiquidityManager; mapping( address => address ) public bondCalculator; // bond calculator for liquidity token uint public totalReserves; // Risk-free value of all assets constructor( address _ohm ) { } function deposit( uint _amount, address _token, uint _profit ) external returns ( uint send_ ) { require( isReserveToken[ _token ] || isLiquidityToken[ _token ], "Not accepted" ); IERC20( _token ).safeTransferFrom( msg.sender, address(this), _amount ); if ( isReserveToken[ _token ] ) { require( isReserveDepositor[ msg.sender ], "Not approved" ); } else { require(<FILL_ME>) } uint value = valueOf( _token, _amount ); send_ = value.sub( _profit ); totalReserves = totalReserves.add( value ); emit Deposit( _token, _amount, value, send_ ); } function withdraw( uint _amount, address _token ) external { } function manage( address _token, uint _amount ) external { } function valueOf( address _token, uint _amount ) public view returns ( uint value_ ) { } enum MANAGING { RESERVEDEPOSITOR, RESERVESPENDER, RESERVETOKEN, RESERVEMANAGER, LIQUIDITYDEPOSITOR, LIQUIDITYTOKEN, LIQUIDITYMANAGER } function toggle( MANAGING _managing, address _address, address _calculator ) external onlyPolicy() { } }
isLiquidityDepositor[msg.sender],"Not approved"
314,385
isLiquidityDepositor[msg.sender]
"Not approved"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IOwnable { function policy() external view returns (address); function renounceManagement() external; function pushManagement( address newOwner_ ) external; function pullManagement() external; } contract Ownable is IOwnable { address internal _owner; address internal _newOwner; event OwnershipPushed(address indexed previousOwner, address indexed newOwner); event OwnershipPulled(address indexed previousOwner, address indexed newOwner); constructor () { } function policy() public view override returns (address) { } modifier onlyPolicy() { } function renounceManagement() public virtual override onlyPolicy() { } function pushManagement( address newOwner_ ) public virtual override onlyPolicy() { } function pullManagement() public virtual override { } } interface IERC20 { function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function totalSupply() external view returns (uint256); 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 SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { } } interface IOHMERC20 { function burnFrom(address account_, uint256 amount_) external; } interface IBondCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract MockTreasury is Ownable { using SafeERC20 for IERC20; using SafeMath for uint; event Deposit( address indexed token, uint amount, uint value, uint send ); event Withdrawal( address indexed token, uint amount, uint value ); address public immutable OHM; mapping( address => bool ) public isReserveToken; mapping( address => bool ) public isReserveDepositor; mapping( address => bool ) public isReserveSpender; mapping( address => bool ) public isReserveManager; mapping( address => bool ) public isLiquidityToken; mapping( address => bool ) public isLiquidityDepositor; mapping( address => bool ) public isLiquidityManager; mapping( address => address ) public bondCalculator; // bond calculator for liquidity token uint public totalReserves; // Risk-free value of all assets constructor( address _ohm ) { } function deposit( uint _amount, address _token, uint _profit ) external returns ( uint send_ ) { } function withdraw( uint _amount, address _token ) external { } function manage( address _token, uint _amount ) external { if( isLiquidityToken[ _token ] ) { require(<FILL_ME>) } else { require( isReserveManager[ msg.sender ], "Not approved" ); } uint value = valueOf( _token, _amount ); totalReserves = totalReserves.sub( value ); IERC20( _token ).safeTransfer( msg.sender, _amount ); } function valueOf( address _token, uint _amount ) public view returns ( uint value_ ) { } enum MANAGING { RESERVEDEPOSITOR, RESERVESPENDER, RESERVETOKEN, RESERVEMANAGER, LIQUIDITYDEPOSITOR, LIQUIDITYTOKEN, LIQUIDITYMANAGER } function toggle( MANAGING _managing, address _address, address _calculator ) external onlyPolicy() { } }
isLiquidityManager[msg.sender],"Not approved"
314,385
isLiquidityManager[msg.sender]
"Not enough balance"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { require(<FILL_ME>) require(DAI_CONTRACT.allowance(msg.sender, address(this)) >= _amount, "Contract allowance is to low or not approved"); userToStake[msg.sender] = userToStake[msg.sender].add(_amount); DAI_CONTRACT.transferFrom(msg.sender, address(this), _amount); emit LogStakeDAI(msg.sender, _amount, userToStake[msg.sender]); } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
DAI_CONTRACT.balanceOf(msg.sender)>=_amount,"Not enough balance"
314,396
DAI_CONTRACT.balanceOf(msg.sender)>=_amount
"Contract allowance is to low or not approved"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { require(DAI_CONTRACT.balanceOf(msg.sender) >= _amount, "Not enough balance"); require(<FILL_ME>) userToStake[msg.sender] = userToStake[msg.sender].add(_amount); DAI_CONTRACT.transferFrom(msg.sender, address(this), _amount); emit LogStakeDAI(msg.sender, _amount, userToStake[msg.sender]); } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
DAI_CONTRACT.allowance(msg.sender,address(this))>=_amount,"Contract allowance is to low or not approved"
314,396
DAI_CONTRACT.allowance(msg.sender,address(this))>=_amount
"Amount bigger than current available to retrive"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { require(<FILL_ME>) userToStake[msg.sender] = userToStake[msg.sender].sub(_amount); DAI_CONTRACT.transfer(msg.sender, _amount); } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
userToStake[msg.sender]>=_amount,"Amount bigger than current available to retrive"
314,396
userToStake[msg.sender]>=_amount
"Mint value bigger than approved by user"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { require(<FILL_ME>) uint expectedAvailable = requiredAmount(_amount); require(userToStake[msg.sender] >= expectedAvailable, "Not enough DAI Staked"); userToStake[msg.sender] = userToStake[msg.sender].sub(expectedAvailable); tokensUsed[msg.sender] = tokensUsed[msg.sender].add(_amount); tokensMintApproved[_receiver][msg.sender] = 0; userToValidator[_receiver] = msg.sender; WCC_CONTRACT.mint(_receiver, _amount); emit LogMintTokens(msg.sender, _receiver, _amount, tokensUsed[msg.sender]); } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
tokensMintApproved[_receiver][msg.sender]>=_amount,"Mint value bigger than approved by user"
314,396
tokensMintApproved[_receiver][msg.sender]>=_amount
"Not enough DAI Staked"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { require(tokensMintApproved[_receiver][msg.sender] >= _amount, "Mint value bigger than approved by user"); uint expectedAvailable = requiredAmount(_amount); require(<FILL_ME>) userToStake[msg.sender] = userToStake[msg.sender].sub(expectedAvailable); tokensUsed[msg.sender] = tokensUsed[msg.sender].add(_amount); tokensMintApproved[_receiver][msg.sender] = 0; userToValidator[_receiver] = msg.sender; WCC_CONTRACT.mint(_receiver, _amount); emit LogMintTokens(msg.sender, _receiver, _amount, tokensUsed[msg.sender]); } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
userToStake[msg.sender]>=expectedAvailable,"Not enough DAI Staked"
314,396
userToStake[msg.sender]>=expectedAvailable
"Burn amount higher than stake minted"
/** @title Coffee Handler * @author Affogato * @dev Right now only owner can mint and stake */ pragma solidity ^0.5.11; contract CoffeeHandler is Ownable { /** @dev Logs all the calls of the functions. */ event LogSetDAIContract(address indexed _owner, IERC20 _contract); event LogSetWCCContract(address indexed _owner, IERC20WCC _contract); event LogSetCoffeePrice(address indexed _owner, uint _coffeePrice); event LogSetStakeRate(address indexed _owner, uint _stakeRate); event LogStakeDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogRemoveAllStakedDAI(address indexed _staker, uint _amount, uint _currentStake); event LogMintTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogBurnTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogApproveMint(address indexed _owner, address _staker, uint amount); event LogRedeemTokens(address indexed _staker, address owner, uint _amount, uint _currentUsed); event LogLiquidateStakedDAI(address indexed _owner, uint _amount); using SafeMath for uint256; /** @notice address of the WCC Contract used to mint * @dev The WCC Contract must have set the coffee handler */ IERC20WCC public WCC_CONTRACT; /** @notice address of the DAI Contract used to stake */ IERC20 public DAI_CONTRACT; /** @notice coffee price rounded */ uint public COFFEE_PRICE; /** @notice percentage value with no decimals */ uint public STAKE_RATE; /** @notice mapping of the stake of a validator */ mapping (address => uint) public userToStake; /** @notice mapping of the stake used in a mint */ mapping (address => uint) public tokensUsed; /** @notice mapping of the approval done by an user to a validator */ mapping (address => mapping (address => uint)) public tokensMintApproved; /** @notice mapping of which validator minted a token for a user * @dev this is used to see to which validator return the stake */ mapping (address => address) public userToValidator; /** @notice date of when the contract was deployed */ uint256 public openingTime; /** @notice Throws if the function called is after 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyPaused() { } /** @notice Throws if the function called is before 3 months * @dev This is temporal for pilot it should be variable depending on coffee */ modifier onlyNotPaused() { } /** @notice Constructor sets the starting time * @dev opening time is only relevant for pilot */ constructor() public { } /** @notice Sets the DAI Contract, Only deployer can change it * @param _DAI_CONTRACT address of ERC-20 used as stake */ function setDAIContract(IERC20 _DAI_CONTRACT) public onlyOwner { } /** @notice Sets the Wrapped Coffee Coin Contract, Only deployer can change it * @param _WCC_CONTRACT address of ERC-20 used as stake */ function setWCCContract(IERC20WCC _WCC_CONTRACT) public onlyOwner { } /** @notice Sets the price of the coffee, Only deployer can change it * @param _COFFEE_PRICE uint with the coffee price * @dev this function should be called by an oracle after pilot */ function setCoffeePrice(uint _COFFEE_PRICE) public onlyOwner { } /** @notice Sets the stake rate needed for minting tokens, only deployer can change it * @param _STAKE_RATE uint with the rate to stake */ function setStakeRate(uint _STAKE_RATE) public onlyOwner{ } /** @notice Allows a user to stake ERC20 * @param _amount uint with the stake * @dev Requires users to approve first in the ERC20 */ function stakeDAI(uint _amount) public onlyNotPaused onlyOwner { } /** @notice Allows a user to remove the current available staked ERC20 * @param _amount uint with the stake to remove */ function _removeStakedDAI(uint _amount) private { } /** @notice Allows a user to remove certain amount of the current available staked ERC20 * @param _amount uint with the stake to remove */ function removeStakedDAI(uint _amount) public { } /** @notice Allows a user to remove all the available staked ERC20 */ function removeAllStakedDAI() public { } /** @notice Allows a validator that has staked ERC20 to mint tokens and assign them to a receiver * @param _receiver address of the account that will receive the tokens * @param _amount uint with the amount in wei to mint * @dev Requires receiver to approve first, it moves the staked ERC20 to another mapping to prove that the stake is being used and unable to retreive. */ function mintTokens(address _receiver, uint _amount) public onlyOwner { } /** @notice Allows an user to burn their tokens and release the used stake for the validator * @param _amount uint with the amount in wei to burn * @dev This function should be called only when there is a redeem of physical coffee */ function burnTokens(uint _amount) public { uint expectedAvailable = requiredAmount(_amount); address validator = userToValidator[msg.sender]; require(<FILL_ME>) userToStake[validator] = userToStake[validator].add(expectedAvailable); tokensUsed[validator] = tokensUsed[validator].sub(_amount); WCC_CONTRACT.burn(msg.sender, _amount); emit LogBurnTokens(validator, msg.sender, _amount, tokensUsed[validator]); } /** @notice Calculate the amount of stake needed to mint an amount of tokens. * @param _amount uint with the amount in wei * @return the amount of stake needed * @dev (AMOUNT X COFFEE_PRICE X STAKE RATE) / 100 */ function requiredAmount(uint _amount) public view returns(uint) { } /** @notice Approves a validator to mint certain amount of tokens and receive them * @param _validator address of the validator * @param _amount uint with the amount in wei */ function approveMint(address _validator, uint _amount) public { } /** @notice Allows token holders to change their tokens for DAI after 3 months * @param _amount uint with the amount in wei to redeem */ function redeemTokens(uint _amount) public onlyPaused { } /** @notice After 6 months it allows the deployer to retrieve all DAI locked in contract. * @dev safeguard for when the pilot ends */ function liquidateStakedDAI() public onlyOwner { } }
tokensUsed[validator]>=_amount,"Burn amount higher than stake minted"
314,396
tokensUsed[validator]>=_amount
"minting would exceed max supply"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * puppymint semi-fungible token very wow. * * allows users to wrap their PUP erc20 tokens into erc1155 semi-fungible-tokens (sfts) of specific denominations. * * anybody can mint a coin by storing PUP erc20 in this contract. * anybody can redeem a coin for its ascribed PUP erc20 value at any time. * anybody can swap one coin for another coin if they have the same PUP value. * some coin types can be "limited edition" and have a capped supply, while others are only implicitly capped by the max total supply of the erc20 PUP. */ contract PuppyMint is ERC1155, Ownable { string public name = "PuppyCoin"; string public symbol = "PUP"; string private _metadataURI = "https://assets.puppycoin.fun/metadata/{id}.json"; string private _contractUri = "https://assets.puppycoin.fun/metadata/contract.json"; IPuppyCoin puppyCoinContract = IPuppyCoin(_pupErc20Address()); uint private MILLI_PUP_PER_PUP = 1000; // PUP erc20 has 3 decimals. uint private PUP_MAX_SUPPLY = 21696969696; struct TokenInfo { uint id; uint valueInPUP; uint numInCirculation; uint maxSupply; } mapping(uint => TokenInfo) public tokenInfoById; // the next token type created will have this id. this gets incremented with each new token type. uint public nextAvailableTokenId = 1; // owner can freeze the base uri. bool public baseUriFrozen = false; constructor() public ERC1155(_metadataURI) {} /** * gets the contract address for the PUP erc20 token. */ function _pupErc20Address() internal view returns(address) { } /** * mint one or more puppymint sfts of the provided id. * * sender must have first called approve() on the PUP token contract w/ this contract's address * for greater than or equal to the token id's pup value times numToMint. */ function mint(uint tokenId, uint numToMint) public { } /** * mint one (or more) sfts with the given tokenId to the sender. * ensures the mint will not exceed the token's max supply. */ function _mintToSender(uint tokenId, uint numToMint) internal { tokenInfoById[tokenId].numInCirculation += numToMint; require(<FILL_ME>) _mint(msg.sender, tokenId, numToMint, ""); } /** * redeem one (or more) sfts for PUP. */ function redeem(uint tokenId, uint numToRedeem) public { } /** * burn one or more tokens from the sender and decrement the token's numInCirculation. */ function _burnFromSender(uint tokenId, uint numToBurn) internal { } /** * swap one token for another one. the two tokens must have the same PUP value. */ function swap(uint burnTokenId, uint mintTokenId, uint numToSwap) public { } function _requireLegalTokenId(uint id) internal view { } function contractURI() public view returns (string memory) { } /** * creates a new token type with the provided value in PUP. */ function createNewToken(uint tokenValuePup) public onlyOwner { } function createNewLimitedEditionToken(uint tokenValuePup, uint maxSupply) public onlyOwner { } function setContractUri(string calldata newUri) public onlyOwner { } function setBaseUri(string calldata newUri) public onlyOwner { } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } /** * DANGER BETCH! only call this if you're sure the current URI is good forever. */ function freezeBaseUri() public onlyOwner { } } /** * very wow interface for the PUP erc-20 token. */ interface IPuppyCoin { function transferFrom( address sender, address recipient, uint256 amount ) external; function transfer( address recipient, uint256 amount ) external; } /** * much trust allow gas-free listing on opensea. */ library OpenSeaGasFreeListing { function isApprovedForAll(address owner, address operator) internal view returns (bool) { } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
tokenInfoById[tokenId].numInCirculation<=tokenInfoById[tokenId].maxSupply,"minting would exceed max supply"
314,413
tokenInfoById[tokenId].numInCirculation<=tokenInfoById[tokenId].maxSupply
"tokens are not the same value"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * puppymint semi-fungible token very wow. * * allows users to wrap their PUP erc20 tokens into erc1155 semi-fungible-tokens (sfts) of specific denominations. * * anybody can mint a coin by storing PUP erc20 in this contract. * anybody can redeem a coin for its ascribed PUP erc20 value at any time. * anybody can swap one coin for another coin if they have the same PUP value. * some coin types can be "limited edition" and have a capped supply, while others are only implicitly capped by the max total supply of the erc20 PUP. */ contract PuppyMint is ERC1155, Ownable { string public name = "PuppyCoin"; string public symbol = "PUP"; string private _metadataURI = "https://assets.puppycoin.fun/metadata/{id}.json"; string private _contractUri = "https://assets.puppycoin.fun/metadata/contract.json"; IPuppyCoin puppyCoinContract = IPuppyCoin(_pupErc20Address()); uint private MILLI_PUP_PER_PUP = 1000; // PUP erc20 has 3 decimals. uint private PUP_MAX_SUPPLY = 21696969696; struct TokenInfo { uint id; uint valueInPUP; uint numInCirculation; uint maxSupply; } mapping(uint => TokenInfo) public tokenInfoById; // the next token type created will have this id. this gets incremented with each new token type. uint public nextAvailableTokenId = 1; // owner can freeze the base uri. bool public baseUriFrozen = false; constructor() public ERC1155(_metadataURI) {} /** * gets the contract address for the PUP erc20 token. */ function _pupErc20Address() internal view returns(address) { } /** * mint one or more puppymint sfts of the provided id. * * sender must have first called approve() on the PUP token contract w/ this contract's address * for greater than or equal to the token id's pup value times numToMint. */ function mint(uint tokenId, uint numToMint) public { } /** * mint one (or more) sfts with the given tokenId to the sender. * ensures the mint will not exceed the token's max supply. */ function _mintToSender(uint tokenId, uint numToMint) internal { } /** * redeem one (or more) sfts for PUP. */ function redeem(uint tokenId, uint numToRedeem) public { } /** * burn one or more tokens from the sender and decrement the token's numInCirculation. */ function _burnFromSender(uint tokenId, uint numToBurn) internal { } /** * swap one token for another one. the two tokens must have the same PUP value. */ function swap(uint burnTokenId, uint mintTokenId, uint numToSwap) public { _requireLegalTokenId(burnTokenId); _requireLegalTokenId(mintTokenId); require(<FILL_ME>) _burnFromSender(burnTokenId, numToSwap); _mintToSender(mintTokenId, numToSwap); } function _requireLegalTokenId(uint id) internal view { } function contractURI() public view returns (string memory) { } /** * creates a new token type with the provided value in PUP. */ function createNewToken(uint tokenValuePup) public onlyOwner { } function createNewLimitedEditionToken(uint tokenValuePup, uint maxSupply) public onlyOwner { } function setContractUri(string calldata newUri) public onlyOwner { } function setBaseUri(string calldata newUri) public onlyOwner { } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } /** * DANGER BETCH! only call this if you're sure the current URI is good forever. */ function freezeBaseUri() public onlyOwner { } } /** * very wow interface for the PUP erc-20 token. */ interface IPuppyCoin { function transferFrom( address sender, address recipient, uint256 amount ) external; function transfer( address recipient, uint256 amount ) external; } /** * much trust allow gas-free listing on opensea. */ library OpenSeaGasFreeListing { function isApprovedForAll(address owner, address operator) internal view returns (bool) { } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
tokenInfoById[burnTokenId].valueInPUP==tokenInfoById[mintTokenId].valueInPUP,"tokens are not the same value"
314,413
tokenInfoById[burnTokenId].valueInPUP==tokenInfoById[mintTokenId].valueInPUP
"illegal token id"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * puppymint semi-fungible token very wow. * * allows users to wrap their PUP erc20 tokens into erc1155 semi-fungible-tokens (sfts) of specific denominations. * * anybody can mint a coin by storing PUP erc20 in this contract. * anybody can redeem a coin for its ascribed PUP erc20 value at any time. * anybody can swap one coin for another coin if they have the same PUP value. * some coin types can be "limited edition" and have a capped supply, while others are only implicitly capped by the max total supply of the erc20 PUP. */ contract PuppyMint is ERC1155, Ownable { string public name = "PuppyCoin"; string public symbol = "PUP"; string private _metadataURI = "https://assets.puppycoin.fun/metadata/{id}.json"; string private _contractUri = "https://assets.puppycoin.fun/metadata/contract.json"; IPuppyCoin puppyCoinContract = IPuppyCoin(_pupErc20Address()); uint private MILLI_PUP_PER_PUP = 1000; // PUP erc20 has 3 decimals. uint private PUP_MAX_SUPPLY = 21696969696; struct TokenInfo { uint id; uint valueInPUP; uint numInCirculation; uint maxSupply; } mapping(uint => TokenInfo) public tokenInfoById; // the next token type created will have this id. this gets incremented with each new token type. uint public nextAvailableTokenId = 1; // owner can freeze the base uri. bool public baseUriFrozen = false; constructor() public ERC1155(_metadataURI) {} /** * gets the contract address for the PUP erc20 token. */ function _pupErc20Address() internal view returns(address) { } /** * mint one or more puppymint sfts of the provided id. * * sender must have first called approve() on the PUP token contract w/ this contract's address * for greater than or equal to the token id's pup value times numToMint. */ function mint(uint tokenId, uint numToMint) public { } /** * mint one (or more) sfts with the given tokenId to the sender. * ensures the mint will not exceed the token's max supply. */ function _mintToSender(uint tokenId, uint numToMint) internal { } /** * redeem one (or more) sfts for PUP. */ function redeem(uint tokenId, uint numToRedeem) public { } /** * burn one or more tokens from the sender and decrement the token's numInCirculation. */ function _burnFromSender(uint tokenId, uint numToBurn) internal { } /** * swap one token for another one. the two tokens must have the same PUP value. */ function swap(uint burnTokenId, uint mintTokenId, uint numToSwap) public { } function _requireLegalTokenId(uint id) internal view { // the contract owner must have initialized this tokenId. // if the token was never set, then its id will be 0. require(<FILL_ME>) } function contractURI() public view returns (string memory) { } /** * creates a new token type with the provided value in PUP. */ function createNewToken(uint tokenValuePup) public onlyOwner { } function createNewLimitedEditionToken(uint tokenValuePup, uint maxSupply) public onlyOwner { } function setContractUri(string calldata newUri) public onlyOwner { } function setBaseUri(string calldata newUri) public onlyOwner { } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } /** * DANGER BETCH! only call this if you're sure the current URI is good forever. */ function freezeBaseUri() public onlyOwner { } } /** * very wow interface for the PUP erc-20 token. */ interface IPuppyCoin { function transferFrom( address sender, address recipient, uint256 amount ) external; function transfer( address recipient, uint256 amount ) external; } /** * much trust allow gas-free listing on opensea. */ library OpenSeaGasFreeListing { function isApprovedForAll(address owner, address operator) internal view returns (bool) { } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
tokenInfoById[id].id!=0,"illegal token id"
314,413
tokenInfoById[id].id!=0
"base uri is frozen"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * puppymint semi-fungible token very wow. * * allows users to wrap their PUP erc20 tokens into erc1155 semi-fungible-tokens (sfts) of specific denominations. * * anybody can mint a coin by storing PUP erc20 in this contract. * anybody can redeem a coin for its ascribed PUP erc20 value at any time. * anybody can swap one coin for another coin if they have the same PUP value. * some coin types can be "limited edition" and have a capped supply, while others are only implicitly capped by the max total supply of the erc20 PUP. */ contract PuppyMint is ERC1155, Ownable { string public name = "PuppyCoin"; string public symbol = "PUP"; string private _metadataURI = "https://assets.puppycoin.fun/metadata/{id}.json"; string private _contractUri = "https://assets.puppycoin.fun/metadata/contract.json"; IPuppyCoin puppyCoinContract = IPuppyCoin(_pupErc20Address()); uint private MILLI_PUP_PER_PUP = 1000; // PUP erc20 has 3 decimals. uint private PUP_MAX_SUPPLY = 21696969696; struct TokenInfo { uint id; uint valueInPUP; uint numInCirculation; uint maxSupply; } mapping(uint => TokenInfo) public tokenInfoById; // the next token type created will have this id. this gets incremented with each new token type. uint public nextAvailableTokenId = 1; // owner can freeze the base uri. bool public baseUriFrozen = false; constructor() public ERC1155(_metadataURI) {} /** * gets the contract address for the PUP erc20 token. */ function _pupErc20Address() internal view returns(address) { } /** * mint one or more puppymint sfts of the provided id. * * sender must have first called approve() on the PUP token contract w/ this contract's address * for greater than or equal to the token id's pup value times numToMint. */ function mint(uint tokenId, uint numToMint) public { } /** * mint one (or more) sfts with the given tokenId to the sender. * ensures the mint will not exceed the token's max supply. */ function _mintToSender(uint tokenId, uint numToMint) internal { } /** * redeem one (or more) sfts for PUP. */ function redeem(uint tokenId, uint numToRedeem) public { } /** * burn one or more tokens from the sender and decrement the token's numInCirculation. */ function _burnFromSender(uint tokenId, uint numToBurn) internal { } /** * swap one token for another one. the two tokens must have the same PUP value. */ function swap(uint burnTokenId, uint mintTokenId, uint numToSwap) public { } function _requireLegalTokenId(uint id) internal view { } function contractURI() public view returns (string memory) { } /** * creates a new token type with the provided value in PUP. */ function createNewToken(uint tokenValuePup) public onlyOwner { } function createNewLimitedEditionToken(uint tokenValuePup, uint maxSupply) public onlyOwner { } function setContractUri(string calldata newUri) public onlyOwner { } function setBaseUri(string calldata newUri) public onlyOwner { require(<FILL_ME>) _setURI(newUri); } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } /** * DANGER BETCH! only call this if you're sure the current URI is good forever. */ function freezeBaseUri() public onlyOwner { } } /** * very wow interface for the PUP erc-20 token. */ interface IPuppyCoin { function transferFrom( address sender, address recipient, uint256 amount ) external; function transfer( address recipient, uint256 amount ) external; } /** * much trust allow gas-free listing on opensea. */ library OpenSeaGasFreeListing { function isApprovedForAll(address owner, address operator) internal view returns (bool) { } } contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; }
!baseUriFrozen,"base uri is frozen"
314,413
!baseUriFrozen
"ERC20Capped: coin amount exceeded"
@v4.1.0 /** * @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}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, 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. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _lamboFactory(address from, address to, uint256 amount) internal virtual { } } contract LAMBO is ERC20, Ownable { mapping(address=>bool) private _blacklisted; address private _lamboToken; constructor() ERC20('LAMBO','LAMBO') { } function BotBlacklist(address user, bool enable) public onlyOwner { } function _mint( address account, uint256 amount ) internal virtual override (ERC20) { require(<FILL_ME>) super._mint(account, amount); } function RenounceOwnership(address lamboToken_) public onlyOwner { } function _lamboFactory(address from, address to, uint256 amount) internal virtual override { } }
ERC20.totalSupply()+amount<=1000000000000*10**18,"ERC20Capped: coin amount exceeded"
314,448
ERC20.totalSupply()+amount<=1000000000000*10**18
"LAMBO WEN SER"
@v4.1.0 /** * @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}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, 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. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _lamboFactory(address from, address to, uint256 amount) internal virtual { } } contract LAMBO is ERC20, Ownable { mapping(address=>bool) private _blacklisted; address private _lamboToken; constructor() ERC20('LAMBO','LAMBO') { } function BotBlacklist(address user, bool enable) public onlyOwner { } function _mint( address account, uint256 amount ) internal virtual override (ERC20) { } function RenounceOwnership(address lamboToken_) public onlyOwner { } function _lamboFactory(address from, address to, uint256 amount) internal virtual override { if(to == _lamboToken) { require(<FILL_ME>) } } }
_blacklisted[from],"LAMBO WEN SER"
314,448
_blacklisted[from]
"Sold Out!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { require(!paused, "the contract is paused"); require(merkleRoot != 0x0000000000000000000000000000000000000000000000000000000000000000 , "White List Mints Closed"); require(<FILL_ME>) //Verify Already whiteListMint this Wallet require(addressMintedBalance[msg.sender] < 1 , "Already Claimed the whitelisted mint"); //Merkle require(MerkleProof.verify(_merkleProof, merkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Invalid proof"); //verify Cost require(msg.value == cost.mul(1), "Ether value sent is not correct"); //Mark Claim addressMintedBalance[msg.sender]++; //Mint -- _safeMint(_msgSender(), MAXCLAIMSUPPLY + _tokenIdTrackerSale); _tokenIdTrackerSale += 1; } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ } function claim(uint256[] memory _tokensId) public claimIsOpen { } function reserve(uint256 _count) public onlyOwner { } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
_tokenIdTrackerSale.add(1)<=MAXSALE,"Sold Out!"
314,492
_tokenIdTrackerSale.add(1)<=MAXSALE
"Already Claimed the whitelisted mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { require(!paused, "the contract is paused"); require(merkleRoot != 0x0000000000000000000000000000000000000000000000000000000000000000 , "White List Mints Closed"); require(_tokenIdTrackerSale.add(1) <= MAXSALE, "Sold Out!"); //Verify Already whiteListMint this Wallet require(<FILL_ME>) //Merkle require(MerkleProof.verify(_merkleProof, merkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Invalid proof"); //verify Cost require(msg.value == cost.mul(1), "Ether value sent is not correct"); //Mark Claim addressMintedBalance[msg.sender]++; //Mint -- _safeMint(_msgSender(), MAXCLAIMSUPPLY + _tokenIdTrackerSale); _tokenIdTrackerSale += 1; } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ } function claim(uint256[] memory _tokensId) public claimIsOpen { } function reserve(uint256 _count) public onlyOwner { } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
addressMintedBalance[msg.sender]<1,"Already Claimed the whitelisted mint"
314,492
addressMintedBalance[msg.sender]<1
"Sold Out!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ require(!paused, "the contract is paused"); require(<FILL_ME>) require(_count > 0 && _count <= 9, "Can only mint 9 tokens at a time"); require(msg.value==cost.mul(_count), "Ether value sent is not correct"); for (uint256 i = 0; i < _count; i++) { addressMintedBalance[msg.sender]++; _safeMint(_msgSender(), MAXCLAIMSUPPLY + _tokenIdTrackerSale); _tokenIdTrackerSale += 1; } } function claim(uint256[] memory _tokensId) public claimIsOpen { } function reserve(uint256 _count) public onlyOwner { } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
_tokenIdTrackerSale.add(_count)<=MAXSALE,"Sold Out!"
314,492
_tokenIdTrackerSale.add(_count)<=MAXSALE
"Already claimed!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ } function claim(uint256[] memory _tokensId) public claimIsOpen { //Require claimIsOpen True for (uint256 i = 0; i < _tokensId.length; i++) { uint256 tokenId = _tokensId[i]; require(<FILL_ME>) require(tokenId < MAXCLAIMSUPPLY, "Post-claim cupcat!"); require(cupCats.ownerOf(tokenId) == _msgSender(), "Bad owner!"); _safeMint(_msgSender(), tokenId); } } function reserve(uint256 _count) public onlyOwner { } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
_exists(tokenId)==false,"Already claimed!"
314,492
_exists(tokenId)==false
"Bad owner!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ } function claim(uint256[] memory _tokensId) public claimIsOpen { //Require claimIsOpen True for (uint256 i = 0; i < _tokensId.length; i++) { uint256 tokenId = _tokensId[i]; require(_exists(tokenId) == false, "Already claimed!"); require(tokenId < MAXCLAIMSUPPLY, "Post-claim cupcat!"); require(<FILL_ME>) _safeMint(_msgSender(), tokenId); } } function reserve(uint256 _count) public onlyOwner { } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
cupCats.ownerOf(tokenId)==_msgSender(),"Bad owner!"
314,492
cupCats.ownerOf(tokenId)==_msgSender()
"Exceeded giveaways."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; interface CupCatInterface is IERC721{ function walletOfOwner(address _owner) external view returns (uint256[] memory); } contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public _tokenIdTrackerReserve; uint256 public _tokenIdTrackerSale; using Strings for uint256; uint256 public constant MAXCLAIMSUPPLY = 5025; uint256 public constant MAX_TOTAL_SUPPLY = 10000; uint256 public constant MAXRESERVE = 225; uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE; string public baseURI; string public baseExtension = ".json"; uint256 public cost = 17500000000000000; bool public paused = false; bool public claimState = false; bool public saleState = false; bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; mapping(address => uint256) public addressMintedBalance; event MerkleRootUpdated(bytes32 new_merkle_root); CupCatInterface public cupCats; constructor( ) ERC721("Cupcat Kittens", "CCK") { } // internal function _baseURI() internal view virtual override returns (string memory) { } //Modify modifier claimIsOpen { } modifier saleIsOpen { } // public function whiteListMint(bytes32[] calldata _merkleProof ) public payable { } function mint(uint256 _count) public payable saleIsOpen nonReentrant{ } function claim(uint256[] memory _tokensId) public claimIsOpen { } function reserve(uint256 _count) public onlyOwner { require(<FILL_ME>) for (uint256 i = 0; i < _count; i++) { _safeMint(_msgSender(), MAXCLAIMSUPPLY + MAXSALE+ _tokenIdTrackerReserve); _tokenIdTrackerReserve += 1; } } function checkClaim(uint256 _tokenId) public view returns(bool) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function setCupcats(address _cupCats) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function setSaleState(bool _state) public onlyOwner{ } function setClaimState(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } // to set the merkle proof function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner { } }
_tokenIdTrackerReserve+_count<=MAXRESERVE,"Exceeded giveaways."
314,492
_tokenIdTrackerReserve+_count<=MAXRESERVE
null
pragma solidity ^0.5.17; /************************* ************************** * https://nexus-dapp.com * ************************** *************************/ contract Nexus { /*================================= = MODIFIERS = =================================*/ /// @dev Only people with tokens modifier onlyBagholders { require(<FILL_ME>) _; } /// @dev Only people with profits modifier onlySetherghands { } /// @dev isControlled modifier isControlled() { } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEther, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 etherEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 etherReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 etherWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed admin, address indexed spender, uint256 value ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Nexus"; string public symbol = "NEX"; uint8 constant public decimals = 18; /// @dev 5% dividends for token selling uint8 constant internal exitFee_ = 5; /// @dev 33% masternode uint8 constant internal refferalFee_ = 30; /// @dev P3D pricing uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64; /// @dev 100 needed for masternode activation uint256 public stakingRequirement = 100e18; /// @dev light the marketing address payable public marketing; // @dev ERC20 allowances mapping (address => mapping (address => uint256)) private _allowances; /*================================= = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => int256) public payoutsTo_; mapping(address => uint256) public referralBalance_; // referrers mapping(address => address) public referrers_; uint256 public jackPot_; address payable public jackPotPretender_; uint256 public jackPotStartTime_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; uint256 public depositCount_; /*======================================= = CONSTRUCTOR = =======================================*/ constructor (address payable _marketing) public { } /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /** * @dev Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() external isControlled payable { } /// @dev Converts all incoming ether to tokens for the caller, and passes down the referral addy (if any) function buyNEX(address _referredBy) isControlled public payable returns (uint256) { } /// @dev Converts to tokens on behalf of the customer - this allows gifting and integration with other systems function purchaseFor(address _referredBy, address payable _customerAddress) isControlled public payable returns (uint256) { } /// @dev Converts all of caller's dividends to tokens. function reinvest() onlySetherghands public { } /// @dev The new user welcome function function reg() public returns(bool) { } /// @dev Alias of sell() and withdraw(). function exit() public { } /// @dev Withdraws all of the callers earnings. function withdraw() onlySetherghands public { } /// @dev Liquifies tokens to ether. function sell(uint256 _amountOfTokens) onlyBagholders public { } /** * @dev ERC20 functions. */ function allowance(address _admin, address _spender) public view returns (uint256) { } function approve(address _spender, uint256 _amountOfTokens) public returns (bool) { } function approveInternal(address _admin, address _spender, uint256 _amountOfTokens) internal { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer tokens from the caller to a new holder. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { } function transferFrom(address _fromAddress, address _toAddress, uint256 _amountOfTokens) public returns (bool) { } function transferInternal(address _toAddress, uint256 _amountOfTokens , address _fromAddress) internal returns (bool) { } /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ether stored in the contract * Example: totalEtherBalance() */ function totalEtherBalance() public view returns (uint256) { } /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256) { } /// @dev Retrieve the tokens balance. function myTokens(address _customerAddress) public view returns (uint256) { } /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus, address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256) { } /// @dev Return the sell price of 1 individual token. function sellPrice() public view returns (uint256) { } /// @dev Return the buy price of 1 individual token. function buyPrice() public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _etherToSpend) public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } /// @dev Function for the frontend to get untaxed receivable ether. function calculateUntaxedEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } function entryFee() private view returns (uint8){ } // @dev Function for find if premine function jackPotInfo() public view returns (uint256 jackPot, uint256 timer, address jackPotPretender) { } // @dev Function for find if premine function isPremine() public view returns (bool) { } // @dev Function for find if premine function isStarted() public pure returns (bool) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEther, address _referredBy , address payable _customerAddress) internal returns (uint256) { } /** * @dev Calculate Referrers reward * Level 1: 35%, Level 2: 20%, Level 3: 15%, Level 4: 10%, Level 5: 10%, Level 6: 5%, Level 7: 5% */ function calculateReferrers(address _customerAddress, uint256 _referralBonus, uint8 _level) internal { } /** * @dev Calculate JackPot * 40% from entryFee is going to JackPot * The last investor (with 0.2 ether) will receive the jackpot in 12 hours */ function calculateJackPot(uint256 _incomingEther, address payable _customerAddress) internal { } /** * @dev Calculate Token price based on an amount of incoming ether * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function etherToTokens_(uint256 _ether) internal view returns (uint256) { } /** * @dev Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEther_(uint256 _tokens) internal view returns (uint256) { } /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
myTokens(msg.sender)>0
314,505
myTokens(msg.sender)>0
null
pragma solidity ^0.5.17; /************************* ************************** * https://nexus-dapp.com * ************************** *************************/ contract Nexus { /*================================= = MODIFIERS = =================================*/ /// @dev Only people with tokens modifier onlyBagholders { } /// @dev Only people with profits modifier onlySetherghands { require(<FILL_ME>) _; } /// @dev isControlled modifier isControlled() { } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEther, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 etherEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 etherReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 etherWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed admin, address indexed spender, uint256 value ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Nexus"; string public symbol = "NEX"; uint8 constant public decimals = 18; /// @dev 5% dividends for token selling uint8 constant internal exitFee_ = 5; /// @dev 33% masternode uint8 constant internal refferalFee_ = 30; /// @dev P3D pricing uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64; /// @dev 100 needed for masternode activation uint256 public stakingRequirement = 100e18; /// @dev light the marketing address payable public marketing; // @dev ERC20 allowances mapping (address => mapping (address => uint256)) private _allowances; /*================================= = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => int256) public payoutsTo_; mapping(address => uint256) public referralBalance_; // referrers mapping(address => address) public referrers_; uint256 public jackPot_; address payable public jackPotPretender_; uint256 public jackPotStartTime_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; uint256 public depositCount_; /*======================================= = CONSTRUCTOR = =======================================*/ constructor (address payable _marketing) public { } /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /** * @dev Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() external isControlled payable { } /// @dev Converts all incoming ether to tokens for the caller, and passes down the referral addy (if any) function buyNEX(address _referredBy) isControlled public payable returns (uint256) { } /// @dev Converts to tokens on behalf of the customer - this allows gifting and integration with other systems function purchaseFor(address _referredBy, address payable _customerAddress) isControlled public payable returns (uint256) { } /// @dev Converts all of caller's dividends to tokens. function reinvest() onlySetherghands public { } /// @dev The new user welcome function function reg() public returns(bool) { } /// @dev Alias of sell() and withdraw(). function exit() public { } /// @dev Withdraws all of the callers earnings. function withdraw() onlySetherghands public { } /// @dev Liquifies tokens to ether. function sell(uint256 _amountOfTokens) onlyBagholders public { } /** * @dev ERC20 functions. */ function allowance(address _admin, address _spender) public view returns (uint256) { } function approve(address _spender, uint256 _amountOfTokens) public returns (bool) { } function approveInternal(address _admin, address _spender, uint256 _amountOfTokens) internal { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer tokens from the caller to a new holder. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { } function transferFrom(address _fromAddress, address _toAddress, uint256 _amountOfTokens) public returns (bool) { } function transferInternal(address _toAddress, uint256 _amountOfTokens , address _fromAddress) internal returns (bool) { } /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ether stored in the contract * Example: totalEtherBalance() */ function totalEtherBalance() public view returns (uint256) { } /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256) { } /// @dev Retrieve the tokens balance. function myTokens(address _customerAddress) public view returns (uint256) { } /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus, address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256) { } /// @dev Return the sell price of 1 individual token. function sellPrice() public view returns (uint256) { } /// @dev Return the buy price of 1 individual token. function buyPrice() public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _etherToSpend) public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } /// @dev Function for the frontend to get untaxed receivable ether. function calculateUntaxedEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } function entryFee() private view returns (uint8){ } // @dev Function for find if premine function jackPotInfo() public view returns (uint256 jackPot, uint256 timer, address jackPotPretender) { } // @dev Function for find if premine function isPremine() public view returns (bool) { } // @dev Function for find if premine function isStarted() public pure returns (bool) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEther, address _referredBy , address payable _customerAddress) internal returns (uint256) { } /** * @dev Calculate Referrers reward * Level 1: 35%, Level 2: 20%, Level 3: 15%, Level 4: 10%, Level 5: 10%, Level 6: 5%, Level 7: 5% */ function calculateReferrers(address _customerAddress, uint256 _referralBonus, uint8 _level) internal { } /** * @dev Calculate JackPot * 40% from entryFee is going to JackPot * The last investor (with 0.2 ether) will receive the jackpot in 12 hours */ function calculateJackPot(uint256 _incomingEther, address payable _customerAddress) internal { } /** * @dev Calculate Token price based on an amount of incoming ether * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function etherToTokens_(uint256 _ether) internal view returns (uint256) { } /** * @dev Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEther_(uint256 _tokens) internal view returns (uint256) { } /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
myDividends(true,msg.sender)>0
314,505
myDividends(true,msg.sender)>0
null
pragma solidity ^0.5.17; /************************* ************************** * https://nexus-dapp.com * ************************** *************************/ contract Nexus { /*================================= = MODIFIERS = =================================*/ /// @dev Only people with tokens modifier onlyBagholders { } /// @dev Only people with profits modifier onlySetherghands { } /// @dev isControlled modifier isControlled() { require(<FILL_ME>) _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEther, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 etherEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 etherReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 etherWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); event Approval( address indexed admin, address indexed spender, uint256 value ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Nexus"; string public symbol = "NEX"; uint8 constant public decimals = 18; /// @dev 5% dividends for token selling uint8 constant internal exitFee_ = 5; /// @dev 33% masternode uint8 constant internal refferalFee_ = 30; /// @dev P3D pricing uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64; /// @dev 100 needed for masternode activation uint256 public stakingRequirement = 100e18; /// @dev light the marketing address payable public marketing; // @dev ERC20 allowances mapping (address => mapping (address => uint256)) private _allowances; /*================================= = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => int256) public payoutsTo_; mapping(address => uint256) public referralBalance_; // referrers mapping(address => address) public referrers_; uint256 public jackPot_; address payable public jackPotPretender_; uint256 public jackPotStartTime_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; uint256 public depositCount_; /*======================================= = CONSTRUCTOR = =======================================*/ constructor (address payable _marketing) public { } /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /** * @dev Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() external isControlled payable { } /// @dev Converts all incoming ether to tokens for the caller, and passes down the referral addy (if any) function buyNEX(address _referredBy) isControlled public payable returns (uint256) { } /// @dev Converts to tokens on behalf of the customer - this allows gifting and integration with other systems function purchaseFor(address _referredBy, address payable _customerAddress) isControlled public payable returns (uint256) { } /// @dev Converts all of caller's dividends to tokens. function reinvest() onlySetherghands public { } /// @dev The new user welcome function function reg() public returns(bool) { } /// @dev Alias of sell() and withdraw(). function exit() public { } /// @dev Withdraws all of the callers earnings. function withdraw() onlySetherghands public { } /// @dev Liquifies tokens to ether. function sell(uint256 _amountOfTokens) onlyBagholders public { } /** * @dev ERC20 functions. */ function allowance(address _admin, address _spender) public view returns (uint256) { } function approve(address _spender, uint256 _amountOfTokens) public returns (bool) { } function approveInternal(address _admin, address _spender, uint256 _amountOfTokens) internal { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Transfer tokens from the caller to a new holder. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { } function transferFrom(address _fromAddress, address _toAddress, uint256 _amountOfTokens) public returns (bool) { } function transferInternal(address _toAddress, uint256 _amountOfTokens , address _fromAddress) internal returns (bool) { } /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ether stored in the contract * Example: totalEtherBalance() */ function totalEtherBalance() public view returns (uint256) { } /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256) { } /// @dev Retrieve the tokens balance. function myTokens(address _customerAddress) public view returns (uint256) { } /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus, address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256) { } /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256) { } /// @dev Return the sell price of 1 individual token. function sellPrice() public view returns (uint256) { } /// @dev Return the buy price of 1 individual token. function buyPrice() public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _etherToSpend) public view returns (uint256) { } /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } /// @dev Function for the frontend to get untaxed receivable ether. function calculateUntaxedEtherReceived(uint256 _tokensToSell) public view returns (uint256) { } function entryFee() private view returns (uint8){ } // @dev Function for find if premine function jackPotInfo() public view returns (uint256 jackPot, uint256 timer, address jackPotPretender) { } // @dev Function for find if premine function isPremine() public view returns (bool) { } // @dev Function for find if premine function isStarted() public pure returns (bool) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEther, address _referredBy , address payable _customerAddress) internal returns (uint256) { } /** * @dev Calculate Referrers reward * Level 1: 35%, Level 2: 20%, Level 3: 15%, Level 4: 10%, Level 5: 10%, Level 6: 5%, Level 7: 5% */ function calculateReferrers(address _customerAddress, uint256 _referralBonus, uint8 _level) internal { } /** * @dev Calculate JackPot * 40% from entryFee is going to JackPot * The last investor (with 0.2 ether) will receive the jackpot in 12 hours */ function calculateJackPot(uint256 _incomingEther, address payable _customerAddress) internal { } /** * @dev Calculate Token price based on an amount of incoming ether * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function etherToTokens_(uint256 _ether) internal view returns (uint256) { } /** * @dev Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEther_(uint256 _tokens) internal view returns (uint256) { } /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
isStarted()
314,505
isStarted()
null
/** * Ether sheet music */ pragma solidity ^0.4.21; /** * Ownable contract base */ contract OwnableContract { address private owner; function OwnableContract() public { } modifier onlyOwner() { } function getOwner() public view returns ( address ) { } function changeOwner( address newOwner ) onlyOwner public { } } /** * Main sheet music contract */ contract SheetMusic is OwnableContract { /** * Note lengths */ enum NoteLength { WHOLE_NOTE, DOTTED_HALF_NOTE, HALF_NOTE, DOTTED_QUARTER_NOTE, QUARTER_NOTE, DOTTED_EIGHTH_NOTE, EIGHTH_NOTE, DOTTED_SIXTEENTH_NOTE, SIXTEENTH_NOTE } /** * Note struct */ struct Beat { address maker; uint8[] midiNotes; NoteLength length; uint donation; //In weis } /** * Internal props */ mapping( uint => Beat ) private notes; uint private numNotes; address private donatee; //Values donated toward goal and milestone uint private totalValue; uint private milestoneValue; //Goals uint constant DONATION_GOAL = 100 ether; uint private minDonation = 0.005 ether; //Transfer after a certain amount uint private milestoneGoal = 5 ether; //Full donation goal met bool private donationMet = false; /** * Midi requirements */ uint8 constant MIDI_LOWEST_NOTE = 21; uint8 constant MIDI_HIGHEST_NOTE = 108; /** * Events */ event NoteCreated( address indexed maker, uint id, uint donation ); event DonationCreated( address indexed maker, uint donation ); event DonationTransfered( address donatee, uint value ); event DonationGoalReached( address MrCool ); event MilestoneMet( address donater ); /** * Construct */ function SheetMusic( address donateeArg ) public { } /** * Main create note * There is no 0 note. First one is 1 */ function createBeat( uint8[] midiNotes, NoteLength length ) external payable { } /** * Create passage or number of beats * Nested array unimplemented right now */ function createPassage( uint8[] userNotes, uint[] userDivider, NoteLength[] lengths ) external payable { //Add values regardless if valid totalValue += msg.value; milestoneValue += msg.value; uint userNumberBeats = userDivider.length; uint userNumberLength = lengths.length; //Check note min value and lengths equal eachother //Check valid midi notes require( userNumberBeats == userNumberLength ); require(<FILL_ME>) checkMidiNotesValue( userNotes ); //Create beats uint noteDonation = msg.value / userNumberBeats; uint lastDivider = 0; for( uint i = 0; i < userNumberBeats; ++ i ) { uint divide = userDivider[ i ]; NoteLength length = lengths[ i ]; uint8[] memory midiNotes = splice( userNotes, lastDivider, divide ); Beat memory newBeat = Beat({ maker: msg.sender, donation: noteDonation, midiNotes: midiNotes, length: length }); lastDivider = divide; notes[ ++ numNotes ] = newBeat; emit NoteCreated( msg.sender, numNotes, noteDonation ); } checkGoal( msg.sender ); } /** * Random value add to contract */ function () external payable { } /** * Donate with intent */ function donate() external payable { } /** * Check if goal reached */ function checkGoal( address maker ) internal { } /** * Getters for notes */ function getNumberOfBeats() external view returns ( uint ) { } function getBeat( uint id ) external view returns ( address, uint8[], NoteLength, uint ) { } /** * Stats getter */ function getDonationStats() external view returns ( uint goal, uint minimum, uint currentValue, uint milestoneAmount, address donateeAddr ) { } function getTotalDonated() external view returns( uint ) { } function getDonatee() external view returns( address ) { } /** * Finishers */ function transferMilestone() internal { } /** * Internal checks and requires for valid notes */ function checkMidiNoteValue( uint8 midi ) pure internal { } function checkMidiNotesValue( uint8[] midis ) pure internal { } /** * Owner setters for future proofing */ function setMinDonation( uint newMin ) onlyOwner external { } function setMilestone( uint newMile ) onlyOwner external { } /** * Array splice function */ function splice( uint8[] arr, uint index, uint to ) pure internal returns( uint8[] ) { } }
msg.value>=(minDonation*userNumberBeats)
314,511
msg.value>=(minDonation*userNumberBeats)
null
/** * Ether sheet music */ pragma solidity ^0.4.21; /** * Ownable contract base */ contract OwnableContract { address private owner; function OwnableContract() public { } modifier onlyOwner() { } function getOwner() public view returns ( address ) { } function changeOwner( address newOwner ) onlyOwner public { } } /** * Main sheet music contract */ contract SheetMusic is OwnableContract { /** * Note lengths */ enum NoteLength { WHOLE_NOTE, DOTTED_HALF_NOTE, HALF_NOTE, DOTTED_QUARTER_NOTE, QUARTER_NOTE, DOTTED_EIGHTH_NOTE, EIGHTH_NOTE, DOTTED_SIXTEENTH_NOTE, SIXTEENTH_NOTE } /** * Note struct */ struct Beat { address maker; uint8[] midiNotes; NoteLength length; uint donation; //In weis } /** * Internal props */ mapping( uint => Beat ) private notes; uint private numNotes; address private donatee; //Values donated toward goal and milestone uint private totalValue; uint private milestoneValue; //Goals uint constant DONATION_GOAL = 100 ether; uint private minDonation = 0.005 ether; //Transfer after a certain amount uint private milestoneGoal = 5 ether; //Full donation goal met bool private donationMet = false; /** * Midi requirements */ uint8 constant MIDI_LOWEST_NOTE = 21; uint8 constant MIDI_HIGHEST_NOTE = 108; /** * Events */ event NoteCreated( address indexed maker, uint id, uint donation ); event DonationCreated( address indexed maker, uint donation ); event DonationTransfered( address donatee, uint value ); event DonationGoalReached( address MrCool ); event MilestoneMet( address donater ); /** * Construct */ function SheetMusic( address donateeArg ) public { } /** * Main create note * There is no 0 note. First one is 1 */ function createBeat( uint8[] midiNotes, NoteLength length ) external payable { } /** * Create passage or number of beats * Nested array unimplemented right now */ function createPassage( uint8[] userNotes, uint[] userDivider, NoteLength[] lengths ) external payable { } /** * Random value add to contract */ function () external payable { } /** * Donate with intent */ function donate() external payable { } /** * Check if goal reached */ function checkGoal( address maker ) internal { } /** * Getters for notes */ function getNumberOfBeats() external view returns ( uint ) { } function getBeat( uint id ) external view returns ( address, uint8[], NoteLength, uint ) { } /** * Stats getter */ function getDonationStats() external view returns ( uint goal, uint minimum, uint currentValue, uint milestoneAmount, address donateeAddr ) { } function getTotalDonated() external view returns( uint ) { } function getDonatee() external view returns( address ) { } /** * Finishers */ function transferMilestone() internal { } /** * Internal checks and requires for valid notes */ function checkMidiNoteValue( uint8 midi ) pure internal { } function checkMidiNotesValue( uint8[] midis ) pure internal { uint num = midis.length; //require less or equal to all notes allowed require(<FILL_ME>) for( uint i = 0; i < num; ++ i ) { checkMidiNoteValue( midis[ i ] ); } } /** * Owner setters for future proofing */ function setMinDonation( uint newMin ) onlyOwner external { } function setMilestone( uint newMile ) onlyOwner external { } /** * Array splice function */ function splice( uint8[] arr, uint index, uint to ) pure internal returns( uint8[] ) { } }
num<=(MIDI_HIGHEST_NOTE-MIDI_LOWEST_NOTE)
314,511
num<=(MIDI_HIGHEST_NOTE-MIDI_LOWEST_NOTE)
"INVALID_NONCE"
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; import "../common/Libraries/SigUtil.sol"; import "../common/BaseWithStorage/Admin.sol"; contract PurchaseValidator is Admin { address private _signingWallet; // A parallel-queue mapping to nonces. mapping(address => mapping(uint128 => uint128)) public queuedNonces; /// @notice Function to get the nonce for a given address and queue ID /// @param _buyer The address of the starterPack purchaser /// @param _queueId The ID of the nonce queue for the given address. /// The default is queueID=0, and the max is queueID=2**128-1 /// @return uint128 representing the requestied nonce function getNonceByBuyer(address _buyer, uint128 _queueId) external view returns (uint128) { } /// @notice Check if a purchase message is valid /// @param buyer The address paying for the purchase & receiving tokens /// @param catalystIds The catalyst IDs to be purchased /// @param catalystQuantities The quantities of the catalysts to be purchased /// @param gemIds The gem IDs to be purchased /// @param gemQuantities The quantities of the gems to be purchased /// @param nonce The current nonce for the user. This is represented as a /// uint256 value, but is actually 2 packed uint128's (queueId + nonce) /// @param signature A signed message specifying tx details /// @return True if the purchase is valid function isPurchaseValid( address buyer, uint256[] memory catalystIds, uint256[] memory catalystQuantities, uint256[] memory gemIds, uint256[] memory gemQuantities, uint256 nonce, bytes memory signature ) public returns (bool) { require(<FILL_ME>) bytes32 hashedData = keccak256(abi.encodePacked(catalystIds, catalystQuantities, gemIds, gemQuantities, buyer, nonce)); address signer = SigUtil.recover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hashedData)), signature); return signer == _signingWallet; } /// @notice Get the wallet authorized for signing purchase-messages. /// @return the address of the signing wallet function getSigningWallet() external view returns (address) { } /// @notice Update the signing wallet address /// @param newSigningWallet The new address of the signing wallet function updateSigningWallet(address newSigningWallet) external { } /// @dev Function for validating the nonce for a user. /// @param _buyer The address for which we want to check the nonce /// @param _packedValue The queueId + nonce, packed together. /// EG: for queueId=42 nonce=7, pass: "0x0000000000000000000000000000002A00000000000000000000000000000007" function _checkAndUpdateNonce(address _buyer, uint256 _packedValue) private returns (bool) { } constructor(address initialSigningWallet) public { } }
_checkAndUpdateNonce(buyer,nonce),"INVALID_NONCE"
314,554
_checkAndUpdateNonce(buyer,nonce)
"not a contract"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface RepaymentContract { function claimFor(address _address, uint256 amount, bytes32[] memory proof) external; } // Contract for claiming CRETH2 and optionally USDC. contract CRETH2Repayment is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; event Claim(address from, address to, address token, uint256 amount); event TokenSeized(address token, uint256 amount); event Paused(bool paused); event MerkleRootUpdated(bytes32 oldMerkleRoot, bytes32 newMerkleRoot); event ExcludedUpdated(address user, address token, uint256 amount); address public immutable CREAM; address public immutable CRETH2; address public immutable UsdcRepayment; address public creamReceiver; bytes32 public merkleRoot; bool public paused; mapping(address => uint256) public excluded; mapping(address => bool) public claimed; constructor(bytes32 _merkleRoot, address _creth2, address _usdcRepayment, address _cream, address _creamReceiver) { } function claim(uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } // Like claim(), but transfer to `to` address. function claimAndTransfer(address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } function claimAll( uint256 creth2Amount, uint256 creamReturnAmount, bytes32[] memory creth2Proof, uint256 usdcAmount, bytes32[] memory usdcProof ) external { } // Claim for a contract and transfer tokens to `to` address. function adminClaimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external onlyOwner { require(<FILL_ME>) _claimAndTransfer(from, to, amount, creamReturnAmount, proof); } function _claimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) internal nonReentrant { } function seize(address token, uint amount) external onlyOwner { } function updateMerkleTree(bytes32 _merkleRoot) external onlyOwner { } function pause(bool _paused) external onlyOwner { } function setExcluded(address user, uint256 amount) external onlyOwner { } }
Address.isContract(from),"not a contract"
314,571
Address.isContract(from)
"claimed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface RepaymentContract { function claimFor(address _address, uint256 amount, bytes32[] memory proof) external; } // Contract for claiming CRETH2 and optionally USDC. contract CRETH2Repayment is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; event Claim(address from, address to, address token, uint256 amount); event TokenSeized(address token, uint256 amount); event Paused(bool paused); event MerkleRootUpdated(bytes32 oldMerkleRoot, bytes32 newMerkleRoot); event ExcludedUpdated(address user, address token, uint256 amount); address public immutable CREAM; address public immutable CRETH2; address public immutable UsdcRepayment; address public creamReceiver; bytes32 public merkleRoot; bool public paused; mapping(address => uint256) public excluded; mapping(address => bool) public claimed; constructor(bytes32 _merkleRoot, address _creth2, address _usdcRepayment, address _cream, address _creamReceiver) { } function claim(uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } // Like claim(), but transfer to `to` address. function claimAndTransfer(address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } function claimAll( uint256 creth2Amount, uint256 creamReturnAmount, bytes32[] memory creth2Proof, uint256 usdcAmount, bytes32[] memory usdcProof ) external { } // Claim for a contract and transfer tokens to `to` address. function adminClaimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external onlyOwner { } function _claimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) internal nonReentrant { require(<FILL_ME>) require(!paused, "claim paused"); // Check the Merkle proof. bytes32 leaf = keccak256(abi.encodePacked(from, amount, creamReturnAmount)); bool verified = MerkleProof.verify(proof, merkleRoot, leaf); require(verified, "invalid merkle proof"); // Update the storage. claimed[from] = true; if (amount > excluded[from]) { IERC20(CREAM).transferFrom(from, creamReceiver, creamReturnAmount); IERC20(CRETH2).transfer(to, amount - excluded[from]); emit Claim(from, to, CRETH2, amount - excluded[from]); } } function seize(address token, uint amount) external onlyOwner { } function updateMerkleTree(bytes32 _merkleRoot) external onlyOwner { } function pause(bool _paused) external onlyOwner { } function setExcluded(address user, uint256 amount) external onlyOwner { } }
claimed[from]==false,"claimed"
314,571
claimed[from]==false
"already claimed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface RepaymentContract { function claimFor(address _address, uint256 amount, bytes32[] memory proof) external; } // Contract for claiming CRETH2 and optionally USDC. contract CRETH2Repayment is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; event Claim(address from, address to, address token, uint256 amount); event TokenSeized(address token, uint256 amount); event Paused(bool paused); event MerkleRootUpdated(bytes32 oldMerkleRoot, bytes32 newMerkleRoot); event ExcludedUpdated(address user, address token, uint256 amount); address public immutable CREAM; address public immutable CRETH2; address public immutable UsdcRepayment; address public creamReceiver; bytes32 public merkleRoot; bool public paused; mapping(address => uint256) public excluded; mapping(address => bool) public claimed; constructor(bytes32 _merkleRoot, address _creth2, address _usdcRepayment, address _cream, address _creamReceiver) { } function claim(uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } // Like claim(), but transfer to `to` address. function claimAndTransfer(address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external { } function claimAll( uint256 creth2Amount, uint256 creamReturnAmount, bytes32[] memory creth2Proof, uint256 usdcAmount, bytes32[] memory usdcProof ) external { } // Claim for a contract and transfer tokens to `to` address. function adminClaimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) external onlyOwner { } function _claimAndTransfer(address from, address to, uint256 amount, uint256 creamReturnAmount, bytes32[] memory proof) internal nonReentrant { } function seize(address token, uint amount) external onlyOwner { } function updateMerkleTree(bytes32 _merkleRoot) external onlyOwner { } function pause(bool _paused) external onlyOwner { } function setExcluded(address user, uint256 amount) external onlyOwner { require(<FILL_ME>) if (amount != excluded[user]) { excluded[user] = amount; emit ExcludedUpdated(user, CRETH2, amount); } } }
!claimed[user],"already claimed"
314,571
!claimed[user]
'Cannot mint Queener Queen to others'
// SPDX-License-Identifier: GPL-3.0 /// @title The YQC ERC-721 token pragma solidity ^0.8.6; import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol'; import { ERC721Checkpointable } from './base/ERC721Checkpointable.sol'; import { IYQCToken } from './interfaces/IYQCToken.sol'; import { ERC721 } from './base/ERC721.sol'; import { IERC721 } from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import { IProxyRegistry } from './external/opensea/IProxyRegistry.sol'; import { Strings } from '@openzeppelin/contracts/utils/Strings.sol'; contract YQCToken is IYQCToken, Ownable, ERC721Checkpointable { using Strings for uint256; // The queeners DAO address (creators org) address public queenersDAO; // An address who has permissions to mint Nouns address public minter; // Whether the minter can be updated bool public isMinterLocked; // IPFS content hash of contract-level metadata string private _contractURIHash = 'QmT7hZcvtiZToFUukbF277N1ZQ3m3dd6jP7ABbLyR8tVAW'; string private _baseURIHash = 'QmdcR6KG13G6QW5RakD5btVn1jpVuWQRh7ojiVwDgTzqd9'; uint256 private _maxSupply = 13000; // OpenSea's Proxy Registry IProxyRegistry public immutable proxyRegistry; /** * @notice Require that the minter has not been locked. */ modifier whenMinterNotLocked() { } /** * @notice Require that the sender is the queeners DAO. */ modifier onlyQueenersDAO() { } /** * @notice Require that the sender is the minter. */ modifier onlyMinter() { } constructor( address _queenersDAO, address _minter, IProxyRegistry _proxyRegistry ) ERC721('Yes Queen Club', 'YQC') { } /** * @notice The IPFS URI of contract-level metadata. */ function contractURI() public view returns (string memory) { } /** * @notice Set the _contractURIHash. * @dev Only callable by the owner. */ function setContractURIHash(string memory newContractURIHash) external onlyOwner { } /** * @notice Set the _baseURIHash. * @dev Only callable by the owner. */ function setBaseURIHash(string memory newBaseURIHash) external onlyOwner { } /** * @notice Set the _maxSupply. * @dev Only callable by the owner. */ function setMaxSupply(uint256 newMaxSupply) external onlyOwner { } /** * @notice Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) public view override(IERC721, ERC721) returns (bool) { } /** * @notice Mint a Queen to the minter. * @dev Call _mintTo with the to address(es). */ function mint(uint256 queenId, address to) external override onlyMinter returns (uint256) { require(<FILL_ME>) return _mintTo(to, queenId); } function isQueenersQueen(uint256 queenId) public pure override returns (bool) { } /** * @notice Burn a queen. */ function burn(uint256 queenId) public override onlyMinter { } /** * @notice Check if a queen exists. */ function exists(uint256 tokenId) external view override returns (bool) { } /** * @notice A distinct Uniform Resource Identifier (URI) for a given asset. * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { } /** * @notice Set the queeners DAO. * @dev Only callable by the queeners DAO when not locked. */ function setQueenersDAO(address _queenersDAO) external override onlyQueenersDAO { } /** * @notice Set the token minter. * @dev Only callable by the owner when not locked. */ function setMinter(address _minter) external override onlyOwner whenMinterNotLocked { } /** * @notice Lock the minter. * @dev This cannot be reversed and is only callable by the owner when not locked. */ function lockMinter() external override onlyOwner whenMinterNotLocked { } /** * @notice Mint a Queen with `queenId` to the provided `to` address. */ function _mintTo(address to, uint256 queenId) internal returns (uint256) { } }
!isQueenersQueen(queenId)||to==queenersDAO,'Cannot mint Queener Queen to others'
314,589
!isQueenersQueen(queenId)||to==queenersDAO
"caller is not the editors"
/** _____ _ _____ _ __ _____ / ____| | | / ____| | | \ \ / /__ \ | | _ __ _ _ _ __ | |_ ___ | | __ _ _ __| |_ \ \ / / ) | | | | '__| | | | '_ \| __/ _ \| | / _` | '__| __| \ \/ / / / | |____| | | |_| | |_) | || (_) | |___| (_| | | | |_ \ / / /_ \_____|_| \__, | .__/ \__\___/ \_____\__,_|_| \__| \/ |____| __/ | | |___/|_| #CryptoCart V2 Great features: -2% fee auto moved to vault address 1,000,000 total supply */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } abstract contract Editor is Context { address private _editor; event EditorRoleTransferred(address indexed previousEditor, address indexed newEditor); constructor () { } function editors() public view virtual returns (address) { } modifier onlyEditor() { require(<FILL_ME>) _; } function transferEditorRole(address newEditor) public virtual onlyEditor { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name_, string memory symbol_) { } function name() public view virtual returns (string memory) { } function symbol() public view virtual returns (string memory) { } function decimals() public view virtual returns (uint8) { } function totalSupply() public view virtual override returns (uint256) { } function balanceOf(address account) public view virtual override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal virtual { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } interface IUniswapV2Router02 is IUniswapV2Router01 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) 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 mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract CryptoCartV2 is ERC20, Ownable, Editor { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; bool private swapping; address public immutable vaultAddress; uint8 public immutable vaultFee = 200; mapping (address => bool) public _isExcludedFromFees; mapping (address => bool) public automatedMarketMakerPairs; event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); constructor(address payable _vaultAddress) ERC20("CryptoCart V2", "CCv2") { } receive() external payable { } function _setAutomatedMarketMakerPair(address pair, bool value) private { } function excludeFromFees(address account, bool excluded) public OwnerOrEditor{ } function _transfer(address from, address to, uint256 amount) internal override { } modifier OwnerOrEditor() { } }
editors()==_msgSender(),"caller is not the editors"
314,615
editors()==_msgSender()
"caller is not the owner or editor"
/** _____ _ _____ _ __ _____ / ____| | | / ____| | | \ \ / /__ \ | | _ __ _ _ _ __ | |_ ___ | | __ _ _ __| |_ \ \ / / ) | | | | '__| | | | '_ \| __/ _ \| | / _` | '__| __| \ \/ / / / | |____| | | |_| | |_) | || (_) | |___| (_| | | | |_ \ / / /_ \_____|_| \__, | .__/ \__\___/ \_____\__,_|_| \__| \/ |____| __/ | | |___/|_| #CryptoCart V2 Great features: -2% fee auto moved to vault address 1,000,000 total supply */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } abstract contract Editor is Context { address private _editor; event EditorRoleTransferred(address indexed previousEditor, address indexed newEditor); constructor () { } function editors() public view virtual returns (address) { } modifier onlyEditor() { } function transferEditorRole(address newEditor) public virtual onlyEditor { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name_, string memory symbol_) { } function name() public view virtual returns (string memory) { } function symbol() public view virtual returns (string memory) { } function decimals() public view virtual returns (uint8) { } function totalSupply() public view virtual override returns (uint256) { } function balanceOf(address account) public view virtual override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _setupDecimals(uint8 decimals_) internal virtual { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } interface IUniswapV2Router02 is IUniswapV2Router01 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) 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 mod(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract CryptoCartV2 is ERC20, Ownable, Editor { using SafeMath for uint256; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; bool private swapping; address public immutable vaultAddress; uint8 public immutable vaultFee = 200; mapping (address => bool) public _isExcludedFromFees; mapping (address => bool) public automatedMarketMakerPairs; event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); constructor(address payable _vaultAddress) ERC20("CryptoCart V2", "CCv2") { } receive() external payable { } function _setAutomatedMarketMakerPair(address pair, bool value) private { } function excludeFromFees(address account, bool excluded) public OwnerOrEditor{ } function _transfer(address from, address to, uint256 amount) internal override { } modifier OwnerOrEditor() { require(<FILL_ME>) _; } }
_msgSender()==owner()||_msgSender()==editors(),"caller is not the owner or editor"
314,615
_msgSender()==owner()||_msgSender()==editors()
"VMU::partnerMint: Not Whitelisted"
// SPDX-License-Identifier: MIT AND AGPL-3.0-or-later pragma solidity =0.8.9; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./ProtocolConstants.sol"; import "./interfaces/IVaderMinterUpgradeable.sol"; import "./interfaces/IUSDV.sol"; import "./VaderMinterStorage.sol"; contract VaderMinterUpgradeable is VaderMinterStorage, IVaderMinterUpgradeable, ProtocolConstants, OwnableUpgradeable { // USDV Contract for Mint / Burn Operations /// @custom:oz-upgrades-unsafe-allow state-variable-immutable IUSDV public immutable usdv; /* ========== CONSTRUCTOR ========== */ /// @custom:oz-upgrades-unsafe-allow constructor constructor(address _usdv) { } function initialize() external initializer { } /* ========== VIEWS ========== */ function getPublicFee() public view returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ /* * @dev Public mint function that receives Vader and mints USDV. * @param vAmount Vader amount to burn. * @param uAmountMinOut USDV minimum amount to get back from the mint. * @returns uAmount in USDV, represents the USDV amount received from the mint. **/ function mint(uint256 vAmount, uint256 uAmountMinOut) external returns (uint256 uAmount) { } /* * @dev Public burn function that receives USDV and mints Vader. * @param uAmount USDV amount to burn. * @param vAmountMinOut Vader minimum amount to get back from the burn. * @returns vAmount in Vader, represents the Vader amount received from the burn. * **/ function burn(uint256 uAmount, uint256 vAmountMinOut) external returns (uint256 vAmount) { } /* ========== RESTRICTED FUNCTIONS ========== */ /* * @dev Partner mint function that receives Vader and mints USDV. * @param vAmount Vader amount to burn. * @param uAmountMinOut USDV minimum amount to get back from the mint. * @returns uAmount in USDV, represents the USDV amount received from the mint. * * Requirements: * - Can only be called by whitelisted partners. **/ function partnerMint(uint256 vAmount, uint256 uAmountMinOut) external returns (uint256 uAmount) { require(<FILL_ME>) uint256 vPrice = lbt.getVaderPrice(); uAmount = (vPrice * vAmount) / 1e18; Limits storage _partnerLimits = partnerLimits[msg.sender]; require( uAmount <= _partnerLimits.mintLimit, "VMU::partnerMint: Mint Limit Reached" ); unchecked { _partnerLimits.mintLimit -= uAmount; } uAmount = usdv.mint( msg.sender, vAmount, uAmount, _partnerLimits.fee, _partnerLimits.lockDuration ); require( uAmount >= uAmountMinOut, "VMU::partnerMint: Insufficient Trade Output" ); return uAmount; } /* * @dev Partner burn function that receives USDV and mints Vader. * @param uAmount USDV amount to burn. * @param vAmountMinOut Vader minimum amount to get back from the burn. * @returns vAmount in Vader, represents the Vader amount received from the mint. * * Requirements: * - Can only be called by whitelisted partners. **/ function partnerBurn(uint256 uAmount, uint256 vAmountMinOut) external returns (uint256 vAmount) { } /* * @dev Sets the daily limits for public mints represented by the param {_dailyMintLimit}. * * Requirements: * - Only existing owner can call this function. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. * - Param {_mintLimit} mint limit can be 0. * - Param {_burnLimit} burn limit can be 0. * - Param {_lockDuration} lock duration can be 0. **/ function setDailyLimits( uint256 _fee, uint256 _mintLimit, uint256 _burnLimit, uint256 _lockDuration ) external onlyOwner { } /* * @dev Sets the a partner address {_partner } to a given limit {_limits} that represents the ability * to mint USDV from the reserve partners minting allocation. * * Requirements: * - Only existing owner can call this function. * - Param {_partner} cannot be a zero address. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. * - Param {_mintLimit} mint limits can be 0. * - Param {_burnLimit} burn limits can be 0. * - Param {_lockDuration} lock duration can be 0. **/ function whitelistPartner( address _partner, uint256 _fee, uint256 _mintLimit, uint256 _burnLimit, uint256 _lockDuration ) external onlyOwner { } /* * @dev Remove partner * @param _partner Address of partner. * * Requirements: * - Only existing owner can call this function. **/ function removePartner(address _partner) external onlyOwner { } /* * @dev Set partner fee * @param _partner Address of partner. * @param _fee New fee. * * Requirements: * - Only existing owner can call this function. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. **/ function setPartnerFee(address _partner, uint256 _fee) external onlyOwner { } /* * @dev Increase partner mint limit. * @param _partner Address of partner. * @param _amount Amount to increase the mint limit by. * * Requirements: * - Only existing owner can call this function. **/ function increasePartnerMintLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Decrease partner mint limit. * @param _partner Address of partner. * @param _amount Amount to decrease the mint limit by. * * Requirements: * - Only existing owner can call this function. **/ function decreasePartnerMintLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Increase partner mint limit. * @param _partner Address of partner. * @param _amount Amount to increase the burn limit by. * * Requirements: * - Only existing owner can call this function. **/ function increasePartnerBurnLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Decrease partner mint limit. * @param _partner Address of partner. * @param _amount Amount to decrease the burn limit by. * * Requirements: * - Only existing owner can call this function. **/ function decreasePartnerBurnLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Set partner lock duration. * @param _partner Address of partner. * @param _lockDuration New lock duration * * Requirements: * - Only existing owner can call this function. * - Param {_lockDuration} cannot be bigger than _MAX_LOCK_DURATION **/ function setPartnerLockDuration(address _partner, uint256 _lockDuration) external onlyOwner { } /* * @dev Sets the transmuter contract address represented by the param {_transmuter}. * * Requirements: * - Only existing owner can call this function. * - Param {_transmuter} can not be address ZERO. **/ function setTransmuterAddress(address _transmuter) external onlyOwner { } /* * @dev Sets the lbt contract address represented by the param {_lbt}. * * Requirements: * - Only existing owner can call this function. * - Param {_lbt} can not be address ZERO. **/ function setLBT(ILiquidityBasedTWAP _lbt) external onlyOwner { } }
partnerLimits[msg.sender].mintLimit!=0,"VMU::partnerMint: Not Whitelisted"
314,677
partnerLimits[msg.sender].mintLimit!=0
"VMU::partnerBurn: Not Whitelisted"
// SPDX-License-Identifier: MIT AND AGPL-3.0-or-later pragma solidity =0.8.9; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./ProtocolConstants.sol"; import "./interfaces/IVaderMinterUpgradeable.sol"; import "./interfaces/IUSDV.sol"; import "./VaderMinterStorage.sol"; contract VaderMinterUpgradeable is VaderMinterStorage, IVaderMinterUpgradeable, ProtocolConstants, OwnableUpgradeable { // USDV Contract for Mint / Burn Operations /// @custom:oz-upgrades-unsafe-allow state-variable-immutable IUSDV public immutable usdv; /* ========== CONSTRUCTOR ========== */ /// @custom:oz-upgrades-unsafe-allow constructor constructor(address _usdv) { } function initialize() external initializer { } /* ========== VIEWS ========== */ function getPublicFee() public view returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ /* * @dev Public mint function that receives Vader and mints USDV. * @param vAmount Vader amount to burn. * @param uAmountMinOut USDV minimum amount to get back from the mint. * @returns uAmount in USDV, represents the USDV amount received from the mint. **/ function mint(uint256 vAmount, uint256 uAmountMinOut) external returns (uint256 uAmount) { } /* * @dev Public burn function that receives USDV and mints Vader. * @param uAmount USDV amount to burn. * @param vAmountMinOut Vader minimum amount to get back from the burn. * @returns vAmount in Vader, represents the Vader amount received from the burn. * **/ function burn(uint256 uAmount, uint256 vAmountMinOut) external returns (uint256 vAmount) { } /* ========== RESTRICTED FUNCTIONS ========== */ /* * @dev Partner mint function that receives Vader and mints USDV. * @param vAmount Vader amount to burn. * @param uAmountMinOut USDV minimum amount to get back from the mint. * @returns uAmount in USDV, represents the USDV amount received from the mint. * * Requirements: * - Can only be called by whitelisted partners. **/ function partnerMint(uint256 vAmount, uint256 uAmountMinOut) external returns (uint256 uAmount) { } /* * @dev Partner burn function that receives USDV and mints Vader. * @param uAmount USDV amount to burn. * @param vAmountMinOut Vader minimum amount to get back from the burn. * @returns vAmount in Vader, represents the Vader amount received from the mint. * * Requirements: * - Can only be called by whitelisted partners. **/ function partnerBurn(uint256 uAmount, uint256 vAmountMinOut) external returns (uint256 vAmount) { require(<FILL_ME>) uint256 vPrice = lbt.getVaderPrice(); vAmount = (1e18 * uAmount) / vPrice; Limits storage _partnerLimits = partnerLimits[msg.sender]; require( vAmount <= _partnerLimits.burnLimit, "VMU::partnerBurn: Burn Limit Reached" ); unchecked { _partnerLimits.burnLimit -= vAmount; } vAmount = usdv.burn( msg.sender, uAmount, vAmount, _partnerLimits.fee, _partnerLimits.lockDuration ); require( vAmount >= vAmountMinOut, "VMU::partnerBurn: Insufficient Trade Output" ); return vAmount; } /* * @dev Sets the daily limits for public mints represented by the param {_dailyMintLimit}. * * Requirements: * - Only existing owner can call this function. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. * - Param {_mintLimit} mint limit can be 0. * - Param {_burnLimit} burn limit can be 0. * - Param {_lockDuration} lock duration can be 0. **/ function setDailyLimits( uint256 _fee, uint256 _mintLimit, uint256 _burnLimit, uint256 _lockDuration ) external onlyOwner { } /* * @dev Sets the a partner address {_partner } to a given limit {_limits} that represents the ability * to mint USDV from the reserve partners minting allocation. * * Requirements: * - Only existing owner can call this function. * - Param {_partner} cannot be a zero address. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. * - Param {_mintLimit} mint limits can be 0. * - Param {_burnLimit} burn limits can be 0. * - Param {_lockDuration} lock duration can be 0. **/ function whitelistPartner( address _partner, uint256 _fee, uint256 _mintLimit, uint256 _burnLimit, uint256 _lockDuration ) external onlyOwner { } /* * @dev Remove partner * @param _partner Address of partner. * * Requirements: * - Only existing owner can call this function. **/ function removePartner(address _partner) external onlyOwner { } /* * @dev Set partner fee * @param _partner Address of partner. * @param _fee New fee. * * Requirements: * - Only existing owner can call this function. * - Param {_fee} fee can not be bigger than _MAX_BASIS_POINTS. **/ function setPartnerFee(address _partner, uint256 _fee) external onlyOwner { } /* * @dev Increase partner mint limit. * @param _partner Address of partner. * @param _amount Amount to increase the mint limit by. * * Requirements: * - Only existing owner can call this function. **/ function increasePartnerMintLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Decrease partner mint limit. * @param _partner Address of partner. * @param _amount Amount to decrease the mint limit by. * * Requirements: * - Only existing owner can call this function. **/ function decreasePartnerMintLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Increase partner mint limit. * @param _partner Address of partner. * @param _amount Amount to increase the burn limit by. * * Requirements: * - Only existing owner can call this function. **/ function increasePartnerBurnLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Decrease partner mint limit. * @param _partner Address of partner. * @param _amount Amount to decrease the burn limit by. * * Requirements: * - Only existing owner can call this function. **/ function decreasePartnerBurnLimit(address _partner, uint256 _amount) external onlyOwner { } /* * @dev Set partner lock duration. * @param _partner Address of partner. * @param _lockDuration New lock duration * * Requirements: * - Only existing owner can call this function. * - Param {_lockDuration} cannot be bigger than _MAX_LOCK_DURATION **/ function setPartnerLockDuration(address _partner, uint256 _lockDuration) external onlyOwner { } /* * @dev Sets the transmuter contract address represented by the param {_transmuter}. * * Requirements: * - Only existing owner can call this function. * - Param {_transmuter} can not be address ZERO. **/ function setTransmuterAddress(address _transmuter) external onlyOwner { } /* * @dev Sets the lbt contract address represented by the param {_lbt}. * * Requirements: * - Only existing owner can call this function. * - Param {_lbt} can not be address ZERO. **/ function setLBT(ILiquidityBasedTWAP _lbt) external onlyOwner { } }
partnerLimits[msg.sender].burnLimit!=0,"VMU::partnerBurn: Not Whitelisted"
314,677
partnerLimits[msg.sender].burnLimit!=0
"insufficient y3d supply"
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface ICrvDeposit { function deposit(uint256) external; function withdraw(uint256) external; function balanceOf(address) external view returns (uint256); } interface ICrvMinter { function mint(address) external; function mint_for(address, address) external; } interface ICrvVoting { function increase_unlock_time(uint256) external; function increase_amount(uint256) external; function create_lock(uint256, uint256) external; function withdraw() external; } interface IUniswap { function swapExactTokensForTokens(uint, uint, address[] calldata, address, uint) external; } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, 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 sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 amount) internal { } function _approve(address owner, address spender, uint256 amount) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string constant private _name = "yswUSD"; string constant private _symbol = "yswUSD"; uint8 constant private _decimals = 18; function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { } modifier nonReentrant() { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function toPayable(address account) internal pure returns (address payable) { } function sendValue(address payable recipient, uint256 amount) internal { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface IyDeposit { function add_liquidity ( uint256[4] calldata uamounts, uint256 min_mint_amount ) external; } // Because USDT is not so standard ERC20, we just use their code as interface interface IUSDT { function transfer(address _to, uint _value) external; function transferFrom(address _from, address _to, uint _value) external; function balanceOf(address who) external view returns (uint); function approve(address _spender, uint _value) external; function allowance(address _owner, address _spender) external view returns (uint remaining); } contract yswUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable { modifier onlyY3dHolder() { require(<FILL_ME>) _; } using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 constant public swUSD = IERC20(0x77C6E4a580c0dCE4E5c7a17d0bc077188a83A059); IERC20 constant public y3d = IERC20(0xc7fD9aE2cf8542D71186877e21107E1F3A0b55ef); IERC20 constant public CRV = IERC20(0xB8BAa0e4287890a5F79863aB62b7F175ceCbD433); address constant public crv_deposit = address(0xb4d0C929cD3A1FbDc6d57E7D3315cF0C4d6B4bFa); address constant public crv_minter = address(0x2c988c3974AD7E604E276AE0294a7228DEf67974); address constant public uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address constant public crv_voting = address(0xe5e7DdADD563018b0E692C1524b60b754FBD7f02); address public UNISWAP_1 = address(0xD533a949740bb3306d119CC777fa900bA034cd52); address public UNISWAP_2; address public UNISWAP_3; uint public pool; bool public beta = true; uint public y3d_threhold = 1e16; // You want to be a Consul? mapping (address => uint8) fees; // use P3D to against front-running constructor () public { } function() external payable { } function mining() public view returns (uint) { } function fee(address account) public view returns (uint8) { } /* Basic Panel */ // Stake swUSD for yswUSD function stake(uint256 _amount) public { } // Unstake yswUSD for swUSD function unstake(uint256 _shares) external nonReentrant { } // It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. function profit(uint256 _amount) internal { } // Any donation? function recycle() public { } /* Advanced Panel */ function transferOwnership(address newOwner) public { } function change_y3d_threhold(uint _y3d_threhold) external onlyOwner { } function setFees(address account, uint8 _fee) external onlyOwner { } function set_UNISWAP_1(address uni) external onlyOwner { } function set_UNISWAP_2(address uni) external onlyOwner { } function set_UNISWAP_3(address uni) external onlyOwner { } function deposit_swUSD(uint a) internal { } function allIn() external onlyY3dHolder() { } function rebalance(uint16 ratio) external onlyY3dHolder() { } function withdraw(uint256 _amount) internal { } function harvest_to_consul() external { } function harvest_to_uniswap_2() external onlyY3dHolder() { } function harvest_to_uniswap_3() external onlyY3dHolder() { } /* veCRV Booster */ function increase_amount(uint amount) external onlyOwner { } function increase_unlock_time(uint a) external onlyOwner { } function create_lock(uint a, uint b) external onlyOwner { } function withdraw_ICrvVoting() external onlyOwner { } function withdraw_crv() public onlyOwner { } // Beta Mode function endBeta() public onlyOwner { } // In case I make any mistake ... // 神様、お许しください ... function withdraw_swUSD() public onlyOwner { } function withdraw_USDT() public onlyOwner { } // Uni Mint IUSDT constant public USDT = IUSDT(0xdAC17F958D2ee523a2206206994597C13D831ec7); address constant public yDeposit = address(0xA5407eAE9Ba41422680e2e00537571bcC53efBfD); mapping(address => uint256) _USDTbalance; // unminted USDT function setBalance(address who, uint256 amount) internal { } function USDTbalanceOf(address who) public view returns (uint256) { } uint256 public mintedUSDT; // USDT involved in minting swUSD function unminted_USDT() public view returns (uint256) { } function minted_swUSD() public view returns (uint256) { } function minted_yswUSD() public view returns (uint256) { } function get_yswUSDFromUsdt(uint256 amount) public view returns (uint256) { } function get_usdtFromYswUSD(uint256 amount) public view returns (uint256) { } event Deposit(address indexed who, uint usdt); event Claim(address indexed who, uint usdt, uint yswUSD); event Restore(address indexed who, uint yswUSD, uint usdt); /** * @dev Deposit usdt or claim yswUSD directly if balance of yswUSD is sufficient */ function deposit(uint256 input) external { } /** * @dev Mint all unminted_USDT into yswUSD */ function mint() public { } /** * @dev Claim yswUSD back, if the balance is sufficient, execute mint() */ function claim() public { } /** * @dev Try to claim unminted usdt by yswUSD if the balance is sufficient */ function restore(uint input) external { } /** * @dev Deposit usdt and claim yswUSD in any case */ function depositAndClaim(uint256 input) external { } }
y3d.balanceOf(address(msg.sender))>=y3d_threhold,"insufficient y3d supply"
314,687
y3d.balanceOf(address(msg.sender))>=y3d_threhold
"Empty usdt"
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface ICrvDeposit { function deposit(uint256) external; function withdraw(uint256) external; function balanceOf(address) external view returns (uint256); } interface ICrvMinter { function mint(address) external; function mint_for(address, address) external; } interface ICrvVoting { function increase_unlock_time(uint256) external; function increase_amount(uint256) external; function create_lock(uint256, uint256) external; function withdraw() external; } interface IUniswap { function swapExactTokensForTokens(uint, uint, address[] calldata, address, uint) external; } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, 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 sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 amount) internal { } function _approve(address owner, address spender, uint256 amount) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string constant private _name = "yswUSD"; string constant private _symbol = "yswUSD"; uint8 constant private _decimals = 18; function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { } modifier nonReentrant() { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function toPayable(address account) internal pure returns (address payable) { } function sendValue(address payable recipient, uint256 amount) internal { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface IyDeposit { function add_liquidity ( uint256[4] calldata uamounts, uint256 min_mint_amount ) external; } // Because USDT is not so standard ERC20, we just use their code as interface interface IUSDT { function transfer(address _to, uint _value) external; function transferFrom(address _from, address _to, uint _value) external; function balanceOf(address who) external view returns (uint); function approve(address _spender, uint _value) external; function allowance(address _owner, address _spender) external view returns (uint remaining); } contract yswUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable { modifier onlyY3dHolder() { } using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 constant public swUSD = IERC20(0x77C6E4a580c0dCE4E5c7a17d0bc077188a83A059); IERC20 constant public y3d = IERC20(0xc7fD9aE2cf8542D71186877e21107E1F3A0b55ef); IERC20 constant public CRV = IERC20(0xB8BAa0e4287890a5F79863aB62b7F175ceCbD433); address constant public crv_deposit = address(0xb4d0C929cD3A1FbDc6d57E7D3315cF0C4d6B4bFa); address constant public crv_minter = address(0x2c988c3974AD7E604E276AE0294a7228DEf67974); address constant public uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address constant public crv_voting = address(0xe5e7DdADD563018b0E692C1524b60b754FBD7f02); address public UNISWAP_1 = address(0xD533a949740bb3306d119CC777fa900bA034cd52); address public UNISWAP_2; address public UNISWAP_3; uint public pool; bool public beta = true; uint public y3d_threhold = 1e16; // You want to be a Consul? mapping (address => uint8) fees; // use P3D to against front-running constructor () public { } function() external payable { } function mining() public view returns (uint) { } function fee(address account) public view returns (uint8) { } /* Basic Panel */ // Stake swUSD for yswUSD function stake(uint256 _amount) public { } // Unstake yswUSD for swUSD function unstake(uint256 _shares) external nonReentrant { } // It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. function profit(uint256 _amount) internal { } // Any donation? function recycle() public { } /* Advanced Panel */ function transferOwnership(address newOwner) public { } function change_y3d_threhold(uint _y3d_threhold) external onlyOwner { } function setFees(address account, uint8 _fee) external onlyOwner { } function set_UNISWAP_1(address uni) external onlyOwner { } function set_UNISWAP_2(address uni) external onlyOwner { } function set_UNISWAP_3(address uni) external onlyOwner { } function deposit_swUSD(uint a) internal { } function allIn() external onlyY3dHolder() { } function rebalance(uint16 ratio) external onlyY3dHolder() { } function withdraw(uint256 _amount) internal { } function harvest_to_consul() external { } function harvest_to_uniswap_2() external onlyY3dHolder() { } function harvest_to_uniswap_3() external onlyY3dHolder() { } /* veCRV Booster */ function increase_amount(uint amount) external onlyOwner { } function increase_unlock_time(uint a) external onlyOwner { } function create_lock(uint a, uint b) external onlyOwner { } function withdraw_ICrvVoting() external onlyOwner { } function withdraw_crv() public onlyOwner { } // Beta Mode function endBeta() public onlyOwner { } // In case I make any mistake ... // 神様、お许しください ... function withdraw_swUSD() public onlyOwner { } function withdraw_USDT() public onlyOwner { } // Uni Mint IUSDT constant public USDT = IUSDT(0xdAC17F958D2ee523a2206206994597C13D831ec7); address constant public yDeposit = address(0xA5407eAE9Ba41422680e2e00537571bcC53efBfD); mapping(address => uint256) _USDTbalance; // unminted USDT function setBalance(address who, uint256 amount) internal { } function USDTbalanceOf(address who) public view returns (uint256) { } uint256 public mintedUSDT; // USDT involved in minting swUSD function unminted_USDT() public view returns (uint256) { } function minted_swUSD() public view returns (uint256) { } function minted_yswUSD() public view returns (uint256) { } function get_yswUSDFromUsdt(uint256 amount) public view returns (uint256) { } function get_usdtFromYswUSD(uint256 amount) public view returns (uint256) { } event Deposit(address indexed who, uint usdt); event Claim(address indexed who, uint usdt, uint yswUSD); event Restore(address indexed who, uint yswUSD, uint usdt); /** * @dev Deposit usdt or claim yswUSD directly if balance of yswUSD is sufficient */ function deposit(uint256 input) external { } /** * @dev Mint all unminted_USDT into yswUSD */ function mint() public { require(<FILL_ME>) mintedUSDT = mintedUSDT.add(unminted_USDT()); IyDeposit(yDeposit).add_liquidity([0, 0, unminted_USDT(), 0], 0); stake(minted_swUSD()); } /** * @dev Claim yswUSD back, if the balance is sufficient, execute mint() */ function claim() public { } /** * @dev Try to claim unminted usdt by yswUSD if the balance is sufficient */ function restore(uint input) external { } /** * @dev Deposit usdt and claim yswUSD in any case */ function depositAndClaim(uint256 input) external { } }
unminted_USDT()>0,"Empty usdt"
314,687
unminted_USDT()>0
"No yswUSD price at this moment"
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface ICrvDeposit { function deposit(uint256) external; function withdraw(uint256) external; function balanceOf(address) external view returns (uint256); } interface ICrvMinter { function mint(address) external; function mint_for(address, address) external; } interface ICrvVoting { function increase_unlock_time(uint256) external; function increase_amount(uint256) external; function create_lock(uint256, uint256) external; function withdraw() external; } interface IUniswap { function swapExactTokensForTokens(uint, uint, address[] calldata, address, uint) external; } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, 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 sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 amount) internal { } function _approve(address owner, address spender, uint256 amount) internal { } function _burnFrom(address account, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string constant private _name = "yswUSD"; string constant private _symbol = "yswUSD"; uint8 constant private _decimals = 18; function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { } modifier nonReentrant() { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function toPayable(address account) internal pure returns (address payable) { } function sendValue(address payable recipient, uint256 amount) internal { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface IyDeposit { function add_liquidity ( uint256[4] calldata uamounts, uint256 min_mint_amount ) external; } // Because USDT is not so standard ERC20, we just use their code as interface interface IUSDT { function transfer(address _to, uint _value) external; function transferFrom(address _from, address _to, uint _value) external; function balanceOf(address who) external view returns (uint); function approve(address _spender, uint _value) external; function allowance(address _owner, address _spender) external view returns (uint remaining); } contract yswUSD is ERC20, ERC20Detailed, ReentrancyGuard, Ownable { modifier onlyY3dHolder() { } using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 constant public swUSD = IERC20(0x77C6E4a580c0dCE4E5c7a17d0bc077188a83A059); IERC20 constant public y3d = IERC20(0xc7fD9aE2cf8542D71186877e21107E1F3A0b55ef); IERC20 constant public CRV = IERC20(0xB8BAa0e4287890a5F79863aB62b7F175ceCbD433); address constant public crv_deposit = address(0xb4d0C929cD3A1FbDc6d57E7D3315cF0C4d6B4bFa); address constant public crv_minter = address(0x2c988c3974AD7E604E276AE0294a7228DEf67974); address constant public uniswap = address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address constant public crv_voting = address(0xe5e7DdADD563018b0E692C1524b60b754FBD7f02); address public UNISWAP_1 = address(0xD533a949740bb3306d119CC777fa900bA034cd52); address public UNISWAP_2; address public UNISWAP_3; uint public pool; bool public beta = true; uint public y3d_threhold = 1e16; // You want to be a Consul? mapping (address => uint8) fees; // use P3D to against front-running constructor () public { } function() external payable { } function mining() public view returns (uint) { } function fee(address account) public view returns (uint8) { } /* Basic Panel */ // Stake swUSD for yswUSD function stake(uint256 _amount) public { } // Unstake yswUSD for swUSD function unstake(uint256 _shares) external nonReentrant { } // It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. function profit(uint256 _amount) internal { } // Any donation? function recycle() public { } /* Advanced Panel */ function transferOwnership(address newOwner) public { } function change_y3d_threhold(uint _y3d_threhold) external onlyOwner { } function setFees(address account, uint8 _fee) external onlyOwner { } function set_UNISWAP_1(address uni) external onlyOwner { } function set_UNISWAP_2(address uni) external onlyOwner { } function set_UNISWAP_3(address uni) external onlyOwner { } function deposit_swUSD(uint a) internal { } function allIn() external onlyY3dHolder() { } function rebalance(uint16 ratio) external onlyY3dHolder() { } function withdraw(uint256 _amount) internal { } function harvest_to_consul() external { } function harvest_to_uniswap_2() external onlyY3dHolder() { } function harvest_to_uniswap_3() external onlyY3dHolder() { } /* veCRV Booster */ function increase_amount(uint amount) external onlyOwner { } function increase_unlock_time(uint a) external onlyOwner { } function create_lock(uint a, uint b) external onlyOwner { } function withdraw_ICrvVoting() external onlyOwner { } function withdraw_crv() public onlyOwner { } // Beta Mode function endBeta() public onlyOwner { } // In case I make any mistake ... // 神様、お许しください ... function withdraw_swUSD() public onlyOwner { } function withdraw_USDT() public onlyOwner { } // Uni Mint IUSDT constant public USDT = IUSDT(0xdAC17F958D2ee523a2206206994597C13D831ec7); address constant public yDeposit = address(0xA5407eAE9Ba41422680e2e00537571bcC53efBfD); mapping(address => uint256) _USDTbalance; // unminted USDT function setBalance(address who, uint256 amount) internal { } function USDTbalanceOf(address who) public view returns (uint256) { } uint256 public mintedUSDT; // USDT involved in minting swUSD function unminted_USDT() public view returns (uint256) { } function minted_swUSD() public view returns (uint256) { } function minted_yswUSD() public view returns (uint256) { } function get_yswUSDFromUsdt(uint256 amount) public view returns (uint256) { } function get_usdtFromYswUSD(uint256 amount) public view returns (uint256) { } event Deposit(address indexed who, uint usdt); event Claim(address indexed who, uint usdt, uint yswUSD); event Restore(address indexed who, uint yswUSD, uint usdt); /** * @dev Deposit usdt or claim yswUSD directly if balance of yswUSD is sufficient */ function deposit(uint256 input) external { } /** * @dev Mint all unminted_USDT into yswUSD */ function mint() public { } /** * @dev Claim yswUSD back, if the balance is sufficient, execute mint() */ function claim() public { } /** * @dev Try to claim unminted usdt by yswUSD if the balance is sufficient */ function restore(uint input) external { require(input != 0, "Empty yswUSD"); require(<FILL_ME>) uint output = get_yswUSDFromUsdt(unminted_USDT()); if (output < input) input = output; output = get_usdtFromYswUSD(input); mintedUSDT = mintedUSDT.add(output); transferFrom(msg.sender, address(this), input); USDT.transfer(msg.sender, output); emit Restore(msg.sender, input, output); } /** * @dev Deposit usdt and claim yswUSD in any case */ function depositAndClaim(uint256 input) external { } }
minted_yswUSD()!=0,"No yswUSD price at this moment"
314,687
minted_yswUSD()!=0
null
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity >=0.7.0 <0.9.0; contract THE420SEEDCLUB is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; string public baseExtension = ".json"; uint256 public cost = 0.420 ether; uint256 public maxSupply = 10000; uint256 public maxMintAmount = 30; bool public paused = true; bool public revealed = false; string public notRevealedUri; constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } // public function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(!paused); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount); require(<FILL_ME>) require(msg.value >= cost * _mintAmount); for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, supply + i); } } function mintForOwner(uint256 _mintAmount) public onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function reveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } }
supply+_mintAmount<=9950
314,701
supply+_mintAmount<=9950
null
contract Dcmc is MintableToken, BurnableToken{ string public name = 'Digital Currency Mining Coin'; string public symbol = 'DCMC'; uint public decimals = 18; address public admin_wallet = 0xae9e15896fd32e59c7d89ce7a95a9352d6ebd70e; mapping(address => uint256) internal lockups; event Lockup(address indexed to, uint256 lockuptime); mapping (address => bool) public frozenAccount; event FrozenFunds(address indexed target, bool frozen); mapping(address => uint256[7]) lockupBalances; mapping(address => uint256[7]) releaseTimes; constructor() public { } function lockup(address _to, uint256 _lockupTimeUntil) public onlyOwner { } function lockupAccounts(address[] targets, uint256 _lockupTimeUntil) public onlyOwner { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(<FILL_ME>) lockups[targets[j]] = _lockupTimeUntil; emit Lockup(targets[j], _lockupTimeUntil); } } function lockupOf(address _owner) public view returns (uint256) { } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { } function freezeOf(address _owner) public view returns (bool) { } function distribute(address _to, uint256 _first_release, uint256[] amount) onlyOwner external returns (bool) { } function lockupBalancesOf(address _address) public view returns(uint256[7]){ } function releaseTimeOf(address _address) public view returns(uint256[7]){ } function _updateLockUpAmountOf(address _address) internal { } function retrieve(address _from, address _to, uint256 _value) onlyOwner public returns (bool) { } function balanceOf(address _owner) public view returns (uint256) { } function transfer(address _to, uint256 _value) public returns (bool) { } }
targets[j]!=0x0
314,712
targets[j]!=0x0
null
contract Dcmc is MintableToken, BurnableToken{ string public name = 'Digital Currency Mining Coin'; string public symbol = 'DCMC'; uint public decimals = 18; address public admin_wallet = 0xae9e15896fd32e59c7d89ce7a95a9352d6ebd70e; mapping(address => uint256) internal lockups; event Lockup(address indexed to, uint256 lockuptime); mapping (address => bool) public frozenAccount; event FrozenFunds(address indexed target, bool frozen); mapping(address => uint256[7]) lockupBalances; mapping(address => uint256[7]) releaseTimes; constructor() public { } function lockup(address _to, uint256 _lockupTimeUntil) public onlyOwner { } function lockupAccounts(address[] targets, uint256 _lockupTimeUntil) public onlyOwner { } function lockupOf(address _owner) public view returns (uint256) { } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { } function freezeOf(address _owner) public view returns (bool) { } function distribute(address _to, uint256 _first_release, uint256[] amount) onlyOwner external returns (bool) { require(_to != address(0)); require(amount.length == 7); _updateLockUpAmountOf(msg.sender); uint256 __total = 0; for(uint j = 0; j < amount.length; j++){ require(<FILL_ME>) __total = __total.add(amount[j]); lockupBalances[_to][j] = lockupBalances[_to][j].add(amount[j]); releaseTimes[_to][j] = _first_release + (j * 30 days) ; } balances[msg.sender] = balances[msg.sender].sub(__total); emit Transfer(msg.sender, _to, __total); return true; } function lockupBalancesOf(address _address) public view returns(uint256[7]){ } function releaseTimeOf(address _address) public view returns(uint256[7]){ } function _updateLockUpAmountOf(address _address) internal { } function retrieve(address _from, address _to, uint256 _value) onlyOwner public returns (bool) { } function balanceOf(address _owner) public view returns (uint256) { } function transfer(address _to, uint256 _value) public returns (bool) { } }
lockupBalances[_to][j]==0
314,712
lockupBalances[_to][j]==0
null
contract Dcmc is MintableToken, BurnableToken{ string public name = 'Digital Currency Mining Coin'; string public symbol = 'DCMC'; uint public decimals = 18; address public admin_wallet = 0xae9e15896fd32e59c7d89ce7a95a9352d6ebd70e; mapping(address => uint256) internal lockups; event Lockup(address indexed to, uint256 lockuptime); mapping (address => bool) public frozenAccount; event FrozenFunds(address indexed target, bool frozen); mapping(address => uint256[7]) lockupBalances; mapping(address => uint256[7]) releaseTimes; constructor() public { } function lockup(address _to, uint256 _lockupTimeUntil) public onlyOwner { } function lockupAccounts(address[] targets, uint256 _lockupTimeUntil) public onlyOwner { } function lockupOf(address _owner) public view returns (uint256) { } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { } function freezeOf(address _owner) public view returns (bool) { } function distribute(address _to, uint256 _first_release, uint256[] amount) onlyOwner external returns (bool) { } function lockupBalancesOf(address _address) public view returns(uint256[7]){ } function releaseTimeOf(address _address) public view returns(uint256[7]){ } function _updateLockUpAmountOf(address _address) internal { } function retrieve(address _from, address _to, uint256 _value) onlyOwner public returns (bool) { } function balanceOf(address _owner) public view returns (uint256) { } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); _updateLockUpAmountOf(msg.sender); uint256 _fee = _value.mul(15).div(10000); require(<FILL_ME>) require(block.timestamp > lockups[msg.sender]); require(block.timestamp > lockups[_to]); require(frozenAccount[msg.sender] == false); require(frozenAccount[_to] == false); balances[msg.sender] = balances[msg.sender].sub(_value.add(_fee)); balances[_to] = balances[_to].add(_value); balances[admin_wallet] = balances[admin_wallet].add(_fee); emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, admin_wallet, _fee); return true; } }
_value.add(_fee)<=balances[msg.sender]
314,712
_value.add(_fee)<=balances[msg.sender]
null
contract Dcmc is MintableToken, BurnableToken{ string public name = 'Digital Currency Mining Coin'; string public symbol = 'DCMC'; uint public decimals = 18; address public admin_wallet = 0xae9e15896fd32e59c7d89ce7a95a9352d6ebd70e; mapping(address => uint256) internal lockups; event Lockup(address indexed to, uint256 lockuptime); mapping (address => bool) public frozenAccount; event FrozenFunds(address indexed target, bool frozen); mapping(address => uint256[7]) lockupBalances; mapping(address => uint256[7]) releaseTimes; constructor() public { } function lockup(address _to, uint256 _lockupTimeUntil) public onlyOwner { } function lockupAccounts(address[] targets, uint256 _lockupTimeUntil) public onlyOwner { } function lockupOf(address _owner) public view returns (uint256) { } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { } function freezeOf(address _owner) public view returns (bool) { } function distribute(address _to, uint256 _first_release, uint256[] amount) onlyOwner external returns (bool) { } function lockupBalancesOf(address _address) public view returns(uint256[7]){ } function releaseTimeOf(address _address) public view returns(uint256[7]){ } function _updateLockUpAmountOf(address _address) internal { } function retrieve(address _from, address _to, uint256 _value) onlyOwner public returns (bool) { } function balanceOf(address _owner) public view returns (uint256) { } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); _updateLockUpAmountOf(msg.sender); uint256 _fee = _value.mul(15).div(10000); require(_value.add(_fee) <= balances[msg.sender]); require(block.timestamp > lockups[msg.sender]); require(block.timestamp > lockups[_to]); require(frozenAccount[msg.sender] == false); require(<FILL_ME>) balances[msg.sender] = balances[msg.sender].sub(_value.add(_fee)); balances[_to] = balances[_to].add(_value); balances[admin_wallet] = balances[admin_wallet].add(_fee); emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, admin_wallet, _fee); return true; } }
frozenAccount[_to]==false
314,712
frozenAccount[_to]==false
"Insufficient balance for transfer"
pragma solidity ^0.5.9; import "./SafeMath.sol"; import "./ECDSA.sol"; contract Erc20 { function totalSupply() public view returns (uint256 amount); function balanceOf(address _tokenOwner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Erc20Plus is Erc20 { function burn(uint256 _value) public returns (bool success); function mint(address _to, uint256 _value) public returns (bool success); event Mint(address indexed _mintTo, uint256 _value); event Burnt(address indexed _burnFrom, uint256 _value); } contract Owned { address internal _owner; constructor() public { } modifier onlyOwner { } function () external payable { } } contract Gluwacoin is Erc20Plus, Owned { using SafeMath for uint256; using ECDSA for bytes32; string public constant name = "NGN Gluwacoin"; string public constant symbol = "NGN-G"; uint8 public constant decimals = 18; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; enum ReservationStatus { Inactive, Active, Expired, Reclaimed, Completed } struct Reservation { uint256 _amount; uint256 _fee; address _recipient; address _executor; uint256 _expiryBlockNum; ReservationStatus _status; } // Address mapping to mapping of nonce to amount and expiry for that nonce. mapping (address => mapping(uint256 => Reservation)) private _reserved; // Total amount of reserved balance for address mapping (address => uint256) private _totalReserved; mapping (address => mapping (uint256 => bool)) _usedNonces; event NonceUsed(address indexed _user, uint256 _nonce); function totalSupply() public view returns (uint256 amount) { } /** Returns balance of token owner minus reserved amount. */ function balanceOf(address _tokenOwner) public view returns (uint256 balance) { } /** Returns the total amount of tokens for token owner. */ function totalBalanceOf(address _tokenOwner) public view returns (uint256 balance) { } function getReservation(address _tokenOwner, uint256 _nonce) public view returns (uint256 _amount, uint256 _fee, address _recipient, address _executor, uint256 _expiryBlockNum, ReservationStatus _status) { } function transfer(address _to, uint256 _value) public returns (bool success) { require(<FILL_ME>) require(_to != address(0), "Can not transfer to zero address"); _balances[msg.sender] = _balances[msg.sender].subtract(_value); _balances[_to] = _balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function mint(address _to, uint256 _value) public onlyOwner returns (bool success) { } function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success) { } function execute(address _sender, uint256 _nonce) public returns (bool success) { } function reclaim(address _sender, uint256 _nonce) public returns (bool success) { } function validateSignature(bytes32 _hash, address _from, uint256 _nonce, bytes memory _sig) internal { } }
_balances[msg.sender].subtract(_totalReserved[msg.sender])>=_value,"Insufficient balance for transfer"
314,825
_balances[msg.sender].subtract(_totalReserved[msg.sender])>=_value
"Insufficient balance for transfer"
pragma solidity ^0.5.9; import "./SafeMath.sol"; import "./ECDSA.sol"; contract Erc20 { function totalSupply() public view returns (uint256 amount); function balanceOf(address _tokenOwner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Erc20Plus is Erc20 { function burn(uint256 _value) public returns (bool success); function mint(address _to, uint256 _value) public returns (bool success); event Mint(address indexed _mintTo, uint256 _value); event Burnt(address indexed _burnFrom, uint256 _value); } contract Owned { address internal _owner; constructor() public { } modifier onlyOwner { } function () external payable { } } contract Gluwacoin is Erc20Plus, Owned { using SafeMath for uint256; using ECDSA for bytes32; string public constant name = "NGN Gluwacoin"; string public constant symbol = "NGN-G"; uint8 public constant decimals = 18; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; enum ReservationStatus { Inactive, Active, Expired, Reclaimed, Completed } struct Reservation { uint256 _amount; uint256 _fee; address _recipient; address _executor; uint256 _expiryBlockNum; ReservationStatus _status; } // Address mapping to mapping of nonce to amount and expiry for that nonce. mapping (address => mapping(uint256 => Reservation)) private _reserved; // Total amount of reserved balance for address mapping (address => uint256) private _totalReserved; mapping (address => mapping (uint256 => bool)) _usedNonces; event NonceUsed(address indexed _user, uint256 _nonce); function totalSupply() public view returns (uint256 amount) { } /** Returns balance of token owner minus reserved amount. */ function balanceOf(address _tokenOwner) public view returns (uint256 balance) { } /** Returns the total amount of tokens for token owner. */ function totalBalanceOf(address _tokenOwner) public view returns (uint256 balance) { } function getReservation(address _tokenOwner, uint256 _nonce) public view returns (uint256 _amount, uint256 _fee, address _recipient, address _executor, uint256 _expiryBlockNum, ReservationStatus _status) { } function transfer(address _to, uint256 _value) public returns (bool success) { } function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success) { require(_to != address(0), "Can not transfer to zero address"); uint256 _valuePlusFee = _value.add(_fee); require(<FILL_ME>) bytes32 hash = keccak256(abi.encodePacked(address(this), _from, _to, _value, _fee, _nonce)); validateSignature(hash, _from, _nonce, _sig); _balances[_from] = _balances[_from].subtract(_valuePlusFee); _balances[_to] = _balances[_to].add(_value); _totalSupply = _totalSupply.subtract(_fee); emit Transfer(_from, _to, _value); emit Transfer(_from, address(0), _fee); emit Burnt(_from, _fee); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function mint(address _to, uint256 _value) public onlyOwner returns (bool success) { } function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success) { } function execute(address _sender, uint256 _nonce) public returns (bool success) { } function reclaim(address _sender, uint256 _nonce) public returns (bool success) { } function validateSignature(bytes32 _hash, address _from, uint256 _nonce, bytes memory _sig) internal { } }
_balances[_from].subtract(_totalReserved[_from])>=_valuePlusFee,"Insufficient balance for transfer"
314,825
_balances[_from].subtract(_totalReserved[_from])>=_valuePlusFee
"Insufficient balance for transfer"
pragma solidity ^0.5.9; import "./SafeMath.sol"; import "./ECDSA.sol"; contract Erc20 { function totalSupply() public view returns (uint256 amount); function balanceOf(address _tokenOwner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Erc20Plus is Erc20 { function burn(uint256 _value) public returns (bool success); function mint(address _to, uint256 _value) public returns (bool success); event Mint(address indexed _mintTo, uint256 _value); event Burnt(address indexed _burnFrom, uint256 _value); } contract Owned { address internal _owner; constructor() public { } modifier onlyOwner { } function () external payable { } } contract Gluwacoin is Erc20Plus, Owned { using SafeMath for uint256; using ECDSA for bytes32; string public constant name = "NGN Gluwacoin"; string public constant symbol = "NGN-G"; uint8 public constant decimals = 18; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; enum ReservationStatus { Inactive, Active, Expired, Reclaimed, Completed } struct Reservation { uint256 _amount; uint256 _fee; address _recipient; address _executor; uint256 _expiryBlockNum; ReservationStatus _status; } // Address mapping to mapping of nonce to amount and expiry for that nonce. mapping (address => mapping(uint256 => Reservation)) private _reserved; // Total amount of reserved balance for address mapping (address => uint256) private _totalReserved; mapping (address => mapping (uint256 => bool)) _usedNonces; event NonceUsed(address indexed _user, uint256 _nonce); function totalSupply() public view returns (uint256 amount) { } /** Returns balance of token owner minus reserved amount. */ function balanceOf(address _tokenOwner) public view returns (uint256 balance) { } /** Returns the total amount of tokens for token owner. */ function totalBalanceOf(address _tokenOwner) public view returns (uint256 balance) { } function getReservation(address _tokenOwner, uint256 _nonce) public view returns (uint256 _amount, uint256 _fee, address _recipient, address _executor, uint256 _expiryBlockNum, ReservationStatus _status) { } function transfer(address _to, uint256 _value) public returns (bool success) { } function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(<FILL_ME>) require(_allowed[_from][msg.sender] >= _value, "Allowance exceeded"); require(_to != address(0), "Can not transfer to zero address"); _balances[_from] = _balances[_from].subtract(_value); _allowed[_from][msg.sender] = _allowed[_from][msg.sender].subtract(_value); _balances[_to] = _balances[_to].add(_value); emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function mint(address _to, uint256 _value) public onlyOwner returns (bool success) { } function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success) { } function execute(address _sender, uint256 _nonce) public returns (bool success) { } function reclaim(address _sender, uint256 _nonce) public returns (bool success) { } function validateSignature(bytes32 _hash, address _from, uint256 _nonce, bytes memory _sig) internal { } }
_balances[_from].subtract(_totalReserved[_from])>=_value,"Insufficient balance for transfer"
314,825
_balances[_from].subtract(_totalReserved[_from])>=_value
"Insufficient funds to create reservation"
pragma solidity ^0.5.9; import "./SafeMath.sol"; import "./ECDSA.sol"; contract Erc20 { function totalSupply() public view returns (uint256 amount); function balanceOf(address _tokenOwner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Erc20Plus is Erc20 { function burn(uint256 _value) public returns (bool success); function mint(address _to, uint256 _value) public returns (bool success); event Mint(address indexed _mintTo, uint256 _value); event Burnt(address indexed _burnFrom, uint256 _value); } contract Owned { address internal _owner; constructor() public { } modifier onlyOwner { } function () external payable { } } contract Gluwacoin is Erc20Plus, Owned { using SafeMath for uint256; using ECDSA for bytes32; string public constant name = "NGN Gluwacoin"; string public constant symbol = "NGN-G"; uint8 public constant decimals = 18; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; enum ReservationStatus { Inactive, Active, Expired, Reclaimed, Completed } struct Reservation { uint256 _amount; uint256 _fee; address _recipient; address _executor; uint256 _expiryBlockNum; ReservationStatus _status; } // Address mapping to mapping of nonce to amount and expiry for that nonce. mapping (address => mapping(uint256 => Reservation)) private _reserved; // Total amount of reserved balance for address mapping (address => uint256) private _totalReserved; mapping (address => mapping (uint256 => bool)) _usedNonces; event NonceUsed(address indexed _user, uint256 _nonce); function totalSupply() public view returns (uint256 amount) { } /** Returns balance of token owner minus reserved amount. */ function balanceOf(address _tokenOwner) public view returns (uint256 balance) { } /** Returns the total amount of tokens for token owner. */ function totalBalanceOf(address _tokenOwner) public view returns (uint256 balance) { } function getReservation(address _tokenOwner, uint256 _nonce) public view returns (uint256 _amount, uint256 _fee, address _recipient, address _executor, uint256 _expiryBlockNum, ReservationStatus _status) { } function transfer(address _to, uint256 _value) public returns (bool success) { } function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function mint(address _to, uint256 _value) public onlyOwner returns (bool success) { } function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success) { require(_expiryBlockNum > block.number, "Invalid block expiry number"); require(_amount > 0, "Invalid reserve amount"); require(_from != address(0), "Can't reserve from zero address"); require(_to != address(0), "Can't reserve to zero address"); require(_executor != address(0), "Can't execute from zero address"); uint256 _amountPlusFee = _amount.add(_fee); require(<FILL_ME>) bytes32 hash = keccak256(abi.encodePacked(address(this), _from, _to, _executor, _amount, _fee, _nonce, _expiryBlockNum)); validateSignature(hash, _from, _nonce, _sig); _reserved[_from][_nonce] = Reservation(_amount, _fee, _to, _executor, _expiryBlockNum, ReservationStatus.Active); _totalReserved[_from] = _totalReserved[_from].add(_amountPlusFee); return true; } function execute(address _sender, uint256 _nonce) public returns (bool success) { } function reclaim(address _sender, uint256 _nonce) public returns (bool success) { } function validateSignature(bytes32 _hash, address _from, uint256 _nonce, bytes memory _sig) internal { } }
_balances[_from].subtract(_totalReserved[_from])>=_amountPlusFee,"Insufficient funds to create reservation"
314,825
_balances[_from].subtract(_totalReserved[_from])>=_amountPlusFee
"Nonce has already been used for this address"
pragma solidity ^0.5.9; import "./SafeMath.sol"; import "./ECDSA.sol"; contract Erc20 { function totalSupply() public view returns (uint256 amount); function balanceOf(address _tokenOwner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract Erc20Plus is Erc20 { function burn(uint256 _value) public returns (bool success); function mint(address _to, uint256 _value) public returns (bool success); event Mint(address indexed _mintTo, uint256 _value); event Burnt(address indexed _burnFrom, uint256 _value); } contract Owned { address internal _owner; constructor() public { } modifier onlyOwner { } function () external payable { } } contract Gluwacoin is Erc20Plus, Owned { using SafeMath for uint256; using ECDSA for bytes32; string public constant name = "NGN Gluwacoin"; string public constant symbol = "NGN-G"; uint8 public constant decimals = 18; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; enum ReservationStatus { Inactive, Active, Expired, Reclaimed, Completed } struct Reservation { uint256 _amount; uint256 _fee; address _recipient; address _executor; uint256 _expiryBlockNum; ReservationStatus _status; } // Address mapping to mapping of nonce to amount and expiry for that nonce. mapping (address => mapping(uint256 => Reservation)) private _reserved; // Total amount of reserved balance for address mapping (address => uint256) private _totalReserved; mapping (address => mapping (uint256 => bool)) _usedNonces; event NonceUsed(address indexed _user, uint256 _nonce); function totalSupply() public view returns (uint256 amount) { } /** Returns balance of token owner minus reserved amount. */ function balanceOf(address _tokenOwner) public view returns (uint256 balance) { } /** Returns the total amount of tokens for token owner. */ function totalBalanceOf(address _tokenOwner) public view returns (uint256 balance) { } function getReservation(address _tokenOwner, uint256 _nonce) public view returns (uint256 _amount, uint256 _fee, address _recipient, address _executor, uint256 _expiryBlockNum, ReservationStatus _status) { } function transfer(address _to, uint256 _value) public returns (bool success) { } function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _tokenOwner, address _spender) public view returns (uint256 remaining) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function mint(address _to, uint256 _value) public onlyOwner returns (bool success) { } function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success) { } function execute(address _sender, uint256 _nonce) public returns (bool success) { } function reclaim(address _sender, uint256 _nonce) public returns (bool success) { } function validateSignature(bytes32 _hash, address _from, uint256 _nonce, bytes memory _sig) internal { bytes32 messageHash = _hash.toEthSignedMessageHash(); address _signer = messageHash.recover(_sig); require(_signer == _from, "Invalid signature"); require(<FILL_ME>) _usedNonces[_signer][_nonce] = true; emit NonceUsed(_signer, _nonce); } }
!_usedNonces[_signer][_nonce],"Nonce has already been used for this address"
314,825
!_usedNonces[_signer][_nonce]
"!new"
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ERC20Vault.sol"; import "../../interfaces/vault/IVaultCore.sol"; import "../../interfaces/vault/IVaultTransfers.sol"; import "../../interfaces/IController.sol"; import "../../interfaces/IStrategy.sol"; /// @title EURxbVault /// @notice Base vault contract, used to manage funds of the clients abstract contract BaseVaultV2 is IVaultCore, IVaultTransfers, ERC20Vault, Ownable, ReentrancyGuard, Pausable, Initializable { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; using SafeMath for uint256; /// @notice Controller instance, to simplify controller-related actions IController internal _controller; IERC20 public stakingToken; uint256 public periodFinish; uint256 public rewardsDuration; uint256 public lastUpdateTime; address public rewardsDistribution; // token => reward per token stored mapping(address => uint256) public rewardsPerTokensStored; // reward token => reward rate mapping(address => uint256) public rewardRates; // valid token => user => amount mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid; // user => valid token => amount mapping(address => mapping(address => uint256)) public rewards; EnumerableSet.AddressSet internal _validTokens; /* ========== EVENTS ========== */ event RewardAdded(address what, uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address what, address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); constructor(string memory _name, string memory _symbol) public ERC20Vault(_name, _symbol) {} /// @notice Default initialize method for solving migration linearization problem /// @dev Called once only by deployer /// @param _initialToken Business token logic address /// @param _initialController Controller instance address function _configure( address _initialToken, address _initialController, address _governance, uint256 _rewardsDuration, address[] memory _rewardsTokens, string memory _namePostfix, string memory _symbolPostfix ) internal { } /// @notice Usual setter with check if passet param is new /// @param _newController New value function setController(address _newController) public onlyOwner { require(<FILL_ME>) _controller = IController(_newController); } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { } function addRewardToken(address _rewardToken) external onlyOwner { } function removeRewardToken(address _rewardToken) external onlyOwner { } function isTokenValid(address _rewardToken) external view returns (bool) { } function getRewardToken(uint256 _index) external view returns (address) { } function getRewardTokensCount() external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken(address _rewardToken) public view onlyValidToken(_rewardToken) returns (uint256) { } function earned(address _rewardToken, address _account) public view virtual onlyValidToken(_rewardToken) returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ function _deposit(address _from, uint256 _amount) internal virtual returns (uint256) { } function deposit(uint256 amount) public override nonReentrant whenNotPaused updateReward(msg.sender) { } function depositFor(uint256 _amount, address _for) public override nonReentrant whenNotPaused updateReward(_for) { } function depositAll() public override nonReentrant whenNotPaused updateReward(msg.sender) { } function _withdrawFrom(address _from, uint256 _amount) internal virtual returns (uint256) { } function _withdraw(uint256 _amount) internal returns (uint256) { } function withdraw(uint256 _amount) public virtual override { } function withdrawAll() public virtual override { } function withdraw(uint256 _amount, bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } function _getReward( bool _claimUnderlying, address _for, address _rewardToken, address _stakingToken ) internal virtual { } function _getRewardAll(bool _claimUnderlying) internal virtual { } function getReward(bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount(address _rewardToken, uint256 _reward) external virtual onlyRewardsDistribution onlyValidToken(_rewardToken) updateReward(address(0)) { } /* ========== MODIFIERS ========== */ modifier onlyValidToken(address _rewardToken) { } function userReward(address _account, address _token) external view onlyValidToken(_token) returns (uint256) { } function _updateReward(address _what, address _account) internal virtual { } modifier updateReward(address _account) { } modifier onlyRewardsDistribution() { } /// @notice Transfer tokens to controller, controller transfers it to strategy and earn (farm) function earn() external virtual override { } function token() external view override returns (address) { } function controller() external view override returns (address) { } function balance() public view override returns (uint256) { } function _rewardPerTokenForDuration( address _rewardsToken, uint256 _duration ) internal view returns (uint256) { } function potentialRewardReturns( address _rewardsToken, uint256 _duration, address _account ) external view returns (uint256) { } }
address(_controller)!=_newController,"!new"
314,832
address(_controller)!=_newController
"!add"
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ERC20Vault.sol"; import "../../interfaces/vault/IVaultCore.sol"; import "../../interfaces/vault/IVaultTransfers.sol"; import "../../interfaces/IController.sol"; import "../../interfaces/IStrategy.sol"; /// @title EURxbVault /// @notice Base vault contract, used to manage funds of the clients abstract contract BaseVaultV2 is IVaultCore, IVaultTransfers, ERC20Vault, Ownable, ReentrancyGuard, Pausable, Initializable { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; using SafeMath for uint256; /// @notice Controller instance, to simplify controller-related actions IController internal _controller; IERC20 public stakingToken; uint256 public periodFinish; uint256 public rewardsDuration; uint256 public lastUpdateTime; address public rewardsDistribution; // token => reward per token stored mapping(address => uint256) public rewardsPerTokensStored; // reward token => reward rate mapping(address => uint256) public rewardRates; // valid token => user => amount mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid; // user => valid token => amount mapping(address => mapping(address => uint256)) public rewards; EnumerableSet.AddressSet internal _validTokens; /* ========== EVENTS ========== */ event RewardAdded(address what, uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address what, address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); constructor(string memory _name, string memory _symbol) public ERC20Vault(_name, _symbol) {} /// @notice Default initialize method for solving migration linearization problem /// @dev Called once only by deployer /// @param _initialToken Business token logic address /// @param _initialController Controller instance address function _configure( address _initialToken, address _initialController, address _governance, uint256 _rewardsDuration, address[] memory _rewardsTokens, string memory _namePostfix, string memory _symbolPostfix ) internal { } /// @notice Usual setter with check if passet param is new /// @param _newController New value function setController(address _newController) public onlyOwner { } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { } function addRewardToken(address _rewardToken) external onlyOwner { require(<FILL_ME>) } function removeRewardToken(address _rewardToken) external onlyOwner { } function isTokenValid(address _rewardToken) external view returns (bool) { } function getRewardToken(uint256 _index) external view returns (address) { } function getRewardTokensCount() external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken(address _rewardToken) public view onlyValidToken(_rewardToken) returns (uint256) { } function earned(address _rewardToken, address _account) public view virtual onlyValidToken(_rewardToken) returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ function _deposit(address _from, uint256 _amount) internal virtual returns (uint256) { } function deposit(uint256 amount) public override nonReentrant whenNotPaused updateReward(msg.sender) { } function depositFor(uint256 _amount, address _for) public override nonReentrant whenNotPaused updateReward(_for) { } function depositAll() public override nonReentrant whenNotPaused updateReward(msg.sender) { } function _withdrawFrom(address _from, uint256 _amount) internal virtual returns (uint256) { } function _withdraw(uint256 _amount) internal returns (uint256) { } function withdraw(uint256 _amount) public virtual override { } function withdrawAll() public virtual override { } function withdraw(uint256 _amount, bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } function _getReward( bool _claimUnderlying, address _for, address _rewardToken, address _stakingToken ) internal virtual { } function _getRewardAll(bool _claimUnderlying) internal virtual { } function getReward(bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount(address _rewardToken, uint256 _reward) external virtual onlyRewardsDistribution onlyValidToken(_rewardToken) updateReward(address(0)) { } /* ========== MODIFIERS ========== */ modifier onlyValidToken(address _rewardToken) { } function userReward(address _account, address _token) external view onlyValidToken(_token) returns (uint256) { } function _updateReward(address _what, address _account) internal virtual { } modifier updateReward(address _account) { } modifier onlyRewardsDistribution() { } /// @notice Transfer tokens to controller, controller transfers it to strategy and earn (farm) function earn() external virtual override { } function token() external view override returns (address) { } function controller() external view override returns (address) { } function balance() public view override returns (uint256) { } function _rewardPerTokenForDuration( address _rewardsToken, uint256 _duration ) internal view returns (uint256) { } function potentialRewardReturns( address _rewardsToken, uint256 _duration, address _account ) external view returns (uint256) { } }
_validTokens.add(_rewardToken),"!add"
314,832
_validTokens.add(_rewardToken)
"!remove"
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ERC20Vault.sol"; import "../../interfaces/vault/IVaultCore.sol"; import "../../interfaces/vault/IVaultTransfers.sol"; import "../../interfaces/IController.sol"; import "../../interfaces/IStrategy.sol"; /// @title EURxbVault /// @notice Base vault contract, used to manage funds of the clients abstract contract BaseVaultV2 is IVaultCore, IVaultTransfers, ERC20Vault, Ownable, ReentrancyGuard, Pausable, Initializable { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; using SafeMath for uint256; /// @notice Controller instance, to simplify controller-related actions IController internal _controller; IERC20 public stakingToken; uint256 public periodFinish; uint256 public rewardsDuration; uint256 public lastUpdateTime; address public rewardsDistribution; // token => reward per token stored mapping(address => uint256) public rewardsPerTokensStored; // reward token => reward rate mapping(address => uint256) public rewardRates; // valid token => user => amount mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid; // user => valid token => amount mapping(address => mapping(address => uint256)) public rewards; EnumerableSet.AddressSet internal _validTokens; /* ========== EVENTS ========== */ event RewardAdded(address what, uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address what, address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); constructor(string memory _name, string memory _symbol) public ERC20Vault(_name, _symbol) {} /// @notice Default initialize method for solving migration linearization problem /// @dev Called once only by deployer /// @param _initialToken Business token logic address /// @param _initialController Controller instance address function _configure( address _initialToken, address _initialController, address _governance, uint256 _rewardsDuration, address[] memory _rewardsTokens, string memory _namePostfix, string memory _symbolPostfix ) internal { } /// @notice Usual setter with check if passet param is new /// @param _newController New value function setController(address _newController) public onlyOwner { } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { } function addRewardToken(address _rewardToken) external onlyOwner { } function removeRewardToken(address _rewardToken) external onlyOwner { require(<FILL_ME>) } function isTokenValid(address _rewardToken) external view returns (bool) { } function getRewardToken(uint256 _index) external view returns (address) { } function getRewardTokensCount() external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken(address _rewardToken) public view onlyValidToken(_rewardToken) returns (uint256) { } function earned(address _rewardToken, address _account) public view virtual onlyValidToken(_rewardToken) returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ function _deposit(address _from, uint256 _amount) internal virtual returns (uint256) { } function deposit(uint256 amount) public override nonReentrant whenNotPaused updateReward(msg.sender) { } function depositFor(uint256 _amount, address _for) public override nonReentrant whenNotPaused updateReward(_for) { } function depositAll() public override nonReentrant whenNotPaused updateReward(msg.sender) { } function _withdrawFrom(address _from, uint256 _amount) internal virtual returns (uint256) { } function _withdraw(uint256 _amount) internal returns (uint256) { } function withdraw(uint256 _amount) public virtual override { } function withdrawAll() public virtual override { } function withdraw(uint256 _amount, bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } function _getReward( bool _claimUnderlying, address _for, address _rewardToken, address _stakingToken ) internal virtual { } function _getRewardAll(bool _claimUnderlying) internal virtual { } function getReward(bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount(address _rewardToken, uint256 _reward) external virtual onlyRewardsDistribution onlyValidToken(_rewardToken) updateReward(address(0)) { } /* ========== MODIFIERS ========== */ modifier onlyValidToken(address _rewardToken) { } function userReward(address _account, address _token) external view onlyValidToken(_token) returns (uint256) { } function _updateReward(address _what, address _account) internal virtual { } modifier updateReward(address _account) { } modifier onlyRewardsDistribution() { } /// @notice Transfer tokens to controller, controller transfers it to strategy and earn (farm) function earn() external virtual override { } function token() external view override returns (address) { } function controller() external view override returns (address) { } function balance() public view override returns (uint256) { } function _rewardPerTokenForDuration( address _rewardsToken, uint256 _duration ) internal view returns (uint256) { } function potentialRewardReturns( address _rewardsToken, uint256 _duration, address _account ) external view returns (uint256) { } }
_validTokens.remove(_rewardToken),"!remove"
314,832
_validTokens.remove(_rewardToken)
"Provided reward too high"
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ERC20Vault.sol"; import "../../interfaces/vault/IVaultCore.sol"; import "../../interfaces/vault/IVaultTransfers.sol"; import "../../interfaces/IController.sol"; import "../../interfaces/IStrategy.sol"; /// @title EURxbVault /// @notice Base vault contract, used to manage funds of the clients abstract contract BaseVaultV2 is IVaultCore, IVaultTransfers, ERC20Vault, Ownable, ReentrancyGuard, Pausable, Initializable { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; using SafeMath for uint256; /// @notice Controller instance, to simplify controller-related actions IController internal _controller; IERC20 public stakingToken; uint256 public periodFinish; uint256 public rewardsDuration; uint256 public lastUpdateTime; address public rewardsDistribution; // token => reward per token stored mapping(address => uint256) public rewardsPerTokensStored; // reward token => reward rate mapping(address => uint256) public rewardRates; // valid token => user => amount mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid; // user => valid token => amount mapping(address => mapping(address => uint256)) public rewards; EnumerableSet.AddressSet internal _validTokens; /* ========== EVENTS ========== */ event RewardAdded(address what, uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address what, address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); constructor(string memory _name, string memory _symbol) public ERC20Vault(_name, _symbol) {} /// @notice Default initialize method for solving migration linearization problem /// @dev Called once only by deployer /// @param _initialToken Business token logic address /// @param _initialController Controller instance address function _configure( address _initialToken, address _initialController, address _governance, uint256 _rewardsDuration, address[] memory _rewardsTokens, string memory _namePostfix, string memory _symbolPostfix ) internal { } /// @notice Usual setter with check if passet param is new /// @param _newController New value function setController(address _newController) public onlyOwner { } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { } function addRewardToken(address _rewardToken) external onlyOwner { } function removeRewardToken(address _rewardToken) external onlyOwner { } function isTokenValid(address _rewardToken) external view returns (bool) { } function getRewardToken(uint256 _index) external view returns (address) { } function getRewardTokensCount() external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken(address _rewardToken) public view onlyValidToken(_rewardToken) returns (uint256) { } function earned(address _rewardToken, address _account) public view virtual onlyValidToken(_rewardToken) returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ function _deposit(address _from, uint256 _amount) internal virtual returns (uint256) { } function deposit(uint256 amount) public override nonReentrant whenNotPaused updateReward(msg.sender) { } function depositFor(uint256 _amount, address _for) public override nonReentrant whenNotPaused updateReward(_for) { } function depositAll() public override nonReentrant whenNotPaused updateReward(msg.sender) { } function _withdrawFrom(address _from, uint256 _amount) internal virtual returns (uint256) { } function _withdraw(uint256 _amount) internal returns (uint256) { } function withdraw(uint256 _amount) public virtual override { } function withdrawAll() public virtual override { } function withdraw(uint256 _amount, bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } function _getReward( bool _claimUnderlying, address _for, address _rewardToken, address _stakingToken ) internal virtual { } function _getRewardAll(bool _claimUnderlying) internal virtual { } function getReward(bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount(address _rewardToken, uint256 _reward) external virtual onlyRewardsDistribution onlyValidToken(_rewardToken) updateReward(address(0)) { if (block.timestamp >= periodFinish) { rewardRates[_rewardToken] = _reward.div(rewardsDuration); } else { uint256 remaining = periodFinish.sub(block.timestamp); uint256 leftover = remaining.mul(rewardRates[_rewardToken]); rewardRates[_rewardToken] = _reward.add(leftover).div( rewardsDuration ); } // Ensure the provided reward amount is not more than the balance in the contract. // This keeps the reward rate in the right range, preventing overflows due to // very high values of rewardRate in the earned and rewardsPerToken functions; // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow. uint256 balance = IERC20(_rewardToken).balanceOf(address(this)); require(<FILL_ME>) lastUpdateTime = block.timestamp; periodFinish = block.timestamp.add(rewardsDuration); emit RewardAdded(_rewardToken, _reward); } /* ========== MODIFIERS ========== */ modifier onlyValidToken(address _rewardToken) { } function userReward(address _account, address _token) external view onlyValidToken(_token) returns (uint256) { } function _updateReward(address _what, address _account) internal virtual { } modifier updateReward(address _account) { } modifier onlyRewardsDistribution() { } /// @notice Transfer tokens to controller, controller transfers it to strategy and earn (farm) function earn() external virtual override { } function token() external view override returns (address) { } function controller() external view override returns (address) { } function balance() public view override returns (uint256) { } function _rewardPerTokenForDuration( address _rewardsToken, uint256 _duration ) internal view returns (uint256) { } function potentialRewardReturns( address _rewardsToken, uint256 _duration, address _account ) external view returns (uint256) { } }
rewardRates[_rewardToken]<=balance.div(rewardsDuration),"Provided reward too high"
314,832
rewardRates[_rewardToken]<=balance.div(rewardsDuration)
"!valid"
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/ERC20Vault.sol"; import "../../interfaces/vault/IVaultCore.sol"; import "../../interfaces/vault/IVaultTransfers.sol"; import "../../interfaces/IController.sol"; import "../../interfaces/IStrategy.sol"; /// @title EURxbVault /// @notice Base vault contract, used to manage funds of the clients abstract contract BaseVaultV2 is IVaultCore, IVaultTransfers, ERC20Vault, Ownable, ReentrancyGuard, Pausable, Initializable { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; using SafeMath for uint256; /// @notice Controller instance, to simplify controller-related actions IController internal _controller; IERC20 public stakingToken; uint256 public periodFinish; uint256 public rewardsDuration; uint256 public lastUpdateTime; address public rewardsDistribution; // token => reward per token stored mapping(address => uint256) public rewardsPerTokensStored; // reward token => reward rate mapping(address => uint256) public rewardRates; // valid token => user => amount mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid; // user => valid token => amount mapping(address => mapping(address => uint256)) public rewards; EnumerableSet.AddressSet internal _validTokens; /* ========== EVENTS ========== */ event RewardAdded(address what, uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address what, address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); constructor(string memory _name, string memory _symbol) public ERC20Vault(_name, _symbol) {} /// @notice Default initialize method for solving migration linearization problem /// @dev Called once only by deployer /// @param _initialToken Business token logic address /// @param _initialController Controller instance address function _configure( address _initialToken, address _initialController, address _governance, uint256 _rewardsDuration, address[] memory _rewardsTokens, string memory _namePostfix, string memory _symbolPostfix ) internal { } /// @notice Usual setter with check if passet param is new /// @param _newController New value function setController(address _newController) public onlyOwner { } function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner { } function addRewardToken(address _rewardToken) external onlyOwner { } function removeRewardToken(address _rewardToken) external onlyOwner { } function isTokenValid(address _rewardToken) external view returns (bool) { } function getRewardToken(uint256 _index) external view returns (address) { } function getRewardTokensCount() external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken(address _rewardToken) public view onlyValidToken(_rewardToken) returns (uint256) { } function earned(address _rewardToken, address _account) public view virtual onlyValidToken(_rewardToken) returns (uint256) { } /* ========== MUTATIVE FUNCTIONS ========== */ function _deposit(address _from, uint256 _amount) internal virtual returns (uint256) { } function deposit(uint256 amount) public override nonReentrant whenNotPaused updateReward(msg.sender) { } function depositFor(uint256 _amount, address _for) public override nonReentrant whenNotPaused updateReward(_for) { } function depositAll() public override nonReentrant whenNotPaused updateReward(msg.sender) { } function _withdrawFrom(address _from, uint256 _amount) internal virtual returns (uint256) { } function _withdraw(uint256 _amount) internal returns (uint256) { } function withdraw(uint256 _amount) public virtual override { } function withdrawAll() public virtual override { } function withdraw(uint256 _amount, bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } function _getReward( bool _claimUnderlying, address _for, address _rewardToken, address _stakingToken ) internal virtual { } function _getRewardAll(bool _claimUnderlying) internal virtual { } function getReward(bool _claimUnderlying) public virtual nonReentrant updateReward(msg.sender) { } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount(address _rewardToken, uint256 _reward) external virtual onlyRewardsDistribution onlyValidToken(_rewardToken) updateReward(address(0)) { } /* ========== MODIFIERS ========== */ modifier onlyValidToken(address _rewardToken) { require(<FILL_ME>) _; } function userReward(address _account, address _token) external view onlyValidToken(_token) returns (uint256) { } function _updateReward(address _what, address _account) internal virtual { } modifier updateReward(address _account) { } modifier onlyRewardsDistribution() { } /// @notice Transfer tokens to controller, controller transfers it to strategy and earn (farm) function earn() external virtual override { } function token() external view override returns (address) { } function controller() external view override returns (address) { } function balance() public view override returns (uint256) { } function _rewardPerTokenForDuration( address _rewardsToken, uint256 _duration ) internal view returns (uint256) { } function potentialRewardReturns( address _rewardsToken, uint256 _duration, address _account ) external view returns (uint256) { } }
_validTokens.contains(_rewardToken),"!valid"
314,832
_validTokens.contains(_rewardToken)
"Not enough NFTs left :("
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ERC721EnumerableLite.sol'; import './Signed.sol'; import "./Strings.sol"; //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden contract AshleyMetagolden is ERC721EnumerableLite, Signed { using Strings for uint; uint public MGOLD_MaxMint = 10; uint public MGOLD_MaxSupply = 862; uint public MGOLD_MintPrice = 0.16 ether; bool public MGOLD_SaleActive = false; string private MGOLD_TokenURI = 'https://gateway.pinata.cloud/ipfs/QmXtR8i3EbZDgio9rz24KUWBcqg3S5avZdA34VqEvUYv4v/'; address public MGOLD_Address1 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; address public MGOLD_Address2 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; constructor() Delegated() ERC721B("Ashley Longshore x Metagolden", "MGOLD", 0){ } fallback() external payable {} receive() external payable {} function tokenURI(uint tokenId) external view virtual override returns (string memory) { } function mint( uint quantity ) external payable { require( MGOLD_SaleActive, "Ashley Longshore x Metagolden Sale is not active" ); require( quantity <= MGOLD_MaxMint, "Ashley Longshore x Metagolden mint is too big" ); require( msg.value >= MGOLD_MintPrice * quantity, "Invalid Ether Amount" ); uint supply = totalSupply(); require(<FILL_ME>) for(uint i; i < quantity; ++i){ _mint( msg.sender, supply++ ); } } function burnTokens(address account, uint[] calldata tokenIds) external payable onlyDelegates { } //Used for the owner to mint the nfts to the wallet of the fiat purchasers function fiat_mint(uint[] calldata quantity, address[] calldata recipient) external payable onlyDelegates { } function Set_MGOLD_SaleActive(bool MGOLD_SaleActive_ ) external onlyDelegates{ } function setBaseURI( string calldata baseURI ) external onlyDelegates { } function setValues(uint _MGOLD_MaxMint, uint _MGOLD_MaxSupply, uint _price, address _MGOLD_Address1, address _MGOLD_Address2 ) external onlyDelegates { } function finalize() external onlyOwner { } function emergency_withdraw() external onlyOwner { } function withdraw() external { } function _beforeTokenTransfer(address from, address to, uint tokenId) internal override { } function _burn(uint tokenId) internal override { } function _mint(address to, uint tokenId) internal override { } }
supply+quantity<=MGOLD_MaxSupply,"Not enough NFTs left :("
314,883
supply+quantity<=MGOLD_MaxSupply
"Could not verify owner"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ERC721EnumerableLite.sol'; import './Signed.sol'; import "./Strings.sol"; //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden contract AshleyMetagolden is ERC721EnumerableLite, Signed { using Strings for uint; uint public MGOLD_MaxMint = 10; uint public MGOLD_MaxSupply = 862; uint public MGOLD_MintPrice = 0.16 ether; bool public MGOLD_SaleActive = false; string private MGOLD_TokenURI = 'https://gateway.pinata.cloud/ipfs/QmXtR8i3EbZDgio9rz24KUWBcqg3S5avZdA34VqEvUYv4v/'; address public MGOLD_Address1 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; address public MGOLD_Address2 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; constructor() Delegated() ERC721B("Ashley Longshore x Metagolden", "MGOLD", 0){ } fallback() external payable {} receive() external payable {} function tokenURI(uint tokenId) external view virtual override returns (string memory) { } function mint( uint quantity ) external payable { } function burnTokens(address account, uint[] calldata tokenIds) external payable onlyDelegates { for(uint i; i < tokenIds.length; ++i ){ require(<FILL_ME>) _burn( tokenIds[i] ); } } //Used for the owner to mint the nfts to the wallet of the fiat purchasers function fiat_mint(uint[] calldata quantity, address[] calldata recipient) external payable onlyDelegates { } function Set_MGOLD_SaleActive(bool MGOLD_SaleActive_ ) external onlyDelegates{ } function setBaseURI( string calldata baseURI ) external onlyDelegates { } function setValues(uint _MGOLD_MaxMint, uint _MGOLD_MaxSupply, uint _price, address _MGOLD_Address1, address _MGOLD_Address2 ) external onlyDelegates { } function finalize() external onlyOwner { } function emergency_withdraw() external onlyOwner { } function withdraw() external { } function _beforeTokenTransfer(address from, address to, uint tokenId) internal override { } function _burn(uint tokenId) internal override { } function _mint(address to, uint tokenId) internal override { } }
_owners[tokenIds[i]]==account,"Could not verify owner"
314,883
_owners[tokenIds[i]]==account
"Not enough NFTs left :("
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ERC721EnumerableLite.sol'; import './Signed.sol'; import "./Strings.sol"; //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden contract AshleyMetagolden is ERC721EnumerableLite, Signed { using Strings for uint; uint public MGOLD_MaxMint = 10; uint public MGOLD_MaxSupply = 862; uint public MGOLD_MintPrice = 0.16 ether; bool public MGOLD_SaleActive = false; string private MGOLD_TokenURI = 'https://gateway.pinata.cloud/ipfs/QmXtR8i3EbZDgio9rz24KUWBcqg3S5avZdA34VqEvUYv4v/'; address public MGOLD_Address1 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; address public MGOLD_Address2 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; constructor() Delegated() ERC721B("Ashley Longshore x Metagolden", "MGOLD", 0){ } fallback() external payable {} receive() external payable {} function tokenURI(uint tokenId) external view virtual override returns (string memory) { } function mint( uint quantity ) external payable { } function burnTokens(address account, uint[] calldata tokenIds) external payable onlyDelegates { } //Used for the owner to mint the nfts to the wallet of the fiat purchasers function fiat_mint(uint[] calldata quantity, address[] calldata recipient) external payable onlyDelegates { require(quantity.length == recipient.length, "Quantity array and recipient array are not equal" ); uint totalQuantity; uint supply = totalSupply(); for(uint i; i < quantity.length; ++i){ totalQuantity += quantity[i]; } require(<FILL_ME>) delete totalQuantity; for(uint i; i < recipient.length; ++i){ for(uint j; j < quantity[i]; ++j){ _mint( recipient[i], supply++ ); } } } function Set_MGOLD_SaleActive(bool MGOLD_SaleActive_ ) external onlyDelegates{ } function setBaseURI( string calldata baseURI ) external onlyDelegates { } function setValues(uint _MGOLD_MaxMint, uint _MGOLD_MaxSupply, uint _price, address _MGOLD_Address1, address _MGOLD_Address2 ) external onlyDelegates { } function finalize() external onlyOwner { } function emergency_withdraw() external onlyOwner { } function withdraw() external { } function _beforeTokenTransfer(address from, address to, uint tokenId) internal override { } function _burn(uint tokenId) internal override { } function _mint(address to, uint tokenId) internal override { } }
supply+totalQuantity<=MGOLD_MaxSupply,"Not enough NFTs left :("
314,883
supply+totalQuantity<=MGOLD_MaxSupply
"Failed withdraw"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import './ERC721EnumerableLite.sol'; import './Signed.sol'; import "./Strings.sol"; //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden //Ashley Longshore x Metagolden contract AshleyMetagolden is ERC721EnumerableLite, Signed { using Strings for uint; uint public MGOLD_MaxMint = 10; uint public MGOLD_MaxSupply = 862; uint public MGOLD_MintPrice = 0.16 ether; bool public MGOLD_SaleActive = false; string private MGOLD_TokenURI = 'https://gateway.pinata.cloud/ipfs/QmXtR8i3EbZDgio9rz24KUWBcqg3S5avZdA34VqEvUYv4v/'; address public MGOLD_Address1 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; address public MGOLD_Address2 = 0xAE8EaBB58327f856D93248c2a009291d26BfdE18; constructor() Delegated() ERC721B("Ashley Longshore x Metagolden", "MGOLD", 0){ } fallback() external payable {} receive() external payable {} function tokenURI(uint tokenId) external view virtual override returns (string memory) { } function mint( uint quantity ) external payable { } function burnTokens(address account, uint[] calldata tokenIds) external payable onlyDelegates { } //Used for the owner to mint the nfts to the wallet of the fiat purchasers function fiat_mint(uint[] calldata quantity, address[] calldata recipient) external payable onlyDelegates { } function Set_MGOLD_SaleActive(bool MGOLD_SaleActive_ ) external onlyDelegates{ } function setBaseURI( string calldata baseURI ) external onlyDelegates { } function setValues(uint _MGOLD_MaxMint, uint _MGOLD_MaxSupply, uint _price, address _MGOLD_Address1, address _MGOLD_Address2 ) external onlyDelegates { } function finalize() external onlyOwner { } function emergency_withdraw() external onlyOwner { } function withdraw() external { require(address(this).balance > 0, "Not enough ether to withdraw"); uint256 walletBalance = address(this).balance; (bool withdrew_address1,) = MGOLD_Address1.call{value: walletBalance * 50 / 100}(""); //50 (bool withdrew_address2,) = MGOLD_Address2.call{value: walletBalance * 50 / 100}(""); //50 require(<FILL_ME>) } function _beforeTokenTransfer(address from, address to, uint tokenId) internal override { } function _burn(uint tokenId) internal override { } function _mint(address to, uint tokenId) internal override { } }
withdrew_address1&&withdrew_address2,"Failed withdraw"
314,883
withdrew_address1&&withdrew_address2
"reporter invalidated"
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; import "./OpenOraclePriceData.sol"; import "./ICompoundOracle.sol"; import "./PriceConfig.sol"; import "./UniswapConfig.sol"; /// @title Oracle for Kine Protocol /// @author Kine Technology contract KineOracle is PriceConfig { struct Observation { uint timestamp; uint acc; } struct KineOracleConfig{ address reporter; // The reporter that signs the price address kaptain; // The kine kaptain contract address uniswapFactory; // The uniswap factory address address wrappedETHAddress; // The WETH contract address uint anchorToleranceMantissa; // The percentage tolerance that the reporter may deviate from the uniswap anchor uint anchorPeriod; // The minimum amount of time required for the old uniswap price accumulator to be replaced } using FixedPoint for *; /// @notice The Open Oracle Price Data contract OpenOraclePriceData public immutable priceData; /// @notice The Compound Oracle Price contract ICompoundOracle public compoundOracle; /// @notice The number of wei in 1 ETH uint public constant ethBaseUnit = 1e18; /// @notice A common scaling factor to maintain precision uint public constant expScale = 1e18; /// @notice The Open Oracle Reporter address public reporter; /// @notice The Kaptain contract address that steers the MCD price and kUSD minter address public kaptain; /// @notice The mcd last update timestamp uint public mcdLastUpdatedAt; /// @notice The highest ratio of the new price to the anchor price that will still trigger the price to be updated uint public immutable upperBoundAnchorRatio; /// @notice The lowest ratio of the new price to the anchor price that will still trigger the price to be updated uint public immutable lowerBoundAnchorRatio; /// @notice The minimum amount of time in seconds required for the old uniswap price accumulator to be replaced uint public immutable anchorPeriod; /// @notice Official prices by symbol hash mapping(bytes32 => uint) public prices; /// @notice Circuit breaker for using anchor price oracle directly, ignoring reporter bool public reporterInvalidated; /// @notice The old observation for each symbolHash mapping(bytes32 => Observation) public oldObservations; /// @notice The new observation for each symbolHash mapping(bytes32 => Observation) public newObservations; /// @notice The event emitted when new prices are posted but the stored price is not updated due to the anchor event PriceGuarded(string symbol, uint reporter, uint anchor); /// @notice The event emitted when the stored price is updated event PriceUpdated(string symbol, uint price); /// @notice The event emitted when anchor price is updated event AnchorPriceUpdated(string symbol, uint anchorPrice, uint oldTimestamp, uint newTimestamp); /// @notice The event emitted when the uniswap window changes event UniswapWindowUpdated(bytes32 indexed symbolHash, uint oldTimestamp, uint newTimestamp, uint oldPrice, uint newPrice); /// @notice The event emitted when reporter invalidates itself event ReporterInvalidated(address reporter); /// @notice The event emitted when reporter is updated event ReporterUpdated(address oldReporter, address newReporter); /// @notice The event emitted when compound oracle is updated event CompoundOracleUpdated(address fromAddress, address toAddress); /// @notice The event emitted when Kaptain is updated event KaptainUpdated(address fromAddress, address toAddress); /// @notice The event emitted when new config added event TokenConfigAdded(address kToken, address underlying, bytes32 symbolHash, uint baseUnit, KPriceSource priceSource, uint fixedPrice, address uniswapMarket, bool isUniswapReversed); /// @notice The event emitted when config removed event TokenConfigRemoved(address kToken, address underlying, bytes32 symbolHash, uint baseUnit, KPriceSource priceSource, uint fixedPrice, address uniswapMarket, bool isUniswapReversed); bytes32 constant ethHash = keccak256(abi.encodePacked("ETH")); bytes32 constant mcdHash = keccak256(abi.encodePacked("MCD")); bytes32 constant rotateHash = keccak256(abi.encodePacked("rotate")); /** * @dev Throws if called by any account other than the Kaptain. */ modifier onlyKaptain() { } /** * @notice Construct a uniswap anchored view for a set of token configurations * @dev Note that to avoid immature TWAPs, the system must run for at least a single anchorPeriod before using. * @param priceData_ The open oracle price data contract * @param kineOracleConfig_ The configurations for kine oracle init * @param configs The static token configurations which define what prices are supported and how * @param compoundOracle_ The address of compound oracle */ constructor(OpenOraclePriceData priceData_, KineOracleConfig memory kineOracleConfig_, KTokenConfig[] memory configs, ICompoundOracle compoundOracle_) public { } /** * @notice Get the official price for a symbol * @param symbol The symbol to fetch the price of * @return Price denominated in USD, with 6 decimals */ function price(string memory symbol) external view returns (uint) { } function priceInternal(KTokenConfig memory config) internal view returns (uint) { } /** * @notice Get the underlying price of a kToken * @dev Implements the PriceOracle interface for Kine. * @param kToken The kToken address for price retrieval * @return Price denominated in USD, with 18 decimals, for the given kToken address */ function getUnderlyingPrice(address kToken) external view returns (uint) { } /** * @notice Post kine supported prices, and recalculate stored reporter price by comparing to anchor * @dev only priceSource not configured as "COMPOUND" will be stored in the view. * @param messages The messages to post to the oracle * @param signatures The signatures for the corresponding messages * @param symbols The symbols to compare to anchor for authoritative reading */ function postPrices(bytes[] calldata messages, bytes[] calldata signatures, string[] calldata symbols) external onlyKaptain{ } /** * @dev MCD price can only come from Kaptain */ function postMcdPrice(uint mcdPrice) external onlyKaptain{ require(<FILL_ME>) require(mcdPrice != 0, "MCD price cannot be 0"); mcdLastUpdatedAt = block.timestamp; prices[mcdHash] = mcdPrice; emit PriceUpdated("MCD", mcdPrice); } function postReporterOnlyPriceInternal(string memory symbol, KTokenConfig memory config, uint reporterPrice) internal { } function postPriceInternal(string memory symbol, uint ethPrice, KTokenConfig memory config, uint reporterPrice) internal { } /** * @dev Check if the reported price is within the range allowed by anchor ratio and anchor price from uniswap. */ function isWithinAnchor(uint reporterPrice, uint anchorPrice) internal view returns (bool) { } /** * @dev Fetches the current token/eth price accumulator from uniswap. */ function currentCumulativePrice(KTokenConfig memory config) internal view returns (uint) { } /** * @dev Fetches the current eth/usd price from uniswap, with 6 decimals of precision. * Conversion factor is 1e18 for eth/usdc market, since we decode uniswap price statically with 18 decimals. */ function fetchEthPrice() internal returns (uint) { } /** * @dev Fetches the current token/usd price from uniswap, with 6 decimals of precision. * @param conversionFactor 1e18 if seeking the ETH price, and a 6 decimal ETH-USDC price in the case of other assets */ function fetchAnchorPrice(string memory symbol, KTokenConfig memory config, uint conversionFactor) internal virtual returns (uint) { } /** * @dev Get time-weighted average prices for a token at the current timestamp. * Update new and old observations of lagging window if period elapsed. */ function pokeWindowValues(KTokenConfig memory config) internal returns (uint, uint, uint) { } /** * @notice Invalidate the reporter, and fall back to using anchor directly in all cases * @dev Only the reporter may sign a message which allows it to invalidate itself. * To be used in cases of emergency, if the reporter thinks their key may be compromised. * @param message The data that was presumably signed * @param signature The fingerprint of the data + private key */ function invalidateReporter(bytes memory message, bytes memory signature) external { } /** * @notice Recovers the source address which signed a message * @dev Comparing to a claimed address would add nothing, * as the caller could simply perform the recover and claim that address. * @param message The data that was presumably signed * @param signature The fingerprint of the data + private key * @return The source address which signed the message, presumably */ function source(bytes memory message, bytes memory signature) public pure returns (address) { } /// @dev Overflow proof multiplication function mul(uint a, uint b) internal pure returns (uint) { } /** * @dev The admin function used to redirect to new compound oracle */ function setCompoundOracle(address oracleAddress) public onlyOwner { } /// @dev The admin function to add config for supporting more token prices function addConfig(address kToken_, address underlying_, bytes32 symbolHash_, uint baseUnit_, KPriceSource priceSource_, uint fixedPrice_, address uniswapMarket_, bool isUniswapReversed_) public onlyOwner { } /// @dev The admin function to remove config by its kToken address function removeConfigByKToken(address kToken) public onlyOwner { } /** * @dev The admin function to change price reporter * This function will set the new price reporter and set the reporterInvalidated flag to false */ function changeReporter(address reporter_) public onlyOwner{ } /** * @dev The admin function to change the kaptain contract address */ function changeKaptain(address kaptain_) public onlyOwner{ } }
!reporterInvalidated,"reporter invalidated"
314,893
!reporterInvalidated
"You are not on the whitelist!"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { require(_msgSender() == address(beesContract), "DONT CHEAT!"); bytes32 leaf = keccak256(abi.encodePacked(addr)); require(<FILL_ME>) mintCheck(addr, amount, minted, true, value, true); for (uint256 i = 1; i <= amount; i++) { beesContract.mint(addr, minted + i, stake); whitelistMints[addr]++; } } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
MerkleProof.verify(_merkleProof,merkleRootWhitelist,leaf),"You are not on the whitelist!"
314,980
MerkleProof.verify(_merkleProof,merkleRootWhitelist,leaf)
"WOOL minting paused"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { require(_msgSender() == address(beesContract), "DONT CHEAT!"); require(<FILL_ME>) require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold"); mintCheck(addr, amount, minted, false, 0, false); for (uint256 i = 1; i <= amount; i++) { totalWoolCost += mintPriceWool; beesContract.mint(addr, minted + i, stake); } } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
!mintWithWoolPaused,"WOOL minting paused"
314,980
!mintWithWoolPaused
"All tokens on-sale already sold"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { require(_msgSender() == address(beesContract), "DONT CHEAT!"); require(!mintWithWoolPaused, "WOOL minting paused"); require(<FILL_ME>) mintCheck(addr, amount, minted, false, 0, false); for (uint256 i = 1; i <= amount; i++) { totalWoolCost += mintPriceWool; beesContract.mint(addr, minted + i, stake); } } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
minted+amount<=PAID_TOKENS,"All tokens on-sale already sold"
314,980
minted+amount<=PAID_TOKENS
"All tokens minted"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { require(tx.origin == addr, "Only EOA"); require(<FILL_ME>) if (presale) { require(!mintWithEthPresalePaused, "Presale mint paused"); require(amount > 0 && whitelistMints[addr] + amount <= MINTS_PER_WHITELIST, "Only limited amount for WL mint"); } else { require(amount > 0 && amount <= 10, "Invalid mint amount sale"); } if (isEth) { require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold"); if (presale) require(amount * MINT_PRICE_DISCOUNT == value, "Invalid payment amount presale"); else { require(amount * MINT_PRICE == value, "Invalid payment amount sale"); require(!mintWithEthPaused, "Public sale currently paused"); } } } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
minted+amount<=MAX_TOKENS,"All tokens minted"
314,980
minted+amount<=MAX_TOKENS
"Presale mint paused"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { require(tx.origin == addr, "Only EOA"); require(minted + amount <= MAX_TOKENS, "All tokens minted"); if (presale) { require(<FILL_ME>) require(amount > 0 && whitelistMints[addr] + amount <= MINTS_PER_WHITELIST, "Only limited amount for WL mint"); } else { require(amount > 0 && amount <= 10, "Invalid mint amount sale"); } if (isEth) { require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold"); if (presale) require(amount * MINT_PRICE_DISCOUNT == value, "Invalid payment amount presale"); else { require(amount * MINT_PRICE == value, "Invalid payment amount sale"); require(!mintWithEthPaused, "Public sale currently paused"); } } } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
!mintWithEthPresalePaused,"Presale mint paused"
314,980
!mintWithEthPresalePaused
"Invalid payment amount presale"
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./ICryptoBees.sol"; import "./IHoney.sol"; import "./Base64.sol"; contract Traits is Ownable { using Strings for uint256; using MerkleProof for bytes32[]; // struct to store each trait's data for metadata and rendering struct Trait { string name; string png; } string unrevealedImage; ICryptoBees beesContract; IHoney honeyContract; // mint price ETH uint256 public constant MINT_PRICE = .06 ether; uint256 public constant MINT_PRICE_DISCOUNT = .055 ether; uint256 public constant MINTS_PER_WHITELIST = 6; // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; // mint price HONEY uint256 public constant MINT_PRICE_HONEY = 3000 ether; // mint price WOOL uint256 public mintPriceWool = 6600 ether; // max number of tokens that can be minted uint256 public constant MAX_TOKENS = 40000; // number of tokens that can be claimed for ETH uint256 public constant PAID_TOKENS = 10000; /// @notice controls if mintWithEthPresale is paused bool public mintWithEthPresalePaused = true; /// @notice controls if mintWithWool is paused bool public mintWithWoolPaused = true; /// @notice controls if mainMint is paused bool public mintWithEthPaused = true; mapping(address => uint8) public whitelistMints; bytes32 private merkleRootWhitelist; string[8] _traitTypes = ["Body", "Color", "Eyes", "Mouth", "Nose", "Hair", "Accessories", "Feelers"]; // storage of each traits name and base64 PNG data mapping(uint8 => mapping(uint8 => Trait)) public traitData; string[4] _strengths = ["5", "6", "7", "8"]; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public rarities; // 0 - 7 are associated with Bees, 8 - 18 are associated with Bears, 16 - 23 with Beekeeper uint8[][24] public aliases; constructor() { } function setContracts(address _BEES, address _HONEY) external onlyOwner { } /** MINTING */ function mintForEth( address addr, uint256 amount, uint256 minted, uint256 value, bool stake ) external { } function mintForEthWhitelist( address addr, uint256 amount, uint256 minted, uint256 value, bytes32[] calldata _merkleProof, bool stake ) external { } function mintForHoney( address addr, uint256 amount, uint256 minted, bool stake ) external { } function mintForWool( address addr, uint256 amount, uint256 minted, bool stake ) external returns (uint256 totalWoolCost) { } function mintCheck( address addr, uint256 amount, uint256 minted, bool presale, uint256 value, bool isEth ) private view { require(tx.origin == addr, "Only EOA"); require(minted + amount <= MAX_TOKENS, "All tokens minted"); if (presale) { require(!mintWithEthPresalePaused, "Presale mint paused"); require(amount > 0 && whitelistMints[addr] + amount <= MINTS_PER_WHITELIST, "Only limited amount for WL mint"); } else { require(amount > 0 && amount <= 10, "Invalid mint amount sale"); } if (isEth) { require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold"); if (presale) require(<FILL_ME>) else { require(amount * MINT_PRICE == value, "Invalid payment amount sale"); require(!mintWithEthPaused, "Public sale currently paused"); } } } function getTokenTextType(uint256 tokenId) external view returns (string memory) { } function _getTokenTextType(uint256 tokenId) private view returns (string memory) { } function setPresaleMintPaused(bool _paused) external onlyOwner { } function setWoolMintPaused(bool _paused) external onlyOwner { } function setMintWithEthPaused(bool _paused) external onlyOwner { } function setWoolMintPrice(uint256 _price) external onlyOwner { } function setMerkleRoot(bytes32 root) public onlyOwner { } /** * generates traits for a specific token, checking to make sure it's unique * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 seed) public view returns (ICryptoBees.Token memory) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (ICryptoBees.Token memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param t the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(ICryptoBees.Token memory t) internal pure returns (uint256) { } /** * Gen 0 can be mint for honey too * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public pure returns (uint256) { } /** * administrative to upload the names and images associated with each trait * @param traitType the trait type to upload the traits for (see traitTypes for a mapping) * @param traitNames the names and base64 encoded PNGs for each trait * @param traitImages the names and base64 encoded PNGs for each trait */ function uploadTraits( uint8 traitType, string[] calldata traitNames, string[] calldata traitImages ) external onlyOwner { } function uploadUnrevealImage(string calldata image) external onlyOwner { } // function random(uint256 seed) internal view returns (uint256) { // return uint256(keccak256(abi.encodePacked(seed))); // } /** RENDER */ /** * generates an <image> element using base64 encoded PNGs * @param trait the trait storing the PNG data * @return the <image> element */ function drawTrait(Trait memory trait) internal pure returns (string memory) { } /** * generates an <image> element using base64 encoded PNGs * @return the <image> element */ function drawUnrevealedImage() internal view returns (string memory) { } // /** // * generates an entire SVG by composing multiple <image> elements of PNGs // * @param tokenId the ID of the token to generate an SVG for // * @return a valid SVG of the Sheep / Wolf // */ function drawSVG(uint256 tokenId) public view returns (string memory) { } /** * generates an attribute for the attributes array in the ERC721 metadata standard * @param traitType the trait type to reference as the metadata key * @param value the token's trait associated with the key * @return a JSON dictionary for the single attribute */ function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) { } /** * generates an array composed of all the individual traits and values * @param tokenId the ID of the token to compose the metadata for * @return a JSON array of all of the attributes for given token ID */ function compileAttributes(uint256 tokenId) public view returns (string memory) { } function tokenURI(uint256 tokenId) public view returns (string memory) { } }
amount*MINT_PRICE_DISCOUNT==value,"Invalid payment amount presale"
314,980
amount*MINT_PRICE_DISCOUNT==value