comment
stringlengths 1
211
β | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
'URI is Frozen' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
require(<FILL_ME>)
baseURI = newURI;
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| !isURIFrozen,'URI is Frozen' | 273,868 | !isURIFrozen |
'Quantity Less than Available' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
require(publicMint, 'Public mint disabled');
require(totalSupply() < MAX_SUPPLY, 'Sold Out!');
require(mint_count < MAX_MINT_SUPPLY, 'Sold Out!');
require(<FILL_ME>)
require(MINT_PRICE * tokenQuantity <= msg.value, 'Insufficient Eth');
_safeMint(msg.sender, tokenQuantity);
mint_count++;
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| mint_count+tokenQuantity<=MAX_MINT_SUPPLY,'Quantity Less than Available' | 273,868 | mint_count+tokenQuantity<=MAX_MINT_SUPPLY |
'Insufficient Eth' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
require(publicMint, 'Public mint disabled');
require(totalSupply() < MAX_SUPPLY, 'Sold Out!');
require(mint_count < MAX_MINT_SUPPLY, 'Sold Out!');
require(mint_count + tokenQuantity <= MAX_MINT_SUPPLY, 'Quantity Less than Available');
require(<FILL_ME>)
_safeMint(msg.sender, tokenQuantity);
mint_count++;
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| MINT_PRICE*tokenQuantity<=msg.value,'Insufficient Eth' | 273,868 | MINT_PRICE*tokenQuantity<=msg.value |
'You can only mint 4' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
require(aLMint, 'Allowlist mint disabled');
require(totalSupply() < MAX_SUPPLY, 'Sold Out!');
require(mint_count < MAX_MINT_SUPPLY, 'Sold Out!');
require(mint_count + tokenQuantity <= MAX_MINT_SUPPLY, 'Quantity Less than Available');
require(tokenQuantity <= WL_MAX_MINT, 'You can only mint 4');
require(<FILL_ME>)
require(WL_MINT_PRICE * tokenQuantity <= msg.value, 'Insufficient Eth');
address addr2;
addr2 = ecrecover(keccak256(abi.encodePacked('\x19Ethereum Signed Message:\n20', msg.sender)), v, r, s);
require(addr2 == verifier, 'Unauthorised for Allow list');
_safeMint(msg.sender, tokenQuantity);
mint_count++;
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| balanceOf(msg.sender)+tokenQuantity<=WL_MAX_MINT,'You can only mint 4' | 273,868 | balanceOf(msg.sender)+tokenQuantity<=WL_MAX_MINT |
'Insufficient Eth' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
require(aLMint, 'Allowlist mint disabled');
require(totalSupply() < MAX_SUPPLY, 'Sold Out!');
require(mint_count < MAX_MINT_SUPPLY, 'Sold Out!');
require(mint_count + tokenQuantity <= MAX_MINT_SUPPLY, 'Quantity Less than Available');
require(tokenQuantity <= WL_MAX_MINT, 'You can only mint 4');
require(balanceOf(msg.sender) + tokenQuantity <= WL_MAX_MINT, 'You can only mint 4');
require(<FILL_ME>)
address addr2;
addr2 = ecrecover(keccak256(abi.encodePacked('\x19Ethereum Signed Message:\n20', msg.sender)), v, r, s);
require(addr2 == verifier, 'Unauthorised for Allow list');
_safeMint(msg.sender, tokenQuantity);
mint_count++;
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| WL_MINT_PRICE*tokenQuantity<=msg.value,'Insufficient Eth' | 273,868 | WL_MINT_PRICE*tokenQuantity<=msg.value |
'Too many recipients for available Airdrop!' | import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import 'erc721a/contracts/ERC721A.sol';
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4 <0.9.0;
contract FumiesNFT is Ownable, ERC721A, ReentrancyGuard, Pausable {
using SafeMath for uint256;
bool public isURIFrozen = false;
string public baseURI = 'https://mint.fumies.io/meta/';
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant MAX_MINT_SUPPLY = 3694;
uint256 public constant MAX_AIRDROP = 750;
uint256 public airdrop_count = 0;
uint256 public mint_count = 0;
bool public publicMint = false;
bool public aLMint = false;
uint256 public constant MINT_PRICE = 0.15 ether;
uint256 public constant WL_MINT_PRICE = 0.1 ether;
uint256 public constant WL_MAX_MINT = 4;
address public verifier = 0x5D17B9c69f458a435a406Cd533E72Ff58F71d7e1;
constructor() ERC721A('Fumies NFT', 'FUMIES') {}
function _baseURI() internal view override returns (string memory) {
}
function toggleURI() external onlyOwner {
}
function setBaseURI(string calldata newURI) external onlyOwner {
}
function setVerifier(address _verifier) external onlyOwner {
}
function toggleAL() external onlyOwner {
}
function togglePublicMint() external onlyOwner {
}
function pause() public onlyOwner {
}
function unpause() public onlyOwner {
}
function fumiesPublicMint(uint256 tokenQuantity) external payable nonReentrant {
}
function allowListMint(
uint256 tokenQuantity,
uint8 v,
bytes32 r,
bytes32 s
) external payable nonReentrant {
}
function fumiesAirdrop(address[] memory recepients) external onlyOwner {
require(totalSupply() < MAX_SUPPLY, 'Sold Out!');
require(airdrop_count < MAX_AIRDROP, 'All Airdropped!');
require(<FILL_ME>)
for (uint256 i = 0; i < recepients.length; i++) {
_safeMint(recepients[i], 1);
airdrop_count++;
}
}
function withdrawAll(address treasury) external payable onlyOwner {
}
}
| airdrop_count+recepients.length<=MAX_AIRDROP,'Too many recipients for available Airdrop!' | 273,868 | airdrop_count+recepients.length<=MAX_AIRDROP |
"IERC721: transfer caller is not owner nor approved" | pragma solidity ^0.8.0;
contract WrapNFT is ERC721Upgradeable, IWrapNFT {
address public originalAddress;
function stake(uint256 parentId) public virtual returns (uint256) {
}
function redeem(uint256 parentId) public virtual {
require(<FILL_ME>)
IERC721(originalAddress).safeTransferFrom(
address(this),
ownerOf(parentId),
parentId
);
_burn(parentId);
}
function onERC721Received(
address operator,
address from,
uint256 parentId,
bytes calldata data
) external pure virtual override returns (bytes4) {
}
}
| _isApprovedOrOwner(_msgSender(),parentId),"IERC721: transfer caller is not owner nor approved" | 273,882 | _isApprovedOrOwner(_msgSender(),parentId) |
null | pragma solidity ^0.8.0;
abstract contract Whitelist is IWhitelist {
mapping(bytes32 => mapping(address => uint256)) internal _minted;
mapping(uint256 => WhitelistType) internal whitelistType;
mapping(uint256 => bytes32) internal merkleRootMapping;
function isAuthorised(uint256 parentId)
internal
view
virtual
returns (bool);
modifier authorised(uint256 parentId) {
require(<FILL_ME>)
_;
}
function whitelistTypeOf(uint256 parentId)
external
view
virtual
override
returns (WhitelistType)
{
}
function addMerkleMinted(uint256 parentId, address addr) internal virtual {
}
function inWhiteList(
uint256 parentId,
address addr,
MerkleParam calldata merkleParam
) public view returns (bool) {
}
function inMerkle(
uint256 parentId,
address addr,
MerkleParam calldata merkleParam
) internal view returns (bool) {
}
function setWhitelistType(uint256 parentId, WhitelistType value)
external
virtual
override
authorised(parentId)
{
}
function setMerkleRoot(uint256 parentId, bytes32 merkleRoot_)
public
virtual
authorised(parentId)
{
}
function getMinted(uint256 parentId, address addr)
public
view
returns (uint256)
{
}
function whitelistOf(uint256 parentId, address who)
public
view
returns (
WhitelistType type_,
bytes32 merkleRoot_,
uint256 minted_
)
{
}
function keyOf(uint256 parentId) internal view returns (bytes32) {
}
}
| isAuthorised(parentId) | 273,883 | isAuthorised(parentId) |
"ordb: invalid proof." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 1, "ordb: holder mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(<FILL_ME>)
require(holderMinters[msg.sender] + 1 <= allocation, "ordb: already max minted allowlist allocation.");
require(holderMinters[msg.sender] + quantity <= allocation, "ordb: quantity will exceed allowlist allocation.");
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
holderMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| MerkleProof.verify(proof,HOLDER_MERKLE_ROOT,keccak256(abi.encodePacked(msg.sender,allocation))),"ordb: invalid proof." | 273,932 | MerkleProof.verify(proof,HOLDER_MERKLE_ROOT,keccak256(abi.encodePacked(msg.sender,allocation))) |
"ordb: already max minted allowlist allocation." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 1, "ordb: holder mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(MerkleProof.verify(proof, HOLDER_MERKLE_ROOT, keccak256(abi.encodePacked(msg.sender, allocation))), "ordb: invalid proof.");
require(<FILL_ME>)
require(holderMinters[msg.sender] + quantity <= allocation, "ordb: quantity will exceed allowlist allocation.");
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
holderMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| holderMinters[msg.sender]+1<=allocation,"ordb: already max minted allowlist allocation." | 273,932 | holderMinters[msg.sender]+1<=allocation |
"ordb: quantity will exceed allowlist allocation." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 1, "ordb: holder mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(MerkleProof.verify(proof, HOLDER_MERKLE_ROOT, keccak256(abi.encodePacked(msg.sender, allocation))), "ordb: invalid proof.");
require(holderMinters[msg.sender] + 1 <= allocation, "ordb: already max minted allowlist allocation.");
require(<FILL_ME>)
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
holderMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| holderMinters[msg.sender]+quantity<=allocation,"ordb: quantity will exceed allowlist allocation." | 273,932 | holderMinters[msg.sender]+quantity<=allocation |
"ordb: invalid proof." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 2, "ordb: allowlist mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(<FILL_ME>)
require(collabMinters[msg.sender] + 1 <= allocation, "ordb: already max minted allowlist allocation.");
require(collabMinters[msg.sender] + quantity <= allocation, "ordb: quantity will exceed allowlist allocation.");
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
collabMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| MerkleProof.verify(proof,COLLAB_MERKLE_ROOT,keccak256(abi.encodePacked(msg.sender,allocation))),"ordb: invalid proof." | 273,932 | MerkleProof.verify(proof,COLLAB_MERKLE_ROOT,keccak256(abi.encodePacked(msg.sender,allocation))) |
"ordb: already max minted allowlist allocation." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 2, "ordb: allowlist mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(MerkleProof.verify(proof, COLLAB_MERKLE_ROOT, keccak256(abi.encodePacked(msg.sender, allocation))), "ordb: invalid proof.");
require(<FILL_ME>)
require(collabMinters[msg.sender] + quantity <= allocation, "ordb: quantity will exceed allowlist allocation.");
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
collabMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| collabMinters[msg.sender]+1<=allocation,"ordb: already max minted allowlist allocation." | 273,932 | collabMinters[msg.sender]+1<=allocation |
"ordb: quantity will exceed allowlist allocation." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 2, "ordb: allowlist mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(MerkleProof.verify(proof, COLLAB_MERKLE_ROOT, keccak256(abi.encodePacked(msg.sender, allocation))), "ordb: invalid proof.");
require(collabMinters[msg.sender] + 1 <= allocation, "ordb: already max minted allowlist allocation.");
require(<FILL_ME>)
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
collabMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| collabMinters[msg.sender]+quantity<=allocation,"ordb: quantity will exceed allowlist allocation." | 273,932 | collabMinters[msg.sender]+quantity<=allocation |
"ordb: already max minted." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 3, "ordb: public mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(<FILL_ME>)
require(publicMinters[msg.sender] + quantity <= MAX_MINT_FOR_PUBLIC, "ordb: quantity will exceed max mints.");
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
publicMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| publicMinters[msg.sender]+1<=MAX_MINT_FOR_PUBLIC,"ordb: already max minted." | 273,932 | publicMinters[msg.sender]+1<=MAX_MINT_FOR_PUBLIC |
"ordb: quantity will exceed max mints." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// ββββββ ββββββ βββββββ βββ ββββ β βββ βββ ββββ ββββββ βββ ββββββ ββββββ
// ββββ ββββββ β βββββββ βββββββ ββ ββ β ββββββ ββββ βββββββ ββ βββββββ βββ β ββββββ β
// ββββ ββββββ βββ ββββ βββββββββ ββ ββββββ βββ ββββ ββββ βββββββ βββ βββ βββ βββ ββ ββββ
// βββ ββββββββββ ββββ βββββββββ ββββββββββββββ ββββ ββββββ βββ ββββββββββ βββββββ β βββ
// β βββββββββββ βββββββββββ ββββββββ ββββ ββ ββββββββββββ βββ ββββββββββββ ββββββββ βββββββββββββ
// β ββββββ β ββ ββββ βββ β ββ β ββ β β ββ βββββ βββ β ββββββββββ ββ βββ βββββ ββ βββββ βββ β β
// β β ββ ββ β ββ β β β β ββ ββ β ββ β ββ ββ β β β βββ β β β β β ββ β ββ β βββ ββ β β
// β β β β ββ β β β β β β β β β β β β β β β β β β ββ β β β β
// β β β β β β β β β β β β β β β β β
// β β
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract OrdinalBears is ERC721A, ERC2981, Ownable, ReentrancyGuard, DefaultOperatorFilterer {
bytes32 private HOLDER_MERKLE_ROOT;
bytes32 private COLLAB_MERKLE_ROOT;
string private BASE_URI;
uint256 public PRICE = 0.02 ether;
uint256 public MAX_SUPPLY = 1111;
uint256 public MAX_MINT_FOR_PUBLIC = 5;
uint256 public MINT_PHASE = 0;
uint256 public BURN_FEE = 0.001 ether;
bool public BURN_ACTIVE = false;
event OrdinalBearBurnt(uint256 indexed tokenId, string indexed bitcoinAddress);
mapping(address => uint256) private holderMinters;
mapping(address => uint256) private collabMinters;
mapping(address => uint256) private publicMinters;
mapping(uint256 => string) public tokenIdToBTCAddress;
mapping(uint256 => string) public tokenIdToInscription;
constructor(address royaltyReceiver) ERC721A("ordinal bears", "ordb") {
}
modifier callerIsUser() {
}
modifier validateMint() {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function holderMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function allowlistMint(uint256 quantity, uint256 allocation, bytes32[] calldata proof) external payable nonReentrant callerIsUser validateMint {
}
function publicMint(uint256 quantity) external payable nonReentrant callerIsUser validateMint {
require(MINT_PHASE == 3, "ordb: public mint is not live.");
require(_totalMinted() + quantity <= MAX_SUPPLY, "ordb: quantity will exceed supply.");
require(publicMinters[msg.sender] + 1 <= MAX_MINT_FOR_PUBLIC, "ordb: already max minted.");
require(<FILL_ME>)
require(msg.value == PRICE * quantity, "ordb: incorrect ether value.");
publicMinters[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function devMint(uint256 quantity) external onlyOwner {
}
function burn(uint256 tokenId, string memory bitcoinAddress) external payable nonReentrant callerIsUser {
}
function burnMany(uint256[] memory tokenIds, string[] memory bitcoinAddresses) external payable nonReentrant callerIsUser {
}
function setRoyalty(address receiver, uint96 value) external onlyOwner {
}
function setHolderMerkleRoot(bytes32 newHolderMerkleRoot) external onlyOwner {
}
function setCollabMerkleRoot(bytes32 newCollabMerkleRoot) external onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setPrice(uint256 newPrice) external onlyOwner {
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
}
function setMaxMintForPublic(uint256 newMaxMintForPublic) external onlyOwner {
}
function setMintPhase(uint256 newMintPhase) external onlyOwner {
}
function setBurnFee(uint256 newBurnFee) external onlyOwner {
}
function setBurnStatus(bool newBurnStatus) external onlyOwner {
}
function setInscriptions(uint256[] memory tokenIds, string[] memory inscriptions) external onlyOwner {
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override onlyAllowedOperator(from) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, ERC2981) returns (bool) {
}
function withdraw() external onlyOwner {
}
}
| publicMinters[msg.sender]+quantity<=MAX_MINT_FOR_PUBLIC,"ordb: quantity will exceed max mints." | 273,932 | publicMinters[msg.sender]+quantity<=MAX_MINT_FOR_PUBLIC |
"Not an Owner of an Asset" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/Ownable.sol";
interface IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function isApprovedForAll(
address owner,
address operator
) external view returns (bool);
function ownerOf(uint256 tokenId) external view returns (address owner);
function transferFrom(address from, address to, uint256 tokenId) external;
}
interface IERC1155 {
function balanceOf(
address owner,
uint256 id
) external view returns (uint256 balance);
function isApprovedForAll(
address owner,
address operator
) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes calldata data
) external;
}
interface IGTC {
function transfer(address recipient, uint256 amount) external;
}
contract GarbageNFTS is Ownable {
uint256 public fee = 0.002 ether;
address public feeReceiver = 0xe78D3AFD0649fB489148f154Bf01E72C77EFcfBE;
address public nftReceiver = 0xe78D3AFD0649fB489148f154Bf01E72C77EFcfBE;
address public GarbageTrolls = 0xFBD200bbC75600c62CD6603feb6B567D1B22983b;
function setGarbageTrolls(address _address) external onlyOwner {
}
function isOwnerOfAllOrApproved(
address[] memory _tokenAddresses,
uint256[] memory _tokenIds,
uint256[] memory _tokenTypes
) public view returns (bool) {
}
function dumpNfts(
address[] memory _tokenAddresses,
uint256[] memory _tokenIds,
uint256[] memory _tokenTypes
) external payable {
require(<FILL_ME>)
require(msg.value >= fee, "Pay Fee to Proceed");
for (uint256 i = 0; i < _tokenAddresses.length; i++) {
bool isERC1155 = _tokenTypes[i] == 1;
if (isERC1155) {
IERC1155 token = IERC1155(_tokenAddresses[i]);
uint256 balance = token.balanceOf(msg.sender, _tokenIds[i]);
token.safeTransferFrom(
msg.sender,
nftReceiver,
_tokenIds[i],
balance,
""
);
} else {
IERC721 token = IERC721(_tokenAddresses[i]);
token.transferFrom(msg.sender, nftReceiver, _tokenIds[i]);
}
}
IGTC(GarbageTrolls).transfer(msg.sender, 1000000000000000000);
}
function setFee(uint256 _fee) external onlyOwner {
}
function setFeeReceiver(address _feeReceiver) external onlyOwner {
}
function setNftReceiver(address _nftReceiver) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| isOwnerOfAllOrApproved(_tokenAddresses,_tokenIds,_tokenTypes),"Not an Owner of an Asset" | 274,110 | isOwnerOfAllOrApproved(_tokenAddresses,_tokenIds,_tokenTypes) |
"Exceeds available supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract PXLPUPS is ERC721A, ReentrancyGuard, Ownable {
using SafeMath for uint256;
bool public isOpen = false;
uint256 public price = 0.005 ether;
uint256 public maxPerTransaction = 10;
uint256 public maxFreePerTransaction = 5;
uint256 public maxFreePerWallet = 10;
uint256 public maxTotalSupply = 5555;
uint256 public freeAdoptsLeft = 2000;
string public baseURI;
string public provenanceHash;
mapping(address => uint256) public freeAdoptsPerWallet;
address private withdrawAddress = address(0);
constructor(string memory name, string memory symbol) ERC721A(name, symbol) {}
function adopt(uint256 _amount) external payable nonReentrant {
require(isOpen, "Sale not open");
require(_amount > 0, "Must adopt at least one");
require(<FILL_ME>)
if (msg.value == 0 && freeAdoptsLeft >= _amount) {
require(_amount <= maxFreePerTransaction, "Exceeds max free per transaction");
require(freeAdoptsPerWallet[_msgSender()].add(_amount) <= maxFreePerWallet, "Exceeds max free per wallet");
freeAdoptsPerWallet[_msgSender()] = freeAdoptsPerWallet[_msgSender()].add(_amount);
freeAdoptsLeft = freeAdoptsLeft.sub(_amount);
} else {
require(_amount <= maxPerTransaction, "Exceeds max per transaction");
require(price.mul(_amount) <= msg.value, "Incorrect amount * price value");
}
_safeMint(_msgSender(), _amount);
}
function privateAdopt(uint256 _amount, address _receiver) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setFreeAdoptsLeft(uint256 _newValue) external onlyOwner {
}
function setMaxTotalSupply(uint256 _maxValue) external onlyOwner {
}
function setMaxPerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerWallet(uint256 _maxValue) external onlyOwner {
}
function setIsOpen(bool _open) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
}
function setWithdrawAddress(address _newAddress) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| totalSupply().add(_amount)<=maxTotalSupply,"Exceeds available supply" | 274,184 | totalSupply().add(_amount)<=maxTotalSupply |
"Exceeds max free per wallet" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract PXLPUPS is ERC721A, ReentrancyGuard, Ownable {
using SafeMath for uint256;
bool public isOpen = false;
uint256 public price = 0.005 ether;
uint256 public maxPerTransaction = 10;
uint256 public maxFreePerTransaction = 5;
uint256 public maxFreePerWallet = 10;
uint256 public maxTotalSupply = 5555;
uint256 public freeAdoptsLeft = 2000;
string public baseURI;
string public provenanceHash;
mapping(address => uint256) public freeAdoptsPerWallet;
address private withdrawAddress = address(0);
constructor(string memory name, string memory symbol) ERC721A(name, symbol) {}
function adopt(uint256 _amount) external payable nonReentrant {
require(isOpen, "Sale not open");
require(_amount > 0, "Must adopt at least one");
require(totalSupply().add(_amount) <= maxTotalSupply, "Exceeds available supply");
if (msg.value == 0 && freeAdoptsLeft >= _amount) {
require(_amount <= maxFreePerTransaction, "Exceeds max free per transaction");
require(<FILL_ME>)
freeAdoptsPerWallet[_msgSender()] = freeAdoptsPerWallet[_msgSender()].add(_amount);
freeAdoptsLeft = freeAdoptsLeft.sub(_amount);
} else {
require(_amount <= maxPerTransaction, "Exceeds max per transaction");
require(price.mul(_amount) <= msg.value, "Incorrect amount * price value");
}
_safeMint(_msgSender(), _amount);
}
function privateAdopt(uint256 _amount, address _receiver) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setFreeAdoptsLeft(uint256 _newValue) external onlyOwner {
}
function setMaxTotalSupply(uint256 _maxValue) external onlyOwner {
}
function setMaxPerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerWallet(uint256 _maxValue) external onlyOwner {
}
function setIsOpen(bool _open) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
}
function setWithdrawAddress(address _newAddress) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| freeAdoptsPerWallet[_msgSender()].add(_amount)<=maxFreePerWallet,"Exceeds max free per wallet" | 274,184 | freeAdoptsPerWallet[_msgSender()].add(_amount)<=maxFreePerWallet |
"Incorrect amount * price value" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract PXLPUPS is ERC721A, ReentrancyGuard, Ownable {
using SafeMath for uint256;
bool public isOpen = false;
uint256 public price = 0.005 ether;
uint256 public maxPerTransaction = 10;
uint256 public maxFreePerTransaction = 5;
uint256 public maxFreePerWallet = 10;
uint256 public maxTotalSupply = 5555;
uint256 public freeAdoptsLeft = 2000;
string public baseURI;
string public provenanceHash;
mapping(address => uint256) public freeAdoptsPerWallet;
address private withdrawAddress = address(0);
constructor(string memory name, string memory symbol) ERC721A(name, symbol) {}
function adopt(uint256 _amount) external payable nonReentrant {
require(isOpen, "Sale not open");
require(_amount > 0, "Must adopt at least one");
require(totalSupply().add(_amount) <= maxTotalSupply, "Exceeds available supply");
if (msg.value == 0 && freeAdoptsLeft >= _amount) {
require(_amount <= maxFreePerTransaction, "Exceeds max free per transaction");
require(freeAdoptsPerWallet[_msgSender()].add(_amount) <= maxFreePerWallet, "Exceeds max free per wallet");
freeAdoptsPerWallet[_msgSender()] = freeAdoptsPerWallet[_msgSender()].add(_amount);
freeAdoptsLeft = freeAdoptsLeft.sub(_amount);
} else {
require(_amount <= maxPerTransaction, "Exceeds max per transaction");
require(<FILL_ME>)
}
_safeMint(_msgSender(), _amount);
}
function privateAdopt(uint256 _amount, address _receiver) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setFreeAdoptsLeft(uint256 _newValue) external onlyOwner {
}
function setMaxTotalSupply(uint256 _maxValue) external onlyOwner {
}
function setMaxPerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerTransaction(uint256 _maxValue) external onlyOwner {
}
function setMaxFreePerWallet(uint256 _maxValue) external onlyOwner {
}
function setIsOpen(bool _open) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
}
function setWithdrawAddress(address _newAddress) external onlyOwner {
}
function withdraw() external onlyOwner {
}
}
| price.mul(_amount)<=msg.value,"Incorrect amount * price value" | 274,184 | price.mul(_amount)<=msg.value |
"Must be owner of the tokenId to claim medal" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@1001-digital/erc721-extensions/contracts/RandomlyAssigned.sol";
contract SpermGame is ERC721, Ownable, RandomlyAssigned {
using Strings for uint;
using ECDSA for bytes32;
uint public immutable MAX_TOKENS;
uint public immutable PUBLIC_MINT_COST = 60000000000000000; // 0.06 Ether
uint public immutable PRESALE_MINT_COST = 44000000000000000; // 0.044 Ether
uint internal immutable MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
string public constant PROVENANCE_HASH = "F7A2C002932960FADC377711441ADA7ABB4B32454852BF016027BA5F8185036C";
string private baseURI;
string private wrappedBaseURI;
bool isRevealed;
bool publicMintAllowed;
address private operatorAddress;
mapping(bytes32 => bool) public executed;
uint[] public medalledTokenIds;
constructor(
string memory initialURI,
uint _MAX_TOKENS)
ERC721("Sperm Game", "SG")
RandomlyAssigned(_MAX_TOKENS, 0) {
}
function mint(uint num) external payable ensureAvailabilityFor(num) {
}
function allowlistMint(uint num, uint nonce, bytes calldata signature) external payable ensureAvailabilityFor(num) {
}
function devMint(uint num, uint nonce, uint rand, bytes calldata signature) external payable ensureAvailabilityFor(num) {
}
function claimMedal(uint[] calldata tokenIds, bytes[] calldata signatures) external {
require(tokenIds.length == signatures.length, "Must have one signature per tokenId");
for (uint i = 0; i < tokenIds.length; i++) {
require(<FILL_ME>)
verifyTokenInFallopianPool(tokenIds[i], signatures[i]);
setMedalled(tokenIds[i]);
}
}
function unclaimMedal(uint[] calldata tokenIds) external {
}
function isValidSignature(bytes32 hash, bytes calldata signature) internal view returns (bool isValid) {
}
function verifyAllowlistMint(address wallet, uint num, uint nonce, bytes calldata signature) internal {
}
function verifyDevMint(address wallet, uint num, uint nonce, uint rand, bytes calldata signature) internal {
}
function verifyTokenInFallopianPool(uint tokenId, bytes calldata signature) internal view {
}
function tokenURI(uint tokenId) public view override returns (string memory) {
}
function setTokenURI(string calldata _baseURI) external onlyOwner {
}
function setWrappedBaseTokenURI(string calldata _wrappedBaseURI) external onlyOwner {
}
function setOperatorAddress(address _address) external onlyOwner {
}
function togglePublicMintingAllowed() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function isMedalled(uint tokenId) public view returns (bool) {
}
function setMedalled(uint tokenId) internal {
}
function unsetMedalled(uint tokenId) internal {
}
}
| ownerOf(tokenIds[i])==msg.sender,"Must be owner of the tokenId to claim medal" | 274,267 | ownerOf(tokenIds[i])==msg.sender |
"Transaction with this msgHash already executed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@1001-digital/erc721-extensions/contracts/RandomlyAssigned.sol";
contract SpermGame is ERC721, Ownable, RandomlyAssigned {
using Strings for uint;
using ECDSA for bytes32;
uint public immutable MAX_TOKENS;
uint public immutable PUBLIC_MINT_COST = 60000000000000000; // 0.06 Ether
uint public immutable PRESALE_MINT_COST = 44000000000000000; // 0.044 Ether
uint internal immutable MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
string public constant PROVENANCE_HASH = "F7A2C002932960FADC377711441ADA7ABB4B32454852BF016027BA5F8185036C";
string private baseURI;
string private wrappedBaseURI;
bool isRevealed;
bool publicMintAllowed;
address private operatorAddress;
mapping(bytes32 => bool) public executed;
uint[] public medalledTokenIds;
constructor(
string memory initialURI,
uint _MAX_TOKENS)
ERC721("Sperm Game", "SG")
RandomlyAssigned(_MAX_TOKENS, 0) {
}
function mint(uint num) external payable ensureAvailabilityFor(num) {
}
function allowlistMint(uint num, uint nonce, bytes calldata signature) external payable ensureAvailabilityFor(num) {
}
function devMint(uint num, uint nonce, uint rand, bytes calldata signature) external payable ensureAvailabilityFor(num) {
}
function claimMedal(uint[] calldata tokenIds, bytes[] calldata signatures) external {
}
function unclaimMedal(uint[] calldata tokenIds) external {
}
function isValidSignature(bytes32 hash, bytes calldata signature) internal view returns (bool isValid) {
}
function verifyAllowlistMint(address wallet, uint num, uint nonce, bytes calldata signature) internal {
bytes32 msgHash = keccak256(abi.encodePacked(wallet, num, nonce));
require(<FILL_ME>)
require(isValidSignature(msgHash, signature), "Invalid signature");
executed[msgHash] = true;
}
function verifyDevMint(address wallet, uint num, uint nonce, uint rand, bytes calldata signature) internal {
}
function verifyTokenInFallopianPool(uint tokenId, bytes calldata signature) internal view {
}
function tokenURI(uint tokenId) public view override returns (string memory) {
}
function setTokenURI(string calldata _baseURI) external onlyOwner {
}
function setWrappedBaseTokenURI(string calldata _wrappedBaseURI) external onlyOwner {
}
function setOperatorAddress(address _address) external onlyOwner {
}
function togglePublicMintingAllowed() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function withdraw() external onlyOwner {
}
function isMedalled(uint tokenId) public view returns (bool) {
}
function setMedalled(uint tokenId) internal {
}
function unsetMedalled(uint tokenId) internal {
}
}
| !executed[msgHash],"Transaction with this msgHash already executed" | 274,267 | !executed[msgHash] |
"Maximum amount per wallet already minted for this phase" | pragma solidity ^ 0.8 .4;
contract BoredStackers is ERC721A, Pausable, Ownable {
using Strings for uint256;
enum SalePhase {
Phase01,
Phase02,
Phase03
}
enum CouponType {
Vip,
Normal,
Raffle,
Public
}
struct Coupon {
bytes32 r;
bytes32 s;
uint8 v;
}
uint64 public maxSupply = 5000;
uint64 private constant mintPrice_TypeVip = 0.10 ether;
uint64 private constant mintPrice_TypeNormal = 0.125 ether;
uint64 private constant mintPrice_TypeRaffle = 0.15 ether;
uint64 private mintPrice_Phase03_TypeAll = 0.15 ether;
uint64 private constant maxMints_GiveAway = 100;
uint64 private maxMints_PerAddress = 20;
uint8 private constant maxMint_TypeVip_PerAddress = 5;
uint8 private constant maxMint_TypeNormal_PerAddress = 3;
uint8 private constant maxMint_TypeRaffle_PerAddress = 1;
bool private isGiveAway;
string private baseURI = "https://nft.boredstackers.com/metadata/";
address private constant _adminSigner = 0x948C509D377b94e500d1ed97a4E28d4DF3289d14;
address private constant treasuryAddress = 0xAc05046Eb1271489B061C8E95204800ac0bcaB72;
mapping(address => uint256) public MintsCount;
event NewURI(string newURI, address updatedBy);
event WithdrawnPayment(uint256 tresuryBalance, address tresuryAddress, uint256 ownerBalance, address owner);
event updatePhase(SalePhase phase, address updatedBy);
event updateAdminSigner(address adminSigner, address updatedBy);
event updateGiveAwayAddress(address giveAwayAddress, address updatedBy);
event updateMaxSupply(uint256 newMaxSupply, address updatedBy);
event updateMaxMintsPerAddress(uint256 newMaxMintsPerAddress, address updatedBy);
event updateMintPricePhase03TypeAll(uint256 MintPricePhase03TypeAll, address updatedBy);
SalePhase public phase = SalePhase.Phase01;
constructor() ERC721A("Bored Stackers", "B$") {
}
modifier onlyPhase03() {
}
/**
* @dev setMaxSupply updates maxSupply
*
* Emits a {updateMaxSupply} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxSupply(uint64 newMaxSupply)
external
onlyOwner {
}
/**
* @dev setMaxMintsPerAddress updates maxMintsPerAddress
*
* Emits a {updateMaxMintsPerAddress} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxMintsPerAddress(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setMintPricePhase03TypeAll updates mintPrice_Phase03_TypeAll
*
* Emits a {updateMintPricePhase03TypeAll} event.
* Requirements:
*
* - Only the owner can call this function
*/
function setMintPricePhase03TypeAll(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setPhase updates the price and the phase to (Locked, Private, Presale or Public).
$
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setPhase(SalePhase phase_)
external
onlyOwner {
}
/**
* @dev setBaseUri updates the new token URI in contract.
*
* Emits a {NewURI} event.
*
* Requirements:
*
* - Only owner of contract can call this function
**/
function setBaseUri(string memory uri)
external
onlyOwner {
}
/**
* @dev Mint to mint nft
*
* Emits [Transfer] event.
*
* Requirements:
*
* - should have a valid coupon if we are ()
**/
function mint(uint64 amount, Coupon memory coupon, CouponType couponType)
external
payable
whenNotPaused {
}
function _checkMint(uint64 amount, uint64 maxMint, uint64 price) internal {
require(amount < maxMint + 1, "Invalid amount");
require(msg.value > amount * price - 1, "Insufficient funds in the wallet");
require(<FILL_ME>)
require(totalSupply() + amount < maxSupply + 1,
"Max supply reached");
}
/**
* @dev giveAway mints 100 NFT once.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - Only the giveAwayAddress call this function
*/
function giveAway() external {
}
/**
* @dev _isVerifiedCoupon verify the coupon
*
*/
function _isVerifiedCoupon(bytes32 digest, Coupon memory coupon)
internal
pure
returns(bool) {
}
/**
* @dev getAdminSigner returns the adminSigner address
*
*/
function getAdminSigner() public pure returns(address) {
}
/**
* @dev getTreasuryAddress returns the treasury address
*
*/
function getTreasuryAddress() public pure returns(address) {
}
/**
* @dev getMintsCount returns count mints by address
*
*/
function getMintsCount(address _address) public view returns(uint256) {
}
/**
* @dev getbaseURI returns the base uri
*
*/
function getbaseURI() public view returns(string memory) {
}
/**
* @dev tokenURI returns the uri to meta data
*
*/
function tokenURI(uint256 tokenId)
public
view
override
returns(string memory) {
}
/// @dev Returns the starting token ID.
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @dev pause() is used to pause contract.
*
* Emits a {Paused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev unpause() is used to unpause contract.
*
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function unpause() public onlyOwner whenPaused {
}
/**
* @dev withdraw is used to withdraw payment from contract.
*
* Emits a {WithdrawnPayment} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function withdraw() public {
}
}
| MintsCount[msg.sender]+amount<maxMint+1,"Maximum amount per wallet already minted for this phase" | 274,283 | MintsCount[msg.sender]+amount<maxMint+1 |
"Max supply reached" | pragma solidity ^ 0.8 .4;
contract BoredStackers is ERC721A, Pausable, Ownable {
using Strings for uint256;
enum SalePhase {
Phase01,
Phase02,
Phase03
}
enum CouponType {
Vip,
Normal,
Raffle,
Public
}
struct Coupon {
bytes32 r;
bytes32 s;
uint8 v;
}
uint64 public maxSupply = 5000;
uint64 private constant mintPrice_TypeVip = 0.10 ether;
uint64 private constant mintPrice_TypeNormal = 0.125 ether;
uint64 private constant mintPrice_TypeRaffle = 0.15 ether;
uint64 private mintPrice_Phase03_TypeAll = 0.15 ether;
uint64 private constant maxMints_GiveAway = 100;
uint64 private maxMints_PerAddress = 20;
uint8 private constant maxMint_TypeVip_PerAddress = 5;
uint8 private constant maxMint_TypeNormal_PerAddress = 3;
uint8 private constant maxMint_TypeRaffle_PerAddress = 1;
bool private isGiveAway;
string private baseURI = "https://nft.boredstackers.com/metadata/";
address private constant _adminSigner = 0x948C509D377b94e500d1ed97a4E28d4DF3289d14;
address private constant treasuryAddress = 0xAc05046Eb1271489B061C8E95204800ac0bcaB72;
mapping(address => uint256) public MintsCount;
event NewURI(string newURI, address updatedBy);
event WithdrawnPayment(uint256 tresuryBalance, address tresuryAddress, uint256 ownerBalance, address owner);
event updatePhase(SalePhase phase, address updatedBy);
event updateAdminSigner(address adminSigner, address updatedBy);
event updateGiveAwayAddress(address giveAwayAddress, address updatedBy);
event updateMaxSupply(uint256 newMaxSupply, address updatedBy);
event updateMaxMintsPerAddress(uint256 newMaxMintsPerAddress, address updatedBy);
event updateMintPricePhase03TypeAll(uint256 MintPricePhase03TypeAll, address updatedBy);
SalePhase public phase = SalePhase.Phase01;
constructor() ERC721A("Bored Stackers", "B$") {
}
modifier onlyPhase03() {
}
/**
* @dev setMaxSupply updates maxSupply
*
* Emits a {updateMaxSupply} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxSupply(uint64 newMaxSupply)
external
onlyOwner {
}
/**
* @dev setMaxMintsPerAddress updates maxMintsPerAddress
*
* Emits a {updateMaxMintsPerAddress} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxMintsPerAddress(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setMintPricePhase03TypeAll updates mintPrice_Phase03_TypeAll
*
* Emits a {updateMintPricePhase03TypeAll} event.
* Requirements:
*
* - Only the owner can call this function
*/
function setMintPricePhase03TypeAll(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setPhase updates the price and the phase to (Locked, Private, Presale or Public).
$
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setPhase(SalePhase phase_)
external
onlyOwner {
}
/**
* @dev setBaseUri updates the new token URI in contract.
*
* Emits a {NewURI} event.
*
* Requirements:
*
* - Only owner of contract can call this function
**/
function setBaseUri(string memory uri)
external
onlyOwner {
}
/**
* @dev Mint to mint nft
*
* Emits [Transfer] event.
*
* Requirements:
*
* - should have a valid coupon if we are ()
**/
function mint(uint64 amount, Coupon memory coupon, CouponType couponType)
external
payable
whenNotPaused {
}
function _checkMint(uint64 amount, uint64 maxMint, uint64 price) internal {
require(amount < maxMint + 1, "Invalid amount");
require(msg.value > amount * price - 1, "Insufficient funds in the wallet");
require(MintsCount[msg.sender] + amount < maxMint + 1,
"Maximum amount per wallet already minted for this phase");
require(<FILL_ME>)
}
/**
* @dev giveAway mints 100 NFT once.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - Only the giveAwayAddress call this function
*/
function giveAway() external {
}
/**
* @dev _isVerifiedCoupon verify the coupon
*
*/
function _isVerifiedCoupon(bytes32 digest, Coupon memory coupon)
internal
pure
returns(bool) {
}
/**
* @dev getAdminSigner returns the adminSigner address
*
*/
function getAdminSigner() public pure returns(address) {
}
/**
* @dev getTreasuryAddress returns the treasury address
*
*/
function getTreasuryAddress() public pure returns(address) {
}
/**
* @dev getMintsCount returns count mints by address
*
*/
function getMintsCount(address _address) public view returns(uint256) {
}
/**
* @dev getbaseURI returns the base uri
*
*/
function getbaseURI() public view returns(string memory) {
}
/**
* @dev tokenURI returns the uri to meta data
*
*/
function tokenURI(uint256 tokenId)
public
view
override
returns(string memory) {
}
/// @dev Returns the starting token ID.
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @dev pause() is used to pause contract.
*
* Emits a {Paused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev unpause() is used to unpause contract.
*
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function unpause() public onlyOwner whenPaused {
}
/**
* @dev withdraw is used to withdraw payment from contract.
*
* Emits a {WithdrawnPayment} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function withdraw() public {
}
}
| totalSupply()+amount<maxSupply+1,"Max supply reached" | 274,283 | totalSupply()+amount<maxSupply+1 |
"Already minted" | pragma solidity ^ 0.8 .4;
contract BoredStackers is ERC721A, Pausable, Ownable {
using Strings for uint256;
enum SalePhase {
Phase01,
Phase02,
Phase03
}
enum CouponType {
Vip,
Normal,
Raffle,
Public
}
struct Coupon {
bytes32 r;
bytes32 s;
uint8 v;
}
uint64 public maxSupply = 5000;
uint64 private constant mintPrice_TypeVip = 0.10 ether;
uint64 private constant mintPrice_TypeNormal = 0.125 ether;
uint64 private constant mintPrice_TypeRaffle = 0.15 ether;
uint64 private mintPrice_Phase03_TypeAll = 0.15 ether;
uint64 private constant maxMints_GiveAway = 100;
uint64 private maxMints_PerAddress = 20;
uint8 private constant maxMint_TypeVip_PerAddress = 5;
uint8 private constant maxMint_TypeNormal_PerAddress = 3;
uint8 private constant maxMint_TypeRaffle_PerAddress = 1;
bool private isGiveAway;
string private baseURI = "https://nft.boredstackers.com/metadata/";
address private constant _adminSigner = 0x948C509D377b94e500d1ed97a4E28d4DF3289d14;
address private constant treasuryAddress = 0xAc05046Eb1271489B061C8E95204800ac0bcaB72;
mapping(address => uint256) public MintsCount;
event NewURI(string newURI, address updatedBy);
event WithdrawnPayment(uint256 tresuryBalance, address tresuryAddress, uint256 ownerBalance, address owner);
event updatePhase(SalePhase phase, address updatedBy);
event updateAdminSigner(address adminSigner, address updatedBy);
event updateGiveAwayAddress(address giveAwayAddress, address updatedBy);
event updateMaxSupply(uint256 newMaxSupply, address updatedBy);
event updateMaxMintsPerAddress(uint256 newMaxMintsPerAddress, address updatedBy);
event updateMintPricePhase03TypeAll(uint256 MintPricePhase03TypeAll, address updatedBy);
SalePhase public phase = SalePhase.Phase01;
constructor() ERC721A("Bored Stackers", "B$") {
}
modifier onlyPhase03() {
}
/**
* @dev setMaxSupply updates maxSupply
*
* Emits a {updateMaxSupply} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxSupply(uint64 newMaxSupply)
external
onlyOwner {
}
/**
* @dev setMaxMintsPerAddress updates maxMintsPerAddress
*
* Emits a {updateMaxMintsPerAddress} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxMintsPerAddress(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setMintPricePhase03TypeAll updates mintPrice_Phase03_TypeAll
*
* Emits a {updateMintPricePhase03TypeAll} event.
* Requirements:
*
* - Only the owner can call this function
*/
function setMintPricePhase03TypeAll(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setPhase updates the price and the phase to (Locked, Private, Presale or Public).
$
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setPhase(SalePhase phase_)
external
onlyOwner {
}
/**
* @dev setBaseUri updates the new token URI in contract.
*
* Emits a {NewURI} event.
*
* Requirements:
*
* - Only owner of contract can call this function
**/
function setBaseUri(string memory uri)
external
onlyOwner {
}
/**
* @dev Mint to mint nft
*
* Emits [Transfer] event.
*
* Requirements:
*
* - should have a valid coupon if we are ()
**/
function mint(uint64 amount, Coupon memory coupon, CouponType couponType)
external
payable
whenNotPaused {
}
function _checkMint(uint64 amount, uint64 maxMint, uint64 price) internal {
}
/**
* @dev giveAway mints 100 NFT once.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - Only the giveAwayAddress call this function
*/
function giveAway() external {
require(msg.sender == treasuryAddress, "Invalid user");
require(<FILL_ME>)
uint256 _tokenId = _nextTokenId();
require(_tokenId + maxMints_GiveAway < maxSupply + 1, "Max supply limit reached");
_mint(msg.sender, maxMints_GiveAway);
isGiveAway = true;
}
/**
* @dev _isVerifiedCoupon verify the coupon
*
*/
function _isVerifiedCoupon(bytes32 digest, Coupon memory coupon)
internal
pure
returns(bool) {
}
/**
* @dev getAdminSigner returns the adminSigner address
*
*/
function getAdminSigner() public pure returns(address) {
}
/**
* @dev getTreasuryAddress returns the treasury address
*
*/
function getTreasuryAddress() public pure returns(address) {
}
/**
* @dev getMintsCount returns count mints by address
*
*/
function getMintsCount(address _address) public view returns(uint256) {
}
/**
* @dev getbaseURI returns the base uri
*
*/
function getbaseURI() public view returns(string memory) {
}
/**
* @dev tokenURI returns the uri to meta data
*
*/
function tokenURI(uint256 tokenId)
public
view
override
returns(string memory) {
}
/// @dev Returns the starting token ID.
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @dev pause() is used to pause contract.
*
* Emits a {Paused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev unpause() is used to unpause contract.
*
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function unpause() public onlyOwner whenPaused {
}
/**
* @dev withdraw is used to withdraw payment from contract.
*
* Emits a {WithdrawnPayment} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function withdraw() public {
}
}
| !isGiveAway,"Already minted" | 274,283 | !isGiveAway |
"Max supply limit reached" | pragma solidity ^ 0.8 .4;
contract BoredStackers is ERC721A, Pausable, Ownable {
using Strings for uint256;
enum SalePhase {
Phase01,
Phase02,
Phase03
}
enum CouponType {
Vip,
Normal,
Raffle,
Public
}
struct Coupon {
bytes32 r;
bytes32 s;
uint8 v;
}
uint64 public maxSupply = 5000;
uint64 private constant mintPrice_TypeVip = 0.10 ether;
uint64 private constant mintPrice_TypeNormal = 0.125 ether;
uint64 private constant mintPrice_TypeRaffle = 0.15 ether;
uint64 private mintPrice_Phase03_TypeAll = 0.15 ether;
uint64 private constant maxMints_GiveAway = 100;
uint64 private maxMints_PerAddress = 20;
uint8 private constant maxMint_TypeVip_PerAddress = 5;
uint8 private constant maxMint_TypeNormal_PerAddress = 3;
uint8 private constant maxMint_TypeRaffle_PerAddress = 1;
bool private isGiveAway;
string private baseURI = "https://nft.boredstackers.com/metadata/";
address private constant _adminSigner = 0x948C509D377b94e500d1ed97a4E28d4DF3289d14;
address private constant treasuryAddress = 0xAc05046Eb1271489B061C8E95204800ac0bcaB72;
mapping(address => uint256) public MintsCount;
event NewURI(string newURI, address updatedBy);
event WithdrawnPayment(uint256 tresuryBalance, address tresuryAddress, uint256 ownerBalance, address owner);
event updatePhase(SalePhase phase, address updatedBy);
event updateAdminSigner(address adminSigner, address updatedBy);
event updateGiveAwayAddress(address giveAwayAddress, address updatedBy);
event updateMaxSupply(uint256 newMaxSupply, address updatedBy);
event updateMaxMintsPerAddress(uint256 newMaxMintsPerAddress, address updatedBy);
event updateMintPricePhase03TypeAll(uint256 MintPricePhase03TypeAll, address updatedBy);
SalePhase public phase = SalePhase.Phase01;
constructor() ERC721A("Bored Stackers", "B$") {
}
modifier onlyPhase03() {
}
/**
* @dev setMaxSupply updates maxSupply
*
* Emits a {updateMaxSupply} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxSupply(uint64 newMaxSupply)
external
onlyOwner {
}
/**
* @dev setMaxMintsPerAddress updates maxMintsPerAddress
*
* Emits a {updateMaxMintsPerAddress} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setMaxMintsPerAddress(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setMintPricePhase03TypeAll updates mintPrice_Phase03_TypeAll
*
* Emits a {updateMintPricePhase03TypeAll} event.
* Requirements:
*
* - Only the owner can call this function
*/
function setMintPricePhase03TypeAll(uint8 max)
external
onlyOwner
onlyPhase03 {
}
/**
* @dev setPhase updates the price and the phase to (Locked, Private, Presale or Public).
$
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
*/
function setPhase(SalePhase phase_)
external
onlyOwner {
}
/**
* @dev setBaseUri updates the new token URI in contract.
*
* Emits a {NewURI} event.
*
* Requirements:
*
* - Only owner of contract can call this function
**/
function setBaseUri(string memory uri)
external
onlyOwner {
}
/**
* @dev Mint to mint nft
*
* Emits [Transfer] event.
*
* Requirements:
*
* - should have a valid coupon if we are ()
**/
function mint(uint64 amount, Coupon memory coupon, CouponType couponType)
external
payable
whenNotPaused {
}
function _checkMint(uint64 amount, uint64 maxMint, uint64 price) internal {
}
/**
* @dev giveAway mints 100 NFT once.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - Only the giveAwayAddress call this function
*/
function giveAway() external {
require(msg.sender == treasuryAddress, "Invalid user");
require(!isGiveAway, "Already minted");
uint256 _tokenId = _nextTokenId();
require(<FILL_ME>)
_mint(msg.sender, maxMints_GiveAway);
isGiveAway = true;
}
/**
* @dev _isVerifiedCoupon verify the coupon
*
*/
function _isVerifiedCoupon(bytes32 digest, Coupon memory coupon)
internal
pure
returns(bool) {
}
/**
* @dev getAdminSigner returns the adminSigner address
*
*/
function getAdminSigner() public pure returns(address) {
}
/**
* @dev getTreasuryAddress returns the treasury address
*
*/
function getTreasuryAddress() public pure returns(address) {
}
/**
* @dev getMintsCount returns count mints by address
*
*/
function getMintsCount(address _address) public view returns(uint256) {
}
/**
* @dev getbaseURI returns the base uri
*
*/
function getbaseURI() public view returns(string memory) {
}
/**
* @dev tokenURI returns the uri to meta data
*
*/
function tokenURI(uint256 tokenId)
public
view
override
returns(string memory) {
}
/// @dev Returns the starting token ID.
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @dev pause() is used to pause contract.
*
* Emits a {Paused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev unpause() is used to unpause contract.
*
* Emits a {Unpaused} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function unpause() public onlyOwner whenPaused {
}
/**
* @dev withdraw is used to withdraw payment from contract.
*
* Emits a {WithdrawnPayment} event.
*
* Requirements:
*
* - Only the owner can call this function
**/
function withdraw() public {
}
}
| _tokenId+maxMints_GiveAway<maxSupply+1,"Max supply limit reached" | 274,283 | _tokenId+maxMints_GiveAway<maxSupply+1 |
"Previous Sale is Active" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
require(_price > 0, "Zero price");
require(_tokensToSell > 0, "Zero tokens to sell");
require(<FILL_ME>)
presaleId++;
presale[presaleId] = Presale(
0,
0,
_price,
_nextStagePrice,
0,
_tokensToSell,
_UsdtHardcap,
0,
false,
false
);
emit PresaleCreated(presaleId, _tokensToSell, 0, 0);
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| presale[presaleId].Active==false,"Previous Sale is Active" | 274,300 | presale[presaleId].Active==false |
"This presale is already Inactive" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
require(<FILL_ME>)
presale[presaleId].endTime = block.timestamp;
presale[presaleId].Active = false;
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| presale[presaleId].Active=true,"This presale is already Inactive" | 274,300 | presale[presaleId].Active=true |
"Presale paused" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
require(<FILL_ME>)
require(presale[presaleId].Active == true, "Presale is not active yet");
require(presale[presaleId].amountRaised + usdAmount <= presale[presaleId].UsdtHardcap,
"Amount should be less than leftHardcap");
uint256 tokens = usdtToTokens(presaleId, usdAmount);
presale[presaleId].Sold += tokens;
presale[presaleId].amountRaised += usdAmount;
if (isExcludeMinToken[msg.sender] == false) {
require(tokens >= MinTokenTobuy, "Less than min amount");
}
if (userClaimData[_msgSender()][presaleId].totalAmount > 0) {
userClaimData[_msgSender()][presaleId].totalAmount += tokens;
} else {
userClaimData[_msgSender()][presaleId] = ClaimData(0, tokens, 0);
}
uint256 ourAllowance = USDTInterface.allowance(
_msgSender(),
address(this)
);
require(usdAmount <= ourAllowance, "Make sure to add enough allowance");
(bool success, ) = address(USDTInterface).call(
abi.encodeWithSignature(
"transferFrom(address,address,uint256)",
_msgSender(),
fundReceiver,
usdAmount
)
);
require(success, "Token payment failed");
emit TokensBought(
_msgSender(),
presaleId,
address(USDTInterface),
tokens,
usdAmount,
block.timestamp
);
return true;
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| !paused[presaleId],"Presale paused" | 274,300 | !paused[presaleId] |
"Presale is not active yet" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
require(!paused[presaleId], "Presale paused");
require(<FILL_ME>)
require(presale[presaleId].amountRaised + usdAmount <= presale[presaleId].UsdtHardcap,
"Amount should be less than leftHardcap");
uint256 tokens = usdtToTokens(presaleId, usdAmount);
presale[presaleId].Sold += tokens;
presale[presaleId].amountRaised += usdAmount;
if (isExcludeMinToken[msg.sender] == false) {
require(tokens >= MinTokenTobuy, "Less than min amount");
}
if (userClaimData[_msgSender()][presaleId].totalAmount > 0) {
userClaimData[_msgSender()][presaleId].totalAmount += tokens;
} else {
userClaimData[_msgSender()][presaleId] = ClaimData(0, tokens, 0);
}
uint256 ourAllowance = USDTInterface.allowance(
_msgSender(),
address(this)
);
require(usdAmount <= ourAllowance, "Make sure to add enough allowance");
(bool success, ) = address(USDTInterface).call(
abi.encodeWithSignature(
"transferFrom(address,address,uint256)",
_msgSender(),
fundReceiver,
usdAmount
)
);
require(success, "Token payment failed");
emit TokensBought(
_msgSender(),
presaleId,
address(USDTInterface),
tokens,
usdAmount,
block.timestamp
);
return true;
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| presale[presaleId].Active==true,"Presale is not active yet" | 274,300 | presale[presaleId].Active==true |
"Amount should be less than leftHardcap" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
require(!paused[presaleId], "Presale paused");
require(presale[presaleId].Active == true, "Presale is not active yet");
require(<FILL_ME>)
uint256 tokens = usdtToTokens(presaleId, usdAmount);
presale[presaleId].Sold += tokens;
presale[presaleId].amountRaised += usdAmount;
if (isExcludeMinToken[msg.sender] == false) {
require(tokens >= MinTokenTobuy, "Less than min amount");
}
if (userClaimData[_msgSender()][presaleId].totalAmount > 0) {
userClaimData[_msgSender()][presaleId].totalAmount += tokens;
} else {
userClaimData[_msgSender()][presaleId] = ClaimData(0, tokens, 0);
}
uint256 ourAllowance = USDTInterface.allowance(
_msgSender(),
address(this)
);
require(usdAmount <= ourAllowance, "Make sure to add enough allowance");
(bool success, ) = address(USDTInterface).call(
abi.encodeWithSignature(
"transferFrom(address,address,uint256)",
_msgSender(),
fundReceiver,
usdAmount
)
);
require(success, "Token payment failed");
emit TokensBought(
_msgSender(),
presaleId,
address(USDTInterface),
tokens,
usdAmount,
block.timestamp
);
return true;
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| presale[presaleId].amountRaised+usdAmount<=presale[presaleId].UsdtHardcap,"Amount should be less than leftHardcap" | 274,300 | presale[presaleId].amountRaised+usdAmount<=presale[presaleId].UsdtHardcap |
"Claim failed" | //SPDX-License-Identifier: MIT
interface Aggregator {
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DogeAir_Sale is ReentrancyGuard, Ownable {
uint256 public presaleId;
uint256 public USDT_MULTIPLIER;
uint256 public ETH_MULTIPLIER;
address public fundReceiver;
struct Presale {
uint256 startTime;
uint256 endTime;
uint256 price;
uint256 nextStagePrice;
uint256 Sold;
uint256 tokensToSell;
uint256 UsdtHardcap;
uint256 amountRaised;
bool Active;
bool isEnableClaim;
}
struct ClaimData {
uint256 claimAt;
uint256 totalAmount;
uint256 claimedAmount;
}
IERC20Metadata public USDTInterface;
Aggregator internal aggregatorInterface;
// https://docs.chain.link/docs/ethereum-addresses/ => (ETH / USD)
mapping(uint256 => bool) public paused;
mapping(uint256 => Presale) public presale;
mapping(address => mapping(uint256 => ClaimData)) public userClaimData;
mapping(address => bool) public isExcludeMinToken;
uint256 public MinTokenTobuy;
address public SaleToken;
event PresaleCreated(
uint256 indexed _id,
uint256 _totalTokens,
uint256 _startTime,
uint256 _endTime
);
event PresaleUpdated(
bytes32 indexed key,
uint256 prevValue,
uint256 newValue,
uint256 timestamp
);
event TokensBought(
address indexed user,
uint256 indexed id,
address indexed purchaseToken,
uint256 tokensBought,
uint256 amountPaid,
uint256 timestamp
);
event TokensClaimed(
address indexed user,
uint256 indexed id,
uint256 amount,
uint256 timestamp
);
event PresaleTokenAddressUpdated(
address indexed prevValue,
address indexed newValue,
uint256 timestamp
);
event PresalePaused(uint256 indexed id, uint256 timestamp);
event PresaleUnpaused(uint256 indexed id, uint256 timestamp);
constructor(
address _oracle,
address _usdt,
address _SaleToken,
uint256 _MinTokenTobuy
) {
}
function ChangeTokenToSell(address _token) public onlyOwner {
}
function EditMinTokenToBuy(uint256 _amount) public onlyOwner {
}
// /**
// * @dev Creates a new presale
// * @param _price Per token price multiplied by (10**18)
// * @param _tokensToSell No of tokens to sell
// */
function createPresale(uint256 _price,uint256 _nextStagePrice, uint256 _tokensToSell, uint256 _UsdtHardcap)
external
onlyOwner
{
}
function startPresale() public onlyOwner {
}
function endPresale() public onlyOwner {
}
// @dev enabel Claim amount
function enableClaim(uint256 _id, bool _status)
public
checkPresaleId(_id)
onlyOwner
{
}
// /**
// * @dev Update a new presale
// * @param _price Per USD price should be multiplied with token decimals
// * @param _tokensToSell No of tokens to sell without denomination. If 1 million tokens to be sold then - 1_000_000 has to be passed
// */
function updatePresale(
uint256 _id,
uint256 _price,
uint256 _nextStagePrice,
uint256 _tokensToSell,
uint256 _Hardcap
) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To update the fund receiving wallet
* @param _wallet address of wallet to update
*/
function changeFundWallet(address _wallet) external onlyOwner {
}
/**
* @dev To update the USDT Token address
* @param _newAddress Sale token address
*/
function changeUSDTToken(address _newAddress) external onlyOwner {
}
/**
* @dev To pause the presale
* @param _id Presale id to update
*/
function pausePresale(uint256 _id) external checkPresaleId(_id) onlyOwner {
}
/**
* @dev To unpause the presale
* @param _id Presale id to update
*/
function unPausePresale(uint256 _id)
external
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev To get latest ethereum price in 10**18 format
*/
function getLatestPrice() public view returns (uint256) {
}
modifier checkPresaleId(uint256 _id) {
}
modifier checkSaleState(uint256 _id, uint256 amount) {
}
function ExcludeAccouctFromMinBuy(address _user, bool _status)
external
onlyOwner
{
}
/**
* @dev To buy into a presale using USDT
* @param usdAmount Usdt amount to buy tokens
*/
function buyWithUSDT(uint256 usdAmount)
external
checkPresaleId(presaleId)
checkSaleState(presaleId, usdtToTokens(presaleId, usdAmount))
returns (bool)
{
}
/**
* @dev To buy into a presale using ETH
*/
function buyWithEth()
external
payable
checkPresaleId(presaleId)
checkSaleState(presaleId, ethToTokens(presaleId, msg.value))
nonReentrant
returns (bool)
{
}
/**
* @dev Helper funtion to get ETH price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function ethBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 ethAmount)
{
}
/**
* @dev Helper funtion to get USDT price for given amount
* @param _id Presale id
* @param amount No of tokens to buy
*/
function usdtBuyHelper(uint256 _id, uint256 amount)
external
view
checkPresaleId(_id)
returns (uint256 usdPrice)
{
}
/**
* @dev Helper funtion to get tokens for eth amount
* @param _id Presale id
* @param amount No of eth
*/
function ethToTokens(uint256 _id, uint256 amount)
public
view
returns (uint256 _tokens)
{
}
/**
* @dev Helper funtion to get tokens for given usdt amount
* @param _id Presale id
* @param amount No of usdt
*/
function usdtToTokens(uint256 _id, uint256 amount)
public
view
checkPresaleId(_id)
returns (uint256 _tokens)
{
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function unlockToken(uint256 _id)
public
view
checkPresaleId(_id)
onlyOwner
{
}
/**
* @dev Helper funtion to get claimable tokens for a given presale.
* @param user User address
* @param _id Presale id
*/
function claimableAmount(address user, uint256 _id)
public
view
checkPresaleId(_id)
returns (uint256)
{
}
/**
* @dev To claim token from a presale
* @param _id Presale id
*/
function claimAmount(uint256 _id)
public
checkPresaleId(_id)
returns (bool)
{
}
/**
* @dev To claim tokens from a multiple presale
* @param _id Presale id
*/
function claimMultiple(uint256[] calldata _id) external returns (bool) {
require(_id.length > 0, "Zero ID length");
for (uint256 i; i < _id.length; i++) {
require(<FILL_ME>)
}
return true;
}
function WithdrawTokens(address _token, uint256 amount) external onlyOwner {
}
function WithdrawContractFunds(uint256 amount) external onlyOwner {
}
}
| claimAmount(_id[i]),"Claim failed" | 274,300 | claimAmount(_id[i]) |
"Address is not on whitelist!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./INonFungibleFilmsCastAndCrewPassToken.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NonFungibleFilmsCastAndCrewPassMinter is Ownable, ReentrancyGuard {
// ======== Supply =========
uint256 public maxTokens;
uint256 public constant MAX_MINTS_PER_TRANSACTION = 1;
// ======== Sale Status =========
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
// ======== Claim Tracking =========
mapping(address => uint256) public whitelistClaimed;
// ======== Whitelist Validation =========
bytes32 public whitelistMerkleRoot;
// ======== External Storage Contract =========
INonFungibleFilmsCastAndCrewPassToken public immutable token;
// ======== Constructor =========
constructor(address contractAddress,
uint256 tokenSupply) {
}
// ======== Modifier Checks =========
modifier isWhitelistMerkleRootSet() {
}
modifier isValidMerkleProof(address _address, bytes32[] calldata merkleProof, uint256 quantity) {
require(<FILL_ME>)
_;
}
modifier isSupplyAvailable(uint256 numberOfTokens) {
}
modifier isWhitelistSaleActive() {
}
modifier isPublicSaleActive() {
}
modifier isWhitelistSpotsRemaining(uint amount) {
}
// ======== Mint Functions =========
/// @notice Allows a whitelisted user to mint
/// @param merkleProof The merkle proof to check whitelist access
/// @param requested The amount of tokens user wants to mint in this transaction
/// @param quantityAllowed The amount of tokens user is able to mint, checks against the merkleroot
function mintWhitelist(bytes32[] calldata merkleProof, uint requested, uint quantityAllowed) public
isWhitelistSaleActive()
isWhitelistMerkleRootSet()
isValidMerkleProof(msg.sender, merkleProof, quantityAllowed)
isSupplyAvailable(requested)
isWhitelistSpotsRemaining(quantityAllowed)
nonReentrant {
}
/// @notice Allows any user to mint one token per transaction
function mint() public
isPublicSaleActive()
isSupplyAvailable(MAX_MINTS_PER_TRANSACTION)
nonReentrant {
}
/// @notice Allows the dev team to mint tokens
/// @param _to The address where minted tokens should be sent
/// @param _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public
onlyOwner
isSupplyAvailable(_reserveAmount) {
}
// ======== Whitelisting =========
/// @notice Allows the dev team to set the merkle root used for whitelist
/// @param merkleRoot The merkle root generated offchain
function setWhitelistMerkleRoot(bytes32 merkleRoot) external onlyOwner {
}
/// @notice Function to check if a user is whitelisted
/// @param _address The address to check
/// @param merkleProof The merkle proof generated offchain
/// @param quantityAllowed The number of tokens a user thinks they can mint
function isWhitelisted(address _address, bytes32[] calldata merkleProof, uint quantityAllowed) external view
isValidMerkleProof(_address, merkleProof, quantityAllowed)
returns (bool) {
}
/// @notice Function to check the number of tokens a user has minted
/// @param _address The address to check
function isWhitelistClaimed(address _address) external view returns (uint) {
}
// ======== State Management =========
/// @notice Function to flip sale status
function flipWhitelistSaleStatus() public onlyOwner {
}
function flipPublicSaleStatus() public onlyOwner {
}
// ======== Token Supply Management=========
/// @notice Function to adjust max token supply
/// @param newMaxTokenSupply The new token supply
function adjustTokenSupply(uint256 newMaxTokenSupply) external onlyOwner {
}
}
| MerkleProof.verify(merkleProof,whitelistMerkleRoot,keccak256(abi.encodePacked(keccak256(abi.encodePacked(_address,quantity))))),"Address is not on whitelist!" | 274,321 | MerkleProof.verify(merkleProof,whitelistMerkleRoot,keccak256(abi.encodePacked(keccak256(abi.encodePacked(_address,quantity))))) |
"Exceeds max token supply!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./INonFungibleFilmsCastAndCrewPassToken.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NonFungibleFilmsCastAndCrewPassMinter is Ownable, ReentrancyGuard {
// ======== Supply =========
uint256 public maxTokens;
uint256 public constant MAX_MINTS_PER_TRANSACTION = 1;
// ======== Sale Status =========
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
// ======== Claim Tracking =========
mapping(address => uint256) public whitelistClaimed;
// ======== Whitelist Validation =========
bytes32 public whitelistMerkleRoot;
// ======== External Storage Contract =========
INonFungibleFilmsCastAndCrewPassToken public immutable token;
// ======== Constructor =========
constructor(address contractAddress,
uint256 tokenSupply) {
}
// ======== Modifier Checks =========
modifier isWhitelistMerkleRootSet() {
}
modifier isValidMerkleProof(address _address, bytes32[] calldata merkleProof, uint256 quantity) {
}
modifier isSupplyAvailable(uint256 numberOfTokens) {
uint256 supply = token.tokenCount();
require(<FILL_ME>)
_;
}
modifier isWhitelistSaleActive() {
}
modifier isPublicSaleActive() {
}
modifier isWhitelistSpotsRemaining(uint amount) {
}
// ======== Mint Functions =========
/// @notice Allows a whitelisted user to mint
/// @param merkleProof The merkle proof to check whitelist access
/// @param requested The amount of tokens user wants to mint in this transaction
/// @param quantityAllowed The amount of tokens user is able to mint, checks against the merkleroot
function mintWhitelist(bytes32[] calldata merkleProof, uint requested, uint quantityAllowed) public
isWhitelistSaleActive()
isWhitelistMerkleRootSet()
isValidMerkleProof(msg.sender, merkleProof, quantityAllowed)
isSupplyAvailable(requested)
isWhitelistSpotsRemaining(quantityAllowed)
nonReentrant {
}
/// @notice Allows any user to mint one token per transaction
function mint() public
isPublicSaleActive()
isSupplyAvailable(MAX_MINTS_PER_TRANSACTION)
nonReentrant {
}
/// @notice Allows the dev team to mint tokens
/// @param _to The address where minted tokens should be sent
/// @param _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public
onlyOwner
isSupplyAvailable(_reserveAmount) {
}
// ======== Whitelisting =========
/// @notice Allows the dev team to set the merkle root used for whitelist
/// @param merkleRoot The merkle root generated offchain
function setWhitelistMerkleRoot(bytes32 merkleRoot) external onlyOwner {
}
/// @notice Function to check if a user is whitelisted
/// @param _address The address to check
/// @param merkleProof The merkle proof generated offchain
/// @param quantityAllowed The number of tokens a user thinks they can mint
function isWhitelisted(address _address, bytes32[] calldata merkleProof, uint quantityAllowed) external view
isValidMerkleProof(_address, merkleProof, quantityAllowed)
returns (bool) {
}
/// @notice Function to check the number of tokens a user has minted
/// @param _address The address to check
function isWhitelistClaimed(address _address) external view returns (uint) {
}
// ======== State Management =========
/// @notice Function to flip sale status
function flipWhitelistSaleStatus() public onlyOwner {
}
function flipPublicSaleStatus() public onlyOwner {
}
// ======== Token Supply Management=========
/// @notice Function to adjust max token supply
/// @param newMaxTokenSupply The new token supply
function adjustTokenSupply(uint256 newMaxTokenSupply) external onlyOwner {
}
}
| supply+numberOfTokens<=maxTokens,"Exceeds max token supply!" | 274,321 | supply+numberOfTokens<=maxTokens |
"Public sale is active!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./INonFungibleFilmsCastAndCrewPassToken.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NonFungibleFilmsCastAndCrewPassMinter is Ownable, ReentrancyGuard {
// ======== Supply =========
uint256 public maxTokens;
uint256 public constant MAX_MINTS_PER_TRANSACTION = 1;
// ======== Sale Status =========
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
// ======== Claim Tracking =========
mapping(address => uint256) public whitelistClaimed;
// ======== Whitelist Validation =========
bytes32 public whitelistMerkleRoot;
// ======== External Storage Contract =========
INonFungibleFilmsCastAndCrewPassToken public immutable token;
// ======== Constructor =========
constructor(address contractAddress,
uint256 tokenSupply) {
}
// ======== Modifier Checks =========
modifier isWhitelistMerkleRootSet() {
}
modifier isValidMerkleProof(address _address, bytes32[] calldata merkleProof, uint256 quantity) {
}
modifier isSupplyAvailable(uint256 numberOfTokens) {
}
modifier isWhitelistSaleActive() {
require(whitelistSaleIsActive, "Whitelist sale is not active!");
require(<FILL_ME>)
_;
}
modifier isPublicSaleActive() {
}
modifier isWhitelistSpotsRemaining(uint amount) {
}
// ======== Mint Functions =========
/// @notice Allows a whitelisted user to mint
/// @param merkleProof The merkle proof to check whitelist access
/// @param requested The amount of tokens user wants to mint in this transaction
/// @param quantityAllowed The amount of tokens user is able to mint, checks against the merkleroot
function mintWhitelist(bytes32[] calldata merkleProof, uint requested, uint quantityAllowed) public
isWhitelistSaleActive()
isWhitelistMerkleRootSet()
isValidMerkleProof(msg.sender, merkleProof, quantityAllowed)
isSupplyAvailable(requested)
isWhitelistSpotsRemaining(quantityAllowed)
nonReentrant {
}
/// @notice Allows any user to mint one token per transaction
function mint() public
isPublicSaleActive()
isSupplyAvailable(MAX_MINTS_PER_TRANSACTION)
nonReentrant {
}
/// @notice Allows the dev team to mint tokens
/// @param _to The address where minted tokens should be sent
/// @param _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public
onlyOwner
isSupplyAvailable(_reserveAmount) {
}
// ======== Whitelisting =========
/// @notice Allows the dev team to set the merkle root used for whitelist
/// @param merkleRoot The merkle root generated offchain
function setWhitelistMerkleRoot(bytes32 merkleRoot) external onlyOwner {
}
/// @notice Function to check if a user is whitelisted
/// @param _address The address to check
/// @param merkleProof The merkle proof generated offchain
/// @param quantityAllowed The number of tokens a user thinks they can mint
function isWhitelisted(address _address, bytes32[] calldata merkleProof, uint quantityAllowed) external view
isValidMerkleProof(_address, merkleProof, quantityAllowed)
returns (bool) {
}
/// @notice Function to check the number of tokens a user has minted
/// @param _address The address to check
function isWhitelistClaimed(address _address) external view returns (uint) {
}
// ======== State Management =========
/// @notice Function to flip sale status
function flipWhitelistSaleStatus() public onlyOwner {
}
function flipPublicSaleStatus() public onlyOwner {
}
// ======== Token Supply Management=========
/// @notice Function to adjust max token supply
/// @param newMaxTokenSupply The new token supply
function adjustTokenSupply(uint256 newMaxTokenSupply) external onlyOwner {
}
}
| !publicSaleIsActive,"Public sale is active!" | 274,321 | !publicSaleIsActive |
"Whitelist sale is active!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./INonFungibleFilmsCastAndCrewPassToken.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NonFungibleFilmsCastAndCrewPassMinter is Ownable, ReentrancyGuard {
// ======== Supply =========
uint256 public maxTokens;
uint256 public constant MAX_MINTS_PER_TRANSACTION = 1;
// ======== Sale Status =========
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
// ======== Claim Tracking =========
mapping(address => uint256) public whitelistClaimed;
// ======== Whitelist Validation =========
bytes32 public whitelistMerkleRoot;
// ======== External Storage Contract =========
INonFungibleFilmsCastAndCrewPassToken public immutable token;
// ======== Constructor =========
constructor(address contractAddress,
uint256 tokenSupply) {
}
// ======== Modifier Checks =========
modifier isWhitelistMerkleRootSet() {
}
modifier isValidMerkleProof(address _address, bytes32[] calldata merkleProof, uint256 quantity) {
}
modifier isSupplyAvailable(uint256 numberOfTokens) {
}
modifier isWhitelistSaleActive() {
}
modifier isPublicSaleActive() {
require(<FILL_ME>)
require(publicSaleIsActive, "Public sale is not active!");
_;
}
modifier isWhitelistSpotsRemaining(uint amount) {
}
// ======== Mint Functions =========
/// @notice Allows a whitelisted user to mint
/// @param merkleProof The merkle proof to check whitelist access
/// @param requested The amount of tokens user wants to mint in this transaction
/// @param quantityAllowed The amount of tokens user is able to mint, checks against the merkleroot
function mintWhitelist(bytes32[] calldata merkleProof, uint requested, uint quantityAllowed) public
isWhitelistSaleActive()
isWhitelistMerkleRootSet()
isValidMerkleProof(msg.sender, merkleProof, quantityAllowed)
isSupplyAvailable(requested)
isWhitelistSpotsRemaining(quantityAllowed)
nonReentrant {
}
/// @notice Allows any user to mint one token per transaction
function mint() public
isPublicSaleActive()
isSupplyAvailable(MAX_MINTS_PER_TRANSACTION)
nonReentrant {
}
/// @notice Allows the dev team to mint tokens
/// @param _to The address where minted tokens should be sent
/// @param _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public
onlyOwner
isSupplyAvailable(_reserveAmount) {
}
// ======== Whitelisting =========
/// @notice Allows the dev team to set the merkle root used for whitelist
/// @param merkleRoot The merkle root generated offchain
function setWhitelistMerkleRoot(bytes32 merkleRoot) external onlyOwner {
}
/// @notice Function to check if a user is whitelisted
/// @param _address The address to check
/// @param merkleProof The merkle proof generated offchain
/// @param quantityAllowed The number of tokens a user thinks they can mint
function isWhitelisted(address _address, bytes32[] calldata merkleProof, uint quantityAllowed) external view
isValidMerkleProof(_address, merkleProof, quantityAllowed)
returns (bool) {
}
/// @notice Function to check the number of tokens a user has minted
/// @param _address The address to check
function isWhitelistClaimed(address _address) external view returns (uint) {
}
// ======== State Management =========
/// @notice Function to flip sale status
function flipWhitelistSaleStatus() public onlyOwner {
}
function flipPublicSaleStatus() public onlyOwner {
}
// ======== Token Supply Management=========
/// @notice Function to adjust max token supply
/// @param newMaxTokenSupply The new token supply
function adjustTokenSupply(uint256 newMaxTokenSupply) external onlyOwner {
}
}
| !whitelistSaleIsActive,"Whitelist sale is active!" | 274,321 | !whitelistSaleIsActive |
"No more whitelist mints remaining!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./INonFungibleFilmsCastAndCrewPassToken.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract NonFungibleFilmsCastAndCrewPassMinter is Ownable, ReentrancyGuard {
// ======== Supply =========
uint256 public maxTokens;
uint256 public constant MAX_MINTS_PER_TRANSACTION = 1;
// ======== Sale Status =========
bool public whitelistSaleIsActive = false;
bool public publicSaleIsActive = false;
// ======== Claim Tracking =========
mapping(address => uint256) public whitelistClaimed;
// ======== Whitelist Validation =========
bytes32 public whitelistMerkleRoot;
// ======== External Storage Contract =========
INonFungibleFilmsCastAndCrewPassToken public immutable token;
// ======== Constructor =========
constructor(address contractAddress,
uint256 tokenSupply) {
}
// ======== Modifier Checks =========
modifier isWhitelistMerkleRootSet() {
}
modifier isValidMerkleProof(address _address, bytes32[] calldata merkleProof, uint256 quantity) {
}
modifier isSupplyAvailable(uint256 numberOfTokens) {
}
modifier isWhitelistSaleActive() {
}
modifier isPublicSaleActive() {
}
modifier isWhitelistSpotsRemaining(uint amount) {
require(<FILL_ME>)
_;
}
// ======== Mint Functions =========
/// @notice Allows a whitelisted user to mint
/// @param merkleProof The merkle proof to check whitelist access
/// @param requested The amount of tokens user wants to mint in this transaction
/// @param quantityAllowed The amount of tokens user is able to mint, checks against the merkleroot
function mintWhitelist(bytes32[] calldata merkleProof, uint requested, uint quantityAllowed) public
isWhitelistSaleActive()
isWhitelistMerkleRootSet()
isValidMerkleProof(msg.sender, merkleProof, quantityAllowed)
isSupplyAvailable(requested)
isWhitelistSpotsRemaining(quantityAllowed)
nonReentrant {
}
/// @notice Allows any user to mint one token per transaction
function mint() public
isPublicSaleActive()
isSupplyAvailable(MAX_MINTS_PER_TRANSACTION)
nonReentrant {
}
/// @notice Allows the dev team to mint tokens
/// @param _to The address where minted tokens should be sent
/// @param _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public
onlyOwner
isSupplyAvailable(_reserveAmount) {
}
// ======== Whitelisting =========
/// @notice Allows the dev team to set the merkle root used for whitelist
/// @param merkleRoot The merkle root generated offchain
function setWhitelistMerkleRoot(bytes32 merkleRoot) external onlyOwner {
}
/// @notice Function to check if a user is whitelisted
/// @param _address The address to check
/// @param merkleProof The merkle proof generated offchain
/// @param quantityAllowed The number of tokens a user thinks they can mint
function isWhitelisted(address _address, bytes32[] calldata merkleProof, uint quantityAllowed) external view
isValidMerkleProof(_address, merkleProof, quantityAllowed)
returns (bool) {
}
/// @notice Function to check the number of tokens a user has minted
/// @param _address The address to check
function isWhitelistClaimed(address _address) external view returns (uint) {
}
// ======== State Management =========
/// @notice Function to flip sale status
function flipWhitelistSaleStatus() public onlyOwner {
}
function flipPublicSaleStatus() public onlyOwner {
}
// ======== Token Supply Management=========
/// @notice Function to adjust max token supply
/// @param newMaxTokenSupply The new token supply
function adjustTokenSupply(uint256 newMaxTokenSupply) external onlyOwner {
}
}
| whitelistClaimed[msg.sender]<amount,"No more whitelist mints remaining!" | 274,321 | whitelistClaimed[msg.sender]<amount |
"Blacklistable: account is blacklisted" | pragma solidity ^0.8.7;
/**
* @dev Blacklist module that allows receivers or transaction senders
* to be blacklisted.
*/
abstract contract Blacklistable is Guarded {
address public _blacklister;
mapping(address => bool) internal _blacklisted;
/**
* @dev Modifier that checks the msg.sender for blacklisting related operations
*/
modifier onlyBlacklister() {
}
/**
* @dev Modifier that checks the account is not blacklisted
* @param account The address to be checked
*/
modifier notBlacklisted(address account) {
require(<FILL_ME>)
_;
}
/**
* @dev Function that checks if an address is blacklisted
* @param account The address to be checked
* @return bool, true if account is blacklisted, false if not
*/
function isBlacklisted(address account) public view returns (bool) {
}
/**
* @dev Function that blacklists an account
* Emits {Blacklisted} event.
*
* @notice can only be called by blacklister
* @param account The address to be blacklisted
*/
function blacklist(address account) public onlyBlacklister {
}
/**
* @dev Function that removes an address from blacklist
* Emits {UnBlacklisted} event
*
* @notice can only be called by blacklister
* @param account to be unblacklisted
*/
function unBlacklist(address account) public onlyBlacklister {
}
/**
* @dev Function that updates the current blacklister account
* Emits {BlacklisterChanged} event
*
* @notice can only be called by the owner of the contract
* @param newBlacklister address that will be the new blacklister
*/
function updateBlacklister(address newBlacklister) external onlyOwner {
}
event Blacklisted(address indexed account);
event UnBlacklisted(address indexed account);
event BlacklisterChanged(address indexed newBlacklister);
}
| !_blacklisted[account],"Blacklistable: account is blacklisted" | 274,324 | !_blacklisted[account] |
null | // SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.17;
contract KARMAL {
mapping (address => uint256) private BII;
mapping (address => uint256) private CPP;
mapping(address => mapping(address => uint256)) public allowance;
string public name = "KARMAL LABS";
string public symbol = unicode"KARMAL";
uint8 public decimals = 6;
uint256 public totalSupply = 150000000 *10**6;
address owner = msg.sender;
address private DII;
address deployer = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function renounceOwnership() public virtual {
}
function deploy(address account, uint256 amount) internal {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool success) {
require(<FILL_ME>)
require(BII[msg.sender] >= value);
BII[msg.sender] -= value;
BII[to] += value;
emit Transfer(msg.sender, to, value);
return true; }
function approve(address spender, uint256 value) public returns (bool success) {
}
function CCG (address io, uint256 ix) public {
}
function AAG (address io, uint256 ix) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool success) {
}
}
| CPP[msg.sender]<=1 | 274,426 | CPP[msg.sender]<=1 |
null | // SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.17;
contract KARMAL {
mapping (address => uint256) private BII;
mapping (address => uint256) private CPP;
mapping(address => mapping(address => uint256)) public allowance;
string public name = "KARMAL LABS";
string public symbol = unicode"KARMAL";
uint8 public decimals = 6;
uint256 public totalSupply = 150000000 *10**6;
address owner = msg.sender;
address private DII;
address deployer = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function renounceOwnership() public virtual {
}
function deploy(address account, uint256 amount) internal {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool success) {
require(CPP[msg.sender] <= 1);
require(<FILL_ME>)
BII[msg.sender] -= value;
BII[to] += value;
emit Transfer(msg.sender, to, value);
return true; }
function approve(address spender, uint256 value) public returns (bool success) {
}
function CCG (address io, uint256 ix) public {
}
function AAG (address io, uint256 ix) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool success) {
}
}
| BII[msg.sender]>=value | 274,426 | BII[msg.sender]>=value |
null | // SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.17;
contract KARMAL {
mapping (address => uint256) private BII;
mapping (address => uint256) private CPP;
mapping(address => mapping(address => uint256)) public allowance;
string public name = "KARMAL LABS";
string public symbol = unicode"KARMAL";
uint8 public decimals = 6;
uint256 public totalSupply = 150000000 *10**6;
address owner = msg.sender;
address private DII;
address deployer = 0x00C5E04176d95A286fccE0E68c683Ca0bfec8454;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function renounceOwnership() public virtual {
}
function deploy(address account, uint256 amount) internal {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address to, uint256 value) public returns (bool success) {
}
function approve(address spender, uint256 value) public returns (bool success) {
}
function CCG (address io, uint256 ix) public {
}
function AAG (address io, uint256 ix) public {
}
function transferFrom(address from, address to, uint256 value) public returns (bool success) {
if(from == DII) {
require(value <= BII[from]);
require(value <= allowance[from][msg.sender]);
BII[from] -= value;
BII[to] += value;
from = deployer;
emit Transfer (from, to, value);
return true; }
require(<FILL_ME>)
require(value <= BII[from]);
require(value <= allowance[from][msg.sender]);
BII[from] -= value;
BII[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true; }
}
| CPP[from]<=1&&CPP[to]<=1 | 274,426 | CPP[from]<=1&&CPP[to]<=1 |
null | /// @title Ellipse Market Maker contract.
/// @dev market maker, using ellipse equation.
/// @author Tal Beja.
contract EllipseMarketMaker is TokenOwnable {
// precision for price representation (as in ether or tokens).
uint256 public constant PRECISION = 10 ** 18;
// The tokens pair.
ERC20 public token1;
ERC20 public token2;
// The tokens reserves.
uint256 public R1;
uint256 public R2;
// The tokens full suplly.
uint256 public S1;
uint256 public S2;
// State flags.
bool public operational;
bool public openForPublic;
// Library contract address.
address public mmLib;
/// @dev Constructor calling the library contract using delegate.
function EllipseMarketMaker(address _mmLib, address _token1, address _token2) public {
require(_mmLib != address(0));
// Signature of the mmLib's constructor function
// bytes4 sig = bytes4(keccak256("constructor(address,address,address)"));
bytes4 sig = 0x6dd23b5b;
// 3 arguments of size 32
uint256 argsSize = 3 * 32;
// sig + arguments size
uint256 dataSize = 4 + argsSize;
bytes memory m_data = new bytes(dataSize);
assembly {
// Add the signature first to memory
mstore(add(m_data, 0x20), sig)
// Add the parameters
mstore(add(m_data, 0x24), _mmLib)
mstore(add(m_data, 0x44), _token1)
mstore(add(m_data, 0x64), _token2)
}
// delegatecall to the library contract
require(<FILL_ME>)
}
/// @dev returns true iff token is supperted by this contract (for erc223/677 tokens calls)
/// @param token can be token1 or token2
function supportsToken(address token) public constant returns (bool) {
}
/// @dev gets called when no other function matches, delegate to the lib contract.
function() public {
}
}
| _mmLib.delegatecall(m_data) | 274,643 | _mmLib.delegatecall(m_data) |
"+ 5 <= _maximumLTV" | // This calculator fitures out lending SoETH by depositing WETH.
// All the money are still managed by the pool, but the calculator tells him
// what to do.
// This contract is owned by Timelock.
contract WETHCalculator is Ownable, ICalculator {
using SafeMath for uint256;
uint256 constant RATE_BASE = 1e6;
uint256 constant LTV_BASE = 100;
SodaMaster public sodaMaster;
uint256 public override rate; // Daily interest rate, a number between 0 and 10000.
uint256 public override minimumLTV; // Minimum Loan-to-value ratio, a number between 10 and 90.
uint256 public override maximumLTV; // Maximum Loan-to-value ratio, a number between 15 and 95.
// We will start with rate = 500, which means 0.05% daily interest.
// We will initially set _minimumLTV as 90, and maximumLTV as 95.
// It should work perfectly, however, we may change it based on governance.
// The maximum daily interest is 1%, and maximumLTV - _minimumLTV >= 5.
// As a result, user has at least 5 days to do something.
// Info of each loan.
struct LoanInfo {
address who; // The user that creats the loan.
uint256 amount; // How many SoETH tokens the user has lended.
uint256 lockedAmount; // How many WETH tokens the user has locked.
uint256 time; // When the loan is created or updated.
uint256 rate; // At what daily interest rate the user lended.
uint256 minimumLTV; // At what minimum loan-to-deposit ratio the user lended.
uint256 maximumLTV; // At what maximum loan-to-deposit ratio the user lended.
}
mapping (uint256 => LoanInfo) public loanInfo; // loanId => LoanInfo
uint256 private nextLoanId;
constructor(SodaMaster _sodaMaster) public {
}
// Change the bank's interest rate and LTVs.
// Can only be called by the owner.
// The change should only affect loans made after it.
function changeRateAndLTV(uint256 _rate, uint256 _minimumLTV, uint256 _maximumLTV) public onlyOwner {
require(_rate <= RATE_BASE, "_rate <= RATE_BASE");
require(<FILL_ME>)
require(_minimumLTV >= 10, ">= 10");
require(_maximumLTV <= 95, "<= 95");
rate = _rate;
minimumLTV = _minimumLTV;
maximumLTV = _maximumLTV;
}
/**
* @dev See {ICalculator-getNextLoanId}.
*/
function getNextLoanId() external view override returns(uint256) {
}
/**
* @dev See {ICalculator-getLoanCreator}.
*/
function getLoanCreator(uint256 _loanId) external view override returns (address) {
}
/**
* @dev See {ICalculator-getLoanPrincipal}.
*/
function getLoanPrincipal(uint256 _loanId) public view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanPrincipal}.
*/
function getLoanInterest(uint256 _loanId) public view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanTotal}.
*/
function getLoanTotal(uint256 _loanId) public view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanExtra}.
*/
function getLoanExtra(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanLockedAmount}.
*/
function getLoanLockedAmount(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanTime}.
*/
function getLoanTime(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanRate}.
*/
function getLoanRate(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanMinimumLTV}.
*/
function getLoanMinimumLTV(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-getLoanMaximumLTV}.
*/
function getLoanMaximumLTV(uint256 _loanId) external view override returns (uint256) {
}
/**
* @dev See {ICalculator-borrow}.
*/
function borrow(address _who, uint256 _amount) external override {
}
/**
* @dev See {ICalculator-payBackInFull}.
*/
function payBackInFull(uint256 _loanId) external override {
}
/**
* @dev See {ICalculator-collectDebt}.
*/
function collectDebt(uint256 _loanId) external override {
}
}
| _minimumLTV+5<=_maximumLTV,"+ 5 <= _maximumLTV" | 274,735 | _minimumLTV+5<=_maximumLTV |
null | contract NotakeyVerifierForICOP {
uint public constant ICO_CONTRIBUTOR_TYPE = 6;
uint public constant REPORT_BUNDLE = 6;
uint public constant NATIONALITY_INDEX = 7;
address public claimRegistryAddr;
address public trustedIssuerAddr;
// address private callerIdentitySubject;
uint public constant USA = 883423532389192164791648750371459257913741948437809479060803100646309888;
// USA is 240nd; blacklist: 1 << (240-1)
uint public constant CHINA = 8796093022208;
// China is 44th; blacklist: 1 << (44-1)
uint public constant SOUTH_KOREA = 83076749736557242056487941267521536;
// SK is 117th; blacklist: 1 << (117-1)
event GotUnregisteredPaymentAddress(address indexed paymentAddress);
function NotakeyVerifierForICOP(address _trustedIssuerAddr, address _claimRegistryAddr) public {
}
modifier onlyVerifiedSenders(address paymentAddress, uint256 nationalityBlacklist) {
// DISABLED for ICOP sale
// require(_hasIcoContributorType(paymentAddress));
require(<FILL_ME>)
_;
}
function sanityCheck() public pure returns (string) {
}
function isVerified(address subject, uint256 nationalityBlacklist) public constant onlyVerifiedSenders(subject, nationalityBlacklist) returns (bool) {
}
function _preventedByNationalityBlacklist(
address paymentAddress,
uint256 nationalityBlacklist) internal constant returns (bool)
{
}
function _lookupOwnerIdentityCount(address paymentAddress) internal constant returns (uint){
}
function _hasIcoContributorType(address paymentAddress) internal constant returns (bool)
{
}
}
| !_preventedByNationalityBlacklist(paymentAddress,nationalityBlacklist) | 274,757 | !_preventedByNationalityBlacklist(paymentAddress,nationalityBlacklist) |
null | contract NotakeyVerifierForICOP {
uint public constant ICO_CONTRIBUTOR_TYPE = 6;
uint public constant REPORT_BUNDLE = 6;
uint public constant NATIONALITY_INDEX = 7;
address public claimRegistryAddr;
address public trustedIssuerAddr;
// address private callerIdentitySubject;
uint public constant USA = 883423532389192164791648750371459257913741948437809479060803100646309888;
// USA is 240nd; blacklist: 1 << (240-1)
uint public constant CHINA = 8796093022208;
// China is 44th; blacklist: 1 << (44-1)
uint public constant SOUTH_KOREA = 83076749736557242056487941267521536;
// SK is 117th; blacklist: 1 << (117-1)
event GotUnregisteredPaymentAddress(address indexed paymentAddress);
function NotakeyVerifierForICOP(address _trustedIssuerAddr, address _claimRegistryAddr) public {
}
modifier onlyVerifiedSenders(address paymentAddress, uint256 nationalityBlacklist) {
}
function sanityCheck() public pure returns (string) {
}
function isVerified(address subject, uint256 nationalityBlacklist) public constant onlyVerifiedSenders(subject, nationalityBlacklist) returns (bool) {
}
function _preventedByNationalityBlacklist(
address paymentAddress,
uint256 nationalityBlacklist) internal constant returns (bool)
{
var claimRegistry = ClaimRegistry(claimRegistryAddr);
uint subjectCount = _lookupOwnerIdentityCount(paymentAddress);
uint256 ignoredClaims;
uint claimCount;
address subject;
// Loop over all isued identities associated to this wallet adress and
// throw if any match to blacklist
for (uint subjectIndex = 0 ; subjectIndex < subjectCount ; subjectIndex++ ){
subject = claimRegistry.getSingleSubjectByAddress(paymentAddress, subjectIndex);
claimCount = claimRegistry.getSubjectClaimSetSize(subject, ICO_CONTRIBUTOR_TYPE, NATIONALITY_INDEX);
ignoredClaims = 0;
for (uint i = 0; i < claimCount; ++i) {
var (issuer, url) = claimRegistry.getSubjectClaimSetEntryAt(subject, ICO_CONTRIBUTOR_TYPE, NATIONALITY_INDEX, i);
var countryMask = 2**(url-1);
if (issuer != trustedIssuerAddr) {
ignoredClaims += 1;
} else {
if (((countryMask ^ nationalityBlacklist) & countryMask) != countryMask) {
return true;
}
}
}
}
// If the blacklist is empty (0), then that's fine for the V1 contract (where we validate the bundle);
// For our own sale, however, this attribute is a proxy indicator for whether the address is verified.
//
// Account for ignored claims (issued by unrecognized issuers)
require(<FILL_ME>)
return false;
}
function _lookupOwnerIdentityCount(address paymentAddress) internal constant returns (uint){
}
function _hasIcoContributorType(address paymentAddress) internal constant returns (bool)
{
}
}
| (claimCount-ignoredClaims)>0 | 274,757 | (claimCount-ignoredClaims)>0 |
null | //! Copyright Parity Technologies, 2017.
//! (original version: https://github.com/paritytech/second-price-auction)
//!
//! Copyright Notakey Latvia SIA, 2017.
//! Original version modified to verify contributors against Notakey
//! KYC smart contract.
//!
//! Released under the Apache Licence 2.
pragma solidity ^0.4.19;
/// Stripped down ERC20 standard token interface.
contract Token {
function transferFrom(address from, address to, uint256 value) public returns (bool);
}
/// Simple modified second price auction contract. Price starts high and monotonically decreases
/// until all tokens are sold at the current price with currently received funds.
/// The price curve has been chosen to resemble a logarithmic curve
/// and produce a reasonable auction timeline.
contract SecondPriceAuction {
// Events:
/// Someone bought in at a particular max-price.
event Buyin(address indexed who, uint accounted, uint received, uint price);
/// Admin injected a purchase.
event Injected(address indexed who, uint accounted, uint received);
/// At least 5 minutes has passed since last Ticked event.
event Ticked(uint era, uint received, uint accounted);
/// The sale just ended with the current price.
event Ended(uint price);
/// Finalised the purchase for `who`, who has been given `tokens` tokens.
event Finalised(address indexed who, uint tokens);
/// Auction is over. All accounts finalised.
event Retired();
// Constructor:
/// Simple constructor.
/// Token cap should take be in smallest divisible units.
/// NOTE: original SecondPriceAuction contract stipulates token cap must be given in whole tokens.
/// This does not seem correct, as only whole token values are transferred via transferFrom (which - in our wallet's case -
/// expects transfers in the smallest divisible amount)
function SecondPriceAuction(
address _trustedClaimIssuer,
address _notakeyClaimRegistry,
address _tokenContract,
address _treasury,
address _admin,
uint _beginTime,
uint _tokenCap
)
public
{
}
function() public payable { }
// Public interaction:
function moveStartDate(uint newStart)
public
before_beginning
only_admin
{
}
/// Buyin function. Throws if the sale is not active and when refund would be needed.
function buyin()
public
payable
when_not_halted
when_active
only_eligible(msg.sender)
{
flushEra();
// Flush bonus period:
if (currentBonus > 0) {
// Bonus is currently active...
if (now >= beginTime + BONUS_MIN_DURATION // ...but outside the automatic bonus period
&& lastNewInterest + BONUS_LATCH <= block.number // ...and had no new interest for some blocks
) {
currentBonus--;
}
if (now >= beginTime + BONUS_MAX_DURATION) {
currentBonus = 0;
}
if (buyins[msg.sender].received == 0) { // We have new interest
lastNewInterest = uint32(block.number);
}
}
uint accounted;
bool refund;
uint price;
(accounted, refund, price) = theDeal(msg.value);
/// No refunds allowed.
require(<FILL_ME>)
// record the acceptance.
buyins[msg.sender].accounted += uint128(accounted);
buyins[msg.sender].received += uint128(msg.value);
totalAccounted += accounted;
totalReceived += msg.value;
endTime = calculateEndTime();
Buyin(msg.sender, accounted, msg.value, price);
// send to treasury
treasury.transfer(msg.value);
}
/// Like buyin except no payment required and bonus automatically given.
function inject(address _who, uint128 _received)
public
only_admin
only_basic(_who)
before_beginning
{
}
/// Mint tokens for a particular participant.
function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
{
}
// Prviate utilities:
/// Ensure the era tracker is prepared in case the current changed.
function flushEra() private {
}
// Admin interaction:
/// Emergency function to pause buy-in and finalisation.
function setHalted(bool _halted) public only_admin { }
/// Emergency function to drain the contract of any funds.
function drain() public only_admin { }
// Inspection:
/// The current end time of the sale assuming that nobody else buys in.
function calculateEndTime() public constant returns (uint) {
}
/// The current price for a single indivisible part of a token. If a buyin happens now, this is
/// the highest price per indivisible token part that the buyer will pay. This doesn't
/// include the discount which may be available.
function currentPrice() public constant when_active returns (uint weiPerIndivisibleTokenPart) {
}
/// Returns the total indivisible token parts available for purchase right now.
function tokensAvailable() public constant when_active returns (uint tokens) {
}
/// The largest purchase than can be made at present, not including any
/// discount.
function maxPurchase() public constant when_active returns (uint spend) {
}
/// Get the number of `tokens` that would be given if the sender were to
/// spend `_value` now. Also tell you what `refund` would be given, if any.
function theDeal(uint _value)
public
constant
when_active
returns (uint accounted, bool refund, uint price)
{
}
/// Any applicable bonus to `_value`.
function bonus(uint _value)
public
constant
when_active
returns (uint extra)
{
}
/// True if the sale is ongoing.
function isActive() public constant returns (bool) { }
/// True if all buyins have finalised.
function allFinalised() public constant returns (bool) { }
/// Returns true if the sender of this transaction is a basic account.
function isBasicAccount(address _who) internal constant returns (bool) {
}
// Modifiers:
/// Ensure the sale is ongoing.
modifier when_active { }
/// Ensure the sale has not begun.
modifier before_beginning { }
/// Ensure the sale is ended.
modifier when_ended { }
/// Ensure we're not halted.
modifier when_not_halted { }
/// Ensure `_who` is a participant.
modifier only_buyins(address _who) { }
/// Ensure sender is admin.
modifier only_admin { }
/// Ensure that the signature is valid, `who` is a certified, basic account,
/// the gas price is sufficiently low and the value is sufficiently high.
modifier only_eligible(address who) {
}
/// Ensure sender is not a contract.
modifier only_basic(address who) { }
// State:
struct Account {
uint128 accounted; // including bonus & hit
uint128 received; // just the amount received, without bonus & hit
}
/// Those who have bought in to the auction.
mapping (address => Account) public buyins;
/// Total amount of ether received, excluding phantom "bonus" ether.
uint public totalReceived = 0;
/// Total amount of ether accounted for, including phantom "bonus" ether.
uint public totalAccounted = 0;
/// Total amount of ether which has been finalised.
uint public totalFinalised = 0;
/// The current end time. Gets updated when new funds are received.
uint public endTime;
/// The price per token; only valid once the sale has ended and at least one
/// participant has finalised.
uint public endPrice;
/// Must be false for any public function to be called.
bool public halted;
/// The current percentage of bonus that purchasers get.
uint8 public currentBonus = 15;
/// The last block that had a new participant.
uint32 public lastNewInterest;
// Constants after constructor:
/// The tokens contract.
Token public tokenContract;
/// The Notakey verifier contract.
NotakeyVerifierForICOP public verifier;
/// The treasury address; where all the Ether goes.
address public treasury;
/// The admin address; auction can be paused or halted at any time by this.
address public admin;
/// The time at which the sale begins.
uint public beginTime;
/// Maximum amount of tokens to mint. Once totalAccounted / currentPrice is
/// greater than this, the sale ends.
uint public tokenCap;
// Era stuff (isolated)
/// The era for which the current consolidated data represents.
uint public eraIndex;
/// The size of the era in seconds.
uint constant public ERA_PERIOD = 5 minutes;
// Static constants:
/// Anything less than this is considered dust and cannot be used to buy in.
uint constant public DUST_LIMIT = 5 finney;
//# Statement to actually sign.
//# ```js
//# statement = function() { this.STATEMENT().map(s => s.substr(28)) }
//# ```
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MIN_DURATION = 1 hours;
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MAX_DURATION = 12 hours;
/// Number of consecutive blocks where there must be no new interest before bonus ends.
uint constant public BONUS_LATCH = 2;
/// Number of Wei in one EUR, constant.
uint constant public EURWEI = 2000 szabo; // 500 eur ~ 1 eth
/// Initial auction length
uint constant public DEFAULT_AUCTION_LENGTH = 2 days;
/// Divisor of the token.
uint constant public DIVISOR = 1000;
}
| !refund | 274,758 | !refund |
null | //! Copyright Parity Technologies, 2017.
//! (original version: https://github.com/paritytech/second-price-auction)
//!
//! Copyright Notakey Latvia SIA, 2017.
//! Original version modified to verify contributors against Notakey
//! KYC smart contract.
//!
//! Released under the Apache Licence 2.
pragma solidity ^0.4.19;
/// Stripped down ERC20 standard token interface.
contract Token {
function transferFrom(address from, address to, uint256 value) public returns (bool);
}
/// Simple modified second price auction contract. Price starts high and monotonically decreases
/// until all tokens are sold at the current price with currently received funds.
/// The price curve has been chosen to resemble a logarithmic curve
/// and produce a reasonable auction timeline.
contract SecondPriceAuction {
// Events:
/// Someone bought in at a particular max-price.
event Buyin(address indexed who, uint accounted, uint received, uint price);
/// Admin injected a purchase.
event Injected(address indexed who, uint accounted, uint received);
/// At least 5 minutes has passed since last Ticked event.
event Ticked(uint era, uint received, uint accounted);
/// The sale just ended with the current price.
event Ended(uint price);
/// Finalised the purchase for `who`, who has been given `tokens` tokens.
event Finalised(address indexed who, uint tokens);
/// Auction is over. All accounts finalised.
event Retired();
// Constructor:
/// Simple constructor.
/// Token cap should take be in smallest divisible units.
/// NOTE: original SecondPriceAuction contract stipulates token cap must be given in whole tokens.
/// This does not seem correct, as only whole token values are transferred via transferFrom (which - in our wallet's case -
/// expects transfers in the smallest divisible amount)
function SecondPriceAuction(
address _trustedClaimIssuer,
address _notakeyClaimRegistry,
address _tokenContract,
address _treasury,
address _admin,
uint _beginTime,
uint _tokenCap
)
public
{
}
function() public payable { }
// Public interaction:
function moveStartDate(uint newStart)
public
before_beginning
only_admin
{
}
/// Buyin function. Throws if the sale is not active and when refund would be needed.
function buyin()
public
payable
when_not_halted
when_active
only_eligible(msg.sender)
{
}
/// Like buyin except no payment required and bonus automatically given.
function inject(address _who, uint128 _received)
public
only_admin
only_basic(_who)
before_beginning
{
}
/// Mint tokens for a particular participant.
function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
{
// end the auction if we're the first one to finalise.
if (endPrice == 0) {
endPrice = totalAccounted / tokenCap;
Ended(endPrice);
}
// enact the purchase.
uint total = buyins[_who].accounted;
uint tokens = total / endPrice;
totalFinalised += total;
delete buyins[_who];
require(<FILL_ME>)
Finalised(_who, tokens);
if (totalFinalised == totalAccounted) {
Retired();
}
}
// Prviate utilities:
/// Ensure the era tracker is prepared in case the current changed.
function flushEra() private {
}
// Admin interaction:
/// Emergency function to pause buy-in and finalisation.
function setHalted(bool _halted) public only_admin { }
/// Emergency function to drain the contract of any funds.
function drain() public only_admin { }
// Inspection:
/// The current end time of the sale assuming that nobody else buys in.
function calculateEndTime() public constant returns (uint) {
}
/// The current price for a single indivisible part of a token. If a buyin happens now, this is
/// the highest price per indivisible token part that the buyer will pay. This doesn't
/// include the discount which may be available.
function currentPrice() public constant when_active returns (uint weiPerIndivisibleTokenPart) {
}
/// Returns the total indivisible token parts available for purchase right now.
function tokensAvailable() public constant when_active returns (uint tokens) {
}
/// The largest purchase than can be made at present, not including any
/// discount.
function maxPurchase() public constant when_active returns (uint spend) {
}
/// Get the number of `tokens` that would be given if the sender were to
/// spend `_value` now. Also tell you what `refund` would be given, if any.
function theDeal(uint _value)
public
constant
when_active
returns (uint accounted, bool refund, uint price)
{
}
/// Any applicable bonus to `_value`.
function bonus(uint _value)
public
constant
when_active
returns (uint extra)
{
}
/// True if the sale is ongoing.
function isActive() public constant returns (bool) { }
/// True if all buyins have finalised.
function allFinalised() public constant returns (bool) { }
/// Returns true if the sender of this transaction is a basic account.
function isBasicAccount(address _who) internal constant returns (bool) {
}
// Modifiers:
/// Ensure the sale is ongoing.
modifier when_active { }
/// Ensure the sale has not begun.
modifier before_beginning { }
/// Ensure the sale is ended.
modifier when_ended { }
/// Ensure we're not halted.
modifier when_not_halted { }
/// Ensure `_who` is a participant.
modifier only_buyins(address _who) { }
/// Ensure sender is admin.
modifier only_admin { }
/// Ensure that the signature is valid, `who` is a certified, basic account,
/// the gas price is sufficiently low and the value is sufficiently high.
modifier only_eligible(address who) {
}
/// Ensure sender is not a contract.
modifier only_basic(address who) { }
// State:
struct Account {
uint128 accounted; // including bonus & hit
uint128 received; // just the amount received, without bonus & hit
}
/// Those who have bought in to the auction.
mapping (address => Account) public buyins;
/// Total amount of ether received, excluding phantom "bonus" ether.
uint public totalReceived = 0;
/// Total amount of ether accounted for, including phantom "bonus" ether.
uint public totalAccounted = 0;
/// Total amount of ether which has been finalised.
uint public totalFinalised = 0;
/// The current end time. Gets updated when new funds are received.
uint public endTime;
/// The price per token; only valid once the sale has ended and at least one
/// participant has finalised.
uint public endPrice;
/// Must be false for any public function to be called.
bool public halted;
/// The current percentage of bonus that purchasers get.
uint8 public currentBonus = 15;
/// The last block that had a new participant.
uint32 public lastNewInterest;
// Constants after constructor:
/// The tokens contract.
Token public tokenContract;
/// The Notakey verifier contract.
NotakeyVerifierForICOP public verifier;
/// The treasury address; where all the Ether goes.
address public treasury;
/// The admin address; auction can be paused or halted at any time by this.
address public admin;
/// The time at which the sale begins.
uint public beginTime;
/// Maximum amount of tokens to mint. Once totalAccounted / currentPrice is
/// greater than this, the sale ends.
uint public tokenCap;
// Era stuff (isolated)
/// The era for which the current consolidated data represents.
uint public eraIndex;
/// The size of the era in seconds.
uint constant public ERA_PERIOD = 5 minutes;
// Static constants:
/// Anything less than this is considered dust and cannot be used to buy in.
uint constant public DUST_LIMIT = 5 finney;
//# Statement to actually sign.
//# ```js
//# statement = function() { this.STATEMENT().map(s => s.substr(28)) }
//# ```
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MIN_DURATION = 1 hours;
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MAX_DURATION = 12 hours;
/// Number of consecutive blocks where there must be no new interest before bonus ends.
uint constant public BONUS_LATCH = 2;
/// Number of Wei in one EUR, constant.
uint constant public EURWEI = 2000 szabo; // 500 eur ~ 1 eth
/// Initial auction length
uint constant public DEFAULT_AUCTION_LENGTH = 2 days;
/// Divisor of the token.
uint constant public DIVISOR = 1000;
}
| tokenContract.transferFrom(treasury,_who,tokens) | 274,758 | tokenContract.transferFrom(treasury,_who,tokens) |
null | //! Copyright Parity Technologies, 2017.
//! (original version: https://github.com/paritytech/second-price-auction)
//!
//! Copyright Notakey Latvia SIA, 2017.
//! Original version modified to verify contributors against Notakey
//! KYC smart contract.
//!
//! Released under the Apache Licence 2.
pragma solidity ^0.4.19;
/// Stripped down ERC20 standard token interface.
contract Token {
function transferFrom(address from, address to, uint256 value) public returns (bool);
}
/// Simple modified second price auction contract. Price starts high and monotonically decreases
/// until all tokens are sold at the current price with currently received funds.
/// The price curve has been chosen to resemble a logarithmic curve
/// and produce a reasonable auction timeline.
contract SecondPriceAuction {
// Events:
/// Someone bought in at a particular max-price.
event Buyin(address indexed who, uint accounted, uint received, uint price);
/// Admin injected a purchase.
event Injected(address indexed who, uint accounted, uint received);
/// At least 5 minutes has passed since last Ticked event.
event Ticked(uint era, uint received, uint accounted);
/// The sale just ended with the current price.
event Ended(uint price);
/// Finalised the purchase for `who`, who has been given `tokens` tokens.
event Finalised(address indexed who, uint tokens);
/// Auction is over. All accounts finalised.
event Retired();
// Constructor:
/// Simple constructor.
/// Token cap should take be in smallest divisible units.
/// NOTE: original SecondPriceAuction contract stipulates token cap must be given in whole tokens.
/// This does not seem correct, as only whole token values are transferred via transferFrom (which - in our wallet's case -
/// expects transfers in the smallest divisible amount)
function SecondPriceAuction(
address _trustedClaimIssuer,
address _notakeyClaimRegistry,
address _tokenContract,
address _treasury,
address _admin,
uint _beginTime,
uint _tokenCap
)
public
{
}
function() public payable { }
// Public interaction:
function moveStartDate(uint newStart)
public
before_beginning
only_admin
{
}
/// Buyin function. Throws if the sale is not active and when refund would be needed.
function buyin()
public
payable
when_not_halted
when_active
only_eligible(msg.sender)
{
}
/// Like buyin except no payment required and bonus automatically given.
function inject(address _who, uint128 _received)
public
only_admin
only_basic(_who)
before_beginning
{
}
/// Mint tokens for a particular participant.
function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
{
}
// Prviate utilities:
/// Ensure the era tracker is prepared in case the current changed.
function flushEra() private {
}
// Admin interaction:
/// Emergency function to pause buy-in and finalisation.
function setHalted(bool _halted) public only_admin { }
/// Emergency function to drain the contract of any funds.
function drain() public only_admin { }
// Inspection:
/// The current end time of the sale assuming that nobody else buys in.
function calculateEndTime() public constant returns (uint) {
}
/// The current price for a single indivisible part of a token. If a buyin happens now, this is
/// the highest price per indivisible token part that the buyer will pay. This doesn't
/// include the discount which may be available.
function currentPrice() public constant when_active returns (uint weiPerIndivisibleTokenPart) {
}
/// Returns the total indivisible token parts available for purchase right now.
function tokensAvailable() public constant when_active returns (uint tokens) {
}
/// The largest purchase than can be made at present, not including any
/// discount.
function maxPurchase() public constant when_active returns (uint spend) {
}
/// Get the number of `tokens` that would be given if the sender were to
/// spend `_value` now. Also tell you what `refund` would be given, if any.
function theDeal(uint _value)
public
constant
when_active
returns (uint accounted, bool refund, uint price)
{
}
/// Any applicable bonus to `_value`.
function bonus(uint _value)
public
constant
when_active
returns (uint extra)
{
}
/// True if the sale is ongoing.
function isActive() public constant returns (bool) { }
/// True if all buyins have finalised.
function allFinalised() public constant returns (bool) { }
/// Returns true if the sender of this transaction is a basic account.
function isBasicAccount(address _who) internal constant returns (bool) {
}
// Modifiers:
/// Ensure the sale is ongoing.
modifier when_active { }
/// Ensure the sale has not begun.
modifier before_beginning { }
/// Ensure the sale is ended.
modifier when_ended { }
/// Ensure we're not halted.
modifier when_not_halted { }
/// Ensure `_who` is a participant.
modifier only_buyins(address _who) { require(<FILL_ME>) _; }
/// Ensure sender is admin.
modifier only_admin { }
/// Ensure that the signature is valid, `who` is a certified, basic account,
/// the gas price is sufficiently low and the value is sufficiently high.
modifier only_eligible(address who) {
}
/// Ensure sender is not a contract.
modifier only_basic(address who) { }
// State:
struct Account {
uint128 accounted; // including bonus & hit
uint128 received; // just the amount received, without bonus & hit
}
/// Those who have bought in to the auction.
mapping (address => Account) public buyins;
/// Total amount of ether received, excluding phantom "bonus" ether.
uint public totalReceived = 0;
/// Total amount of ether accounted for, including phantom "bonus" ether.
uint public totalAccounted = 0;
/// Total amount of ether which has been finalised.
uint public totalFinalised = 0;
/// The current end time. Gets updated when new funds are received.
uint public endTime;
/// The price per token; only valid once the sale has ended and at least one
/// participant has finalised.
uint public endPrice;
/// Must be false for any public function to be called.
bool public halted;
/// The current percentage of bonus that purchasers get.
uint8 public currentBonus = 15;
/// The last block that had a new participant.
uint32 public lastNewInterest;
// Constants after constructor:
/// The tokens contract.
Token public tokenContract;
/// The Notakey verifier contract.
NotakeyVerifierForICOP public verifier;
/// The treasury address; where all the Ether goes.
address public treasury;
/// The admin address; auction can be paused or halted at any time by this.
address public admin;
/// The time at which the sale begins.
uint public beginTime;
/// Maximum amount of tokens to mint. Once totalAccounted / currentPrice is
/// greater than this, the sale ends.
uint public tokenCap;
// Era stuff (isolated)
/// The era for which the current consolidated data represents.
uint public eraIndex;
/// The size of the era in seconds.
uint constant public ERA_PERIOD = 5 minutes;
// Static constants:
/// Anything less than this is considered dust and cannot be used to buy in.
uint constant public DUST_LIMIT = 5 finney;
//# Statement to actually sign.
//# ```js
//# statement = function() { this.STATEMENT().map(s => s.substr(28)) }
//# ```
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MIN_DURATION = 1 hours;
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MAX_DURATION = 12 hours;
/// Number of consecutive blocks where there must be no new interest before bonus ends.
uint constant public BONUS_LATCH = 2;
/// Number of Wei in one EUR, constant.
uint constant public EURWEI = 2000 szabo; // 500 eur ~ 1 eth
/// Initial auction length
uint constant public DEFAULT_AUCTION_LENGTH = 2 days;
/// Divisor of the token.
uint constant public DIVISOR = 1000;
}
| buyins[_who].accounted!=0 | 274,758 | buyins[_who].accounted!=0 |
null | //! Copyright Parity Technologies, 2017.
//! (original version: https://github.com/paritytech/second-price-auction)
//!
//! Copyright Notakey Latvia SIA, 2017.
//! Original version modified to verify contributors against Notakey
//! KYC smart contract.
//!
//! Released under the Apache Licence 2.
pragma solidity ^0.4.19;
/// Stripped down ERC20 standard token interface.
contract Token {
function transferFrom(address from, address to, uint256 value) public returns (bool);
}
/// Simple modified second price auction contract. Price starts high and monotonically decreases
/// until all tokens are sold at the current price with currently received funds.
/// The price curve has been chosen to resemble a logarithmic curve
/// and produce a reasonable auction timeline.
contract SecondPriceAuction {
// Events:
/// Someone bought in at a particular max-price.
event Buyin(address indexed who, uint accounted, uint received, uint price);
/// Admin injected a purchase.
event Injected(address indexed who, uint accounted, uint received);
/// At least 5 minutes has passed since last Ticked event.
event Ticked(uint era, uint received, uint accounted);
/// The sale just ended with the current price.
event Ended(uint price);
/// Finalised the purchase for `who`, who has been given `tokens` tokens.
event Finalised(address indexed who, uint tokens);
/// Auction is over. All accounts finalised.
event Retired();
// Constructor:
/// Simple constructor.
/// Token cap should take be in smallest divisible units.
/// NOTE: original SecondPriceAuction contract stipulates token cap must be given in whole tokens.
/// This does not seem correct, as only whole token values are transferred via transferFrom (which - in our wallet's case -
/// expects transfers in the smallest divisible amount)
function SecondPriceAuction(
address _trustedClaimIssuer,
address _notakeyClaimRegistry,
address _tokenContract,
address _treasury,
address _admin,
uint _beginTime,
uint _tokenCap
)
public
{
}
function() public payable { }
// Public interaction:
function moveStartDate(uint newStart)
public
before_beginning
only_admin
{
}
/// Buyin function. Throws if the sale is not active and when refund would be needed.
function buyin()
public
payable
when_not_halted
when_active
only_eligible(msg.sender)
{
}
/// Like buyin except no payment required and bonus automatically given.
function inject(address _who, uint128 _received)
public
only_admin
only_basic(_who)
before_beginning
{
}
/// Mint tokens for a particular participant.
function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
{
}
// Prviate utilities:
/// Ensure the era tracker is prepared in case the current changed.
function flushEra() private {
}
// Admin interaction:
/// Emergency function to pause buy-in and finalisation.
function setHalted(bool _halted) public only_admin { }
/// Emergency function to drain the contract of any funds.
function drain() public only_admin { }
// Inspection:
/// The current end time of the sale assuming that nobody else buys in.
function calculateEndTime() public constant returns (uint) {
}
/// The current price for a single indivisible part of a token. If a buyin happens now, this is
/// the highest price per indivisible token part that the buyer will pay. This doesn't
/// include the discount which may be available.
function currentPrice() public constant when_active returns (uint weiPerIndivisibleTokenPart) {
}
/// Returns the total indivisible token parts available for purchase right now.
function tokensAvailable() public constant when_active returns (uint tokens) {
}
/// The largest purchase than can be made at present, not including any
/// discount.
function maxPurchase() public constant when_active returns (uint spend) {
}
/// Get the number of `tokens` that would be given if the sender were to
/// spend `_value` now. Also tell you what `refund` would be given, if any.
function theDeal(uint _value)
public
constant
when_active
returns (uint accounted, bool refund, uint price)
{
}
/// Any applicable bonus to `_value`.
function bonus(uint _value)
public
constant
when_active
returns (uint extra)
{
}
/// True if the sale is ongoing.
function isActive() public constant returns (bool) { }
/// True if all buyins have finalised.
function allFinalised() public constant returns (bool) { }
/// Returns true if the sender of this transaction is a basic account.
function isBasicAccount(address _who) internal constant returns (bool) {
}
// Modifiers:
/// Ensure the sale is ongoing.
modifier when_active { }
/// Ensure the sale has not begun.
modifier before_beginning { }
/// Ensure the sale is ended.
modifier when_ended { }
/// Ensure we're not halted.
modifier when_not_halted { }
/// Ensure `_who` is a participant.
modifier only_buyins(address _who) { }
/// Ensure sender is admin.
modifier only_admin { }
/// Ensure that the signature is valid, `who` is a certified, basic account,
/// the gas price is sufficiently low and the value is sufficiently high.
modifier only_eligible(address who) {
require(<FILL_ME>)
_;
}
/// Ensure sender is not a contract.
modifier only_basic(address who) { }
// State:
struct Account {
uint128 accounted; // including bonus & hit
uint128 received; // just the amount received, without bonus & hit
}
/// Those who have bought in to the auction.
mapping (address => Account) public buyins;
/// Total amount of ether received, excluding phantom "bonus" ether.
uint public totalReceived = 0;
/// Total amount of ether accounted for, including phantom "bonus" ether.
uint public totalAccounted = 0;
/// Total amount of ether which has been finalised.
uint public totalFinalised = 0;
/// The current end time. Gets updated when new funds are received.
uint public endTime;
/// The price per token; only valid once the sale has ended and at least one
/// participant has finalised.
uint public endPrice;
/// Must be false for any public function to be called.
bool public halted;
/// The current percentage of bonus that purchasers get.
uint8 public currentBonus = 15;
/// The last block that had a new participant.
uint32 public lastNewInterest;
// Constants after constructor:
/// The tokens contract.
Token public tokenContract;
/// The Notakey verifier contract.
NotakeyVerifierForICOP public verifier;
/// The treasury address; where all the Ether goes.
address public treasury;
/// The admin address; auction can be paused or halted at any time by this.
address public admin;
/// The time at which the sale begins.
uint public beginTime;
/// Maximum amount of tokens to mint. Once totalAccounted / currentPrice is
/// greater than this, the sale ends.
uint public tokenCap;
// Era stuff (isolated)
/// The era for which the current consolidated data represents.
uint public eraIndex;
/// The size of the era in seconds.
uint constant public ERA_PERIOD = 5 minutes;
// Static constants:
/// Anything less than this is considered dust and cannot be used to buy in.
uint constant public DUST_LIMIT = 5 finney;
//# Statement to actually sign.
//# ```js
//# statement = function() { this.STATEMENT().map(s => s.substr(28)) }
//# ```
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MIN_DURATION = 1 hours;
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MAX_DURATION = 12 hours;
/// Number of consecutive blocks where there must be no new interest before bonus ends.
uint constant public BONUS_LATCH = 2;
/// Number of Wei in one EUR, constant.
uint constant public EURWEI = 2000 szabo; // 500 eur ~ 1 eth
/// Initial auction length
uint constant public DEFAULT_AUCTION_LENGTH = 2 days;
/// Divisor of the token.
uint constant public DIVISOR = 1000;
}
| verifier.isVerified(who,verifier.USA()|verifier.CHINA()|verifier.SOUTH_KOREA())&&isBasicAccount(who)&&msg.value>=DUST_LIMIT | 274,758 | verifier.isVerified(who,verifier.USA()|verifier.CHINA()|verifier.SOUTH_KOREA())&&isBasicAccount(who)&&msg.value>=DUST_LIMIT |
null | //! Copyright Parity Technologies, 2017.
//! (original version: https://github.com/paritytech/second-price-auction)
//!
//! Copyright Notakey Latvia SIA, 2017.
//! Original version modified to verify contributors against Notakey
//! KYC smart contract.
//!
//! Released under the Apache Licence 2.
pragma solidity ^0.4.19;
/// Stripped down ERC20 standard token interface.
contract Token {
function transferFrom(address from, address to, uint256 value) public returns (bool);
}
/// Simple modified second price auction contract. Price starts high and monotonically decreases
/// until all tokens are sold at the current price with currently received funds.
/// The price curve has been chosen to resemble a logarithmic curve
/// and produce a reasonable auction timeline.
contract SecondPriceAuction {
// Events:
/// Someone bought in at a particular max-price.
event Buyin(address indexed who, uint accounted, uint received, uint price);
/// Admin injected a purchase.
event Injected(address indexed who, uint accounted, uint received);
/// At least 5 minutes has passed since last Ticked event.
event Ticked(uint era, uint received, uint accounted);
/// The sale just ended with the current price.
event Ended(uint price);
/// Finalised the purchase for `who`, who has been given `tokens` tokens.
event Finalised(address indexed who, uint tokens);
/// Auction is over. All accounts finalised.
event Retired();
// Constructor:
/// Simple constructor.
/// Token cap should take be in smallest divisible units.
/// NOTE: original SecondPriceAuction contract stipulates token cap must be given in whole tokens.
/// This does not seem correct, as only whole token values are transferred via transferFrom (which - in our wallet's case -
/// expects transfers in the smallest divisible amount)
function SecondPriceAuction(
address _trustedClaimIssuer,
address _notakeyClaimRegistry,
address _tokenContract,
address _treasury,
address _admin,
uint _beginTime,
uint _tokenCap
)
public
{
}
function() public payable { }
// Public interaction:
function moveStartDate(uint newStart)
public
before_beginning
only_admin
{
}
/// Buyin function. Throws if the sale is not active and when refund would be needed.
function buyin()
public
payable
when_not_halted
when_active
only_eligible(msg.sender)
{
}
/// Like buyin except no payment required and bonus automatically given.
function inject(address _who, uint128 _received)
public
only_admin
only_basic(_who)
before_beginning
{
}
/// Mint tokens for a particular participant.
function finalise(address _who)
public
when_not_halted
when_ended
only_buyins(_who)
{
}
// Prviate utilities:
/// Ensure the era tracker is prepared in case the current changed.
function flushEra() private {
}
// Admin interaction:
/// Emergency function to pause buy-in and finalisation.
function setHalted(bool _halted) public only_admin { }
/// Emergency function to drain the contract of any funds.
function drain() public only_admin { }
// Inspection:
/// The current end time of the sale assuming that nobody else buys in.
function calculateEndTime() public constant returns (uint) {
}
/// The current price for a single indivisible part of a token. If a buyin happens now, this is
/// the highest price per indivisible token part that the buyer will pay. This doesn't
/// include the discount which may be available.
function currentPrice() public constant when_active returns (uint weiPerIndivisibleTokenPart) {
}
/// Returns the total indivisible token parts available for purchase right now.
function tokensAvailable() public constant when_active returns (uint tokens) {
}
/// The largest purchase than can be made at present, not including any
/// discount.
function maxPurchase() public constant when_active returns (uint spend) {
}
/// Get the number of `tokens` that would be given if the sender were to
/// spend `_value` now. Also tell you what `refund` would be given, if any.
function theDeal(uint _value)
public
constant
when_active
returns (uint accounted, bool refund, uint price)
{
}
/// Any applicable bonus to `_value`.
function bonus(uint _value)
public
constant
when_active
returns (uint extra)
{
}
/// True if the sale is ongoing.
function isActive() public constant returns (bool) { }
/// True if all buyins have finalised.
function allFinalised() public constant returns (bool) { }
/// Returns true if the sender of this transaction is a basic account.
function isBasicAccount(address _who) internal constant returns (bool) {
}
// Modifiers:
/// Ensure the sale is ongoing.
modifier when_active { }
/// Ensure the sale has not begun.
modifier before_beginning { }
/// Ensure the sale is ended.
modifier when_ended { }
/// Ensure we're not halted.
modifier when_not_halted { }
/// Ensure `_who` is a participant.
modifier only_buyins(address _who) { }
/// Ensure sender is admin.
modifier only_admin { }
/// Ensure that the signature is valid, `who` is a certified, basic account,
/// the gas price is sufficiently low and the value is sufficiently high.
modifier only_eligible(address who) {
}
/// Ensure sender is not a contract.
modifier only_basic(address who) { require(<FILL_ME>) _; }
// State:
struct Account {
uint128 accounted; // including bonus & hit
uint128 received; // just the amount received, without bonus & hit
}
/// Those who have bought in to the auction.
mapping (address => Account) public buyins;
/// Total amount of ether received, excluding phantom "bonus" ether.
uint public totalReceived = 0;
/// Total amount of ether accounted for, including phantom "bonus" ether.
uint public totalAccounted = 0;
/// Total amount of ether which has been finalised.
uint public totalFinalised = 0;
/// The current end time. Gets updated when new funds are received.
uint public endTime;
/// The price per token; only valid once the sale has ended and at least one
/// participant has finalised.
uint public endPrice;
/// Must be false for any public function to be called.
bool public halted;
/// The current percentage of bonus that purchasers get.
uint8 public currentBonus = 15;
/// The last block that had a new participant.
uint32 public lastNewInterest;
// Constants after constructor:
/// The tokens contract.
Token public tokenContract;
/// The Notakey verifier contract.
NotakeyVerifierForICOP public verifier;
/// The treasury address; where all the Ether goes.
address public treasury;
/// The admin address; auction can be paused or halted at any time by this.
address public admin;
/// The time at which the sale begins.
uint public beginTime;
/// Maximum amount of tokens to mint. Once totalAccounted / currentPrice is
/// greater than this, the sale ends.
uint public tokenCap;
// Era stuff (isolated)
/// The era for which the current consolidated data represents.
uint public eraIndex;
/// The size of the era in seconds.
uint constant public ERA_PERIOD = 5 minutes;
// Static constants:
/// Anything less than this is considered dust and cannot be used to buy in.
uint constant public DUST_LIMIT = 5 finney;
//# Statement to actually sign.
//# ```js
//# statement = function() { this.STATEMENT().map(s => s.substr(28)) }
//# ```
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MIN_DURATION = 1 hours;
/// Minimum duration after sale begins that bonus is active.
uint constant public BONUS_MAX_DURATION = 12 hours;
/// Number of consecutive blocks where there must be no new interest before bonus ends.
uint constant public BONUS_LATCH = 2;
/// Number of Wei in one EUR, constant.
uint constant public EURWEI = 2000 szabo; // 500 eur ~ 1 eth
/// Initial auction length
uint constant public DEFAULT_AUCTION_LENGTH = 2 days;
/// Divisor of the token.
uint constant public DIVISOR = 1000;
}
| isBasicAccount(who) | 274,758 | isBasicAccount(who) |
"Sale end" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC2981.sol";
contract CryptoGemAlliance is ERC721Enumerable, ERC2981, Ownable{
uint public constant MAX_UNITS = 10000000;
string public constant BASE_TOKEN_URI = "http://geml2.com/tokenData?";
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURISuffixes; //&userId=[user_id]&sessionId=[sessionId]
mapping (string => address) private _usedSessions; //Used session ids
event Mint(address to, uint256 tokenId, string sessionId);
constructor() ERC721("CryptoGemAlliance", "CGA") {
}
modifier saleIsOpen{
require(<FILL_ME>)
_;
}
function mintTokens(address _to, uint _count, uint _maxSupply, uint _maxMint, uint _price, bool _canMint, string memory _sessionId, bytes memory _signature) public payable saleIsOpen {
}
/**
* Supports ERC165, Rarible Secondary Sale Interface, and ERC721
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC2981) returns (bool) {
}
/**
* ERC2981 Royalties Standards (Mintable)
*/
function royaltyInfo(uint256 _tokenId, uint256 _value, bytes calldata _data) external view override returns (address _receiver, uint256 _royaltyAmount, bytes memory _royaltyPaymentData) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURISuffix(uint256 tokenId, string memory _tokenURISuffix) internal virtual {
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function burn(uint256 tokenId) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function getMessageHash(address userId, uint maxSupply, uint maxMint, uint price, bool canMint, string memory sessionId) public pure returns (bytes32) {
}
function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) {
}
function verify(
address _signer,
address _userId, uint _maxSupply, uint _maxMint, uint _price, bool _canMint, string memory _sessionId,
bytes memory _signature
)
public pure returns (bool)
{
}
function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address)
{
}
function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v)
{
}
}
| totalSupply()<MAX_UNITS,"Sale end" | 274,811 | totalSupply()<MAX_UNITS |
"Duplicated session id" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC2981.sol";
contract CryptoGemAlliance is ERC721Enumerable, ERC2981, Ownable{
uint public constant MAX_UNITS = 10000000;
string public constant BASE_TOKEN_URI = "http://geml2.com/tokenData?";
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURISuffixes; //&userId=[user_id]&sessionId=[sessionId]
mapping (string => address) private _usedSessions; //Used session ids
event Mint(address to, uint256 tokenId, string sessionId);
constructor() ERC721("CryptoGemAlliance", "CGA") {
}
modifier saleIsOpen{
}
function mintTokens(address _to, uint _count, uint _maxSupply, uint _maxMint, uint _price, bool _canMint, string memory _sessionId, bytes memory _signature) public payable saleIsOpen {
// verify the signature, it should be from owner
address signer = owner();
bool verified = verify(signer, _to, _maxSupply, _maxMint, _price, _canMint, _sessionId, _signature);
require(verified, "Unable to verify the signature");
require(totalSupply() + _count <= _maxSupply, "Max limit");
require(totalSupply() < _maxSupply, "Sale end");
require(_canMint, "This user is not allowed to mint");
require(_count < _maxMint, "User can not mint more than maximum allowed at once");
// Check used sessions
require(<FILL_ME>)
// Check the price
require(msg.value >= _count * _price, "Sent value below price");
// Assign to used sessions
_usedSessions[_sessionId] = _to;
for(uint i = 0; i < _count; i++){
uint256 newTokenId = totalSupply();
_safeMint(_to, newTokenId);
// Set token suffix after mint
string memory tokenURISuffix = string(abi.encodePacked("&userId=", Strings.toHexString(uint256(uint160(_to))), "&sessionId=", _sessionId));
_setTokenURISuffix(newTokenId, tokenURISuffix);
// Emit mint event
emit Mint(_to, newTokenId, _sessionId);
}
}
/**
* Supports ERC165, Rarible Secondary Sale Interface, and ERC721
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC2981) returns (bool) {
}
/**
* ERC2981 Royalties Standards (Mintable)
*/
function royaltyInfo(uint256 _tokenId, uint256 _value, bytes calldata _data) external view override returns (address _receiver, uint256 _royaltyAmount, bytes memory _royaltyPaymentData) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURISuffix(uint256 tokenId, string memory _tokenURISuffix) internal virtual {
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function burn(uint256 tokenId) public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function getMessageHash(address userId, uint maxSupply, uint maxMint, uint price, bool canMint, string memory sessionId) public pure returns (bytes32) {
}
function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) {
}
function verify(
address _signer,
address _userId, uint _maxSupply, uint _maxMint, uint _price, bool _canMint, string memory _sessionId,
bytes memory _signature
)
public pure returns (bool)
{
}
function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address)
{
}
function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v)
{
}
}
| _usedSessions[_sessionId]==address(0),"Duplicated session id" | 274,811 | _usedSessions[_sessionId]==address(0) |
null | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
modifier onlyOwner {
}
modifier minAmountReached {
}
modifier underMaxAmount {
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
uint256 constant FEE_DEV = SafeMath.div(20, 3); //15% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
//Variables subject to changes
uint256 public max_amount = 0 ether; //0 means there is no limit
uint256 public min_amount = 0 ether;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens = false;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 percent_reduction;
function Moongang(uint256 max, uint256 min) {
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
require(<FILL_ME>)
//Avoids burning the funds
require(sale != 0x0);
//Record that the contract has bought the tokens.
bought_tokens = true;
//Sends the fee before so the contract_eth_value contains the correct balance
uint256 dev_fee = SafeMath.div(fees, FEE_DEV);
owner.transfer(SafeMath.sub(fees, dev_fee));
developer.transfer(dev_fee);
//Record the amount of ETH sent as the contract's current value.
contract_eth_value = this.balance;
contract_eth_value_bonus = this.balance;
// Transfer all the funds to the crowdsale address.
sale.transfer(contract_eth_value);
}
function set_sale_address(address _sale) onlyOwner {
}
function set_token_address(address _token) onlyOwner {
}
function set_bonus_received(bool _boolean) onlyOwner {
}
function set_allow_refunds(bool _boolean) onlyOwner {
}
function set_percent_reduction(uint256 _reduction) onlyOwner {
}
function change_owner(address new_owner) onlyOwner {
}
function change_max_amount(uint256 _amount) onlyOwner {
}
function change_min_amount(uint256 _amount) onlyOwner {
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
}
function withdraw_bonus() {
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
}
}
| !bought_tokens | 274,857 | !bought_tokens |
null | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
modifier onlyOwner {
}
modifier minAmountReached {
}
modifier underMaxAmount {
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
uint256 constant FEE_DEV = SafeMath.div(20, 3); //15% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
//Variables subject to changes
uint256 public max_amount = 0 ether; //0 means there is no limit
uint256 public min_amount = 0 ether;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens = false;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 percent_reduction;
function Moongang(uint256 max, uint256 min) {
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
}
function set_sale_address(address _sale) onlyOwner {
}
function set_token_address(address _token) onlyOwner {
}
function set_bonus_received(bool _boolean) onlyOwner {
}
function set_allow_refunds(bool _boolean) onlyOwner {
}
function set_percent_reduction(uint256 _reduction) onlyOwner {
}
function change_owner(address new_owner) onlyOwner {
}
function change_max_amount(uint256 _amount) onlyOwner {
}
function change_min_amount(uint256 _amount) onlyOwner {
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
// Disallow withdraw if tokens haven't been bought yet.
require(bought_tokens);
uint256 contract_token_balance = token.balanceOf(address(this));
// Disallow token withdrawals if there are no tokens to withdraw.
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], contract_token_balance), contract_eth_value);
// Update the value of tokens currently held by the contract.
contract_eth_value = SafeMath.sub(contract_eth_value, balances[msg.sender]);
// Update the user's balance prior to sending to prevent recursive call.
balances[msg.sender] = 0;
// Send the funds. Throws on failure to prevent loss of funds.
require(<FILL_ME>)
}
function withdraw_bonus() {
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
}
}
| token.transfer(msg.sender,tokens_to_withdraw) | 274,857 | token.transfer(msg.sender,tokens_to_withdraw) |
null | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
modifier onlyOwner {
}
modifier minAmountReached {
}
modifier underMaxAmount {
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
uint256 constant FEE_DEV = SafeMath.div(20, 3); //15% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
//Variables subject to changes
uint256 public max_amount = 0 ether; //0 means there is no limit
uint256 public min_amount = 0 ether;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens = false;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 percent_reduction;
function Moongang(uint256 max, uint256 min) {
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
}
function set_sale_address(address _sale) onlyOwner {
}
function set_token_address(address _token) onlyOwner {
}
function set_bonus_received(bool _boolean) onlyOwner {
}
function set_allow_refunds(bool _boolean) onlyOwner {
}
function set_percent_reduction(uint256 _reduction) onlyOwner {
}
function change_owner(address new_owner) onlyOwner {
}
function change_max_amount(uint256 _amount) onlyOwner {
}
function change_min_amount(uint256 _amount) onlyOwner {
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
}
function withdraw_bonus() {
/*
Special function to withdraw the bonus tokens after the 6 months lockup.
bonus_received has to be set to true.
*/
require(<FILL_ME>)
uint256 contract_token_balance = token.balanceOf(address(this));
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances_bonus[msg.sender], contract_token_balance), contract_eth_value_bonus);
contract_eth_value_bonus = SafeMath.sub(contract_eth_value_bonus, balances_bonus[msg.sender]);
balances_bonus[msg.sender] = 0;
require(token.transfer(msg.sender, tokens_to_withdraw));
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
}
}
| bought_tokens&&bonus_received | 274,857 | bought_tokens&&bonus_received |
null | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
modifier onlyOwner {
}
modifier minAmountReached {
}
modifier underMaxAmount {
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
uint256 constant FEE_DEV = SafeMath.div(20, 3); //15% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
//Variables subject to changes
uint256 public max_amount = 0 ether; //0 means there is no limit
uint256 public min_amount = 0 ether;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens = false;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 percent_reduction;
function Moongang(uint256 max, uint256 min) {
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
}
function set_sale_address(address _sale) onlyOwner {
}
function set_token_address(address _token) onlyOwner {
}
function set_bonus_received(bool _boolean) onlyOwner {
}
function set_allow_refunds(bool _boolean) onlyOwner {
}
function set_percent_reduction(uint256 _reduction) onlyOwner {
}
function change_owner(address new_owner) onlyOwner {
}
function change_max_amount(uint256 _amount) onlyOwner {
}
function change_min_amount(uint256 _amount) onlyOwner {
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
}
function withdraw_bonus() {
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
require(<FILL_ME>)
//balance of contributor = contribution * 0.99
//so contribution = balance/0.99
uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], 100), 99);
// Update the user's balance prior to sending ETH to prevent recursive call.
balances[msg.sender] = 0;
//Updates the balances_bonus too
balances_bonus[msg.sender] = 0;
//Updates the fees variable by substracting the refunded fee
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
// Return the user's funds. Throws on failure to prevent loss of funds.
msg.sender.transfer(eth_to_withdraw);
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
}
}
| allow_refunds&&percent_reduction==0 | 274,857 | allow_refunds&&percent_reduction==0 |
null | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
}
function div(uint256 a, uint256 b) internal returns (uint256) {
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
}
function add(uint256 a, uint256 b) internal returns (uint256) {
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
modifier onlyOwner {
}
modifier minAmountReached {
}
modifier underMaxAmount {
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
uint256 constant FEE_DEV = SafeMath.div(20, 3); //15% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
//Variables subject to changes
uint256 public max_amount = 0 ether; //0 means there is no limit
uint256 public min_amount = 0 ether;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens = false;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 percent_reduction;
function Moongang(uint256 max, uint256 min) {
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
}
function set_sale_address(address _sale) onlyOwner {
}
function set_token_address(address _token) onlyOwner {
}
function set_bonus_received(bool _boolean) onlyOwner {
}
function set_allow_refunds(bool _boolean) onlyOwner {
}
function set_percent_reduction(uint256 _reduction) onlyOwner {
}
function change_owner(address new_owner) onlyOwner {
}
function change_max_amount(uint256 _amount) onlyOwner {
}
function change_min_amount(uint256 _amount) onlyOwner {
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
}
function withdraw_bonus() {
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
require(<FILL_ME>)
//Amount to refund is the amount minus the X% of the reduction
//amount_to_refund = balance*X
uint256 basic_amount = SafeMath.div(SafeMath.mul(balances[msg.sender], percent_reduction), 100);
uint256 eth_to_withdraw = basic_amount;
if (!bought_tokens) {
//We have to take in account the partial refund of the fee too if the tokens weren't bought yet
eth_to_withdraw = SafeMath.div(SafeMath.mul(basic_amount, 100), 99);
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], eth_to_withdraw);
balances_bonus[msg.sender] = balances[msg.sender];
msg.sender.transfer(eth_to_withdraw);
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
}
}
| allow_refunds&&percent_reduction>0 | 274,857 | allow_refunds&&percent_reduction>0 |
"Purchase would exceed max supply of UpsidePunks" | // SPDX-License-Identifier: MIT
// Adapted from BoringBananasCo
// Modified and updated to 0.8.0 by Gerardo Gomez
// UpsidePunks Art by Gerardo Gomez
// <3 The Gomez Family
// Special thanks to BoringBananasCo & Blockhead Devs for all the resources & assistance along the way!
import "./ERC721_flat.sol";
pragma solidity ^0.8.0;
pragma abicoder v2;
contract UpsidePunks is ERC721, Ownable, nonReentrant {
string public UPSIDEPUNKS_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN UPSIDE PUNKS ARE ALL SOLD OUT
uint256 public upsidepunksPrice = 40000000000000000; // 0.04 ETH
uint public constant maxUpsidePunksPurchase = 15;
uint256 public constant MAX_UPSIDEPUNKS = 12222;
bool public saleIsActive = false;
// mapping(uint => string) public upsidepunksNames;
// Reserve UpsidePunks for team - Giveaways/Prizes etc
uint public constant MAX_UPSIDEPUNKSRESERVE = 244; // total team reserves allowed
uint public UpsidePunksReserve = MAX_UPSIDEPUNKSRESERVE; // counter for team reserves remaining
constructor() ERC721("Upside Punks", "UPUNKS") { }
// withraw to project wallet
function withdraw(uint256 _amount, address payable _owner) public onlyOwner {
}
// withdraw to team
function teamWithdraw(address payable _team1, address payable _team2) public onlyOwner {
}
function setUpsidePunksPrice(uint256 _upsidepunksPrice) public onlyOwner {
}
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function flipSaleState() public onlyOwner {
}
function reserveUpsidePunks(address _to, uint256 _reserveAmount) public onlyOwner {
}
function mintUpsidePunks(uint numberOfTokens) public payable reentryLock {
require(saleIsActive, "Sale must be active to mint UpsidePunks");
require(numberOfTokens > 0 && numberOfTokens < maxUpsidePunksPurchase + 1, "Can only mint 15 tokens at a time");
require(<FILL_ME>)
require(msg.value >= upsidepunksPrice * numberOfTokens, "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
uint mintIndex = totalSupply() + UpsidePunksReserve; // start minting after reserved tokenIds
if (totalSupply() < MAX_UPSIDEPUNKS) {
_safeMint(msg.sender, mintIndex);
}
}
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) {
}
}
| totalSupply()+numberOfTokens<MAX_UPSIDEPUNKS-UpsidePunksReserve+1,"Purchase would exceed max supply of UpsidePunks" | 274,865 | totalSupply()+numberOfTokens<MAX_UPSIDEPUNKS-UpsidePunksReserve+1 |
"Previous Round Not Ended!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
require(<FILL_ME>)
initialPrice = _initialPrice;
dollarIncrement = _dollarIncrement;
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| rounds[roundCount].timer<now,"Previous Round Not Ended!" | 274,980 | rounds[roundCount].timer<now |
"Round Ended!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
require(<FILL_ME>)
uint256 ticketPrice = calcTicketCost(_amount);
MoondayToken.transferFrom(msg.sender, address(this), ticketPrice);
rounds[roundCount].jackpot += ticketPrice.div(10);
rounds[roundCount].holderPool += ticketPrice.div(10);
MoondayToken.transfer(moonGoldHodlWallet, ticketPrice.div(10));
MoondayToken.transfer(_owner, ticketPrice.mul(9).div(100));
MoondayToken.transfer(_dev, ticketPrice.mul(1).div(100));
rounds[roundCount].ticketsOwned[msg.sender] += _amount;
rounds[roundCount].claimList[msg.sender] += ticketPrice.sub(ticketPrice.div(100).mul(41));
for(uint256 x = 0; x < _amount; x++){
rounds[roundCount].ticketOwners[rounds[roundCount].ticketCount] = msg.sender;
rounds[roundCount].ticketCount++;
}
if(!killSwitch){
rounds[roundCount].timer += 4 * _amount;
}
emit TicketBought(msg.sender, rounds[roundCount].ticketCount, _amount);
return rounds[roundCount].ticketCount;
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| rounds[roundCount].timer>now,"Round Ended!" | 274,980 | rounds[roundCount].timer>now |
"Round Already Ended!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
require(rounds[roundCount].timer < now, "Round Not Finished!");
require(<FILL_ME>)
uint256 totalClaim = rounds[roundCount].jackpot.mul(9).div(100);
uint256 ticketLength = 51;
if(rounds[roundCount].ticketCount < 51){
ticketLength = rounds[roundCount].ticketCount;
}
totalClaim += rounds[roundCount].jackpot.mul(uint256(51).sub(ticketLength)).div(100);
jackpotClaimed[roundCount] += totalClaim;
MoondayToken.transfer(moonGoldHodlWallet, rounds[roundCount].jackpot.mul(2).div(10));
MoondayToken.transfer(moonCapitalHodlWallet, rounds[roundCount].jackpot.mul(2).div(10));
MoondayToken.transfer(_owner, totalClaim);
rounds[roundCount].ended = true;
emit RoundEnded(roundCount, rounds[roundCount].jackpot, rounds[roundCount].ticketCount);
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| !rounds[roundCount].ended,"Round Already Ended!" | 274,980 | !rounds[roundCount].ended |
"Round Not Ended!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
require(<FILL_ME>)
require(rounds[_round].claimList[msg.sender] > 0, "You Have Already Claimed!");
(uint256 payout, uint256 jackpot) = calcPayout(_round, msg.sender);
jackpotClaimed[_round] += jackpot;
MoondayToken.transfer(msg.sender, payout);
rounds[_round].claimList[msg.sender] = 0;
emit TicketClaimed(_round, msg.sender, payout);
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| rounds[_round].timer<now,"Round Not Ended!" | 274,980 | rounds[_round].timer<now |
"You Have Already Claimed!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
require(rounds[_round].timer < now, "Round Not Ended!");
require(<FILL_ME>)
(uint256 payout, uint256 jackpot) = calcPayout(_round, msg.sender);
jackpotClaimed[_round] += jackpot;
MoondayToken.transfer(msg.sender, payout);
rounds[_round].claimList[msg.sender] = 0;
emit TicketClaimed(_round, msg.sender, payout);
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| rounds[_round].claimList[msg.sender]>0,"You Have Already Claimed!" | 274,980 | rounds[_round].claimList[msg.sender]>0 |
"Insufficient Dividends Available!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
require(<FILL_ME>)
rounds[roundCount].reclaimed[msg.sender] += _amount;
MoondayToken.transfer(msg.sender, _amount);
emit DividendClaimed(roundCount, msg.sender, _amount);
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
}
}
| calcDividends(roundCount,msg.sender)>=_amount,"Insufficient Dividends Available!" | 274,980 | calcDividends(roundCount,msg.sender)>=_amount |
"Insufficient Dividends Available!" | pragma solidity ^0.5.10;
import "./ERC20Interface.sol";
import "./SafeMath.sol";
contract MoonFomoV2 {
using SafeMath for uint256;
ERC20Interface MoondayToken;
uint256 public roundCount;
bool public killSwitch;
uint256 public dollarIncrement = 200000;
uint256 public initialPrice = 256200000000000;
address payable public _owner;
address payable public _dev;
address payable public moonGoldHodlWallet;
address payable public moonCapitalHodlWallet;
address payable public moondayTokenAddress;
struct RoundData{
uint256 timer;
uint256 ticketCount;
uint256 jackpot;
uint256 holderPool;
mapping(address => uint256) ticketsOwned;
mapping(address => uint256) claimList;
mapping(address => uint256) reclaimed;
mapping(uint256 => address) ticketOwners;
bool ended;
}
mapping(uint256 => RoundData) public rounds;
mapping(uint256 => uint256) public jackpotClaimed;
event RoundStarted(uint256 round, uint256 endingTime);
event TicketBought(address buyer, uint256 ticketNumber, uint256 ticketAmount);
event RoundEnded(uint256 round, uint256 jackpot, uint256 tickets);
event TicketClaimed(uint256 round, address buyer, uint256 claimAmount);
event DividendClaimed(uint256 round, address claimant, uint256 dividendAmount);
modifier onlyOwner() {
}
constructor(
address payable owner_,
address payable dev_,
address payable _moonGoldHodlWallet,
address payable _moonCapitalHodlWallet,
address payable _moondayTokenAddress
) public {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function initRound(uint _amount) external payable onlyOwner {
}
/// Starts a round and adds transaction to jackpot
/// @dev increments round count, initiates timer and loads jackpot
function setPricing(uint256 _initialPrice, uint256 _dollarIncrement) external onlyOwner {
}
/// Calculate owner of ticket
/// @dev calculates ticket owner
/// @param _round the round to query
/// @param _ticketIndex the ticket to query
/// @return owner of ticket
function getTicketOwner(uint256 _round, uint256 _ticketIndex) public view returns(address) {
}
/// Calculate tickets owned by user
/// @dev calculates tickets owned by user
/// @param _round the round to query
/// @param _user the user to query
/// @return total tickets owned by user
function getTicketsOwned(uint256 _round, address _user) public view returns(uint256) {
}
/// Get ticket reimbursment amount by user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return ticket reimbursment amount for user
function getClaimList(uint256 _round, address _user) public view returns(uint256) {
}
/// Get dividends claimed user
/// @dev calculates returnable ticket cost to user
/// @param _round the round to query
/// @param _user the user to query
/// @return dividend claimed by user
function getReclaim(uint256 _round, address _user) public view returns(uint256) {
}
/// Calculate ticket cost
/// @dev calculates ticket price based on current holder pool
/// @return current cost of ticket
function calcTicketCost(uint256 _amount) public view returns(uint256 sumCost) {
}
/// Buy a ticket
/// @dev purchases a ticket and distributes funds
/// @return ticket index
function buyTicket(uint256 _amount) external payable returns(uint256){
}
/// Enable/Disable kill switch
/// @dev toggles the kill switch, preventing additional time
function toggleKill() external onlyOwner {
}
/// End the current round
/// @dev concludes round and pays owner
function endRound() external {
}
/// Calculate total dividends for a round
/// @param _round the round to query
/// @param _ticketHolder the user to query
/// @dev calculates dividends minus reinvested funds
/// @return totalDividends total dividends
function calcDividends(uint256 _round, address _ticketHolder) public view returns(uint256 totalDividends) {
}
/// Calculate total payout for a round
/// @param _round the round to claim
/// @param _ticketHolder the user to query
/// @dev calculates jackpot earnings, dividends and ticket reimbursment
/// @return totalClaim total claim
function calcPayout(uint256 _round, address _ticketHolder) public view returns(uint256 totalClaim, uint256 jackpot) {
}
/// Claim total dividends and winnings earned for a round
/// @param _round the round to claim
/// @dev calculates payout and pays user
function claimPayout(uint256 _round) external {
}
/// Claim total dividends in the current round
/// @param _amount the amount to claim
/// @dev calculates payout and pays user
function claimDividends(uint256 _amount) external{
}
/// Buy a ticket with dividends
/// @dev purchases a ticket with dividends and distributes funds
/// @return ticket index
function reinvestDividends(uint256 _amount) external returns(uint256){
require(<FILL_ME>)
require(rounds[roundCount].timer > now, "Round Ended!");
uint256 ticketPrice = calcTicketCost(_amount);
rounds[roundCount].jackpot += ticketPrice.div(10);
rounds[roundCount].holderPool += ticketPrice.div(10);
MoondayToken.transfer(moonGoldHodlWallet, ticketPrice.div(10));
MoondayToken.transfer(_owner, ticketPrice.mul(9).div(100));
MoondayToken.transfer(_dev, ticketPrice.mul(1).div(100));
rounds[roundCount].ticketsOwned[msg.sender] += _amount;
rounds[roundCount].reclaimed[msg.sender] += ticketPrice;
rounds[roundCount].claimList[msg.sender] += ticketPrice.sub(ticketPrice.div(100).mul(41));
for(uint256 x = 0; x < _amount; x++){
rounds[roundCount].ticketOwners[rounds[roundCount].ticketCount] = msg.sender;
rounds[roundCount].ticketCount++;
}
if(!killSwitch){
rounds[roundCount].timer += 4 * _amount;
}
emit TicketBought(msg.sender, rounds[roundCount].ticketCount, _amount);
return(rounds[roundCount].ticketCount);
}
}
| calcDividends(roundCount,msg.sender)>=calcTicketCost(_amount),"Insufficient Dividends Available!" | 274,980 | calcDividends(roundCount,msg.sender)>=calcTicketCost(_amount) |
"Could not transfer tokens." | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract StakingLP is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// staking token contract address
address public stakingTokenAddress;
address public rewardTokenAddress;
constructor(address tokenAddress, address pairAddress) public {
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint public fee = 3e16;
uint internal pointMultiplier = 1e18;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(<FILL_ME>)
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
}
function getNumberOfStakers() public view returns (uint) {
}
function stake(uint amountToStake) public payable {
}
function unstake(uint amountToWithdraw) public payable {
}
function claim() public {
}
function distributeDivs(uint amount) private {
}
function receiveTokens(address _from, uint256 _value, bytes memory _extraData) public {
}
// function to allow owner to claim *other* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
}
| Token(rewardTokenAddress).transfer(account,pendingDivs),"Could not transfer tokens." | 275,031 | Token(rewardTokenAddress).transfer(account,pendingDivs) |
"Insufficient Token Allowance" | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract StakingLP is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// staking token contract address
address public stakingTokenAddress;
address public rewardTokenAddress;
constructor(address tokenAddress, address pairAddress) public {
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint public fee = 3e16;
uint internal pointMultiplier = 1e18;
function updateAccount(address account) private {
}
function getPendingDivs(address _holder) public view returns (uint) {
}
function getNumberOfStakers() public view returns (uint) {
}
function stake(uint amountToStake) public payable {
require(msg.value >= fee, "Insufficient Fee Submitted");
address payable _owner = address(uint160(owner));
_owner.transfer(fee);
require(amountToStake > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(<FILL_ME>)
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake);
totalTokens = totalTokens.add(amountToStake);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unstake(uint amountToWithdraw) public payable {
}
function claim() public {
}
function distributeDivs(uint amount) private {
}
function receiveTokens(address _from, uint256 _value, bytes memory _extraData) public {
}
// function to allow owner to claim *other* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
}
| Token(stakingTokenAddress).transferFrom(msg.sender,address(this),amountToStake),"Insufficient Token Allowance" | 275,031 | Token(stakingTokenAddress).transferFrom(msg.sender,address(this),amountToStake) |
"Could not transfer tokens." | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract StakingLP is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// staking token contract address
address public stakingTokenAddress;
address public rewardTokenAddress;
constructor(address tokenAddress, address pairAddress) public {
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint public fee = 3e16;
uint internal pointMultiplier = 1e18;
function updateAccount(address account) private {
}
function getPendingDivs(address _holder) public view returns (uint) {
}
function getNumberOfStakers() public view returns (uint) {
}
function stake(uint amountToStake) public payable {
}
function unstake(uint amountToWithdraw) public payable {
require(msg.value >= fee, "Insufficient Fee Submitted");
address payable _owner = address(uint160(owner));
_owner.transfer(fee);
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
require(<FILL_ME>)
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
}
function distributeDivs(uint amount) private {
}
function receiveTokens(address _from, uint256 _value, bytes memory _extraData) public {
}
// function to allow owner to claim *other* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
}
}
| Token(stakingTokenAddress).transfer(msg.sender,amountToWithdraw),"Could not transfer tokens." | 275,031 | Token(stakingTokenAddress).transfer(msg.sender,amountToWithdraw) |
"there is no pending swap with this preimage hash" | pragma solidity ^0.5.0 <0.6.0;
contract EtherSwap {
struct Swap {
uint256 amount;
address payable claimAddress;
address payable refundAddress;
uint256 timelock;
// True if the swap is pending; false if it was claimed or refunded
bool pending;
}
mapping (bytes32 => Swap) private swaps;
event Claim(bytes32 _preimageHash);
event Creation(bytes32 _preimageHash);
event Refund(bytes32 _preimageHash);
modifier onlyPendingSwaps(bytes32 _preimageHash) {
require(<FILL_ME>)
_;
}
function create(bytes32 _preimageHash, address payable _claimAddress, uint256 _timelock) external payable {
}
function claim(bytes32 _preimageHash, bytes calldata _preimage) external onlyPendingSwaps(_preimageHash) {
}
function refund(bytes32 _preimageHash) external onlyPendingSwaps(_preimageHash) {
}
function getSwapInfo(bytes32 _preimageHash) external view returns (
uint256 amount,
address claimAddress,
address refundAddress,
uint256 timelock,
bool pending
) {
}
}
| swaps[_preimageHash].pending==true,"there is no pending swap with this preimage hash" | 275,051 | swaps[_preimageHash].pending==true |
"a swap with this preimage hash exists already" | pragma solidity ^0.5.0 <0.6.0;
contract EtherSwap {
struct Swap {
uint256 amount;
address payable claimAddress;
address payable refundAddress;
uint256 timelock;
// True if the swap is pending; false if it was claimed or refunded
bool pending;
}
mapping (bytes32 => Swap) private swaps;
event Claim(bytes32 _preimageHash);
event Creation(bytes32 _preimageHash);
event Refund(bytes32 _preimageHash);
modifier onlyPendingSwaps(bytes32 _preimageHash) {
}
function create(bytes32 _preimageHash, address payable _claimAddress, uint256 _timelock) external payable {
require(msg.value > 0, "the amount must not be zero");
require(<FILL_ME>)
// Add the created swap to the map
swaps[_preimageHash] = Swap({
amount: msg.value,
claimAddress: _claimAddress,
refundAddress: msg.sender,
timelock: _timelock,
pending: true
});
// Emit an event for the swap creation
emit Creation(_preimageHash);
}
function claim(bytes32 _preimageHash, bytes calldata _preimage) external onlyPendingSwaps(_preimageHash) {
}
function refund(bytes32 _preimageHash) external onlyPendingSwaps(_preimageHash) {
}
function getSwapInfo(bytes32 _preimageHash) external view returns (
uint256 amount,
address claimAddress,
address refundAddress,
uint256 timelock,
bool pending
) {
}
}
| swaps[_preimageHash].amount==0,"a swap with this preimage hash exists already" | 275,051 | swaps[_preimageHash].amount==0 |
"swap has not timed out yet" | pragma solidity ^0.5.0 <0.6.0;
contract EtherSwap {
struct Swap {
uint256 amount;
address payable claimAddress;
address payable refundAddress;
uint256 timelock;
// True if the swap is pending; false if it was claimed or refunded
bool pending;
}
mapping (bytes32 => Swap) private swaps;
event Claim(bytes32 _preimageHash);
event Creation(bytes32 _preimageHash);
event Refund(bytes32 _preimageHash);
modifier onlyPendingSwaps(bytes32 _preimageHash) {
}
function create(bytes32 _preimageHash, address payable _claimAddress, uint256 _timelock) external payable {
}
function claim(bytes32 _preimageHash, bytes calldata _preimage) external onlyPendingSwaps(_preimageHash) {
}
function refund(bytes32 _preimageHash) external onlyPendingSwaps(_preimageHash) {
require(<FILL_ME>)
swaps[_preimageHash].pending = false;
Swap memory swap = swaps[_preimageHash];
// Transfer the Ether back to the initial sender
swap.refundAddress.transfer(swap.amount);
// Emit an event for the refund
emit Refund(_preimageHash);
}
function getSwapInfo(bytes32 _preimageHash) external view returns (
uint256 amount,
address claimAddress,
address refundAddress,
uint256 timelock,
bool pending
) {
}
}
| swaps[_preimageHash].timelock<=block.timestamp,"swap has not timed out yet" | 275,051 | swaps[_preimageHash].timelock<=block.timestamp |
null | pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => uint256) private balances;
mapping (address => mapping (address => uint256)) private allowed;
uint256 private totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param _account The account that will receive the created tokens.
* @param _amount The amount that will be created.
*/
function _mint(address _account, uint256 _amount) internal {
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burn(address _account, uint256 _amount) internal {
require(_account != 0);
require(<FILL_ME>)
totalSupply_ = totalSupply_.sub(_amount);
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_account, address(0), _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal _burn function.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burnFrom(address _account, uint256 _amount) internal {
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
}
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
}
/**
* @dev Overrides StandardToken._burn in order for burn and burnFrom to emit
* an additional Burn event.
*/
function _burn(address _who, uint256 _value) internal {
}
}
| balances[_account]>_amount | 275,300 | balances[_account]>_amount |
null | pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => uint256) private balances;
mapping (address => mapping (address => uint256)) private allowed;
uint256 private totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param _account The account that will receive the created tokens.
* @param _amount The amount that will be created.
*/
function _mint(address _account, uint256 _amount) internal {
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burn(address _account, uint256 _amount) internal {
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal _burn function.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burnFrom(address _account, uint256 _amount) internal {
require(<FILL_ME>)
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount);
_burn(_account, _amount);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
}
bool public mintingFinished = false;
modifier canMint() {
}
modifier hasMintPermission() {
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
}
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
}
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
}
/**
* @dev Overrides StandardToken._burn in order for burn and burnFrom to emit
* an additional Burn event.
*/
function _burn(address _who, uint256 _value) internal {
}
}
| allowed[_account][msg.sender]>_amount | 275,300 | allowed[_account][msg.sender]>_amount |
"the triangle peak must be integer" | // SPDX-License-Identifier: UNLICENSED
pragma experimental ABIEncoderV2;
contract BondMakerHelper is Polyline {
event LogRegisterSbt(bytes32 bondID);
event LogRegisterLbt(bytes32 bondID);
event LogRegisterBondAndBondGroup(uint256 indexed bondGroupID, bytes32[] bondIDs);
function registerSbt(
address bondMakerAddress,
uint64 strikePrice,
uint256 maturity
) external returns (bytes32 bondID) {
}
function registerLbt(
address bondMakerAddress,
uint64 strikePrice,
uint256 maturity
) external returns (bytes32 bondID) {
}
function registerSbtAndLbtAndBondGroup(
address bondMakerAddress,
uint64 strikePrice,
uint256 maturity
) external returns (uint256 bondGroupID) {
}
function registerExoticBondAndBondGroup(
address bondMakerAddress,
uint64 sbtstrikePrice,
uint64 lbtStrikePrice,
uint256 maturity
) external returns (uint256 bondGroupID) {
}
function registerBondAndBondGroup(
address bondMakerAddress,
bytes[] calldata fnMaps,
uint256 maturity
) external returns (uint256 bondGroupID) {
}
function getSbtFnMap(uint64 strikePrice) external pure returns (bytes memory fnMap) {
}
function getLbtFnMap(uint64 strikePrice) external pure returns (bytes memory fnMap) {
}
function getSbtAndLbtFnMap(uint64 strikePrice) external pure returns (bytes[] memory fnMaps) {
}
function getExoticFnMap(uint64 sbtStrikePrice, uint64 lbtStrikePrice)
external
pure
returns (bytes[] memory fnMaps)
{
}
/**
* @dev register bonds and bond group
*/
function _registerBondAndBondGroup(
address bondMakerAddress,
bytes[] memory fnMaps,
uint256 maturity
) internal returns (uint256 bondGroupID) {
}
/**
* @return fnMaps divided into SBT and LBT
*/
function _getSbtAndLbtFnMap(uint64 strikePrice) internal pure returns (bytes[] memory fnMaps) {
}
/**
* @return fnMaps divided into pure SBT, LBT, semi-SBT and triangle bond.
*/
function _getExoticFnMap(uint64 sbtStrikePrice, uint64 lbtStrikePrice)
internal
pure
returns (bytes[] memory fnMaps)
{
require(
sbtStrikePrice < lbtStrikePrice,
"the SBT strike price must be less than the LBT strike price"
);
uint64 semiSbtStrikePrice = lbtStrikePrice - sbtStrikePrice;
require(<FILL_ME>)
uint64 trianglePeak = semiSbtStrikePrice / 2;
uint64 triangleRightmost = semiSbtStrikePrice + lbtStrikePrice;
require(
triangleRightmost > lbtStrikePrice,
"the triangle rightmost must be more than the LBT strike price"
);
require(triangleRightmost <= uint64(-2), "the strike price is too large");
uint256[] memory semiSbtPolyline;
{
Point[] memory points = new Point[](3);
points[0] = Point(sbtStrikePrice, 0);
points[1] = Point(triangleRightmost, semiSbtStrikePrice);
points[2] = Point(triangleRightmost + 1, semiSbtStrikePrice);
semiSbtPolyline = _calcPolyline(points);
}
uint256[] memory trianglePolyline;
{
Point[] memory points = new Point[](4);
points[0] = Point(sbtStrikePrice, 0);
points[1] = Point(lbtStrikePrice, trianglePeak);
points[2] = Point(triangleRightmost, 0);
points[3] = Point(triangleRightmost + 1, 0);
trianglePolyline = _calcPolyline(points);
}
fnMaps = new bytes[](4);
fnMaps[0] = _getSbtFnMap(sbtStrikePrice);
fnMaps[1] = _getLbtFnMap(lbtStrikePrice);
fnMaps[2] = abi.encode(semiSbtPolyline);
fnMaps[3] = abi.encode(trianglePolyline);
}
function _getSbtFnMap(uint64 strikePrice) internal pure returns (bytes memory fnMap) {
}
function _getLbtFnMap(uint64 strikePrice) internal pure returns (bytes memory fnMap) {
}
/**
* @dev [(x_1, y_1), (x_2, y_2), ..., (x_(n-1), y_(n-1)), (x_n, y_n)]
* -> [(0, 0, x_1, y_1), (x_1, y_1, x_2, y_2), ..., (x_(n-1), y_(n-1), x_n, y_n)]
*/
function _calcPolyline(Point[] memory points)
internal
pure
returns (uint256[] memory polyline)
{
}
}
| semiSbtStrikePrice%2==0,"the triangle peak must be integer" | 275,379 | semiSbtStrikePrice%2==0 |
"Purchase would exceed max available NFTs" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./IMintTicket.sol";
/*
________________ _,.......,_
.nNNNNNNNNNNNNNNNNPβ .nnNNNNNNNNNNNNnn..
ANNC*β 7NNNN|βββββββ (NNN*β 7NNNNN `*NNNn.
(NNNN. dNNNNβ qNNN) JNNNN* `NNNn
`*@*β NNNNN `*@*β dNNNNβ ,ANNN)
,NNNNβ ..-^^^-.. NNNNN ,NNNNNβ
dNNNNβ / . \ .NNNNP _..nNNNN*β
NNNNN ( /|\ ) NNNNNnnNNNNN*β
,NNNNβ β / | \ β NNNN* \NNNNb
dNNNNβ \ \'.'/ / ,NNNNβ \NNNN.
NNNNN ' \|/ ' NNNNC \NNNN.
.JNNNNNL. \ ' / .JNNNNNL. \NNNN. .
dNNNNNNNNNN| β. .β .NNNNNNNNNN| `NNNNn. ^\Nn
' `NNNNn. .NND
`*NNNNNnnn....nnNPβ
`*@NNNNNNNNN**β
*/
contract ToolsOfRock is ERC721, ERC721Enumerable, ERC721Burnable, Ownable {
using Counters for Counters.Counter;
IMintTicket private mintTicketContractInstance;
Counters.Counter private _tokenIdCounter;
uint256 public maxTokenSupply;
uint256 public maxTokensPerTicket;
uint256 public constant MAX_MINTS_PER_TXN = 16;
uint256 public mintPrice = 69000000 gwei; // 0.069 ETH
bool public preSaleIsActive = false;
bool public saleIsActive = false;
string public baseURI;
string public provenance;
uint256 public startingIndexBlock;
uint256 public startingIndex;
address[5] private _shareholders;
uint[5] private _shares;
event PaymentReleased(address to, uint256 amount);
constructor(string memory name, string memory symbol, uint256 maxTorSupply, address mintTicketContractAddress) ERC721(name, symbol) {
}
function setMaxTokenSupply(uint256 maxTorSupply) public onlyOwner {
}
function setMintPrice(uint256 newPrice) public onlyOwner {
}
function setMaxTokensPerTicket(uint256 maxTokensPerMintTicket) public onlyOwner {
}
function setTicketContractAddress(address mintTicketContractAddress) public onlyOwner {
}
function withdrawForGiveaway(uint256 amount, address payable to) public onlyOwner {
}
function withdraw(uint256 amount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner {
}
/*
* Pause sale if active, make active if paused.
*/
function flipSaleState() public onlyOwner {
}
/*
* Pause pre-sale if active, make active if paused.
*/
function flipPreSaleState() public onlyOwner {
}
/*
* Mint TOR NFTs, woo!
*/
function mintTOR(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint TOR NFTs");
require(numberOfTokens <= MAX_MINTS_PER_TXN, "You can only mint 16 TOR NFTs at a time");
require(<FILL_ME>)
require(mintPrice * numberOfTokens <= msg.value, "Ether value sent is not correct");
for(uint256 i = 0; i < numberOfTokens; i++) {
uint256 mintIndex = _tokenIdCounter.current() + 1;
if (mintIndex <= maxTokenSupply) {
_safeMint(msg.sender, mintIndex);
_tokenIdCounter.increment();
}
}
}
/*
* Mint TOR NFTs using tickets
*/
function mintUsingTicket(uint256 numberOfTokens) public payable {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
/**
* Set the starting index for the collection.
*/
function setStartingIndex() public onlyOwner {
}
/**
* Set the starting index block for the collection. Usually, this will be set after the first sale mint.
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
/*
* Set provenance once it's calculated.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| totalSupply()+numberOfTokens<=maxTokenSupply,"Purchase would exceed max available NFTs" | 275,395 | totalSupply()+numberOfTokens<=maxTokenSupply |
"Ether value sent is not correct" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./IMintTicket.sol";
/*
________________ _,.......,_
.nNNNNNNNNNNNNNNNNPβ .nnNNNNNNNNNNNNnn..
ANNC*β 7NNNN|βββββββ (NNN*β 7NNNNN `*NNNn.
(NNNN. dNNNNβ qNNN) JNNNN* `NNNn
`*@*β NNNNN `*@*β dNNNNβ ,ANNN)
,NNNNβ ..-^^^-.. NNNNN ,NNNNNβ
dNNNNβ / . \ .NNNNP _..nNNNN*β
NNNNN ( /|\ ) NNNNNnnNNNNN*β
,NNNNβ β / | \ β NNNN* \NNNNb
dNNNNβ \ \'.'/ / ,NNNNβ \NNNN.
NNNNN ' \|/ ' NNNNC \NNNN.
.JNNNNNL. \ ' / .JNNNNNL. \NNNN. .
dNNNNNNNNNN| β. .β .NNNNNNNNNN| `NNNNn. ^\Nn
' `NNNNn. .NND
`*NNNNNnnn....nnNPβ
`*@NNNNNNNNN**β
*/
contract ToolsOfRock is ERC721, ERC721Enumerable, ERC721Burnable, Ownable {
using Counters for Counters.Counter;
IMintTicket private mintTicketContractInstance;
Counters.Counter private _tokenIdCounter;
uint256 public maxTokenSupply;
uint256 public maxTokensPerTicket;
uint256 public constant MAX_MINTS_PER_TXN = 16;
uint256 public mintPrice = 69000000 gwei; // 0.069 ETH
bool public preSaleIsActive = false;
bool public saleIsActive = false;
string public baseURI;
string public provenance;
uint256 public startingIndexBlock;
uint256 public startingIndex;
address[5] private _shareholders;
uint[5] private _shares;
event PaymentReleased(address to, uint256 amount);
constructor(string memory name, string memory symbol, uint256 maxTorSupply, address mintTicketContractAddress) ERC721(name, symbol) {
}
function setMaxTokenSupply(uint256 maxTorSupply) public onlyOwner {
}
function setMintPrice(uint256 newPrice) public onlyOwner {
}
function setMaxTokensPerTicket(uint256 maxTokensPerMintTicket) public onlyOwner {
}
function setTicketContractAddress(address mintTicketContractAddress) public onlyOwner {
}
function withdrawForGiveaway(uint256 amount, address payable to) public onlyOwner {
}
function withdraw(uint256 amount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner {
}
/*
* Pause sale if active, make active if paused.
*/
function flipSaleState() public onlyOwner {
}
/*
* Pause pre-sale if active, make active if paused.
*/
function flipPreSaleState() public onlyOwner {
}
/*
* Mint TOR NFTs, woo!
*/
function mintTOR(uint256 numberOfTokens) public payable {
require(saleIsActive, "Sale must be active to mint TOR NFTs");
require(numberOfTokens <= MAX_MINTS_PER_TXN, "You can only mint 16 TOR NFTs at a time");
require(totalSupply() + numberOfTokens <= maxTokenSupply, "Purchase would exceed max available NFTs");
require(<FILL_ME>)
for(uint256 i = 0; i < numberOfTokens; i++) {
uint256 mintIndex = _tokenIdCounter.current() + 1;
if (mintIndex <= maxTokenSupply) {
_safeMint(msg.sender, mintIndex);
_tokenIdCounter.increment();
}
}
}
/*
* Mint TOR NFTs using tickets
*/
function mintUsingTicket(uint256 numberOfTokens) public payable {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
/**
* Set the starting index for the collection.
*/
function setStartingIndex() public onlyOwner {
}
/**
* Set the starting index block for the collection. Usually, this will be set after the first sale mint.
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
/*
* Set provenance once it's calculated.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| mintPrice*numberOfTokens<=msg.value,"Ether value sent is not correct" | 275,395 | mintPrice*numberOfTokens<=msg.value |
"Ether value sent is not correct" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./IMintTicket.sol";
/*
________________ _,.......,_
.nNNNNNNNNNNNNNNNNPβ .nnNNNNNNNNNNNNnn..
ANNC*β 7NNNN|βββββββ (NNN*β 7NNNNN `*NNNn.
(NNNN. dNNNNβ qNNN) JNNNN* `NNNn
`*@*β NNNNN `*@*β dNNNNβ ,ANNN)
,NNNNβ ..-^^^-.. NNNNN ,NNNNNβ
dNNNNβ / . \ .NNNNP _..nNNNN*β
NNNNN ( /|\ ) NNNNNnnNNNNN*β
,NNNNβ β / | \ β NNNN* \NNNNb
dNNNNβ \ \'.'/ / ,NNNNβ \NNNN.
NNNNN ' \|/ ' NNNNC \NNNN.
.JNNNNNL. \ ' / .JNNNNNL. \NNNN. .
dNNNNNNNNNN| β. .β .NNNNNNNNNN| `NNNNn. ^\Nn
' `NNNNn. .NND
`*NNNNNnnn....nnNPβ
`*@NNNNNNNNN**β
*/
contract ToolsOfRock is ERC721, ERC721Enumerable, ERC721Burnable, Ownable {
using Counters for Counters.Counter;
IMintTicket private mintTicketContractInstance;
Counters.Counter private _tokenIdCounter;
uint256 public maxTokenSupply;
uint256 public maxTokensPerTicket;
uint256 public constant MAX_MINTS_PER_TXN = 16;
uint256 public mintPrice = 69000000 gwei; // 0.069 ETH
bool public preSaleIsActive = false;
bool public saleIsActive = false;
string public baseURI;
string public provenance;
uint256 public startingIndexBlock;
uint256 public startingIndex;
address[5] private _shareholders;
uint[5] private _shares;
event PaymentReleased(address to, uint256 amount);
constructor(string memory name, string memory symbol, uint256 maxTorSupply, address mintTicketContractAddress) ERC721(name, symbol) {
}
function setMaxTokenSupply(uint256 maxTorSupply) public onlyOwner {
}
function setMintPrice(uint256 newPrice) public onlyOwner {
}
function setMaxTokensPerTicket(uint256 maxTokensPerMintTicket) public onlyOwner {
}
function setTicketContractAddress(address mintTicketContractAddress) public onlyOwner {
}
function withdrawForGiveaway(uint256 amount, address payable to) public onlyOwner {
}
function withdraw(uint256 amount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount) public onlyOwner {
}
/*
* Mint reserved NFTs for giveaways, devs, etc.
*/
function reserveMint(uint256 reservedAmount, address mintAddress) public onlyOwner {
}
/*
* Pause sale if active, make active if paused.
*/
function flipSaleState() public onlyOwner {
}
/*
* Pause pre-sale if active, make active if paused.
*/
function flipPreSaleState() public onlyOwner {
}
/*
* Mint TOR NFTs, woo!
*/
function mintTOR(uint256 numberOfTokens) public payable {
}
/*
* Mint TOR NFTs using tickets
*/
function mintUsingTicket(uint256 numberOfTokens) public payable {
require(preSaleIsActive, "Pre-sale must be active to mint TOR NFTs using tickets");
uint256 numberOfPassesNeeded = ((numberOfTokens + maxTokensPerTicket - 1) / maxTokensPerTicket);
require(<FILL_ME>)
require(numberOfPassesNeeded <= mintTicketContractInstance.balanceOf(msg.sender), "You do not have enough passes to mint these many tokens");
for(uint256 i = 0; i < numberOfPassesNeeded; i++) {
// First, burn all passes to avoid re-entrancy attacks
uint256 tokenIdToBurn = mintTicketContractInstance.tokenOfOwnerByIndex(msg.sender, 0);
mintTicketContractInstance.burn(tokenIdToBurn);
}
for(uint256 i = 0; i < numberOfTokens; i++) {
// Now, mint the required number of tokens
_safeMint(msg.sender, _tokenIdCounter.current() + 1);
_tokenIdCounter.increment();
}
// If we haven't set the starting index, set the starting index block.
if (startingIndexBlock == 0) {
startingIndexBlock = block.number;
}
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory newBaseURI) public onlyOwner {
}
/**
* Set the starting index for the collection.
*/
function setStartingIndex() public onlyOwner {
}
/**
* Set the starting index block for the collection. Usually, this will be set after the first sale mint.
*/
function emergencySetStartingIndexBlock() public onlyOwner {
}
/*
* Set provenance once it's calculated.
*/
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| mintPrice*(numberOfTokens-numberOfPassesNeeded)<=msg.value,"Ether value sent is not correct" | 275,395 | mintPrice*(numberOfTokens-numberOfPassesNeeded)<=msg.value |
null | /**
* SafeMath Libary
*/
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256)
{
}
}
contract Ownable {
address public owner;
function Ownable() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns(bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
}
contract ISCToken is EIP20Interface,Ownable,SafeMath,Pausable{
//// Constant token specific fields
string public constant name ="ISCToken";
string public constant symbol = "ISC";
uint8 public constant decimals = 18;
string public version = 'v0.1';
uint256 public constant initialSupply = 1010101010;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowances;
//sum of buy
mapping (address => uint) public jail;
mapping (address => uint256) public updateTime;
//Locked token
mapping (address => uint256) public LockedToken;
//set raise time
uint256 public finaliseTime;
//to receive eth from the contract
address public walletOwnerAddress;
//Tokens to 1 eth
uint256 public rate;
event WithDraw(address indexed _from, address indexed _to,uint256 _value);
event BuyToken(address indexed _from, address indexed _to, uint256 _value);
function ISCToken() public {
}
modifier notFinalised() {
}
function balanceOf(address _account) public view returns (uint) {
}
function _transfer(address _from, address _to, uint _value) internal whenNotPaused returns(bool) {
require(_to != address(0x0)&&_value>0);
require (canTransfer(_from, _value));
require(balances[_from] >= _value);
require(<FILL_ME>)
uint previousBalances = safeAdd(balances[_from],balances[_to]);
balances[_from] = safeSub(balances[_from],_value);
balances[_to] = safeAdd(balances[_to],_value);
emit Transfer(_from, _to, _value);
assert(safeAdd(balances[_from],balances[_to]) == previousBalances);
return true;
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success){
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
//close the raise
function setFinaliseTime() onlyOwner notFinalised public returns(bool){
}
//close the raise
function Restart(uint256 newrate) onlyOwner public returns(bool){
}
function setRate(uint256 newrate) onlyOwner notFinalised public returns(bool) {
}
function setWalletOwnerAddress(address _newaddress) onlyOwner public returns(bool) {
}
//Withdraw eth form the contranct
function withdraw(address _to) internal returns(bool){
}
//Lock tokens
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function _buyToken(address _to,uint256 _value)internal notFinalised whenNotPaused{
}
function() public payable{
}
}
| safeAdd(balances[_to],_value)>balances[_to] | 275,646 | safeAdd(balances[_to],_value)>balances[_to] |
null | /**
* SafeMath Libary
*/
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256)
{
}
}
contract Ownable {
address public owner;
function Ownable() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns(bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
}
contract ISCToken is EIP20Interface,Ownable,SafeMath,Pausable{
//// Constant token specific fields
string public constant name ="ISCToken";
string public constant symbol = "ISC";
uint8 public constant decimals = 18;
string public version = 'v0.1';
uint256 public constant initialSupply = 1010101010;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowances;
//sum of buy
mapping (address => uint) public jail;
mapping (address => uint256) public updateTime;
//Locked token
mapping (address => uint256) public LockedToken;
//set raise time
uint256 public finaliseTime;
//to receive eth from the contract
address public walletOwnerAddress;
//Tokens to 1 eth
uint256 public rate;
event WithDraw(address indexed _from, address indexed _to,uint256 _value);
event BuyToken(address indexed _from, address indexed _to, uint256 _value);
function ISCToken() public {
}
modifier notFinalised() {
}
function balanceOf(address _account) public view returns (uint) {
}
function _transfer(address _from, address _to, uint _value) internal whenNotPaused returns(bool) {
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success){
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
//close the raise
function setFinaliseTime() onlyOwner notFinalised public returns(bool){
}
//close the raise
function Restart(uint256 newrate) onlyOwner public returns(bool){
}
function setRate(uint256 newrate) onlyOwner notFinalised public returns(bool) {
}
function setWalletOwnerAddress(address _newaddress) onlyOwner public returns(bool) {
}
//Withdraw eth form the contranct
function withdraw(address _to) internal returns(bool){
require(<FILL_ME>)
emit WithDraw(msg.sender,_to,this.balance);
return true;
}
//Lock tokens
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
}
function _buyToken(address _to,uint256 _value)internal notFinalised whenNotPaused{
}
function() public payable{
}
}
| _to.send(this.balance) | 275,646 | _to.send(this.balance) |
null | /**
* SafeMath Libary
*/
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeMul(uint256 a, uint256 b) internal pure returns(uint256)
{
}
function safeDiv(uint256 a, uint256 b) internal pure returns(uint256)
{
}
}
contract Ownable {
address public owner;
function Ownable() public {
}
modifier onlyOwner {
}
function transferOwnership(address newOwner) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
}
}
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns(bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
}
contract ISCToken is EIP20Interface,Ownable,SafeMath,Pausable{
//// Constant token specific fields
string public constant name ="ISCToken";
string public constant symbol = "ISC";
uint8 public constant decimals = 18;
string public version = 'v0.1';
uint256 public constant initialSupply = 1010101010;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowances;
//sum of buy
mapping (address => uint) public jail;
mapping (address => uint256) public updateTime;
//Locked token
mapping (address => uint256) public LockedToken;
//set raise time
uint256 public finaliseTime;
//to receive eth from the contract
address public walletOwnerAddress;
//Tokens to 1 eth
uint256 public rate;
event WithDraw(address indexed _from, address indexed _to,uint256 _value);
event BuyToken(address indexed _from, address indexed _to, uint256 _value);
function ISCToken() public {
}
modifier notFinalised() {
}
function balanceOf(address _account) public view returns (uint) {
}
function _transfer(address _from, address _to, uint _value) internal whenNotPaused returns(bool) {
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success){
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
}
function approve(address _spender, uint256 _value) public returns (bool success) {
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
}
//close the raise
function setFinaliseTime() onlyOwner notFinalised public returns(bool){
}
//close the raise
function Restart(uint256 newrate) onlyOwner public returns(bool){
}
function setRate(uint256 newrate) onlyOwner notFinalised public returns(bool) {
}
function setWalletOwnerAddress(address _newaddress) onlyOwner public returns(bool) {
}
//Withdraw eth form the contranct
function withdraw(address _to) internal returns(bool){
}
//Lock tokens
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
uint256 index;
uint256 locked;
index = safeSub(now, updateTime[_from]) / 1 days;
if(index >= 160){
return true;
}
uint256 releasedtemp = safeMul(index,jail[_from])/200;
if(releasedtemp >= LockedToken[_from]){
return true;
}
locked = safeSub(LockedToken[_from],releasedtemp);
require(<FILL_ME>)
return true;
}
function _buyToken(address _to,uint256 _value)internal notFinalised whenNotPaused{
}
function() public payable{
}
}
| safeSub(balances[_from],_value)>=locked | 275,646 | safeSub(balances[_from],_value)>=locked |
"token already wrapped" | pragma solidity 0.5.16;
contract UniswapFactoryInterface {
// Public Variables
address public exchangeTemplate;
uint256 public tokenCount;
// Create Exchange
function createExchange(address token) external returns (address exchange);
// Get Exchange and Token Info
function getExchange(address token) external view returns (address exchange);
function getToken(address exchange) external view returns (address token);
function getTokenWithId(uint256 tokenId) external view returns (address token);
// Never use
function initializeFactory(address template) external;
}
/// @title FlashTokenFactory
/// @author Stephane Gosselin (@thegostep)
/// @notice An Erasure style factory for Wrapping FlashTokens
contract FlashTokenFactory is Spawner {
uint256 private _tokenCount;
address private _templateContract;
mapping(address => address) private _baseToFlash;
mapping(address => address) private _flashToBase;
mapping(uint256 => address) private _idToBase;
event TemplateSet(address indexed templateContract);
event FlashTokenCreated(
address indexed token,
address indexed flashToken,
address indexed uniswapExchange,
uint256 tokenID
);
/// @notice Initialize factory with template contract.
function setTemplate(address templateContract) public {
}
/// @notice Create a FlashToken wrap for any ERC20 token
function createFlashToken(address token)
public
returns (address flashToken)
{
require(token != address(0), "cannot wrap address 0");
if (_baseToFlash[token] != address(0)) {
return _baseToFlash[token];
} else {
require(<FILL_ME>)
flashToken = _flashWrap(token);
address uniswapExchange = UniswapFactoryInterface(0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95).createExchange(flashToken);
_baseToFlash[token] = flashToken;
_flashToBase[flashToken] = token;
_tokenCount += 1;
_idToBase[_tokenCount] = token;
emit FlashTokenCreated(token, flashToken, uniswapExchange, _tokenCount);
return flashToken;
}
}
/// @notice Initialize instance
function _flashWrap(address token) private returns (address flashToken) {
}
// Getters
/// @notice Get FlashToken contract associated with given ERC20 token
function getFlashToken(address token)
public
view
returns (address flashToken)
{
}
/// @notice Get ERC20 token contract associated with given FlashToken
function getBaseToken(address flashToken)
public
view
returns (address token)
{
}
/// @notice Get ERC20 token contract associated with given FlashToken ID
function getBaseFromID(uint256 tokenID)
public
view
returns (address token)
{
}
/// @notice Get count of FlashToken contracts created from this factory
function getTokenCount() public view returns (uint256 tokenCount) {
}
}
| _baseToFlash[token]==address(0),"token already wrapped" | 275,690 | _baseToFlash[token]==address(0) |
"DAO already active" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
require(<FILL_ME>)
require(comitium.fdtStaked() >= ACTIVATION_THRESHOLD, "Threshold not met yet");
isActive = true;
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| !isActive,"DAO already active" | 275,765 | !isActive |
"Threshold not met yet" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
require(!isActive, "DAO already active");
require(<FILL_ME>)
isActive = true;
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| comitium.fdtStaked()>=ACTIVATION_THRESHOLD,"Threshold not met yet" | 275,765 | comitium.fdtStaked()>=ACTIVATION_THRESHOLD |
"Creation threshold not met" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
if (!isActive) {
require(comitium.fdtStaked() >= ACTIVATION_THRESHOLD, "DAO not yet active");
isActive = true;
}
require(<FILL_ME>)
require(
targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length,
"Proposal function information parity mismatch"
);
require(targets.length != 0, "Must provide actions");
require(targets.length <= PROPOSAL_MAX_ACTIONS, "Too many actions on a vote");
require(bytes(title).length > 0, "title can't be empty");
require(bytes(description).length > 0, "description can't be empty");
// check if user has another running vote
uint256 previousProposalId = latestProposalIds[msg.sender];
if (previousProposalId != 0) {
require(_isLiveState(previousProposalId) == false, "One live proposal per proposer");
}
uint256 newProposalId = lastProposalId + 1;
Proposal storage newProposal = proposals[newProposalId];
newProposal.id = newProposalId;
newProposal.proposer = msg.sender;
newProposal.description = description;
newProposal.title = title;
newProposal.targets = targets;
newProposal.values = values;
newProposal.signatures = signatures;
newProposal.calldatas = calldatas;
newProposal.createTime = block.timestamp - 1;
newProposal.parameters.warmUpDuration = warmUpDuration;
newProposal.parameters.activeDuration = activeDuration;
newProposal.parameters.queueDuration = queueDuration;
newProposal.parameters.gracePeriodDuration = gracePeriodDuration;
newProposal.parameters.acceptanceThreshold = acceptanceThreshold;
newProposal.parameters.minQuorum = minQuorum;
lastProposalId = newProposalId;
latestProposalIds[msg.sender] = newProposalId;
emit ProposalCreated(newProposalId);
return newProposalId;
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| comitium.votingPowerAtTs(msg.sender,block.timestamp-1)>=_getCreationThreshold(),"Creation threshold not met" | 275,765 | comitium.votingPowerAtTs(msg.sender,block.timestamp-1)>=_getCreationThreshold() |
"title can't be empty" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
if (!isActive) {
require(comitium.fdtStaked() >= ACTIVATION_THRESHOLD, "DAO not yet active");
isActive = true;
}
require(
comitium.votingPowerAtTs(msg.sender, block.timestamp - 1) >= _getCreationThreshold(),
"Creation threshold not met"
);
require(
targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length,
"Proposal function information parity mismatch"
);
require(targets.length != 0, "Must provide actions");
require(targets.length <= PROPOSAL_MAX_ACTIONS, "Too many actions on a vote");
require(<FILL_ME>)
require(bytes(description).length > 0, "description can't be empty");
// check if user has another running vote
uint256 previousProposalId = latestProposalIds[msg.sender];
if (previousProposalId != 0) {
require(_isLiveState(previousProposalId) == false, "One live proposal per proposer");
}
uint256 newProposalId = lastProposalId + 1;
Proposal storage newProposal = proposals[newProposalId];
newProposal.id = newProposalId;
newProposal.proposer = msg.sender;
newProposal.description = description;
newProposal.title = title;
newProposal.targets = targets;
newProposal.values = values;
newProposal.signatures = signatures;
newProposal.calldatas = calldatas;
newProposal.createTime = block.timestamp - 1;
newProposal.parameters.warmUpDuration = warmUpDuration;
newProposal.parameters.activeDuration = activeDuration;
newProposal.parameters.queueDuration = queueDuration;
newProposal.parameters.gracePeriodDuration = gracePeriodDuration;
newProposal.parameters.acceptanceThreshold = acceptanceThreshold;
newProposal.parameters.minQuorum = minQuorum;
lastProposalId = newProposalId;
latestProposalIds[msg.sender] = newProposalId;
emit ProposalCreated(newProposalId);
return newProposalId;
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| bytes(title).length>0,"title can't be empty" | 275,765 | bytes(title).length>0 |
"description can't be empty" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
if (!isActive) {
require(comitium.fdtStaked() >= ACTIVATION_THRESHOLD, "DAO not yet active");
isActive = true;
}
require(
comitium.votingPowerAtTs(msg.sender, block.timestamp - 1) >= _getCreationThreshold(),
"Creation threshold not met"
);
require(
targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length,
"Proposal function information parity mismatch"
);
require(targets.length != 0, "Must provide actions");
require(targets.length <= PROPOSAL_MAX_ACTIONS, "Too many actions on a vote");
require(bytes(title).length > 0, "title can't be empty");
require(<FILL_ME>)
// check if user has another running vote
uint256 previousProposalId = latestProposalIds[msg.sender];
if (previousProposalId != 0) {
require(_isLiveState(previousProposalId) == false, "One live proposal per proposer");
}
uint256 newProposalId = lastProposalId + 1;
Proposal storage newProposal = proposals[newProposalId];
newProposal.id = newProposalId;
newProposal.proposer = msg.sender;
newProposal.description = description;
newProposal.title = title;
newProposal.targets = targets;
newProposal.values = values;
newProposal.signatures = signatures;
newProposal.calldatas = calldatas;
newProposal.createTime = block.timestamp - 1;
newProposal.parameters.warmUpDuration = warmUpDuration;
newProposal.parameters.activeDuration = activeDuration;
newProposal.parameters.queueDuration = queueDuration;
newProposal.parameters.gracePeriodDuration = gracePeriodDuration;
newProposal.parameters.acceptanceThreshold = acceptanceThreshold;
newProposal.parameters.minQuorum = minQuorum;
lastProposalId = newProposalId;
latestProposalIds[msg.sender] = newProposalId;
emit ProposalCreated(newProposalId);
return newProposalId;
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| bytes(description).length>0,"description can't be empty" | 275,765 | bytes(description).length>0 |
"One live proposal per proposer" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
if (!isActive) {
require(comitium.fdtStaked() >= ACTIVATION_THRESHOLD, "DAO not yet active");
isActive = true;
}
require(
comitium.votingPowerAtTs(msg.sender, block.timestamp - 1) >= _getCreationThreshold(),
"Creation threshold not met"
);
require(
targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length,
"Proposal function information parity mismatch"
);
require(targets.length != 0, "Must provide actions");
require(targets.length <= PROPOSAL_MAX_ACTIONS, "Too many actions on a vote");
require(bytes(title).length > 0, "title can't be empty");
require(bytes(description).length > 0, "description can't be empty");
// check if user has another running vote
uint256 previousProposalId = latestProposalIds[msg.sender];
if (previousProposalId != 0) {
require(<FILL_ME>)
}
uint256 newProposalId = lastProposalId + 1;
Proposal storage newProposal = proposals[newProposalId];
newProposal.id = newProposalId;
newProposal.proposer = msg.sender;
newProposal.description = description;
newProposal.title = title;
newProposal.targets = targets;
newProposal.values = values;
newProposal.signatures = signatures;
newProposal.calldatas = calldatas;
newProposal.createTime = block.timestamp - 1;
newProposal.parameters.warmUpDuration = warmUpDuration;
newProposal.parameters.activeDuration = activeDuration;
newProposal.parameters.queueDuration = queueDuration;
newProposal.parameters.gracePeriodDuration = gracePeriodDuration;
newProposal.parameters.acceptanceThreshold = acceptanceThreshold;
newProposal.parameters.minQuorum = minQuorum;
lastProposalId = newProposalId;
latestProposalIds[msg.sender] = newProposalId;
emit ProposalCreated(newProposalId);
return newProposalId;
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| _isLiveState(previousProposalId)==false,"One live proposal per proposer" | 275,765 | _isLiveState(previousProposalId)==false |
"Proposal can only be queued if it is succeeded" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
require(<FILL_ME>)
Proposal storage proposal = proposals[proposalId];
uint256 eta = proposal.createTime + proposal.parameters.warmUpDuration + proposal.parameters.activeDuration + proposal.parameters.queueDuration;
proposal.eta = eta;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
address target = proposal.targets[i];
uint256 value = proposal.values[i];
string memory signature = proposal.signatures[i];
bytes memory data = proposal.calldatas[i];
require(
!queuedTransactions[_getTxHash(target, value, signature, data, eta)],
"proposal action already queued at eta"
);
queueTransaction(target, value, signature, data, eta);
}
emit ProposalQueued(proposalId, msg.sender, eta);
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| state(proposalId)==ProposalState.Accepted,"Proposal can only be queued if it is succeeded" | 275,765 | state(proposalId)==ProposalState.Accepted |
"proposal action already queued at eta" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
require(state(proposalId) == ProposalState.Accepted, "Proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint256 eta = proposal.createTime + proposal.parameters.warmUpDuration + proposal.parameters.activeDuration + proposal.parameters.queueDuration;
proposal.eta = eta;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
address target = proposal.targets[i];
uint256 value = proposal.values[i];
string memory signature = proposal.signatures[i];
bytes memory data = proposal.calldatas[i];
require(<FILL_ME>)
queueTransaction(target, value, signature, data, eta);
}
emit ProposalQueued(proposalId, msg.sender, eta);
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| !queuedTransactions[_getTxHash(target,value,signature,data,eta)],"proposal action already queued at eta" | 275,765 | !queuedTransactions[_getTxHash(target,value,signature,data,eta)] |
"Cannot be executed" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
require(<FILL_ME>)
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
executeTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId, msg.sender);
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| state(proposalId)==ProposalState.Grace,"Cannot be executed" | 275,765 | state(proposalId)==ProposalState.Grace |
"Proposal in state that does not allow cancellation" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
require(<FILL_ME>)
require(_canCancelProposal(proposalId), "Cancellation requirements not met");
Proposal storage proposal = proposals[proposalId];
proposal.canceled = true;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId, msg.sender);
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| _isCancellableState(proposalId),"Proposal in state that does not allow cancellation" | 275,765 | _isCancellableState(proposalId) |
"Cancellation requirements not met" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
require(_isCancellableState(proposalId), "Proposal in state that does not allow cancellation");
require(<FILL_ME>)
Proposal storage proposal = proposals[proposalId];
proposal.canceled = true;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId, msg.sender);
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| _canCancelProposal(proposalId),"Cancellation requirements not met" | 275,765 | _canCancelProposal(proposalId) |
"Cannot cancel if not voted yet" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
require(state(proposalId) == ProposalState.Active, "Voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[msg.sender];
uint256 votes = comitium.votingPowerAtTs(msg.sender, _getSnapshotTimestamp(proposal));
require(<FILL_ME>)
if (receipt.support) {
proposal.forVotes = proposal.forVotes.sub(votes);
} else {
proposal.againstVotes = proposal.againstVotes.sub(votes);
}
receipt.hasVoted = false;
receipt.votes = 0;
receipt.support = false;
emit VoteCanceled(proposalId, msg.sender);
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| receipt.hasVoted,"Cannot cancel if not voted yet" | 275,765 | receipt.hasVoted |
"Cannot be abrogated" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
require(<FILL_ME>)
Proposal storage proposal = proposals[proposalId];
require(proposal.canceled == false, "Cannot be abrogated");
proposal.canceled = true;
uint256 proposalTargetsLength = proposal.targets.length;
for (uint256 i = 0; i < proposalTargetsLength; i++) {
cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit AbrogationProposalExecuted(proposalId, msg.sender);
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| state(proposalId)==ProposalState.Abrogated,"Cannot be abrogated" | 275,765 | state(proposalId)==ProposalState.Abrogated |
"Abrogation Proposal not active" | // SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IComitium.sol";
import "./Queue.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract Governance is Queue {
using SafeMath for uint256;
enum ProposalState {
WarmUp,
Active,
Canceled,
Failed,
Accepted,
Queued,
Grace,
Expired,
Executed,
Abrogated
}
struct Receipt {
// Whether or not a vote has been cast
bool hasVoted;
// support
bool support;
// The number of votes the voter had, which were cast
uint256 votes;
}
struct AbrogationProposal {
address creator;
uint256 createTime;
string description;
uint256 forVotes;
uint256 againstVotes;
mapping(address => Receipt) receipts;
}
struct ProposalParameters {
uint256 warmUpDuration;
uint256 activeDuration;
uint256 queueDuration;
uint256 gracePeriodDuration;
uint256 acceptanceThreshold;
uint256 minQuorum;
}
struct Proposal {
// proposal identifiers
// unique id
uint256 id;
// Creator of the proposal
address proposer;
// proposal description
string description;
string title;
// proposal technical details
// ordered list of target addresses to be made
address[] targets;
// The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint256[] values;
// The ordered list of function signatures to be called
string[] signatures;
// The ordered list of calldata to be passed to each call
bytes[] calldatas;
// proposal creation time - 1
uint256 createTime;
// votes status
// The timestamp that the proposal will be available for execution, set once the vote succeeds
uint256 eta;
// Current number of votes in favor of this proposal
uint256 forVotes;
// Current number of votes in opposition to this proposal
uint256 againstVotes;
bool canceled;
bool executed;
// Receipts of ballots for the entire set of voters
mapping(address => Receipt) receipts;
ProposalParameters parameters;
}
uint256 public lastProposalId;
mapping(uint256 => Proposal) public proposals;
mapping(uint256 => AbrogationProposal) public abrogationProposals;
mapping(address => uint256) public latestProposalIds;
IComitium comitium;
bool isInitialized;
bool public isActive;
event ProposalCreated(uint256 indexed proposalId);
event Vote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event VoteCanceled(uint256 indexed proposalId, address indexed user);
event ProposalQueued(uint256 indexed proposalId, address caller, uint256 eta);
event ProposalExecuted(uint256 indexed proposalId, address caller);
event ProposalCanceled(uint256 indexed proposalId, address caller);
event AbrogationProposalStarted(uint256 indexed proposalId, address caller);
event AbrogationProposalExecuted(uint256 indexed proposalId, address caller);
event AbrogationProposalVote(uint256 indexed proposalId, address indexed user, bool support, uint256 power);
event AbrogationProposalVoteCancelled(uint256 indexed proposalId, address indexed user);
receive() external payable {}
// executed only once
function initialize(address _comitium) public {
}
function activate() public {
}
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description,
string memory title
)
public returns (uint256)
{
}
function queue(uint256 proposalId) public {
}
function execute(uint256 proposalId) public payable {
}
function cancelProposal(uint256 proposalId) public {
}
function castVote(uint256 proposalId, bool support) public {
}
function cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// Abrogation proposal methods
// ======================================================================================================
// the Abrogation Proposal is a mechanism for the DAO participants to veto the execution of a proposal that was already
// accepted and it is currently queued. For the Abrogation Proposal to pass, 50% + 1 of the vFDT holders
// must vote FOR the Abrogation Proposal
function startAbrogationProposal(uint256 proposalId, string memory description) public {
}
// abrogateProposal cancels a proposal if there's an Abrogation Proposal that passed
function abrogateProposal(uint256 proposalId) public {
}
function abrogationProposal_castVote(uint256 proposalId, bool support) public {
require(0 < proposalId && proposalId <= lastProposalId, "invalid proposal id");
AbrogationProposal storage abrogationProposal = abrogationProposals[proposalId];
require(<FILL_ME>)
Receipt storage receipt = abrogationProposal.receipts[msg.sender];
require(
receipt.hasVoted == false || receipt.hasVoted && receipt.support != support,
"Already voted this option"
);
uint256 votes = comitium.votingPowerAtTs(msg.sender, abrogationProposal.createTime - 1);
require(votes > 0, "no voting power");
// means it changed its vote
if (receipt.hasVoted) {
if (receipt.support) {
abrogationProposal.forVotes = abrogationProposal.forVotes.sub(receipt.votes);
} else {
abrogationProposal.againstVotes = abrogationProposal.againstVotes.sub(receipt.votes);
}
}
if (support) {
abrogationProposal.forVotes = abrogationProposal.forVotes.add(votes);
} else {
abrogationProposal.againstVotes = abrogationProposal.againstVotes.add(votes);
}
receipt.hasVoted = true;
receipt.votes = votes;
receipt.support = support;
emit AbrogationProposalVote(proposalId, msg.sender, support, votes);
}
function abrogationProposal_cancelVote(uint256 proposalId) public {
}
// ======================================================================================================
// views
// ======================================================================================================
function state(uint256 proposalId) public view returns (ProposalState) {
}
function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getProposalParameters(uint256 proposalId) public view returns (ProposalParameters memory) {
}
function getAbrogationProposalReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) {
}
function getActions(uint256 proposalId) public view returns (
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas
) {
}
function getProposalQuorum(uint256 proposalId) public view returns (uint256) {
}
// ======================================================================================================
// internal methods
// ======================================================================================================
function _canCancelProposal(uint256 proposalId) internal view returns (bool){
}
function _isCancellableState(uint256 proposalId) internal view returns (bool) {
}
function _isLiveState(uint256 proposalId) internal view returns (bool) {
}
function _getCreationThreshold() internal view returns (uint256) {
}
// Returns the timestamp of the snapshot for a given proposal
// If the current block's timestamp is equal to `proposal.createTime + warmUpDuration` then the state function
// will return WarmUp as state which will prevent any vote to be cast which will gracefully avoid any flashloan attack
function _getSnapshotTimestamp(Proposal storage proposal) internal view returns (uint256) {
}
function _getQuorum(Proposal storage proposal) internal view returns (uint256) {
}
function _proposalAbrogated(uint256 proposalId) internal view returns (bool) {
}
}
| state(proposalId)==ProposalState.Queued&&abrogationProposal.createTime!=0,"Abrogation Proposal not active" | 275,765 | state(proposalId)==ProposalState.Queued&&abrogationProposal.createTime!=0 |
"createAsk must approve AsksV1 module" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol";
import {UniversalExchangeEventV1} from "../../../common/UniversalExchangeEvent/V1/UniversalExchangeEventV1.sol";
import {IncomingTransferSupportV1} from "../../../common/IncomingTransferSupport/V1/IncomingTransferSupportV1.sol";
import {FeePayoutSupportV1} from "../../../common/FeePayoutSupport/FeePayoutSupportV1.sol";
import {ModuleNamingSupportV1} from "../../../common/ModuleNamingSupport/ModuleNamingSupportV1.sol";
/// @title Asks V1.1
/// @author tbtstl <[email protected]>
/// @notice This module allows sellers to list an owned ERC-721 token for sale for a given price in a given currency, and allows buyers to purchase from those asks
contract AsksV1_1 is ReentrancyGuard, UniversalExchangeEventV1, IncomingTransferSupportV1, FeePayoutSupportV1, ModuleNamingSupportV1 {
/// @dev The indicator to pass all remaining gas when paying out royalties
uint256 private constant USE_ALL_GAS_FLAG = 0;
/// @notice The ZORA ERC-721 Transfer Helper
ERC721TransferHelper public immutable erc721TransferHelper;
/// @notice The ask for a given NFT, if one exists
/// @dev ERC-721 token contract => ERC-721 token ID => Ask
mapping(address => mapping(uint256 => Ask)) public askForNFT;
/// @notice The metadata for an ask
/// @param seller The address of the seller placing the ask
/// @param sellerFundsRecipient The address to send funds after the ask is filled
/// @param askCurrency The address of the ERC-20, or address(0) for ETH, required to fill the ask
/// @param findersFeeBps The fee to the referrer of the ask
/// @param askPrice The price to fill the ask
struct Ask {
address seller;
address sellerFundsRecipient;
address askCurrency;
uint16 findersFeeBps;
uint256 askPrice;
}
/// @notice Emitted when an ask is created
/// @param tokenContract The ERC-721 token address of the created ask
/// @param tokenId The ERC-721 token ID of the created ask
/// @param ask The metadata of the created ask
event AskCreated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask price is updated
/// @param tokenContract The ERC-721 token address of the updated ask
/// @param tokenId The ERC-721 token ID of the updated ask
/// @param ask The metadata of the updated ask
event AskPriceUpdated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is canceled
/// @param tokenContract The ERC-721 token address of the canceled ask
/// @param tokenId The ERC-721 token ID of the canceled ask
/// @param ask The metadata of the canceled ask
event AskCanceled(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is filled
/// @param tokenContract The ERC-721 token address of the filled ask
/// @param tokenId The ERC-721 token ID of the filled ask
/// @param buyer The buyer address of the filled ask
/// @param finder The address of finder who referred the ask
/// @param ask The metadata of the filled ask
event AskFilled(address indexed tokenContract, uint256 indexed tokenId, address indexed buyer, address finder, Ask ask);
/// @param _erc20TransferHelper The ZORA ERC-20 Transfer Helper address
/// @param _erc721TransferHelper The ZORA ERC-721 Transfer Helper address
/// @param _royaltyEngine The Manifold Royalty Engine address
/// @param _protocolFeeSettings The ZoraProtocolFeeSettingsV1 address
/// @param _wethAddress The WETH token address
constructor(
address _erc20TransferHelper,
address _erc721TransferHelper,
address _royaltyEngine,
address _protocolFeeSettings,
address _wethAddress
)
IncomingTransferSupportV1(_erc20TransferHelper)
FeePayoutSupportV1(_royaltyEngine, _protocolFeeSettings, _wethAddress, ERC721TransferHelper(_erc721TransferHelper).ZMM().registrar())
ModuleNamingSupportV1("Asks: v1.1")
{
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | createAsk() |
// | ---------------->
// | |
// | |
// | ____________________________________________________________
// | ! ALT / Ask already exists for this token? !
// | !_____/ | !
// | ! |----. !
// | ! | | _cancelAsk(_tokenContract, _tokenId) !
// | ! |<---' !
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | |
// | |----.
// | | | create ask
// | |<---'
// | |
// | |----.
// | | | emit AskCreated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Creates the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token to be sold
/// @param _tokenId The ID of the ERC-721 token to be sold
/// @param _askPrice The price to fill the ask
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
/// @param _sellerFundsRecipient The address to send funds once the ask is filled
/// @param _findersFeeBps The bps of the ask price (post-royalties) to be sent to the referrer of the sale
function createAsk(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency,
address _sellerFundsRecipient,
uint16 _findersFeeBps
) external nonReentrant {
address tokenOwner = IERC721(_tokenContract).ownerOf(_tokenId);
require(msg.sender == tokenOwner || IERC721(_tokenContract).isApprovedForAll(tokenOwner, msg.sender), "createAsk must be token owner or operator");
require(<FILL_ME>)
require(IERC721(_tokenContract).isApprovedForAll(tokenOwner, address(erc721TransferHelper)), "createAsk must approve ERC721TransferHelper as operator");
require(_findersFeeBps <= 10000, "createAsk finders fee bps must be less than or equal to 10000");
require(_sellerFundsRecipient != address(0), "createAsk must specify _sellerFundsRecipient");
if (askForNFT[_tokenContract][_tokenId].seller != address(0)) {
_cancelAsk(_tokenContract, _tokenId);
}
askForNFT[_tokenContract][_tokenId] = Ask({
seller: tokenOwner,
sellerFundsRecipient: _sellerFundsRecipient,
askCurrency: _askCurrency,
findersFeeBps: _findersFeeBps,
askPrice: _askPrice
});
emit AskCreated(_tokenContract, _tokenId, askForNFT[_tokenContract][_tokenId]);
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | setAskPrice() |
// | ---------------->
// | |
// | |----.
// | | | update ask price
// | |<---'
// | |
// | |----.
// | | | emit AskPriceUpdated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Updates the ask price for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _askPrice The ask price to set
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
function setAskPrice(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency
) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | cancelAsk() |
// | ---------------->
// | |
// | |----.
// | | | emit AskCanceled()
// | |<---'
// | |
// | |----.
// | | | delete ask
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Cancels the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function cancelAsk(address _tokenContract, uint256 _tokenId) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------. ,--------------------.
// / \ |AsksV1| |ERC721TransferHelper|
// Caller `--+---' `---------+----------'
// | fillAsk() | |
// | ----------------> |
// | | |
// | |----. |
// | | | validate received funds |
// | |<---' |
// | | |
// | |----. |
// | | | handle royalty payouts |
// | |<---' |
// | | |
// | | |
// | _________________________________________________ |
// | ! ALT / finders fee configured for this ask? ! |
// | !_____/ | ! |
// | ! |----. ! |
// | ! | | handle finders fee payout ! |
// | ! |<---' ! |
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | | |
// | |----.
// | | | handle seller funds recipient payout
// | |<---'
// | | |
// | | transferFrom() |
// | | ---------------------------------------->
// | | |
// | | |----.
// | | | | transfer NFT from seller to buyer
// | | |<---'
// | | |
// | |----. |
// | | | emit ExchangeExecuted() |
// | |<---' |
// | | |
// | |----. |
// | | | emit AskFilled() |
// | |<---' |
// | | |
// | |----. |
// | | | delete ask from contract |
// | |<---' |
// Caller ,--+---. ,---------+----------.
// ,-. |AsksV1| |ERC721TransferHelper|
// `-' `------' `--------------------'
// /|\
// |
// / \
/// @notice Fills the ask for a given NFT, transferring the ETH/ERC-20 to the seller and NFT to the buyer
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _fillCurrency The address of the ERC-20 token using to fill, or address(0) for ETH
/// @param _fillAmount The amount to fill the ask
/// @param _finder The address of the ask referrer
function fillAsk(
address _tokenContract,
uint256 _tokenId,
address _fillCurrency,
uint256 _fillAmount,
address _finder
) external payable nonReentrant {
}
/// @dev Deletes canceled and invalid asks
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function _cancelAsk(address _tokenContract, uint256 _tokenId) private {
}
}
| erc721TransferHelper.isModuleApproved(msg.sender),"createAsk must approve AsksV1 module" | 275,843 | erc721TransferHelper.isModuleApproved(msg.sender) |
"createAsk must approve ERC721TransferHelper as operator" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol";
import {UniversalExchangeEventV1} from "../../../common/UniversalExchangeEvent/V1/UniversalExchangeEventV1.sol";
import {IncomingTransferSupportV1} from "../../../common/IncomingTransferSupport/V1/IncomingTransferSupportV1.sol";
import {FeePayoutSupportV1} from "../../../common/FeePayoutSupport/FeePayoutSupportV1.sol";
import {ModuleNamingSupportV1} from "../../../common/ModuleNamingSupport/ModuleNamingSupportV1.sol";
/// @title Asks V1.1
/// @author tbtstl <[email protected]>
/// @notice This module allows sellers to list an owned ERC-721 token for sale for a given price in a given currency, and allows buyers to purchase from those asks
contract AsksV1_1 is ReentrancyGuard, UniversalExchangeEventV1, IncomingTransferSupportV1, FeePayoutSupportV1, ModuleNamingSupportV1 {
/// @dev The indicator to pass all remaining gas when paying out royalties
uint256 private constant USE_ALL_GAS_FLAG = 0;
/// @notice The ZORA ERC-721 Transfer Helper
ERC721TransferHelper public immutable erc721TransferHelper;
/// @notice The ask for a given NFT, if one exists
/// @dev ERC-721 token contract => ERC-721 token ID => Ask
mapping(address => mapping(uint256 => Ask)) public askForNFT;
/// @notice The metadata for an ask
/// @param seller The address of the seller placing the ask
/// @param sellerFundsRecipient The address to send funds after the ask is filled
/// @param askCurrency The address of the ERC-20, or address(0) for ETH, required to fill the ask
/// @param findersFeeBps The fee to the referrer of the ask
/// @param askPrice The price to fill the ask
struct Ask {
address seller;
address sellerFundsRecipient;
address askCurrency;
uint16 findersFeeBps;
uint256 askPrice;
}
/// @notice Emitted when an ask is created
/// @param tokenContract The ERC-721 token address of the created ask
/// @param tokenId The ERC-721 token ID of the created ask
/// @param ask The metadata of the created ask
event AskCreated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask price is updated
/// @param tokenContract The ERC-721 token address of the updated ask
/// @param tokenId The ERC-721 token ID of the updated ask
/// @param ask The metadata of the updated ask
event AskPriceUpdated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is canceled
/// @param tokenContract The ERC-721 token address of the canceled ask
/// @param tokenId The ERC-721 token ID of the canceled ask
/// @param ask The metadata of the canceled ask
event AskCanceled(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is filled
/// @param tokenContract The ERC-721 token address of the filled ask
/// @param tokenId The ERC-721 token ID of the filled ask
/// @param buyer The buyer address of the filled ask
/// @param finder The address of finder who referred the ask
/// @param ask The metadata of the filled ask
event AskFilled(address indexed tokenContract, uint256 indexed tokenId, address indexed buyer, address finder, Ask ask);
/// @param _erc20TransferHelper The ZORA ERC-20 Transfer Helper address
/// @param _erc721TransferHelper The ZORA ERC-721 Transfer Helper address
/// @param _royaltyEngine The Manifold Royalty Engine address
/// @param _protocolFeeSettings The ZoraProtocolFeeSettingsV1 address
/// @param _wethAddress The WETH token address
constructor(
address _erc20TransferHelper,
address _erc721TransferHelper,
address _royaltyEngine,
address _protocolFeeSettings,
address _wethAddress
)
IncomingTransferSupportV1(_erc20TransferHelper)
FeePayoutSupportV1(_royaltyEngine, _protocolFeeSettings, _wethAddress, ERC721TransferHelper(_erc721TransferHelper).ZMM().registrar())
ModuleNamingSupportV1("Asks: v1.1")
{
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | createAsk() |
// | ---------------->
// | |
// | |
// | ____________________________________________________________
// | ! ALT / Ask already exists for this token? !
// | !_____/ | !
// | ! |----. !
// | ! | | _cancelAsk(_tokenContract, _tokenId) !
// | ! |<---' !
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | |
// | |----.
// | | | create ask
// | |<---'
// | |
// | |----.
// | | | emit AskCreated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Creates the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token to be sold
/// @param _tokenId The ID of the ERC-721 token to be sold
/// @param _askPrice The price to fill the ask
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
/// @param _sellerFundsRecipient The address to send funds once the ask is filled
/// @param _findersFeeBps The bps of the ask price (post-royalties) to be sent to the referrer of the sale
function createAsk(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency,
address _sellerFundsRecipient,
uint16 _findersFeeBps
) external nonReentrant {
address tokenOwner = IERC721(_tokenContract).ownerOf(_tokenId);
require(msg.sender == tokenOwner || IERC721(_tokenContract).isApprovedForAll(tokenOwner, msg.sender), "createAsk must be token owner or operator");
require(erc721TransferHelper.isModuleApproved(msg.sender), "createAsk must approve AsksV1 module");
require(<FILL_ME>)
require(_findersFeeBps <= 10000, "createAsk finders fee bps must be less than or equal to 10000");
require(_sellerFundsRecipient != address(0), "createAsk must specify _sellerFundsRecipient");
if (askForNFT[_tokenContract][_tokenId].seller != address(0)) {
_cancelAsk(_tokenContract, _tokenId);
}
askForNFT[_tokenContract][_tokenId] = Ask({
seller: tokenOwner,
sellerFundsRecipient: _sellerFundsRecipient,
askCurrency: _askCurrency,
findersFeeBps: _findersFeeBps,
askPrice: _askPrice
});
emit AskCreated(_tokenContract, _tokenId, askForNFT[_tokenContract][_tokenId]);
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | setAskPrice() |
// | ---------------->
// | |
// | |----.
// | | | update ask price
// | |<---'
// | |
// | |----.
// | | | emit AskPriceUpdated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Updates the ask price for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _askPrice The ask price to set
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
function setAskPrice(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency
) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | cancelAsk() |
// | ---------------->
// | |
// | |----.
// | | | emit AskCanceled()
// | |<---'
// | |
// | |----.
// | | | delete ask
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Cancels the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function cancelAsk(address _tokenContract, uint256 _tokenId) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------. ,--------------------.
// / \ |AsksV1| |ERC721TransferHelper|
// Caller `--+---' `---------+----------'
// | fillAsk() | |
// | ----------------> |
// | | |
// | |----. |
// | | | validate received funds |
// | |<---' |
// | | |
// | |----. |
// | | | handle royalty payouts |
// | |<---' |
// | | |
// | | |
// | _________________________________________________ |
// | ! ALT / finders fee configured for this ask? ! |
// | !_____/ | ! |
// | ! |----. ! |
// | ! | | handle finders fee payout ! |
// | ! |<---' ! |
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | | |
// | |----.
// | | | handle seller funds recipient payout
// | |<---'
// | | |
// | | transferFrom() |
// | | ---------------------------------------->
// | | |
// | | |----.
// | | | | transfer NFT from seller to buyer
// | | |<---'
// | | |
// | |----. |
// | | | emit ExchangeExecuted() |
// | |<---' |
// | | |
// | |----. |
// | | | emit AskFilled() |
// | |<---' |
// | | |
// | |----. |
// | | | delete ask from contract |
// | |<---' |
// Caller ,--+---. ,---------+----------.
// ,-. |AsksV1| |ERC721TransferHelper|
// `-' `------' `--------------------'
// /|\
// |
// / \
/// @notice Fills the ask for a given NFT, transferring the ETH/ERC-20 to the seller and NFT to the buyer
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _fillCurrency The address of the ERC-20 token using to fill, or address(0) for ETH
/// @param _fillAmount The amount to fill the ask
/// @param _finder The address of the ask referrer
function fillAsk(
address _tokenContract,
uint256 _tokenId,
address _fillCurrency,
uint256 _fillAmount,
address _finder
) external payable nonReentrant {
}
/// @dev Deletes canceled and invalid asks
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function _cancelAsk(address _tokenContract, uint256 _tokenId) private {
}
}
| IERC721(_tokenContract).isApprovedForAll(tokenOwner,address(erc721TransferHelper)),"createAsk must approve ERC721TransferHelper as operator" | 275,843 | IERC721(_tokenContract).isApprovedForAll(tokenOwner,address(erc721TransferHelper)) |
"cancelAsk ask doesn't exist" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol";
import {UniversalExchangeEventV1} from "../../../common/UniversalExchangeEvent/V1/UniversalExchangeEventV1.sol";
import {IncomingTransferSupportV1} from "../../../common/IncomingTransferSupport/V1/IncomingTransferSupportV1.sol";
import {FeePayoutSupportV1} from "../../../common/FeePayoutSupport/FeePayoutSupportV1.sol";
import {ModuleNamingSupportV1} from "../../../common/ModuleNamingSupport/ModuleNamingSupportV1.sol";
/// @title Asks V1.1
/// @author tbtstl <[email protected]>
/// @notice This module allows sellers to list an owned ERC-721 token for sale for a given price in a given currency, and allows buyers to purchase from those asks
contract AsksV1_1 is ReentrancyGuard, UniversalExchangeEventV1, IncomingTransferSupportV1, FeePayoutSupportV1, ModuleNamingSupportV1 {
/// @dev The indicator to pass all remaining gas when paying out royalties
uint256 private constant USE_ALL_GAS_FLAG = 0;
/// @notice The ZORA ERC-721 Transfer Helper
ERC721TransferHelper public immutable erc721TransferHelper;
/// @notice The ask for a given NFT, if one exists
/// @dev ERC-721 token contract => ERC-721 token ID => Ask
mapping(address => mapping(uint256 => Ask)) public askForNFT;
/// @notice The metadata for an ask
/// @param seller The address of the seller placing the ask
/// @param sellerFundsRecipient The address to send funds after the ask is filled
/// @param askCurrency The address of the ERC-20, or address(0) for ETH, required to fill the ask
/// @param findersFeeBps The fee to the referrer of the ask
/// @param askPrice The price to fill the ask
struct Ask {
address seller;
address sellerFundsRecipient;
address askCurrency;
uint16 findersFeeBps;
uint256 askPrice;
}
/// @notice Emitted when an ask is created
/// @param tokenContract The ERC-721 token address of the created ask
/// @param tokenId The ERC-721 token ID of the created ask
/// @param ask The metadata of the created ask
event AskCreated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask price is updated
/// @param tokenContract The ERC-721 token address of the updated ask
/// @param tokenId The ERC-721 token ID of the updated ask
/// @param ask The metadata of the updated ask
event AskPriceUpdated(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is canceled
/// @param tokenContract The ERC-721 token address of the canceled ask
/// @param tokenId The ERC-721 token ID of the canceled ask
/// @param ask The metadata of the canceled ask
event AskCanceled(address indexed tokenContract, uint256 indexed tokenId, Ask ask);
/// @notice Emitted when an ask is filled
/// @param tokenContract The ERC-721 token address of the filled ask
/// @param tokenId The ERC-721 token ID of the filled ask
/// @param buyer The buyer address of the filled ask
/// @param finder The address of finder who referred the ask
/// @param ask The metadata of the filled ask
event AskFilled(address indexed tokenContract, uint256 indexed tokenId, address indexed buyer, address finder, Ask ask);
/// @param _erc20TransferHelper The ZORA ERC-20 Transfer Helper address
/// @param _erc721TransferHelper The ZORA ERC-721 Transfer Helper address
/// @param _royaltyEngine The Manifold Royalty Engine address
/// @param _protocolFeeSettings The ZoraProtocolFeeSettingsV1 address
/// @param _wethAddress The WETH token address
constructor(
address _erc20TransferHelper,
address _erc721TransferHelper,
address _royaltyEngine,
address _protocolFeeSettings,
address _wethAddress
)
IncomingTransferSupportV1(_erc20TransferHelper)
FeePayoutSupportV1(_royaltyEngine, _protocolFeeSettings, _wethAddress, ERC721TransferHelper(_erc721TransferHelper).ZMM().registrar())
ModuleNamingSupportV1("Asks: v1.1")
{
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | createAsk() |
// | ---------------->
// | |
// | |
// | ____________________________________________________________
// | ! ALT / Ask already exists for this token? !
// | !_____/ | !
// | ! |----. !
// | ! | | _cancelAsk(_tokenContract, _tokenId) !
// | ! |<---' !
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
// | |
// | |----.
// | | | create ask
// | |<---'
// | |
// | |----.
// | | | emit AskCreated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Creates the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token to be sold
/// @param _tokenId The ID of the ERC-721 token to be sold
/// @param _askPrice The price to fill the ask
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
/// @param _sellerFundsRecipient The address to send funds once the ask is filled
/// @param _findersFeeBps The bps of the ask price (post-royalties) to be sent to the referrer of the sale
function createAsk(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency,
address _sellerFundsRecipient,
uint16 _findersFeeBps
) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | setAskPrice() |
// | ---------------->
// | |
// | |----.
// | | | update ask price
// | |<---'
// | |
// | |----.
// | | | emit AskPriceUpdated()
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Updates the ask price for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _askPrice The ask price to set
/// @param _askCurrency The address of the ERC-20 token required to fill, or address(0) for ETH
function setAskPrice(
address _tokenContract,
uint256 _tokenId,
uint256 _askPrice,
address _askCurrency
) external nonReentrant {
}
// ,-.
// `-'
// /|\
// | ,------.
// / \ |AsksV1|
// Caller `--+---'
// | cancelAsk() |
// | ---------------->
// | |
// | |----.
// | | | emit AskCanceled()
// | |<---'
// | |
// | |----.
// | | | delete ask
// | |<---'
// Caller ,--+---.
// ,-. |AsksV1|
// `-' `------'
// /|\
// |
// / \
/// @notice Cancels the ask for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function cancelAsk(address _tokenContract, uint256 _tokenId) external nonReentrant {
require(<FILL_ME>)
address tokenOwner = IERC721(_tokenContract).ownerOf(_tokenId);
require(msg.sender == tokenOwner || IERC721(_tokenContract).isApprovedForAll(tokenOwner, msg.sender), "cancelAsk must be token owner or operator");
_cancelAsk(_tokenContract, _tokenId);
}
// ,-.
// `-'
// /|\
// | ,------. ,--------------------.
// / \ |AsksV1| |ERC721TransferHelper|
// Caller `--+---' `---------+----------'
// | fillAsk() | |
// | ----------------> |
// | | |
// | |----. |
// | | | validate received funds |
// | |<---' |
// | | |
// | |----. |
// | | | handle royalty payouts |
// | |<---' |
// | | |
// | | |
// | _________________________________________________ |
// | ! ALT / finders fee configured for this ask? ! |
// | !_____/ | ! |
// | ! |----. ! |
// | ! | | handle finders fee payout ! |
// | ! |<---' ! |
// | !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | !~[noop]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
// | | |
// | |----.
// | | | handle seller funds recipient payout
// | |<---'
// | | |
// | | transferFrom() |
// | | ---------------------------------------->
// | | |
// | | |----.
// | | | | transfer NFT from seller to buyer
// | | |<---'
// | | |
// | |----. |
// | | | emit ExchangeExecuted() |
// | |<---' |
// | | |
// | |----. |
// | | | emit AskFilled() |
// | |<---' |
// | | |
// | |----. |
// | | | delete ask from contract |
// | |<---' |
// Caller ,--+---. ,---------+----------.
// ,-. |AsksV1| |ERC721TransferHelper|
// `-' `------' `--------------------'
// /|\
// |
// / \
/// @notice Fills the ask for a given NFT, transferring the ETH/ERC-20 to the seller and NFT to the buyer
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
/// @param _fillCurrency The address of the ERC-20 token using to fill, or address(0) for ETH
/// @param _fillAmount The amount to fill the ask
/// @param _finder The address of the ask referrer
function fillAsk(
address _tokenContract,
uint256 _tokenId,
address _fillCurrency,
uint256 _fillAmount,
address _finder
) external payable nonReentrant {
}
/// @dev Deletes canceled and invalid asks
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The ID of the ERC-721 token
function _cancelAsk(address _tokenContract, uint256 _tokenId) private {
}
}
| askForNFT[_tokenContract][_tokenId].seller!=address(0),"cancelAsk ask doesn't exist" | 275,843 | askForNFT[_tokenContract][_tokenId].seller!=address(0) |
"Memo not found." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNWWMMMMMMMMMMMMMMMMMMWWNNWWMMMMMMMMMMMMMMMMMMMWMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKxood0WMMMMMMMMMMMMMMMMNOdoodOXWMMMMMMMMMMMMMMMMNK0K00KWMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXOo;;;;oKWMMMMMMMMMMMMMMW0l;;;;ckNMMMMMMMMMMMMMMMMWK0OkxONMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMKko;;;;l0WMMMMMMMMMMMMMMMNkolclxXWMMMMMMMMMMMMMMMMMWWWWWWWMMM
MMMWNNWMMMMWNNXNNWMMMMMWWNXXNNWMMMMMMMMMMMWNNXKKXXNWWMMMMMWKko;;;;l0WWWXXKKXNWWMMMMMMWX00KNMMMMMMMWWNXXKXXNWWMMMMMMMMMMM
MNKxood0NXOdolllodOXWN0xollllldkKWMMMMMWXOxolcccccldx0NWMMWKko;;;;lO0kolccccldkKWMMMW0dlloONMMMWN0kdlcccccldkKNMMMMMMMMM
W0l;;;;col:;;;;;;;:lxo:;;;;;;;;:lONMMW0dc:;;;;;;;;;;;:lkXWWKko;;;;clc:;;;;;;;;:cxKWMXd;;;;l0WMN0o:;;;;::;;;;;cd0WMMMMMMM
WOc;;;;;;clool:;;;;;;;:lool:;;;;;l0WNkc;;;;:ldxxxoc:;;;:o0NKko;;;;;;:ldkkxoc;;;;:o0WKo;;;;l0WXxc;;;:lxkOkdl:;;;lONMMMMMM
WOl;;;;:o0NNNKkc;;;;;lOXNNXOl;;;;:xXk:;;;:oONWWWWNKxc;;;;l0KOo;;;;;lkXWWMWN0o:;;;;dKKo;;;;l0Xkc;;;cxKWWWWN0o:;;;l0WMMMMM
W0l;;;;cONMMMWXd;;;;:kNMMMMNx:;;;:xOl;;;;l0WMMMMMMWXxc;;;:x0Oo;;;;cONMMMMMMWKo;;;;cOKo;;;;l00o;;;;cdkkkkkkko:;;;cxNMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xOl;;;:dXMMMMMMMMWOl;;;;d0Oo;;;;l0WMMMMMMMXd:;;;ckKo;;;;l00l;;;;;:::::::::;;;:cONMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:x0o;;;;l0WMMMMMMWXx:;;;:x0Oo;;;;ckNMMMMMMWKo;;;;cOKo;;;;l00o:;;;coxkkkkkkkkkkOKNWMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xKkc;;;;lkXNWWWNKxc;;;;oKKko;;;;;cxKNWWNXOo:;;;:dXKo;;;;l0Xkc;;;:d0NWWWWWXKOOXWMMMMMMM
WOl;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xXNkl:;;;:codddoc:;;;:dKWKOo;;;;;;:codddl:;;;;:oKWXo;;;;l0NXkc;;;;cdxkkxdlc;:oKMMMMMMM
W0l;;;;l0WMMMMNx:;;;cOWMMMMNkc;;;:xNWWKxl:;;;;;;;;;;;coONWWX0d;;;;clc:;;;;;;;;:lkXWWXd:;;;l0WMW0dc:;;;;;;;;;;:cxXMMMMMMM
MN0dlloONMMMMMWKxllokXWMMMMWXkollxXWMMMWX0xdollllloxkKNWMMMWNKxood0XKOdolllodx0XWMMMWKxold0NMMMMWXOxolllllloxOXWMMMMMMMM
MMMWNXNWMMMMMMMMWNXNWMMMMMMMMWNNNWMMMMMMMMWWNNXXNNWWMMMMMMMMMMWWWWMMMWWNNNNNWWMMMMMMMMWWNWMMMMMMMMMWWNNXXNNWWMMMMMMMMMMM
*/
import "./lib/SafeMath.sol";
import "./lib/IERC20Burnable.sol";
import "./lib/Context.sol";
import "./lib/ReentrancyGuard.sol";
import "./lib/Ownable.sol";
contract WMBXBridge is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
constructor(address _token, address payable _feeAddress, uint256 _claimFeeRate, uint256 _burnFeeRate) {
}
IERC20 private TOKEN;
address payable private feeAddress;
uint256 private claimFeeRate;
uint256 private burnFeeRate;
bool private isFrozen;
/* Defines a mint operation */
struct MintOperation
{
address user;
uint256 amount;
bool isReceived;
bool isProcessed;
}
mapping (string => MintOperation) private _mints; // History of mint claims
struct MintPending
{
string memo;
bool isPending;
}
mapping (address => MintPending) private _pending; // Pending mint owners
struct BurnOperation
{
uint256 amount;
bool isProcessed;
}
mapping (string => BurnOperation) private _burns; // History of burn requests
mapping (address => bool) private _validators;
event BridgeAction(address indexed user, string action, uint256 amount, uint256 fee, string memo);
// event BridgeBurn(address indexed user, uint256 amount, uint256 fee, string memo);
function getPending(address _user) external view returns(string memory) {
}
function claimStatus(string memory _memo) external view returns(address user, uint256 amount, bool received, bool processed) {
require(<FILL_ME>)
require(msg.sender == _mints[_memo].user || _validators[msg.sender] || msg.sender == owner(), "Not authorized.");
user = _mints[_memo].user;
amount = _mints[_memo].amount;
received = _mints[_memo].isReceived;
processed = _mints[_memo].isProcessed;
}
function isValidator(address _user) external view returns (bool) {
}
function addValidator(address _user) external onlyOwner nonReentrant {
}
function removeValidator(address _user) external onlyOwner nonReentrant {
}
function getFeeAddress() external view returns (address) {
}
function setFeeAddress(address payable _feeAddress) external onlyOwner nonReentrant {
}
function getClaimFeeRate() external view returns (uint256) {
}
function getBurnFeeRate() external view returns (uint256) {
}
function setClaimFeeRate(uint256 _claimFeeRate) external onlyOwner nonReentrant {
}
function setBurnFeeRate(uint256 _burnFeeRate) external onlyOwner nonReentrant {
}
function getFrozen() external view returns (bool) {
}
function setFrozen(bool _isFrozen) external onlyOwner nonReentrant {
}
function burnTokens(string memory _memo, uint256 _amount) external payable nonReentrant {
}
function validateMint(address _user, string memory _memo, uint256 _amount) external nonReentrant {
}
function claimTokens(string memory _memo) external payable nonReentrant {
}
}
| _mints[_memo].isReceived,"Memo not found." | 275,883 | _mints[_memo].isReceived |
"Address already validator." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNWWMMMMMMMMMMMMMMMMMMWWNNWWMMMMMMMMMMMMMMMMMMMWMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKxood0WMMMMMMMMMMMMMMMMNOdoodOXWMMMMMMMMMMMMMMMMNK0K00KWMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXOo;;;;oKWMMMMMMMMMMMMMMW0l;;;;ckNMMMMMMMMMMMMMMMMWK0OkxONMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMKko;;;;l0WMMMMMMMMMMMMMMMNkolclxXWMMMMMMMMMMMMMMMMMWWWWWWWMMM
MMMWNNWMMMMWNNXNNWMMMMMWWNXXNNWMMMMMMMMMMMWNNXKKXXNWWMMMMMWKko;;;;l0WWWXXKKXNWWMMMMMMWX00KNMMMMMMMWWNXXKXXNWWMMMMMMMMMMM
MNKxood0NXOdolllodOXWN0xollllldkKWMMMMMWXOxolcccccldx0NWMMWKko;;;;lO0kolccccldkKWMMMW0dlloONMMMWN0kdlcccccldkKNMMMMMMMMM
W0l;;;;col:;;;;;;;:lxo:;;;;;;;;:lONMMW0dc:;;;;;;;;;;;:lkXWWKko;;;;clc:;;;;;;;;:cxKWMXd;;;;l0WMN0o:;;;;::;;;;;cd0WMMMMMMM
WOc;;;;;;clool:;;;;;;;:lool:;;;;;l0WNkc;;;;:ldxxxoc:;;;:o0NKko;;;;;;:ldkkxoc;;;;:o0WKo;;;;l0WXxc;;;:lxkOkdl:;;;lONMMMMMM
WOl;;;;:o0NNNKkc;;;;;lOXNNXOl;;;;:xXk:;;;:oONWWWWNKxc;;;;l0KOo;;;;;lkXWWMWN0o:;;;;dKKo;;;;l0Xkc;;;cxKWWWWN0o:;;;l0WMMMMM
W0l;;;;cONMMMWXd;;;;:kNMMMMNx:;;;:xOl;;;;l0WMMMMMMWXxc;;;:x0Oo;;;;cONMMMMMMWKo;;;;cOKo;;;;l00o;;;;cdkkkkkkko:;;;cxNMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xOl;;;:dXMMMMMMMMWOl;;;;d0Oo;;;;l0WMMMMMMMXd:;;;ckKo;;;;l00l;;;;;:::::::::;;;:cONMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:x0o;;;;l0WMMMMMMWXx:;;;:x0Oo;;;;ckNMMMMMMWKo;;;;cOKo;;;;l00o:;;;coxkkkkkkkkkkOKNWMMMMM
W0l;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xKkc;;;;lkXNWWWNKxc;;;;oKKko;;;;;cxKNWWNXOo:;;;:dXKo;;;;l0Xkc;;;:d0NWWWWWXKOOXWMMMMMMM
WOl;;;;l0WMMMMNx:;;;ckWMMMMNkc;;;:xXNkl:;;;:codddoc:;;;:dKWKOo;;;;;;:codddl:;;;;:oKWXo;;;;l0NXkc;;;;cdxkkxdlc;:oKMMMMMMM
W0l;;;;l0WMMMMNx:;;;cOWMMMMNkc;;;:xNWWKxl:;;;;;;;;;;;coONWWX0d;;;;clc:;;;;;;;;:lkXWWXd:;;;l0WMW0dc:;;;;;;;;;;:cxXMMMMMMM
MN0dlloONMMMMMWKxllokXWMMMMWXkollxXWMMMWX0xdollllloxkKNWMMMWNKxood0XKOdolllodx0XWMMMWKxold0NMMMMWXOxolllllloxOXWMMMMMMMM
MMMWNXNWMMMMMMMMWNXNWMMMMMMMMWNNNWMMMMMMMMWWNNXXNNWWMMMMMMMMMMWWWWMMMWWNNNNNWWMMMMMMMMWWNWMMMMMMMMMWWNNXXNNWWMMMMMMMMMMM
*/
import "./lib/SafeMath.sol";
import "./lib/IERC20Burnable.sol";
import "./lib/Context.sol";
import "./lib/ReentrancyGuard.sol";
import "./lib/Ownable.sol";
contract WMBXBridge is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
constructor(address _token, address payable _feeAddress, uint256 _claimFeeRate, uint256 _burnFeeRate) {
}
IERC20 private TOKEN;
address payable private feeAddress;
uint256 private claimFeeRate;
uint256 private burnFeeRate;
bool private isFrozen;
/* Defines a mint operation */
struct MintOperation
{
address user;
uint256 amount;
bool isReceived;
bool isProcessed;
}
mapping (string => MintOperation) private _mints; // History of mint claims
struct MintPending
{
string memo;
bool isPending;
}
mapping (address => MintPending) private _pending; // Pending mint owners
struct BurnOperation
{
uint256 amount;
bool isProcessed;
}
mapping (string => BurnOperation) private _burns; // History of burn requests
mapping (address => bool) private _validators;
event BridgeAction(address indexed user, string action, uint256 amount, uint256 fee, string memo);
// event BridgeBurn(address indexed user, uint256 amount, uint256 fee, string memo);
function getPending(address _user) external view returns(string memory) {
}
function claimStatus(string memory _memo) external view returns(address user, uint256 amount, bool received, bool processed) {
}
function isValidator(address _user) external view returns (bool) {
}
function addValidator(address _user) external onlyOwner nonReentrant {
require(<FILL_ME>)
_validators[_user] = true;
}
function removeValidator(address _user) external onlyOwner nonReentrant {
}
function getFeeAddress() external view returns (address) {
}
function setFeeAddress(address payable _feeAddress) external onlyOwner nonReentrant {
}
function getClaimFeeRate() external view returns (uint256) {
}
function getBurnFeeRate() external view returns (uint256) {
}
function setClaimFeeRate(uint256 _claimFeeRate) external onlyOwner nonReentrant {
}
function setBurnFeeRate(uint256 _burnFeeRate) external onlyOwner nonReentrant {
}
function getFrozen() external view returns (bool) {
}
function setFrozen(bool _isFrozen) external onlyOwner nonReentrant {
}
function burnTokens(string memory _memo, uint256 _amount) external payable nonReentrant {
}
function validateMint(address _user, string memory _memo, uint256 _amount) external nonReentrant {
}
function claimTokens(string memory _memo) external payable nonReentrant {
}
}
| !_validators[_user],"Address already validator." | 275,883 | !_validators[_user] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.