Abstract
Back from the ancient days of human civilization, games were fun! Making money was even more fun! Nowadays, games are still enjoyable, and when games involve money, they become even more thrilling!
What if we could harness the power of blockchain to ensure transparency in games?
It sounds intriguing, but currently, many people are unfamiliar with playing in the decentralized world of blockchain. One of the challenges of web3 applications is onboarding players to the nature of blockchain, which requires a wallet and some gas fees for transactions to be processed on the chain. It can be daunting for newcomers to figure out how to obtain a crypto wallet, provide gas fee coins, and send transactions. Palgam recognizes that to attract the next wave of players, the player experience must closely resemble that of current web2 games. To simplify onboarding, when a player makes their first deposit, Palgam creates a dedicated smart wallet for them using the PalgamAccountFactory.
So, let’s talk more about the smart wallet used in the Palgam:
Palgam introduces a one-time smart wallet for each player to simplify onboarding and enhance security. This wallet is fully owned by the player, and deposited funds can only be transferred to the player’s EOA wallet.
Smart Wallet System
To simplify onboarding and ensure seamless gameplay, Palgam introduces a one-time smart wallet for each player upon their first deposit. Using the PalgamAccountFactory, the Palgam server detects the deposit and triggers a blockchain transaction that:
- Creates a player-owned smart wallet – fully controlled by the player, ensuring funds cannot be transferred to any address other than the player’s EOA.
- Handles gas fees automatically – a small portion of the deposited USDT is swapped into MATIC to cover blockchain transaction fees.
- Transfers remaining funds – the remaining USDT, along with the swapped MATIC, is sent directly to the player’s EOA wallet.
After this initial transfer, the player provides an approval transaction to the Palgam gateway contract, enabling it to interact with the player’s funds only with the player’s explicit signature. Once approved, the player no longer uses the smart wallet, as all future transactions occur directly from their EOA through the gateway contract.
This system ensures a frictionless experience, allowing players to enter game tables without needing native MATIC for gas while keeping all funds secure and under player control. All operations occur on the Polygon PoS network using the USDT ERC20 token, combining decentralization, security, and convenience for the player.
Flow of player onboarding to the Palgam
In PalGam, each player is assigned an EOA (Externally Owned Account) wallet that is securely generated on their device through the Unity app. A corresponding smart contract wallet address can also be precomputed and displayed to the player for their initial deposit. The player onboarding process is illustrated in the diagram below:
The above diagram shows a big picture of the whole idea of what is happening. But there are some steps which we need to know about. As the player starts onboarding journey in the Palgam, two main steps could occur:
1. Player Registration Process
Scenario 1: Player Has Native POL Coins in Their EOA Wallet
- Upon registration, an approval operation is conducted to allow the "gateway contract" to deduct tables fees from user.
Scenario 2: Player Does Not Have Native POL Coins in Their EOA Wallet
- A smart wallet address is precomputed and displayed to the player.
- The player must deposit USDT into this precomputed Smart Wallet address, which is fully owned by the player.
- After depositing USDT:
- The backend system automatically detects the transaction.
- The player receives a “Deposit in Progress” notification, indicating that the backend has acknowledged the transfer.
- Once the smart wallet is funded:
- A portion of the player's USDT is automatically swap to POL and sent to their Main wallet, which is generated during player registration.
- The remaining USDT is also transferred to their Main wallet.
2. Final Approval and Activation
- Once the Tether and POL are transferred to the player's EOA wallet, the EOA wallet will approve the "Gateway" contract.
If the player already has POL in their balance, the process differs slightly. The updated flow is illustrated in the diagram below:
Flow of Withdrawal Process
Withdrawals follow a similar process to deposits, with players specifying the chain to which they wish to transfer their funds.
Player wants to withdraw to the Polygon PoS chain:
- The player easily initiates a funds transfer transaction from their main wallet inside the app to their chosen wallet address wherever they desire (without any limitation) .
- Additionally, Palgam imposes a general fee of $0.01 for every withdrawal transaction.
However, in this case, we will encounter two different scenarios, which are best understood through a diagram provided below:
During the withdrawal process, if the player’s intention is to withdraw all the balance, gas fees and commissions are deducted from the value being transferred from the player's main wallet, and as another scenario, if the player’s intention is to withdraw some of the balance that is less then transfer amount + tx fee + palgam fee, the gas fees and commissions are deducted from player’s remained balance in his/her wallet.
It is important to note that the corresponding withdrawal function facilitates secure, permissioned token transfers while ensuring the integrity and authenticity of transactions through cryptographic signature verification. It is designed to support meta-transactions, allowing authorized administrators to execute transfers on behalf of users in a trustless yet controlled manner.

