- Table of Contents
- ERC20withMetadata
- PumpFaxtToken
- PumpFaxtInterface
- Constructor
- deployNewToken()
- minimumInitialSupply()
- maximumInitialSupply()
- deploymentCharge()
- setDeploymentCharge()
- withdraw()
- isTokenValid()
- displayPictureIndex()
- setDisplayPictureIndex()
- setMinimumInitialSupply()
- setMaximumInitialSupply()
- setInitialVirtualReserve()
- disableTrading()
- enableTrading()
constructor(
address creator_,
uint256 initialSupply_,
string memory name_,
string memory symbol_,
string memory image_,
string memory metadata_
)
Initializes the ERC20 token with metadata. Sets the creator, initial supply, image, and metadata.
function decimals() public pure override returns (uint8)
Returns the number of decimals used by the token. Always returns 18 (fixed).
function image() external view returns (string memory)
Returns the image URL or data associated with the token.
function creator() public view returns (address)
Returns the address of the token creator.
function createdBlock() external view returns (uint256)
Returns the block number when the token was created.
function metadata() external view returns (string memory)
Returns the metadata associated with the token.
function setMetadata(string memory metadata_) public onlyCreator
Allows the creator to update the metadata for the token.
constructor(
address creator_,
uint256 initialSupply_,
string memory name_,
string memory symbol_,
string memory image_,
string memory metadata_,
uint256 initialVirtualReserve_
)
Initializes the PumpFaxtToken with an initial virtual reserve. It also sets the creator and related metadata.
function allowance(
address owner,
address spender
) public view override returns (uint256)
Updates the token's reserve and supply, calculates the new display price, and adjusts the virtual reserve when certain thresholds are met.
function tokenPrice() public view returns (uint256)
Returns the current token price based on the virtual reserve and supply.
function marketCap() public view returns (uint256)
Returns the market cap of the token, excluding the virtual reserve.
function reserve() public view returns (uint256)
Returns the current reserve of the token.
function supply() public view returns (uint256)
Returns the current supply of the token held by the contract.
function disableTrading() public onlyInterface
Disables trading of the token. Can only be called by the interface contract.
function enableTrading() public onlyInterface
Re-enables trading of the token. Can only be called by the interface contract.
function calculateBuyCostByTokenAmount(uint256 amount_) public view returns (uint256)
Calculates the cost (in Frax) to buy a specified amount of tokens based on the current supply and reserve.
function calculateSellRefundByTokenAmount(uint256 amount_) public view returns (uint256)
Calculates the refund (in Frax) for selling a specified amount of tokens based on the current reserve and supply.
function calculateTokensByFraxRefundAmount(uint256 amount_) public view returns (uint256)
Calculates how many tokens you can buy by refunding a specified amount of Frax.
function calculateTokensReceivedByFraxAmount(uint256 amount_) public view returns (uint256)
Calculates how many tokens can be bought with a specified amount of Frax.
function reserveThreshold() public view returns (uint256)
Returns the reserve threshold, which is used to determine when virtual reserves should be burned.
function buy(uint256 amountIn_, uint256 amountOutMin_) external nonReentrant
Allows users to buy tokens by sending Frax. Ensures that the transaction meets the minimum required output based on slippage tolerance.
function sell(uint256 amountIn_, uint256 amountOutMin_) external nonReentrant
Allows users to sell tokens in exchange for Frax. Ensures that the transaction meets the minimum refund based on slippage tolerance.
constructor(address fraxAddress_) Ownable(_msgSender())
Initializes the PumpFaxtInterface and sets the Frax token address.
function deployNewToken(
uint256 initialSupply_,
string calldata name_,
string calldata symbol_,
string calldata image_,
string calldata metadata_
) external returns (address)
Deploys a new PumpFaxtToken and adds it to the valid token list.
function minimumInitialSupply() external view returns (uint256)
Returns the minimum allowed initial supply for token deployment.
function maximumInitialSupply() external view returns (uint256)
Returns the maximum allowed initial supply for token deployment.
function deploymentCharge() external view returns (uint256)
Returns the current deployment charge required to deploy a new PumpFaxtToken.
function setDeploymentCharge(uint256 newCharge_) external onlyOwner
Updates the deployment charge for new tokens.
function withdraw(
address token_,
address addr_,
uint256 amount_
) external onlyOwner nonReentrant
Allows the contract owner to withdraw funds from the contract.
function isTokenValid(address addr_) external view returns (bool)
Checks if the provided address is a valid PumpFaxtToken contract.
function displayPictureIndex(address user_) external view returns (uint16)
Returns the display picture index for a user.
function setDisplayPictureIndex(uint16 index) external
Allows users to set their display picture index.
function setMinimumInitialSupply(uint256 newMinimum_) external onlyOwner
Updates the minimum allowed initial supply for token deployment.
function setMaximumInitialSupply(uint256 newMaxium_) external onlyOwner
Updates the maximum allowed initial supply for token deployment.
function setInitialVirtualReserve(uint256 initialVirtualReserve_) external onlyOwner
Updates the initial virtual reserve for new token deployments.
function disableTrading(address token_) external onlyOwner
Disables trading for a specific token.
function enableTrading(address token_) external onlyOwner
Enables trading for a specific token.