¡El código fuente de este contrato está verificado!
Metadatos del Contrato
Compilador
0.8.12+commit.f00d7308
Idioma
Solidity
Código Fuente del Contrato
Archivo 1 de 15: Address.sol
Código Fuente del Contrato
Archivo 2 de 15: Context.sol
Código Fuente del Contrato
Archivo 3 de 15: Counters.sol
Código Fuente del Contrato
Archivo 4 de 15: ERC165.sol
Código Fuente del Contrato
Archivo 5 de 15: ERC721.sol
Código Fuente del Contrato
Archivo 6 de 15: ERC721F.sol
Código Fuente del Contrato
Archivo 7 de 15: IERC165.sol
Código Fuente del Contrato
Archivo 8 de 15: IERC721.sol
Código Fuente del Contrato
Archivo 9 de 15: IERC721Enumerable.sol
Código Fuente del Contrato
Archivo 10 de 15: IERC721Metadata.sol
Código Fuente del Contrato
Archivo 11 de 15: IERC721Receiver.sol
Código Fuente del Contrato
Archivo 12 de 15: Ownable.sol
Código Fuente del Contrato
Archivo 13 de 15: Ruggies.sol
// SPDX-License-Identifier: MITpragmasolidity ^0.8.9 <0.9.0;import"https://github.com/FrankNFT-labs/ERC721F/blob/v1.0.0/ERC721F.sol";
import"https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/math/SafeMath.sol";
/**
* @title Ruggies contract
* @dev Extends ERC721F Non-Fungible Token Standard basic implementation.
* Optimized to no longer use ERC721Enumerable , but still provide a totalSupply() and walletOfOwner(address _owner) implementation.
* @author @FrankPoncelet
*
*/contractRuggiesisERC721F{
usingSafeMathforuint256;
uint256public tokenPrice =0.085ether;
uint256publicconstant MAX_TOKENS =4444;
uintpublicconstant MAX_PURCHASE =3; // set 1 to high to avoid some gasuintpublicconstant MAX_RESERVE =23; // set 1 to high to avoid some gasboolpublic saleIsActive;
boolpublic preSaleIsActive;
addressprivateconstant FRANK =0xF40Fd88ac59A206D009A07F8c09828a01e2ACC0d;
addressprivateconstant WOUT =0x47CE3f096c523E7A5C9B42254c965C7AF1930EB2;
addressprivateconstant COMM =0xA226A89572Df4a653Bb3589F5D703b963D1b974A;
addressprivateconstant BIASED =0xb6CfdaA92763f95a03995d331417d98C615204dD;
addressprivateconstant MISC =0x3D300E438d5Bd4DaAe83a6dAf15172C7e274E802;
addressprivateconstant RENDER =0x7A33bCFFFFA5D4B146E1Ca39663bfBFAcb517941;
mapping(address=>uint256) private whitelist;
eventpriceChange(address _by, uint256 price);
constructor() ERC721F("Ruggies", "RUG") {
setBaseTokenURI("ipfs://Qmekhgx967o4eAJuJYysxbZCdQwy87YTc7nNTRqFiomQSq/");
_safeMint( FRANK, 0);
}
/**
* Mint Tokens to a wallet.
*/functionmint(address to,uint numberOfTokens) publiconlyOwner{
uint supply = totalSupply();
require(supply.add(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 WL
*/functionaddWL(address _address, uint256 amount) publiconlyOwner{
whitelist[_address] = amount;
}
/**
* add an array of address to the WL
*/functionaddAdresses(address[] memory _address, uint256 amount) externalonlyOwner{
for (uint i=0; i<_address.length; i++) {
addWL(_address[i], amount);
}
}
/**
* remove an address off the WL
*/functionremoveWL(address _address) externalonlyOwner{
whitelist[_address] =0;
}
/**
* get the number of mints still availible for this WL
*/functiongetWLmints(address _address) externalviewreturns(uint256) {
return whitelist[_address];
}
/**
* returns true if the wallet is Whitelisted.
*/functionisWhitelisted(address _address) publicviewreturns(bool) {
return whitelist[_address]>0;
}
functionmint(uint256 numberOfTokens) externalpayable{
require(msg.sender==tx.origin);
if(preSaleIsActive){
require(isWhitelisted(msg.sender),"sender is NOT Whitelisted or no more WL mints");
require(whitelist[msg.sender]>=numberOfTokens,"Purchase would exceed max WL mint for walet");
whitelist[msg.sender] = whitelist[msg.sender] - numberOfTokens;
}else{
require(saleIsActive,"Sale NOT active yet");
require(numberOfTokens < MAX_PURCHASE, "Can only mint 2 tokens at a time");
}
uint256 supply = totalSupply();
require(supply.add(numberOfTokens) <= MAX_TOKENS, "Purchase would exceed max supply of Tokens");
require(tokenPrice.mul(numberOfTokens) <=msg.value, "Ether value sent is not correct");
for(uint256 i; i < numberOfTokens; i++){
_safeMint( msg.sender, supply + i );
}
}
functionwithdraw() publiconlyOwner{
uint256 balance =address(this).balance;
require(balance >0, "Insufficent balance");
_withdraw(WOUT, balance/10);
_withdraw(BIASED, (balance/100)*13);
_withdraw(MISC, balance/20);
_withdraw(RENDER, balance/50);
_withdraw(COMM, address(this).balance);
}
}