Callback Function Risk Explainer
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Callback Function Risk Explainer is a read-only tool that analyzes callback functions in smart contracts, generating AI-powered plain-language explanations of what a callback does, when it is invoked, what permissions it has, who registered it, and the risks of those permissions. It reads contract address, callback function signature, callback registration status, callback execution context, access control lists, function permissions, trigger conditions, upgrade history, owner address, privileged function signatures, event logs, transaction history, callback activation and deactivation status, governance proposals, execution order, and callback dependencies. The tool then presents this data alongside an AI-generated analysis of the callback's permissions and risks, identifying potential threats such as reentrancy, trust assumptions, and state manipulation — helping you understand the trustworthiness of a callback before interacting with or relying on it.
HOW TO USE
Connect your wallet using the BGWallet bridge and select your target network. Enter the contract address and the callback function signature you want to analyze (e.g., "onTransfer(address,uint256)"). Click "Analyze callback risk" to read on-chain contract data. The tool displays the contract address, callback function, registration status, invocation context, and callback risk level (Low/Medium/High). Detailed information includes registered by, owner, access control type, permissions, trigger conditions, execution order, dependencies, activation status, upgrade history, privileged functions, and governance proposals. A risk assessment box provides a summary risk evaluation. An AI explanation appears below the on-chain data, explaining what the callback function does, when it is invoked, what permissions it has, who registered or approved it, and the risks of those permissions (including reentrancy and trust assumptions) before you interact with or rely on the callback. The wallet's own signature step still protects you — this explanation is informational only and does not replace reviewing what you approve in your wallet.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 with the provider from the BGWallet bridge to read on-chain contract data. No hardcoded contract addresses are used — you are always in control of which contract you trust. When analyzing callback risks, the tool reads the contract address from the user input, reads the callback function signature from the user input, checks callback registration status via the contract's callback registry (e.g., isCallbackRegistered()), reads callback execution context via the contract's callback management functions, reads access control lists via the contract's access control functions, reads function permissions via the contract's permission management functions, reads trigger conditions via the contract's callback configuration, reads upgrade history by scanning event logs (e.g., CallbackAdded, CallbackRemoved), reads owner address via the contract's owner() function, reads privileged function signatures by analyzing function selectors, reads event logs by scanning for callback-related events, reads transaction history via provider.getTransactionCount(contract), reads callback activation and deactivation status via the contract's callback management functions, reads governance proposals via the governance contract (if available), reads execution order via the contract's callback configuration, and reads callback dependencies via the contract's dependency management. The tool fetches event logs by walking backwards in chunks and halving chunk size on failure, ensuring logs are properly read despite varying RPC limitations. The data is formatted and passed to the AI bridge via BGAI.generate() with a structured prompt that includes all the on-chain data read. The AI is instructed to explain what the callback function does, when it is invoked, what permissions it has, who registered or approved it, and the risks of those permissions — while stating plainly that it cannot detect if a callback's registered actions are being used maliciously beyond the on-chain configuration, cannot detect off-chain social engineering attacks or governance manipulation, and cannot guarantee that a callback's behavior will not be changed in a future upgrade. The AI response is capped at 1,024 tokens to ensure concise, focused callback risk assessments. All computed values are guarded against negative numbers — if a permission count or function count appears invalid, the tool flags it rather than displaying nonsensical values.
WHAT IT CANNOT SEE
This tool cannot detect if a callback's registered actions are being used maliciously beyond the on-chain configuration. It cannot detect off-chain social engineering attacks or governance manipulation. It cannot guarantee that a callback's behavior will not be changed in a future upgrade. It cannot detect callbacks that are registered but have hidden or off-chain functionality. The AI explanation is generated from on-chain data only and cannot detect hidden callback functionality, off-chain actions, or social engineering attacks. It cannot predict whether a callback's behavior will be changed or removed in the future. The tool does not continuously monitor callback risks; each analysis is a snapshot at the time of the lookup. It cannot detect delayed behavior changes, hidden callbacks, or off-chain factors. The tool does not store any data persistently; all state is in-memory and resets on reload. The AI explanation is informational and does not constitute financial advice, legal advice, or a guarantee of callback safety or behavior correctness.
PLEASE NOTE
Callback Function Risk Explainer works exclusively with EVM-compatible chains. It requires a Web3 wallet (MetaMask or similar) and the BGWallet bridge. Explanations are AI-generated from data the app reads on-chain — always review what you are actually signing in your wallet before approving it. Callback functions carry significant risk including reentrancy, trust assumptions, and state manipulation. Use this tool as a guide only; always cross-check with independent sources and contract audits for critical decisions. This is experimental software; use at your own risk.