-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description:
To enhance the usability of the Vertix platform, we need to support stablecoin payments USDT for purchasing NFT and non-NFT assets in the VertixMarketplace contract. Currently, the marketplace only accepts ETH payments (via msg.value in buyNFT and buyNonNFTAsset). Adding stablecoin support will provide users with price stability and broader payment options, aligning with common DeFi practices.
Goals:
- Enable stablecoin payments for all marketplace purchases.
- Preserve existing ETH payment functionality.
- Ensure secure and upgradable contract interactions.
- Pass all tests and CI checks (formatting, build, test, deployment).
Tasks:
-
Research and Select Stablecoin:
- Choose USDT as the initial stablecoin.
- Identify the USDT contract address for Sepolia.
-
Update VertixMarketplace Contract:
- Add a state variable for the stablecoin contract address (e.g., IERC20 public stablecoin).
- Modify initialize to accept a stablecoin address parameter.
-
Update buyNFT and buyNonNFTAsset to accept stablecoin payments:
- Remove payable and msg.value checks for stablecoin mode.
- Use IERC20.transferFrom to transfer stablecoin from the buyer to the marketplace.
- Add a payment type parameter (e.g., enum PaymentType { ETH, Stablecoin }) to select ETH or stablecoin.
- Update royalty and platform fee calculations to handle stablecoin amounts.
- Emit updated events (e.g., NFTBought, NonNFTBought) with payment type and amount.
-
Update VertixEscrow Contract:
- Modify lockFunds to accept stablecoin payments:
- Add a parameter for payment type and stablecoin amount.
- Use IERC20.transfer to lock stablecoin funds in the escrow.
- Update releaseFunds, releaseFundsToWinner, and refundFunds to transfer stablecoin to the appropriate recipient.
- Update Escrow struct to track payment type and stablecoin amount.
-
Update VertixGovernance Contract:
- Add a function to set/update the stablecoin address (e.g., setStablecoinAddress).
- Update FeeConfig struct to include stablecoin fee settings if needed.
- Ensure getFeeConfig supports stablecoin fee calculations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request