An audit of a standard unsafe-call pattern — how contracts leak approvals and execute arbitrary code.
approveAndCallcode — approval + arbitrary execution
A function that sets an allowance and then lets the recipient execute code:
_spender_spender_spender spends the freshly-approved allowance — steals fundsCombining approval with uncontrolled external execution is a classic funds-leak.
An address.call(data) where the target or calldata is user-controlled — arbitrary execution with no allowlist, enabling any state change or fund movement.
Critical — "approveAndCallcode sets allowance for msg.sender then executes arbitrary code from _spender — a known pattern for stealing user allowances."
High — "External call to arbitrary address — target not validated."
Unvalidated external calls are a top DeFi exploit class. AI catches the allowance-leak and arbitrary-call variants in minutes.