← Developers
PLUS Game SDK · preview v0.1

Build games on PLUS

Wallet connect, Sign-In with PLUS, in-game purchases through PLUS Pay and standard item tokens: one script, no dependencies. Blocks every ~3 s with instant finality and a fixed 1 gwei gas price (≈ 0.000021 PLUS per transfer).

Step 1

Add the SDK, connect and sign in

Works with any EIP-1193 browser wallet (MetaMask, WPLUS, Trust, OKX). connect() adds and switches to PLUS Mainnet automatically.

html
<script src="https://plusmain.net/plus-game-sdk.js"></script>
<script>
  // 1. Connect a wallet and switch to PLUS Mainnet (88088)
  const { address } = await PlusGame.connect();

  // 2. Sign in (EIP-4361): the player signs a message, no gas
  const { token } = await PlusGame.signIn();
  await fetch("/api/login", { method: "POST", body: JSON.stringify({ token }) }); // your server

  // 3. Read the PLUS balance
  const plus = await PlusGame.getBalance();
</script>
Step 2

Check the player on your server

The sign-in message is standard EIP-4361(Sign-In with Ethereum, chain 88088). Tokens last 24 hours. Sign-in must be started from a web page on your own domain: the browser's Origin is checked, so a phishing site cannot get a token for your game. Native apps can verify the signed EIP-4361 message themselves with any SIWE library.

js
// Your game server (Node): accept the player only if the token is for YOUR domain
const r = await fetch("https://plusmain.net/api/game/auth/session", {
  headers: { Authorization: "Bearer " + token },
});
const s = await r.json();
if (!s.ok || s.domain !== "mygame.com") throw new Error("not signed in");
const playerAddress = s.address; // checksummed 0x address, valid until s.expiresAt
Step 3

Sell items with PLUS Pay

Players pay in USDT (BNB Chain) or PLUS straight to your wallet; PLUS Pay never holds funds and charges no fee. Get your API key and webhook secret on PLUS Pay for developers.

js
// 1. SERVER: create an invoice with your PLUS Pay API key (never in the client)
const r = await fetch("https://plusmain.net/api/pay/invoice", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.PLUSPAY_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ asset: "USDT_BSC", amount: "4.99", orderId: "player123:gem-pack-500", merchantName: "My Game", memo: "500 gems" }),
});
const { invoice } = await r.json();          // send invoice.id to the client

// 2. CLIENT: open the checkout and wait
const result = await PlusGame.checkout(invoice.id);  // resolves { status: "paid", txHash }

// 3. SERVER: grant the item when the signed "invoice.paid" webhook arrives
//    (check source === "api", orderId, asset, amountUnits; handle duplicates by invoice id)
Grant items on your server only. A message from the checkout window is a hint, not proof: the SDK re-checks the invoice on our server, and your server should rely on the signed webhook.
Step 4

Item and currency tokens

PLUS is fully EVM-compatible, so standard OpenZeppelin contracts deploy unchanged. Use ERC-1155 for items and ERC-20 for a soft currency. Keep the admin role in a multisig (Safe works on PLUS).

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

/// Game items: one contract, many item types (id 1 = sword, id 2 = shield, ...).
contract GameItems is ERC1155, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    constructor(address admin, string memory uri_) ERC1155(uri_) {   // e.g. "https://mygame.com/items/{id}.json"
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        _grantRole(MINTER_ROLE, admin);
    }

    function mint(address to, uint256 id, uint256 amount) external onlyRole(MINTER_ROLE) { _mint(to, id, amount, ""); }

    function supportsInterface(bytes4 i) public view override(ERC1155, AccessControl) returns (bool) {
        return super.supportsInterface(i);
    }
}
solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

/// In-game soft currency. Only the game server (MINTER_ROLE) can mint; players can transfer and burn.
contract GameCoin is ERC20, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    constructor(address admin) ERC20("My Game Coin", "MGC") {
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        _grantRole(MINTER_ROLE, admin);
    }

    function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) { _mint(to, amount); }
    function burn(uint256 amount) external { _burn(msg.sender, amount); }
}
bash
# Foundry: deploy to PLUS Mainnet (gas is paid in PLUS, 1 gwei)
forge create src/GameItems.sol:GameItems \
  --rpc-url https://rpc.plusmain.net --chain 88088 \
  --private-key $DEPLOYER_KEY \
  --constructor-args 0xYourAdminSafe "https://mygame.com/items/{id}.json"
# Then verify the source on https://scan.plusmain.net (Code → Verify & Publish)

These templates are starting points, not audited products. Have your final contracts reviewed before mainnet use.

Unity

Unity SDK (preview)

C# API for Unity 2020.3+. Balances and PLUS Pay checkout work on every platform (native builds open checkout in the browser and wait for payment); wallet sign-in and transfers work in WebGL builds through the web SDK. Copy the PlusGame folder into Assets.

c#
using PlusMainnet;

// Any platform: read a balance
string plus = await PlusGame.GetBalance(playerAddress);

// Any platform: pay an invoice your SERVER created with its PLUS Pay API key
var result = await PlusGame.Checkout(invoiceId);    // result.status == "paid"
// ...then grant the item on your server when the signed invoice.paid webhook arrives

// WebGL builds: browser wallet sign-in (send session.token to your server)
var session = await PlusGame.SignIn("Sign in to My Game");

Preview release: test with small amounts.

Unreal

Unreal Engine SDK (preview)

Plugin for Unreal Engine 5.1+ with Blueprint nodes: Get PLUS Balance, PLUS Pay Checkout(opens checkout in the player's browser and waits for payment) and Get PLUS Pay Invoice. Copy the PlusGame folder into your project's Plugins folder. Sign players in on your web page with Sign-In with PLUS.

c++
// Blueprint: "PLUS Pay Checkout" node -> On Paid / On Failure
// C++:
#include "PlusGameActions.h"

// invoiceId comes from YOUR server (POST /api/pay/invoice with its PLUS Pay API key)
UPlusCheckoutAction* Pay = UPlusCheckoutAction::PlusCheckout(this, InvoiceId, 900);
Pay->OnPaid.AddDynamic(this, &AMyShop::HandlePaid);      // (InvoiceId, TxHash): update the UI
Pay->OnFailure.AddDynamic(this, &AMyShop::HandleFailed); // (Code, Message): EXPIRED / TIMEOUT
Pay->Activate();
// Your server grants the item when the signed invoice.paid webhook arrives.

Preview release: test with small amounts.

Roadmap

What is live and what is next

Wallet connect + chain switchLive
Sign-In with PLUS (EIP-4361)Live
In-game purchases (PLUS Pay)Live (preview)
ERC-20 / ERC-1155 templatesLive
Gas sponsorship (paymaster)Planned
Email / social login walletsPlanned
Public testnet + faucetPlanned
Partner applicationsOpen
Unity SDKLive (preview)
Unreal SDKLive (preview)
Game grantsPlanned

Design guidance: build games that are fun without token prices. Avoid play-to-earn rewards that depend on a token's market value, and check local rules for paid items (for example, game rating rules in Korea). Gambling is not allowed through these tools.