# Smart contract integration

Games must allow our Wrapped NFT collection (wNFT) to be used within their ecosystem with the same functionality as the original NFTs.

#### Key Points

* **wNFT Acceptance:** Games must recognize and accept our wrapped NFTs for gameplay
* **Full Functionality**: Wrapped NFTs will provide identical game benefits as original NFTs
* **Seamless Experience**: No difference in gameplay between original and wrapped NFTs

This integration ensures users can immediately use their wrapped NFTs in the game while paying over time through our BNPL protocol.

### Flow

This is the NFT-flow. You can see [here](../payment-system) the payment flow

#### Step 1: Initial Payment

When a user selects an NFT for BNPL purchase, they make an initial payment of 50% of the total price. The protocol then wraps the original NFT into a wNFT and delivers it to the user while keeping the original NFT secure in the protocol.

#### Step 2: Weekly Payments

During the payment period, the user continues making weekly payments while maintaining possession of the wNFT. The user can use this wNFT in the game with full functionality, but the wNFT cannot be transferred to other users.

#### Step 3A: Successful Payment Completion

Once the user completes all weekly payments, the protocol sends the original NFT to the user and burns the wNFT, transferring full ownership to the user.

#### Step 3B: Failed Payment

If the user fails to make payments, the protocol burns the wNFT and retains the original NFT, removing the user's access to the asset.

### Game Integration

Games must accept the wNFT for gameplay, providing the same functionality as the original NFT without any gameplay differences.

**Contact our team for technical integration assistance and contract deployment support.**



### Integration examples

To illustrate how wNFTs can be integrated into a game's allowed collections, we present two examples: on-chain and off-chain integration. These examples demonstrate potential flows, which can vary depending on each game's specific requirements and architecture.

#### Ensuring Feature Parity

Our wNFTs are designed to mirror the features and in-game characteristics of the original NFTs. By maintaining a 1:1 relationship with the original NFTs, we ensure that games face minimal modifications, preserving the intended balance and experience without additional adjustments.

#### Off-chain integration

Off-chain integration involves incorporating wNFT functionality without altering the game smart contracts. Instead, this method leverages backend systems to validate and authorize wNFTs for gameplay, ensuring they are treated equivalently to original NFTs. This approach is ideal for games where direct smart contract modification isn't feasible.

```javascript
// Example: Backend NFT validation

const allowedCollections = [
originalNFTAddress,
wNFTAddress // Add our wNFT collection
];

function validatePlayerNFT(playerAddress, nftContract, tokenId) {

return allowedCollections.includes(nftContract) &&
isNFTOwner(playerAddress, nftContract, tokenId);
}
```

#### On-chain integration

On-chain integration involves modifying the game smart contracts to recognize and accept the wNFT as valid for gameplay. This means directly implementing logic within the smart contracts to check for wNFT ownership and authorizing its use in the game, ensuring seamless functionality alongside original NFTs.

```c
// Example: Modified NFT validation in game contract
mapping(address => bool) public allowedCollections;

function canPlay(address player, uint256 tokenId, address nftContract) public view returns (bool) {
    return allowedCollections[nftContract] && IERC721(nftContract).ownerOf(tokenId) == player;
}

function addAllowedCollection(address collection) external onlyOwner {
    allowedCollections[collection] = true;
}

```



**Contact our team for technical integration assistance and contract deployment support.**
