Caller: Caller is a user’s crypto-wallet. This includes admin, owner, whitelist and public addresses.
Re-entrancy: https://hackernoon.com/hack-solidity-reentrancy-attack
- Caller must fit these requirements to access the public minting:
-
Can not be a contract
/* EOA->A->B->C->D */ /* if tx.origin and msg.sender are same, * msg.sender can NOT be a contract. */ modifier callerIsUser() { require( tx.origin == msg.sender, "Otter Society :: Cannot be called by a contract" ); _; }
-
Caller can not call the function again before the execution has ended. (Re-entrancy Guard)
/** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; }
-
Caller can not access the function when the contract is paused.
/// @notice As an end-user, when the pause is set to 'false' /// you are allowed to access whitelist mint and public mint. modifier notPaused() { require(!pause, "Otter Society :: Contract is paused."); _; }
- Following conditions must be met for the function to execute successfully and mint the token to end-user.
-
Public sale must be started by the admin or owner of the contract.
require(publicSale, "Otter Society :: Not Yet Active.");
-
Total supply (amount of NFTs that were minted to that moment) can NOT exceed the
MAX_SUPPLY
.require( (totalSupply() + _quantity) <= MAX_SUPPLY, "Otter Society :: Beyond Max Supply" );
-
User can NOT exceed
MAX_PUBLIC_MINT
when minting from public.require( (totalPublicMint[msg.sender] + _quantity) <= MAX_PUBLIC_MINT, "Otter Society :: Minted maximum amount." );
-
$AVAX amount sent by the end-user must be equal to or higher than
PUBLIC_SALE_PRICE
. End-users can mint their NFTs through Kalao and/or SnowTrace (blockchain explorer of Avalanche’s C-chain) Note: For$N$ NFTs, you must send at leastPUBLIC_SALE_PRICE * $N$
amount of $AVAX.require( msg.value >= (PUBLIC_SALE_PRICE * _quantity), "Otter Society :: Not enough AVAX. " );
- Caller must fit these requirements to access the whitelist minting:
-
Can not be a contract.
/* EOA->A->B->C->D */ /* if tx.origin and msg.sender are same, * msg.sender can NOT be a contract. */ modifier callerIsUser() { require( tx.origin == msg.sender, "Otter Society :: Cannot be called by a contract" ); _; }
-
Caller can not call the function again before the execution has ended. (Re-entrancy Guard)
/** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; }
-
Caller can not access the function when the contract is paused.
/// @notice As an end-user, when the pause is set to 'false' /// you are allowed to access whitelist mint and public mint. modifier notPaused() { require(!pause, "Otter Society :: Contract is paused."); _; }
-
Caller address must be registered as whitelisted.
modifier isWhitelisted(address _address) { require(whitelistedAddresses[_address], "You need to be whitelisted"); _; }
- Following conditions must be met for the function to execute successfully and mint the token to end-user.
-
Whitelist sale must be started by the admin or owner of the contract.
require( whiteListSale, "Otter Society :: White-list minting is on pause" );
-
Total supply (amount of NFTs that were minted to that moment) can NOT exceed the
MAX_SUPPLY_WHITELIST
.require( (totalSupply() + _quantity) <= MAX_SUPPLY_WHITELIST, "Otter Society :: Cannot mint beyond max supply" );
-
User can NOT exceed
MAX_WHITELIST_MINT
when minting from whitelist. Note: Whitelisted users can both mint from whitelist & public within the same wallet.require( (totalWhitelistMint[msg.sender] + _quantity) <= MAX_WHITELIST_MINT, "Otter Society :: Cannot mint beyond whitelist max mint!" );
-
$AVAX amount sent by the end-user must be equal to or higher than
PUBLIC_SALE_PRICE
. End-users can mint their NFTs through Kalao and/or SnowTrace (blockchain explorer of Avalanche’s C-chain) Note: For$N$ NFTs, you must send at leastWHITELIST_SALE_PRICE * $N$
amount of $AVAX.require( msg.value >= (WHITELIST_SALE_PRICE * _quantity), "Otter Society :: Payment is below the price" );
- Caller can only be owner or the admin of the contract, Otter Society developer team.
-
Owner of the contract will mint
TEAM_MINT_AMOUNT
to their address for once.require(!teamMinted, "Otter Society :: Team already minted.");
- Caller can be only owner or admin account.
-
On each withdraw, %75 goes to Otter Society developer team, this includes roadmap and crew salaries.
_withdraw(owner(), (fullBalance * 75) / 100);
-
On each withdraw, %25 goes to DAO wallet, $AVAX in this wallet will NOT be used by the developers of Otter Society, DAO will decide what happens with this wallet.
_withdraw(marketDAOWallet, (fullBalance * 25) / 100);
Before sold-out royalty fee: %10 After sold-out royalty fee: %5
Note: Otter Society developer team, or any 3rd party, can NOT set the royalty fee higher than %20
/// Reveal Otter Society on sold-out.
/// Reduce royalty fee to 5%
if (totalSupply() == MAX_SUPPLY) {
isRevealed = true;
_setDefaultRoyalty(marketDAOWallet, uint96(royaltyDividend / 2));
}
This documentation has been made & prepared by Otter Society Developer Team for public access and educational purposes.
This documentation accurately represents The Otter Society NFT Smart Contract that will be used to host The Otter Society NFT Collection.