Smart Contracts
Overview
Price Play uses a single core smart contract for managing deposits and withdrawals. All game logic is processed off-chain for speed and cost efficiency, with on-chain settlement for security.
Price Play Vault
The Vault contract is the secure storage for all player deposits.
Contract Address
BNB Chain Mainnet: 0x699f58d98f3c6e9e76c579e68b08a0558291de4fContract Functions
Public Functions
deposit()
Deposit BNB into vault
None (payable)
withdraw()
Withdraw BNB with signature
amount, nonce, expiry, signature
View Functions
balances(address)
Check deposit balance
uint256
usedNonces(bytes32)
Check if nonce was used
bool
signer()
Get current signer address
address
Admin Functions
setSigner()
Update withdrawal signer
Owner only
pause()
Emergency pause
Owner only
unpause()
Resume operations
Owner only
emergencyWithdraw()
Emergency fund recovery
Owner only
Deposit Flow
User calls
deposit()with BNB valueContract validates amount (min: 0.001 BNB, max: 10 BNB)
BNB is stored in contract
Depositedevent is emittedBackend credits user's game balance
Withdrawal Flow
Withdrawals require a signature from the Price Play backend to prevent unauthorized withdrawals.
User requests withdrawal in the app
Backend verifies user's balance
Backend generates signature via Turnkey MPC
User receives signature, nonce, and expiry
User calls
withdraw()with these parametersContract verifies signature and transfers BNB
Security Features
Reentrancy Protection
All state changes happen before external calls, following the checks-effects-interactions pattern.
Nonce Tracking
Each withdrawal uses a unique nonce that can only be used once, preventing replay attacks.
Signature Expiry
Signatures expire after 15 minutes, limiting the attack window.
Chain ID Binding
Signatures include the chain ID, preventing cross-chain replay attacks.
Pausable
Owner can pause the contract in emergencies, stopping all deposits and withdrawals.
Signature Verification
The contract verifies withdrawals using ECDSA signatures:
The signature must be from the authorized signer address.
Verification
The contract source code is verified on BscScan.
Compiler: Solidity 0.8.19
License: MIT
Audit Status
Smart Contract
Source verified on BscScan
Key Management
Powered by Turnkey MPC
Backend Logic
Internal security review
Last updated
