PNPL Smart Contracts
1. MersoPNPL Contract (Per Game)
Purpose: Core PNPL logic and payment management for each game
Key State Variables:
contract MersoPNPL is Ownable, ReentrancyGuard {
MersoTokenPool public immutable MERSO_TOKEN_POOL;
address[] public allowedCollections;
mapping(address => address) public wrappedCollection;
mapping(address => address) 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 with PNPL (user pays 50% upfront)
function buyTokenFrom(
address originalCollection,
uint256 tokenId,
uint256 tokenPrice
) 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 Chain)
Purpose: Manages liquidity and payment tokens for each blockchain
Key State Variables:
Key Functions:
Liquidity Management:
3. WrappedNFT Contract (Per Collection)
Purpose: Creates wrapped versions of original NFTs with transfer restrictions
Key State Variables:
Key Functions:
Transfer Restrictions:
Last updated