Due to the mechanism implemented in the MetaTransfers contract, we prevent the replay attacks which is provided by the signature verification and the signature deadline. So, each withdrawal transaction request is only applicable one time based on the player’s signed transfer data including from and to addresses, withdrawal amount, the player’s nonce, the applicable deadline.
Skill Base Tables Management System
Palgam generally offers two types of games: Free and with USDT. In free games, there are no on-chain transactions, as these games operate similarly to normal web2 games. Free game tables allow players to enter the game without needing any funds. These types of tables do not include any commission, and consequently, there are no winnings for the table winner.
Further exploration of the games reveals various types of non-free tables. Here is the current list of tables:
- 1-to-1 Table
- Tournament Table
For 1-to-1 tables, players can play with their friends or with random opponents. In friendly tables, players can choose the amount themselves.
In skill base tables, due to the block gas limits and desired speed for joining players to the game, the below strategy has been devised:
Pre-generated tables contracts: These contracts are cloned from the main implementation. These pre-generated table contract instances are ready to be used by joining players and isolate the amount in that specific contract for each game.
1-to-1 Games Process
The process of entering the game begins with selecting an available(open) table. Each player is provided with the address of their opponent, the table's nonce, and the table’s smart contract address. Each Players must then sign a combination of these details, along with the amount and a signature deadline:

Once this data is signed, the player submits the generated signature to Palgam’s backend service. The smart contract then verifies each player’s signature using the function described above. It’s important to note that signatures are valid only once and have a maximum expiration time of 2.78 hours. After expiration, a signature becomes invalid. Additionally, each signature can be used for only one game and is marked as used in the signature history.
Each game table has a nonce, similar to externally owned accounts (EOAs). This nonce increments with each game session, either after a winner is determined or when a refund is issued. The nonce mechanism ensures that funds cannot be withdrawn multiple times within the same deadline interval, preventing unauthorized withdrawals or transactions exceeding the intended amount.
Joining Players: Player A requests to join a game table, the system reserves a table and searches for an opponent. Once an opponent B is found, both players exchange the necessary data to generate their respective signatures. These signatures are then sent to the server, where a check is performed to verify whether the transaction can proceed. If no errors are detected, the transaction is submitted. Once mined, players are redirected to the game screen to begin the match. It's important to note that at most one of the players can play with their bonus balance.
Determining the Winner: Based on the game result, the winner is selected by the app. It's notable that if one of the players leaves the game voluntarily, gets disconnected from the internet, or runs out of time, the player who stays longer in the game will be declared as winner. After determining the winner, payments are made, and table parameters are reset. Payments include:
- Commission for Palgam (and the winner’s referrer if one exists)
- Gas costs of the table
- Winner’s winning amount
Commission:
When a winner is announced, the commission is transferred to the Palgam commission wallet. If the winning player has a referrer (and the player is not using a bonus balance), a portion of this commission is transferred to the referrer’s account.
By default, Palgam’s commission is 3%, but it can range between 2% and 10%.
For example, in a $10 skill base table with a 3% commission, the total commission would be $0.30. If the winner has a referrer with a 25% referrer commission rate, Palgam’s share would be $0.225, and the referrer’s share would be $0.075.
Note that if any player participates using their bonus balance, Palgam’s commission will instead be transferred to the bonus pool.
Gas Costs: The amount of gas consumed for executing the joining transaction and setting the winner transaction is stored in the table. After the game finishes, the total gas cost of the game that is equivalent to multiplication of: gasprice * pre-calculated gas usage * POL’s price that is taken from oracles will be deducted from the table’s balance and send to the Palgam's gas wallet. the remained amount will be sent to the winner’s main wallet.
Winning Amount:
If the winner is playing with their main balance, the remaining balance in the table is transferred to the winner’s main account.
If the winner is playing with their bonus balance, the winning amount is transferred to the bonus pool and added to their bonus balance.
Refunding Process: In the event of any issues arising during the game processes, where players’ funds remain locked in the table and there is no option to complete the game due to unforeseen circumstances, Palgam and players can initiate a refund. This refund request can be made two days after their initial joining time. This policy ensures that players are not left without recourse in situations beyond their control, providing a fair and transparent mechanism for reclaiming their tokens.
Tournaments Process
The process of entering the tournaments begins with selecting an available(open) tournament table. Each player is provided with the table's nonce, and the tournament’s table smart contract address. Players must then sign a combination of these details, along with the tournament entrance amount and a deadline:

