Developers
Contracts
Contract responsibilities, roles, upgradeability, and addresses.
CreditTopUp payment path
Check
Agent ID + quote
Transfer
Immutable treasury
Developers
Contract responsibilities, roles, upgradeability, and addresses.
CreditTopUp payment path
Check
Agent ID + quote
Transfer
Immutable treasury
Emit
ToppedUp
CreditTopUp accepts BNB and 18-decimal BSC USDT for AI credit. It is deployed separately from the historical NFT contracts and is not upgradeable.
quoteTopUp(uint256 amountUsd, address paymentToken) returns (uint256)
topUp(uint256 amountUsd, address paymentToken, uint256 maxPayment) payable
USD uses 18 decimals and must be a positive multiple of 10^12. Use the zero address for BNB or the contract's immutable usdt() address. The caller must have an Agent ID.
BNB quotes round upward to the nearest wei. The oracle must have a positive answer, a valid round, at most 18 decimals, and a timestamp no more than one hour old. USDT does not depend on oracle availability.
Successful payments emit ToppedUp(account, paymentToken, amountPaid, creditUsd, handle). Payments go to the immutable treasury. Unused BNB is refunded. Failed transfers revert.
The UI's 1% BNB ceiling is a maximum, not a fee. The contract charges its current quote and refunds the difference. For USDT, the treasury balance must increase by exactly the quoted amount. A treasury wallet paying USDT to itself fails that check.
PAUSER_ROLE controls pause and unpause. DEFAULT_ADMIN_ROLE controls setOracle and role management. Treasury, USDT, and the registry cannot change. There is no arbitrary credit grant, reward method, or NFT mint.
The earlier AgentPass proxies, renderer, distributor, tax splitter, and vesting contracts remain for existing data and rights. They are not part of the new topup payment flow. Legacy claims are available at /claim.
The payment contract is deployed on BSC Testnet (97) and source-verified on Sourcify. Mainnet is not deployed. See Addresses and Security.