Agent Anti-Patterns
Purpose: Define hard boundaries that coding assistants must not cross when working with Octant v2. Audience: Developers pairing with coding assistants; the assistants themselves. Level: Beginner Source of truth: This page is the canonical anti-patterns list. Workflow page task cards link here. Use this page when: setting up a coding assistant session, reviewing agent-generated code, or building custom prompts. Do not use this page for: general Solidity best practices unrelated to Octant v2.
Do not edit 07_smart_contracts pages manually
These are autogenerated from source. Manual edits will be overwritten on the next generation run, and the discrepancy between source and docs can mislead developers.
Do not treat the latest GitHub branch as source of truth
These docs are pinned to [email protected] (commit 36ed6ad6665661a18f83394d561fa75c68ccf4ac). The main or develop branch may contain breaking changes, renamed functions, or removed contracts. Always use the pinned commit.
Do not invent a canonical deployment address
If a contract isn't listed on the Deployed Addresses page, absence means "not documented here", not proof that no deployment exists. Do not fabricate an address from tests, examples, local deployments, or block explorer search results. Use the pinned deployment scripts or ask the Octant team.
Some addresses on the Deployed Addresses page are Octant v2 developer-team confirmed deployments that are not fully mirrored by the [email protected] registry files. Do not "correct" those listed addresses back to older values from the pinned core registry.
Do not use placeholder implementation addresses
Strategy constructors require the exact shared implementation address (e.g., YieldDonatingTokenizedStrategy at 0xE8797A98710518A6973Cc8612f98154EECF2C711). Using address(0), a test address, or any other placeholder will cause the strategy to be non-functional on mainnet.
Do not assume first YDS deposits mint 1:1
In [email protected], the first successful deposit or mint into an empty YieldDonatingTokenizedStrategy locks 1_000 shares at address(0xdead). Tests should expect assets - 1000 user shares for a first deposit and shares + 1000 assets for a first mint preview.
Do not disable burning without reporting pending state
For YDS and YSS implementations, direct setEnableBurning(false) can revert with report before disabling burning when pending dragon shares or a pending dragon burn should be reported first. Use reportAndDisableBurning() for the atomic operator path.
Do not deploy MultistrategyVault directly
Always use MultistrategyVaultFactory.deployNewVault(...). Direct deployment bypasses the factory's initialization sequence and produces a vault that won't be recognized by the protocol's indexing and UI layer.
Do not modify dependencies/octant-v2-core while following starter-template tutorials
The starter template includes octant-v2-core as a Git submodule pinned to a specific commit. Editing files inside this directory breaks the version guarantee and can introduce compilation errors or subtle behavioral differences.
Do not paste fragments as complete files (or complete files as fragments)
Code blocks on workflow pages are labelled Complete file, Fragment, Patch, Command, or Illustrative only. A fragment inserted as a complete file will lack imports and contract scaffolding. A complete file inserted as a fragment will duplicate declarations and cause compilation failures.
Do not skip fork/RPC prerequisites
Many tutorials require an Ethereum mainnet RPC URL for fork testing. Without a valid RPC, forge test --fork-url will fail silently or produce misleading results. Set up .env with a real RPC endpoint before running tests.
Do not treat tutorial examples as production-audited code
Tutorial strategies are intentionally minimal to teach concepts. They omit production concerns like slippage protection, oracle validation, access control hardening, and emergency withdrawal paths. Always conduct a full security review before deploying any strategy with real funds.
If you're building custom prompts for Octant v2 work, include a link to this page so the assistant has access to these boundaries. See also the Prompt Library for ready-made prompts.