Smart Contracts & Protocol Security
The definitive technical registry of deployed TopToken smart contracts, multi-signature treasury architecture, on-chain invariants, and security specifications on BNB Chain.
1. Security Architecture & On-Chain Invariants
TopTokenPay is an immutable, non-custodial payment routing protocol deployed natively on the BNB Chain (BSC). The smart contract acts as an atomic verification gateway that connects Web3 users, token communities, and decentralized treasuries.
The protocol is governed by three fundamental on-chain invariants that cannot be altered or bypassed by any participant:
- Invariant 1: Zero Contract Custody. The contract never retains custody of incoming user funds. Every native BNB or BEP-20 token transfer is atomically routed to the Safe Treasury within the exact same transaction execution frame. The contract balance remains zero at all times.
- Invariant 2: Two-Day Timelock on Treasury Migration. The protocol treasury address cannot be modified immediately. Any proposed update initiates an on-chain 48-hour timelock delay (172,800 seconds via
proposeTreasuryChange), giving the community full transparency before any migration can take effect. - Invariant 3: Exact Balance Delta Accounting. Strict pre- and post-transfer balance delta measurement ensures that fee-on-transfer or deflationary tokens credit only the exact net amount received by the treasury.
2. Published Contract Address Registries
All production smart contracts are open-source, verified, and audited on BscScan:
Handles direct user contributions, token allowance verification, atomic treasury forwarding, and emits the authoritative Payment event.
3. Allowlisted Settlement Assets (BSC Mainnet)
TopTokenPay restricts direct on-chain deposits to verified high-liquidity assets to protect against price oracle manipulation and flash-loan exploits:
| Asset | Contract Address | Decimals | Min Contribution | Status |
|---|---|---|---|---|
| Native BNB | 0x0000...0000 (Native) | 18 | 0.001 BNB (~$0.60) | Active |
| Tether USD (USDT) | 0x55d398326f99059fF775485246999027B3197955 | 18 | 1.00 USDT ($1.00) | Active |
| USD Coin (USDC) | 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d | 18 | 1.00 USDC ($1.00) | Active |
4. On-Chain Event Specifications & Indexer Verification
Every confirmed contribution emits a standardized EVM log on BNB Chain. Independent nodes and external indexers can verify all contributions using the public event signature:
event Payment(bytes32 indexed projectId, address indexed payer, address indexed token, uint256 amount, bytes32 paymentReference)Event Topic 0: 0x3460f925ee54b08ddb1fa4f7d4abe37bceb732c0dd80651d494365c5849a534f
5. Governance & Emergency Procedures
Administrative controls are strictly circumscribed. Safe signers can add new allowlisted BEP-20 stablecoins, adjust minimum contribution bounds, or trigger an emergency pause (pause()) in the event of an upstream BSC hard fork or RPC network divergence.
All administrative actions require approval from a 3-of-5 Gnosis Safe threshold of independent hardware keyholders. No individual party or automated service possesses upgrade or unilateral fund-redirection privileges.
