Mementos

Git Source

Inherits: ERC20, Ownable

State Variables

NAME

string private constant NAME = "Mementos";

SYMBOL

string private constant SYMBOL = "MOTE";

ENS_NAME

'ENS_NAME' is a public constant that encapsulates the Ethereum Name Service domain, signifying an easily recognizable entry point for interacting with the contract. The prefix 'mementos' signifies the collectible nature of the NFTs, each a token of progress in the evolving narrative of Web3, attached to the 'hbhart' indicating the Half Baked Heroes Art collection.

string public constant ENS_NAME = "mementos.hbhart.eth";

POOL_FEE_RETH_500

uint24 private constant POOL_FEE_RETH_500 = 500;

HALF_BAKED_HEROES

IERC721NonFungibleToken private constant HALF_BAKED_HEROES = IERC721NonFungibleToken(HBHART);

LIQUIDITY_MANAGER

ILiquidityManager private constant LIQUIDITY_MANAGER = ILiquidityManager(LM_HBH);

skipLiquitiyPositionEvaluation

This public mapping records addresses that should be excluded from liquidity position evaluation.

If an address is set to true in this mapping, transfers to and from this address will not initiate the process of fee collection iterations steps from the liquidity positions. There are no token taxes/fees; is entirely liquidity provising fees which anyone can also claim by providing liquidity. The checks are avoided on mining and liquidity pool interaction to reduce gas as these are already higher gas events.

mapping(address => bool) public skipLiquitiyPositionEvaluation;

Functions

onlyHBHContract

onlyHBHContract() restricts function execution to the Half Baked Heroes primary contract.

Modifier ensures only the designated HBH main contract can call the guarded function, maintaining secure contract-to-contract communication.

modifier onlyHBHContract();

onlyHeroes

onlyHeroes() is the gatekeeper ensuring that only those who have joined the illustrious ranks of Hero holders may pass. It's a tribute to the camaraderie and exclusivity of the Half Baked Heroes community, where holding a Hero is not just ownership — it's a membership, a badge of honor in the Web3 odyssey.

This modifier enforces the sacred rule that only addresses with at least one Hero in their keep may invoke the function it guards. It upholds the community's ethos, where privileges are reserved for those who have embarked on the journey through the maze, bearing their digital totems with pride.

modifier onlyHeroes();

constructor

Initiates the Memento token contract in alignment with fair launch principles.

Mints the total supply at launch with no presales, no allocations to the team, no insiders, or tokens reserved for future minting. "If I knew what the picture was going to be like, I wouldn’t make it" — Cindy Sherman

constructor();

name

Returns the name of the token.

function name() public view virtual override returns (string memory);

symbol

Returns the symbol of the token.

function symbol() public view virtual override returns (string memory);

decimals

Returns the decimals places of the token.

function decimals() public view virtual override returns (uint8);

maxSupply

maximum total supply.

function maxSupply() public pure returns (uint256);

addPools

Adds an array of pool addresses to the skip list for liquidity position evaluation.

Marks each pool address as true in the skipLiquidityPositionEvaluation mapping to prevent unnecessary fee collection iteration and reduce gas.

function addPools(address[] calldata pools) external onlyHBHContract;

Parameters

NameTypeDescription
poolsaddress[]An array of addresses representing the pool contracts to be added. Requires that the caller is an authorized HBH contract to ensure proper access control.

bonAppetit

Transfers ownership of the contract to the zero address, effectively making it ownerless.

This is a permanent action that renounces the control of the contract by setting its owner to the zero address. Requires that the caller is an authorized HBH contract to ensure it happens in the proper sequence.

function bonAppetit() external onlyHBHContract;

sacrificeDonatedTokens

When called, the function calculates 10% of the donated tokens' value and returns it to the caller, converting rest to WETH and sending to Liquiduty Manager.

Allows a hero to sacrifice tokens donated by others in exchange for a portion of their value. If the token is Mementos 100% will be burnt, if WETH or rETH 100% will be sent to liquidity manager.

function sacrificeDonatedTokens(address donatedTokenAddress) external onlyHeroes returns (uint256 lootDrop);

Parameters

NameTypeDescription
donatedTokenAddressaddressThe address of the token being sacrificed.

Returns

NameTypeDescription
lootDropuint256uint256 A sumptuous slice of the salvaged tokens, chosen by the very hands of the HalfBaked spirit, as a tribute to your deeds. Your share is not merely a reward, but a manifestation of the recycled energy of forgotten battles, now fuelling your journey in the mystical lands of Half Baked Heroes. May this bounty empower your adventures, and remind all heroes of the cycles of loss and gain, abandonment and rediscovery, within our universe.

_lootDropToHero

Embarks on the clandestine ritual of the Half Baked Heroes, invoking the spirits of the Web3 world to bestow upon the brave a portion of the collected spoils. This sacred ceremony transmutes the donated balance into a loot drop, a treasure that fuels the hero's further adventures in the cryptic labyrinth.

function _lootDropToHero(uint256 donatedBalance) private returns (uint256 lootDrop);

Parameters

NameTypeDescription
donatedBalanceuint256The total amount of the donation gathered by the hero's valiant exploits.

Returns

NameTypeDescription
lootDropuint256A treasure trove, calculated as a fraction of the donated balance, awarded to the noble hero.

_brutalized

For the culture 🫠

dead code that will be removed from the bytecode

function _brutalized(address a) private view returns (address result);

_afterTokenTransfer

function _afterTokenTransfer(address from, address to, uint256) internal override;

_checkIsHeroesContract

Ensures that the calling entity is the esteemed HBHART contract, the sanctum of our heroes. It is a safeguard that permits only the HBHART, the creator of legends, to initiate the sacred call. Any impostor invoking this ritual without being the HBHART shall be denied with the decree "Not HBH".

function _checkIsHeroesContract() private view;

_checkIsHero

A clandestine rite to discern if the caller is among the vaunted ranks of heroes. In the shadows, it invokes the ancient ledger's balanceOf, a tome of ownership inscribed with the deeds of those who command the allegiance of heroes. It demands proof of a bond with at least one hero, lest the caller face the harsh truth of their mortal standing. Should one fail to present such proof, the spirits of the contract shall deny passage with a decree: "Not a Hero".

function _checkIsHero() private view;