// SPDX-License-Identifier: MITpragmasolidity ^0.8.9 <0.9.0;import"https://github.com/FrankNFT-labs/ERC721F/blob/v1.0.2/ERC721F.sol";
/**
* @title OneOnes contract
* @dev Extends ERC721F Non-Fungible Token Standard basic implementation.
* Optimized to no longer use ERC721Enumarable , but still provide a totalSupply() implementation.
* @author @FrankNFT.eth
*
*/contractOneOnesisERC721F{
uint256public tokenPrice =0.09ether;
uint256public preSaleTokenPrice =0.08ether;
uint256publicconstant MAX_TOKENS=6565;
uintpublicconstant MAX_PURCHASE =26; // set 1 to high to avoid some gasuintpublicconstant MAX_RESERVE =26; // set 1 to high to avoid some gasstringpublicconstant IMAGE_HASH="df5518ebd60e4dc03b603c990d211a1e075e5dd4e6d7bf71fc40d4766b7d21a4";
boolpublic saleIsActive;
boolpublic preSaleIsActive;
addressprivateconstant FRANK =0xF40Fd88ac59A206D009A07F8c09828a01e2ACC0d;
addressprivateconstant FCCVIEW =0xf450a5d6C4205ca8151fb1c6FAF49A02c8A527FC;
addressprivateconstant M =0x209Aed6244189fcc69e419Befadc7Ab4DcAe0ab0;
addressprivateconstant N =0x60b8630C9F3842674896732C826E0fCF559d4E8A;
addressprivateconstant MN =0x6524f10644F7e10339743c4cb8bc46c0eD14f745;
addressprivateconstant T =0x29a0ac7892D7bDf17cC43fA487443255946D01B7;
mapping(address=>bool) private allowlist;
mapping(address=>uint256) private amount;
eventpriceChange(address _by, uint256 price);
constructor() ERC721F("OneOnes", "11") {
setBaseTokenURI("ipfs://QmV75gut8rrFrn5YPcY6w53ydcc1GhAiBdHrekLej3ru4g/");
_safeMint(FRANK, 0);
}
/**
* Mint Tokens to a wallet.
*/functionmint(address to,uint numberOfTokens) publiconlyOwner{
uint supply = totalSupply();
require(supply + numberOfTokens <= MAX_TOKENS, "Reserve would exceed max supply of Tokens");
require(numberOfTokens < MAX_RESERVE, "Can only mint 25 tokens at a time");
for (uint i =0; i < numberOfTokens; i++) {
_safeMint(to, supply + i);
}
}
/**
* Mint Tokens to the owners reserve.
*/functionreserveTokens() externalonlyOwner{
mint(owner(),MAX_RESERVE-1);
}
/**
* Pause sale if active, make active if paused
*/functionflipSaleState() externalonlyOwner{
saleIsActive =!saleIsActive;
if(saleIsActive){
preSaleIsActive=false;
}
}
/**
* Pause sale if active, make active if paused
*/functionflipPreSaleState() externalonlyOwner{
preSaleIsActive =!preSaleIsActive;
}
/**
* Set price
*/functionsetPrice(uint256 price) externalonlyOwner{
tokenPrice = price;
emit priceChange(msg.sender, tokenPrice);
}
/**
* add an address to the AL
*/functionaddAllowList(address _address) publiconlyOwner{
allowlist[_address] =true;
}
/**
* add an array of address to the AL
*/functionaddAdresses(address[] memory _address) externalonlyOwner{
for (uint i=0; i<_address.length; i++) {
addAllowList(_address[i]);
}
}
/**
* remove an address off the AL
*/functionremoveAllowList(address _address) externalonlyOwner{
allowlist[_address] =false;
}
/**
* returns true if the wallet is the address is on the Allowlist.
*/functionisAllowlist(address _address) publicviewreturns(bool) {
return allowlist[_address];
}
/**
* returns the number of tokens left to if the wallet is on the Allowlist.
*/functiongetAllowedMints(address _address) publicviewreturns(uint256) {
return2-amount[_address];
}
/**
* Mint your tokens here.
*/functionmint(uint256 numberOfTokens) externalpayable{
if(preSaleIsActive){
require(isAllowlist(msg.sender),"sender is NOT Allowlisted ");
require(amount[msg.sender]+numberOfTokens<3,"Purchase would exceed max mint for walet");
amount[msg.sender] = amount[msg.sender]+numberOfTokens;
require(preSaleTokenPrice * numberOfTokens <=msg.value, "Ether value sent is not correct");
}else{
require(saleIsActive,"Sale NOT active yet");
require(tokenPrice * numberOfTokens <=msg.value, "Ether value sent is not correct");
}
require(numberOfTokens >0, "numberOfNfts cannot be 0");
require(numberOfTokens < MAX_PURCHASE, "Can only mint 25 tokens at a time");
uint256 supply = totalSupply();
require(supply + numberOfTokens <= MAX_TOKENS, "Purchase would exceed max supply of Tokens");
for(uint256 i; i < numberOfTokens; i++){
_safeMint( msg.sender, supply + i );
}
}
functionwithdraw() publiconlyOwner{
uint256 balance =address(this).balance;
require(balance >0, "Insufficent balance");
_withdraw(FRANK,(balance *5) /100);
_withdraw(FCCVIEW,(balance *5) /100);
_withdraw(M,(balance *30) /100);
_withdraw(N,(balance *20) /100);
_withdraw(MN,(balance *20) /100);
_withdraw(T, address(this).balance);
}
}