Upfront Payment Contracts

1. MersoUP Contract (Per Game)

Purpose: Core Upfront Payment logic and payment management for each game

Key State Variables:

contract MersoUP is ReentrancyGuard {
    MersoTokenPool public immutable MERSO_TOKEN_POOL;
    
    address[] public allowedCollections;
    mapping(address => address) public wrappedCollection;
    mapping(address => mapping(address => bool)) public originalCollectionToken;
    mapping(address => mapping(uint256 => uint256)) public tokenLastPayment;
    mapping(address => mapping(uint256 => address)) public tokenUser;
    mapping(address => mapping(uint256 => uint256)) public tokenPaymentNumber;
    mapping(address => mapping(uint256 => uint256)) public tokenSplitPayment;
}

Key Functions:

// Add new NFT collection to the protocol
function addNewAllowedCollection(
    address originalCollection,
    string memory wCollectionName,
    string memory wCollectionSymbol,
    address gameToken
) external onlyOwner;

// Purchase NFT
function buyTokenFrom(
    address originalCollection,
    uint256 tokenId,
    uint256 tokenPrice,
    address tokenAddress
) external onlyAllowedCollection(originalCollection) nonReentrant;

// Process weekly payment (called by owner)
function payUserNFTPortion(
    address collection,
    uint256 tokenId
) external onlyOwner onlyRegisteredToken(collection, tokenId) nonReentrant;

Payment Flow Logic:

2. MersoTokenPool Contract (Per Game)

Purpose: Manages liquidity and payment tokens for each blockchain

Key State Variables:

Key Functions:

Liquidity Management:

Last updated