Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Checks Solidity contracts for asset accounting, oracle, signature, ERC-20, and proxy security risks before deployment.
83% 87%+4 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 19 of 23 without it.
To optimize gas for our users when interacting with an external router, our vault contract calls `token.approve(router, type(uint256).max)` inside its initialization routine. Is granting infinite token allowance recommended?
recommends approving only exact required amounts
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Treat every external token, price, signature, callback, and privileged caller as adversarial. Prefer audited OpenZeppelin primitives over hand-rolled implementations, but verify the installed library version and the assumptions around each primitive.
mulDiv where intermediate overflow or rounding matters.SafeERC20.safeTransfer and safeTransferFrom. Credit deposits from the contract's balance delta, not the requested amount, or reject tokens whose received amount differs. Fee-on-transfer and rebasing tokens otherwise break custody accounting.SafeERC20.forceApprove when an allowance may already be nonzero. safeApprove was removed. Keep approvals exact or bounded and clear leftovers when practical.For a vault or receipt-token design, start from OpenZeppelin ERC4626. A hand-rolled vault must defend its empty state against first-depositor donation/inflation attacks with virtual assets and shares or another explicit mitigation. Test direct donations and rounding at small deposits; never use an unprotected assets * totalSupply / totalAssets conversion with a special 1:1 empty-vault path.
Never use a DEX spot read (slot0, reserves, balances, or a current quote) for collateral, borrowing, minting, or liquidation decisions. Pool depth does not fix atomic manipulation: flash-borrowed capital can move the price, exploit the dependent action, unwind, and repay inside one transaction before arbitrage can intervene.
Use a manipulation-resistant push feed for high-value decisions, or a meaningful TWAP when its weaker guarantees fit the risk. For every feed:
updatedAt against a per-feed maximum age derived from that feed's published heartbeat plus a justified margin—never one global hardcoded timeout;Every swap a contract or a user makes needs a real minimum output, derived from an oracle or an offchain quote minus a stated slippage tolerance. amountOutMinimum = 0 (or a minimum computed from the same pool's spot price) hands the trade to any sandwich bot. Pass a real deadline, not block.timestamp, so a held transaction can't execute later at a worse price. For large user swaps, offer private routing (e.g. Flashbots Protect) or a batch auction. On an L2 the sequencer orders transactions, which narrows but does not remove this risk; keep the minimum output either way.
Use EIP-712 and OpenZeppelin's implementation rather than assembling signature recovery from scratch. Bind the signed action to the intended contract and chain, consume a signer-scoped nonce, enforce a deadline, and update replay state before moving assets.
If a domain separator is cached, also cache the deployment chain id and re-derive the separator whenever block.chainid differs. An immutable separator computed only at deployment becomes stale after a fork. OpenZeppelin EIP712 handles this invalidation.
Use an upgradeable design only when post-deployment changes are required. With proxies:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.