Palgam offers tournaments for each game, facilitated by the Tournament Management System, empowering admins to create new pre-generated tournaments and define essential parameters for each game. During tournaments, participants are randomly selected, and those progressing to subsequent rounds carry forward any remaining funds from the previous stage. Entry fees are debited from players' main balances upon tournament registration, with a platform commission of 10% levied on the total value of tournament matches. The process is as follows:
Setting the tournament data: The tournament admin sets tournament-related parameters such as entry fee, required players, start time (if applicable), etc. Then, a tournament contract instance is ready to join players to it. Each tournament operates within its own isolated smart contract clone, ensuring the secure collection of entry fees.
Joining players: Players can participate in the tournament by submitting a request within the app, when a free tournament is found, the player can join the tournament table. During this process, the entry fee is deducted from the players' main balances and transferred to the specific smart contract associated with the tournament. It's important to note that this function is only available for open tournaments and can be executed until 4 hours before the start time (first level). Within this timeframe, only the required number of players can join to ensure the tournament progresses smoothly.
Finishing the Tournament:
After the tournament concludes, the Tournament Admin can call a function to specify the winners’ addresses. During this process, Palgam distributes both its commission and the winners’ prizes. As mentioned earlier, Palgam’s commission for tournaments is 10%.
Prize Distribution:
- 1st place: 65% of the total tournament pot
- 2nd place: 15% of the total tournament pot
- 3rd place: 10% of the total tournament pot
It's important to note that all these percentages, including the Palgam commission and winners' prize allocations, are fixed and hardcoded. All gas costs incurred during the entire tournament, including all function calls mentioned earlier, are covered by Palgam. Players are not responsible for paying any gas fees used in tournament function calls.
Refunding Process: In the event of any issues arising during a tournament — such as situations where players’ funds remain locked and the tournament cannot be completed due to unforeseen circumstances — Palgam has the ability to initiate a refund.
Refund requests can be submitted before the tournament reaches completion.
This policy ensures that players are not left without recourse in situations beyond their control, providing a fair and transparent mechanism for reclaiming their tokens.
Bonus Management System
In Palgam, players have the opportunity to receive bonuses under various circumstances — such as completing 20 free games (if enabled by Palgam), registering in the app using a referral code (if enabled by Palgam), or during special events and promotions.
The Palgam Bonus Admin is responsible for distributing bonuses to players, either manually or automatically (for example, when registering with a referral code). Each type of bonus can be activated or deactivated individually.
For instance, if the referral bonus is deactivated, players who register using a referral code will no longer receive that specific bonus. Once a player has received a bonus, it cannot be canceled or withdrawn, and Palgam cannot retract bonuses that have already been distributed.
While the Palgam Referral Admin has the authority to enable or disable bonus distribution, they cannot revoke or alter bonuses that have already been granted.
In cases where a player receives multiple bonuses within the same time period, the newer bonus will be queued until the fate of the older bonuses is determined. Bonus balances are kept separate from players' main balances, with each bonus valued at $1. Players have a two-week deadline to utilize their bonus balance. If their bonus balance falls below $1, the bonus will be lost. Players can use bonuses to participate in 1-to-1 tables, and if a player's total plays with bonuses exceed $100 during that two-week period, their bonus balance will be automatically transferred to their main balance. However, if the two-week period elapses, players will lose their bonus balance.
The Bonus Pool smart contract manages the balance of distributed bonuses. Palgam can transfer tokens to this smart contract address, effectively creating the Palgam bonus distribution pool. When a player receives a bonus, their balance is updated within this contract. Admins have the ability to withdraw non-active bonus balances from this smart contract, which includes tokens that are not allocated to bonuses. Additionally, Palgam can withdraw the amounts related to bonuses that were issued but not activated during their two-week period. This means that if some players receive bonuses but do not utilize them, Palgam is able to reclaim the corresponding tokens for those non-activated bonuses.
Each player within the application can view the bonuses they have received and use them to enter games. When a player chooses to play with their bonus, the corresponding amount is deducted from the bonus pool (by updating their bonus balance) and transferred to the game table. If a player with a bonus wins, the amount is transferred to the bonus pool, and their bonus balance will be updated, while if their opponent wins, the amount is transferred from the game table to that player’s main balance. It's important to note that two players with bonuses cannot play against each other; one of them must enter the game using their main balance at least. Additionally, players cannot use their bonus balance in friendly games, or to entering tournaments. The Palgam commission earned from games involving a player with a bonus is transferred to the Bonus Pool contract rather than the Palgam commission wallet.
As the final note, please consider in case of low POL balance of the player who wants to withdraw his/her bonus balance, a little amount of bonus balance of the user will automatically be swapped from USDT to POL and the remaining USDT amount is then sent to the player’s main wallet.
Referral Management System
Each player within the app is assigned referral codes, which they can share with others. When others enter the app using their referral code, they become subset players for that referrer. Essentially, upon registering, each player's referrer address is set in the Referral Pool smart contract. Referrers are referred to as Palgam partners and can earn profits by receiving a specific commission percentage from their subsets' winning. The initial commission percentage for partners is set at 25%. This means that when their subsets win, 25% of Palgam's commission from that game is transferred to the referral balance of the referrer of the winner. In simpler terms, 25% of the app's profit from that particular game is allocated to that partner's referral balance. The accumulated referral balance is stored within the Referral Pool contract. It's important to note that subsets playing with a bonus balance are not counted for referral commission payments.
Players can view the individuals who have joined the app using their referral code in the "Subsets" section. Partners cannot transfer their referral balance to their main balance until the following conditions are met:
- A minimum of 5 registrations using their referral code.
- Each subset must win at least 1 skill based with USDT games.
- The total winnings of all subset players must reach $1,000.
The withdrawal limit for the accumulated amount in the referral balance is set at a minimum of $2. Partners can request to withdraw their referral balance, which can be initiated by the Palgam Referral Admin or by the players themselves, allowing for independent action. Please note that the gas cost for this transaction will be deducted from the withdrawal amount. It is important to emphasize that Palgam does not have access to withdraw any funds from the Referral Pool contract.
If the total winnings of a player's subsets reach $100,000, their commission percentage increases from 25% to 30%. If it reaches $200,000, it increases to 35%, and if it reaches $500,000, it further increases to 45%.
Palgam admin has the authority to adjust the partner commission percentage within the range of 25% to 45%. However, once a partner meets the criteria to increase their commission percentage, as mentioned previously, Palgam admin cannot set their commission percentage to a value lower than the valid floor.
As the final note, please consider in case of low POL balance of the referrer who wants to withdraw his/her referral balance, after making the referral withdrawal transaction, a little amount of referral balance of the referrer will be swapped from USDT to POL and the remaining USDT amount is then sent to the referrer’s main wallet.
Palgam Governance System
The Palgam Governance System is designed to ensure long-term security, transparency, and community-driven control over the platform’s core smart contract infrastructure.
At the foundation of this system are two essential contracts — the Referral Storage Contract and the Bonus Storage Contract — which securely store all users’ referral and bonus histories.
These two contracts are isolated from the main operational logic to ensure data integrity and reliability. In the event of bugs, vulnerabilities, or logic contract upgrades, all user historical data remains intact within these storage contracts. The system architecture allows newly deployed contracts to connect seamlessly to these storage layers, ensuring full data continuity.
Contract Upgrade Philosophy
Palgam contracts are non-upgradable by design.
We deliberately avoided using upgradable proxy architectures to enhance system reliability, transparency, and user trust. This means that every contract within the Palgam ecosystem is immutable after deployment.
In the event of a required patch or upgrade, new contracts are deployed entirely, and previous contract addresses are replaced.
The governance mechanism exists solely to re-link the Referral Storage and Bonus Storage contracts to the upgraded system, ensuring that all historical data and user records remain accessible within the new version.
Governance Mechanism
To achieve decentralized decision-making in the contract update process, Palgam introduces a community-based governance model.
This mechanism empowers users — specifically, those with active referrals — to participate in determining which new contracts should be recognized as valid successors during system upgrades.
Unlike traditional DAO frameworks, Palgam does not issue or rely on a dedicated governance token. Instead, voting power is directly derived from the economic contribution and engagement of referral participants, aligning the interests of the Palgam platform and its community partners.
Voting Power Model
Voting power is calculated based on each member’s referral subset performance, according to the following logic:
- Eligibility Threshold — Users must have a total subset win amount exceeding 1,000 USDT to qualify for voting power.
- Power Calculation — For every 1,000 USDT earned through referred subset wins, the user gains 1 voting power unit.
- Example: 5,000 USDT in subset wins = 5 voting power units.
- Dynamic Adjustment — The system continuously monitors changes in subset wins and automatically mints or burns voting power to reflect the updated performance.
- Delegation Requirement — Users must delegate their voting power in order to participate in governance proposals, voting for or against contract upgrade actions.
- Fairness Limitations — To prevent disproportionate influence, users with total subset wins below 1,000 USDT or above 100,000 USDT are excluded from voting power calculations.
System Objective
The ultimate purpose of this governance model is not to modify Palgam’s immutable contracts, but to authorize the reconnection of existing storage contracts (Bonus and Referral) to new logic contracts after an upgrade.
Through this mechanism, Palgam ensures full data persistence, trustless integrity, and community involvement in the system’s evolution — all without compromising the immutability of its core architecture.